diff options
author | Jason Ekstrand <[email protected]> | 2016-02-09 12:13:32 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-02-09 16:48:36 -0800 |
commit | 09b3e30dc672d38e60aac1d279eb1db94c9b048e (patch) | |
tree | 50b745e0d7e820a848a300390ffaed63dfdb6036 /src/compiler/nir | |
parent | b14f4c1fd33e13c48a8fd81a9bc77c6df60108dd (diff) |
anv: Fix up spirv for new texture/sampler split stuff
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/spirv/spirv_to_nir.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/compiler/nir/spirv/spirv_to_nir.c b/src/compiler/nir/spirv/spirv_to_nir.c index a7efa196832..979357d67c8 100644 --- a/src/compiler/nir/spirv/spirv_to_nir.c +++ b/src/compiler/nir/spirv/spirv_to_nir.c @@ -1389,12 +1389,32 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode, } nir_deref_var *sampler = vtn_access_chain_to_deref(b, sampled.sampler); - instr->sampler = nir_deref_as_var(nir_copy_deref(instr, &sampler->deref)); if (sampled.image) { nir_deref_var *image = vtn_access_chain_to_deref(b, sampled.image); instr->texture = nir_deref_as_var(nir_copy_deref(instr, &image->deref)); } else { - instr->texture = NULL; + instr->texture = nir_deref_as_var(nir_copy_deref(instr, &sampler->deref)); + } + + switch (instr->op) { + case nir_texop_tex: + case nir_texop_txb: + case nir_texop_txl: + case nir_texop_txd: + /* These operations require a sampler */ + instr->sampler = nir_deref_as_var(nir_copy_deref(instr, &sampler->deref)); + break; + case nir_texop_txf: + case nir_texop_txf_ms: + case nir_texop_txs: + case nir_texop_lod: + case nir_texop_tg4: + case nir_texop_query_levels: + case nir_texop_texture_samples: + case nir_texop_samples_identical: + /* These don't */ + instr->sampler = NULL; + break; } nir_ssa_dest_init(&instr->instr, &instr->dest, |