diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2018-06-15 19:39:56 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-09-04 08:59:29 -0700 |
commit | a144518f3464a0e00df7da9f87b4c24c4b06424e (patch) | |
tree | e9e336879d009fdb56d32bf234bf7893ef62df8e | |
parent | de445b36bad04e73279d27435ceea7a56124538e (diff) |
i965/vec4: Correctly handle uniform sources in generate_tes_add_indirect_urb_offset
Fixes failure in the new piglit test
tes-patch-input-array-vec2-index-invalid-rd.shader_test.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 75666605c98e628ad6a88ef46ec7351588969ed5)
-rw-r--r-- | src/intel/compiler/brw_vec4_generator.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_vec4_generator.cpp b/src/intel/compiler/brw_vec4_generator.cpp index a3ed8609a29..8ff34a5f73c 100644 --- a/src/intel/compiler/brw_vec4_generator.cpp +++ b/src/intel/compiler/brw_vec4_generator.cpp @@ -932,8 +932,21 @@ generate_tes_add_indirect_urb_offset(struct brw_codegen *p, brw_set_default_mask_control(p, BRW_MASK_DISABLE); brw_MOV(p, dst, header); + + /* Uniforms will have a stride <0;4,1>, and we need to convert to <0;1,0>. + * Other values get <4;1,0>. + */ + struct brw_reg restrided_offset; + if (offset.vstride == BRW_VERTICAL_STRIDE_0 && + offset.width == BRW_WIDTH_4 && + offset.hstride == BRW_HORIZONTAL_STRIDE_1) { + restrided_offset = stride(offset, 0, 1, 0); + } else { + restrided_offset = stride(offset, 4, 1, 0); + } + /* m0.3-0.4: 128-bit-granular offsets into the URB from the handles */ - brw_MOV(p, vec2(get_element_ud(dst, 3)), stride(offset, 4, 1, 0)); + brw_MOV(p, vec2(get_element_ud(dst, 3)), restrided_offset); brw_pop_insn_state(p); } |