zink: Re-emit the SpvBuiltInSampleMask access chain each load.
authorEmma Anholt <emma@anholt.net>
Thu, 19 Jan 2023 00:59:11 +0000 (16:59 -0800)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:35 +0000 (15:40 +0000)
commit8d8987577d2a8162e737cdda238e56a208df8884
treecea87eb03663de902e04386ac753236fa0d6afa3
parent135425a3ae692d73cbed7afcceba0ee01f828c0c
zink: Re-emit the SpvBuiltInSampleMask access chain each load.

Otherwise, the access chain you emitted last time may not dominate the
current use.

Fixes the following validation failure in
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_sample.multisample_texture_2:

  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC):
  msgNum: 7060244 - Validation Error: [
  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
  0x55cf3cea2c60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
  SPIR-V module not valid: ID '67[%67]' defined in block '23[%23]' does
  not dominate its use in block '31[%31]'

Fixes: 8899f6a19857 ("zink: fix gl_SampleMaskIn spirv generation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit 4286633eec3e134d462edd16629311ed0e0e7934)
.pick_status.json
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c