OSDN Git Service

spirv: OpImageQueryLod requires a sampler
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 27 Feb 2019 06:12:01 +0000 (00:12 -0600)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 14 Mar 2019 19:02:42 +0000 (19:02 +0000)
No idea how this fell through the cracks besides the fact that the
sampler bound at 0 almost always works and the CTS isn't amazing.  In
any case, this appears to have been broken for almost forever.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ca295ddbfb414a526d3bab7daf93fffbbc417c6e)

src/compiler/spirv/spirv_to_nir.c

index 16d9c92..3579182 100644 (file)
@@ -2021,6 +2021,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
    case nir_texop_txl:
    case nir_texop_txd:
    case nir_texop_tg4:
+   case nir_texop_lod:
       /* These operations require a sampler */
       p->src = nir_src_for_ssa(&sampler->dest.ssa);
       p->src_type = nir_tex_src_sampler_deref;
@@ -2029,7 +2030,6 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
    case nir_texop_txf:
    case nir_texop_txf_ms:
    case nir_texop_txs:
-   case nir_texop_lod:
    case nir_texop_query_levels:
    case nir_texop_texture_samples:
    case nir_texop_samples_identical: