intel/compiler: make uses_pos_offset a tri-state

This value depends on the per-sample value which can be unknown at
compile time with graphics pipeline libraries. So we need to have this
dynamic has well and pick the right value when generating the
3DSTATE_PS/3DSTATE_WM packet.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d8dfd153c5 ("intel/fs: Make per-sample and coarse dispatch tri-state")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22728>
This commit is contained in:
Lionel Landwerlin
2023-04-26 16:44:51 +03:00
committed by Marge Bot
parent ef01a9cf3b
commit 5489033fa8
6 changed files with 49 additions and 17 deletions

View File

@@ -7365,12 +7365,16 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader,
* per-sample dispatch. If we need gl_SamplePosition and we don't have
* persample dispatch, we hard-code it to 0.5.
*/
prog_data->uses_pos_offset =
prog_data->persample_dispatch != BRW_NEVER &&
(BITSET_TEST(shader->info.system_values_read,
SYSTEM_VALUE_SAMPLE_POS) ||
BITSET_TEST(shader->info.system_values_read,
SYSTEM_VALUE_SAMPLE_POS_OR_CENTER));
prog_data->read_pos_offset_input =
BITSET_TEST(shader->info.system_values_read,
SYSTEM_VALUE_SAMPLE_POS) ||
BITSET_TEST(shader->info.system_values_read,
SYSTEM_VALUE_SAMPLE_POS_OR_CENTER);
if (prog_data->read_pos_offset_input)
prog_data->uses_pos_offset = prog_data->persample_dispatch;
else
prog_data->uses_pos_offset = BRW_NEVER;
}
prog_data->has_render_target_reads = shader->info.outputs_read != 0ull;