diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp index a19d3632caa..8a484fcfe21 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp @@ -915,7 +915,8 @@ RatInstr::emit_image_size(nir_intrinsic_instr *intrin, Shader& shader) shader.set_flag(Shader::sh_txs_cube_array_comp); if (const_offset) { - unsigned lookup_resid = const_offset[0].u32 + shader.image_size_const_offset(); + unsigned lookup_resid = (res_id - R600_IMAGE_REAL_RESOURCE_OFFSET) + + shader.image_size_const_offset(); shader.emit_instruction( new AluInstr(op1_mov, dest[2],