summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2021-02-03 10:52:04 -0800
committerJordan Justen <jordan.l.justen@intel.com>2021-07-21 11:34:49 -0700
commit6ae5a7cbfec1866a9228d1af605f7064b86aa72b (patch)
tree1fd8e5fa23833c6ebaa3a922126e18da8f9d80ec
parent3085349feeee3e4eb00659d97befbe5990df307f (diff)
intel/compiler: Remove cube array size lowering in compiler backendintel-nir-cube-image-size
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--src/intel/compiler/brw_fs_nir.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 8f63d682c34..1b2e533c2ab 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -4190,6 +4190,9 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
case nir_intrinsic_image_size:
case nir_intrinsic_bindless_image_size: {
+ /* Cube image sizes should have previously been lowered to a 2D array */
+ assert(nir_intrinsic_image_dim(instr) != GLSL_SAMPLER_DIM_CUBE);
+
/* Unlike the [un]typed load and store opcodes, the TXS that this turns
* into will handle the binding table index for us in the geneerator.
* Incidentally, this means that we can handle bindless with exactly the
@@ -4221,14 +4224,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
inst->size_written = 4 * REG_SIZE;
for (unsigned c = 0; c < instr->dest.ssa.num_components; ++c) {
- if (c == 2 && nir_intrinsic_image_dim(instr) == GLSL_SAMPLER_DIM_CUBE) {
- bld.emit(SHADER_OPCODE_INT_QUOTIENT,
- offset(retype(dest, tmp.type), bld, c),
- component(offset(tmp, ubld, c), 0), brw_imm_ud(6));
- } else {
- bld.MOV(offset(retype(dest, tmp.type), bld, c),
- component(offset(tmp, ubld, c), 0));
- }
+ bld.MOV(offset(retype(dest, tmp.type), bld, c),
+ component(offset(tmp, ubld, c), 0));
}
break;
}