summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-12-12 16:58:56 -0500
committerJonathan Marek <[email protected]>2019-12-12 20:33:17 -0500
commit99a4f7c79fa8c529433981b81fea470ddf51f56e (patch)
treeab484440e171e5e1b39aa20c3ac08be514170dbd
parent7bbcf7deff57ced3b7d4e3984851c5498d481767 (diff)
turnip: set load_layer_id to zero
We don't have layered rendering and ir3 doesn't support this intrinsic, so just set it to zero for now. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/freedreno/vulkan/tu_shader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 24b4dc3e75d..a220f8ce4df 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -225,6 +225,14 @@ static bool
lower_intrinsic(nir_builder *b, nir_intrinsic_instr *instr,
struct tu_shader *shader)
{
+ /* TODO: remove this when layered rendering is implemented */
+ if (instr->intrinsic == nir_intrinsic_load_layer_id) {
+ nir_ssa_def_rewrite_uses(&instr->dest.ssa,
+ nir_src_for_ssa(nir_imm_int(b, 0)));
+ nir_instr_remove(&instr->instr);
+ return true;
+ }
+
if (instr->intrinsic == nir_intrinsic_load_push_constant) {
/* note: ir3 wants load_ubo, not load_uniform */
assert(nir_intrinsic_base(instr) == 0);