glsl: Allow dynamic tracking of variable allocation

This commit is contained in:
ameerj 2021-06-07 18:04:01 -04:00
parent 465903468e
commit 258106038e
3 changed files with 35 additions and 21 deletions

View file

@ -57,11 +57,10 @@ static_assert(sizeof(Id) == sizeof(u32));
class VarAlloc {
public:
static constexpr size_t NUM_VARS = 1023;
struct UseTracker {
size_t num_used{};
std::bitset<NUM_VARS> var_use{};
bool uses_temp{};
size_t num_used{};
std::vector<bool> var_use;
};
/// Used for explicit usages of variables, may revert to temporaries