intel/fs: Use helper for discard sample mask flag subregister number.

Use it instead of hard-coding f0.1 for the sample mask of programs
that use discard.  This will make the task easier when we replace f0.1
with another flag register location in order to support discard with
SIMD32 shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Francisco Jerez
2020-01-04 14:32:09 -08:00
parent a6bc11a789
commit 083fd96a97
4 changed files with 16 additions and 5 deletions

View File

@@ -417,6 +417,17 @@ private:
unsigned workgroup_size() const;
};
/**
* Return the flag register used in fragment shaders to keep track of live
* samples.
*/
static inline unsigned
sample_mask_flag_subreg(const fs_visitor *shader)
{
assert(shader->stage == MESA_SHADER_FRAGMENT);
return 1;
}
/**
* The fragment shader code generator.
*