diff --git a/.pick_status.json b/.pick_status.json index a67055e3802..eeceddea077 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -211,7 +211,7 @@ "description": "anv: Insert holes for non-existant XFB varyings", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "36ee2fd61c8f943be1d1e2b0354f7a121ffef28f" }, diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 0964ef5c604..ea2e38834e8 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -1415,11 +1415,23 @@ emit_3dstate_streamout(struct anv_pipeline *pipeline, next_offset[buffer] = output->offset + __builtin_popcount(component_mask) * 4; - so_decl[stream][decls[stream]++] = (struct GENX(SO_DECL)) { - .OutputBufferSlot = buffer, - .RegisterIndex = vue_map->varying_to_slot[varying], - .ComponentMask = component_mask, - }; + const int slot = vue_map->varying_to_slot[varying]; + if (slot < 0) { + /* This can happen if the shader never writes to the varying. + * Insert a hole instead of actual varying data. + */ + so_decl[stream][decls[stream]++] = (struct GENX(SO_DECL)) { + .HoleFlag = true, + .OutputBufferSlot = buffer, + .ComponentMask = component_mask, + }; + } else { + so_decl[stream][decls[stream]++] = (struct GENX(SO_DECL)) { + .OutputBufferSlot = buffer, + .RegisterIndex = slot, + .ComponentMask = component_mask, + }; + } } int max_decls = 0;