intel: Pointer to SCISSOR_RECT array should be 64B aligned
v2: Apply the workaround to all gen hardawre Ref: GEN:BUG:1409725701 Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7463>
This commit is contained in:
parent
a1a365e818
commit
3c4e43e72b
|
@ -6055,12 +6055,19 @@ iris_upload_dirty_render_state(struct iris_context *ice,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dirty & IRIS_DIRTY_SCISSOR_RECT) {
|
if (dirty & IRIS_DIRTY_SCISSOR_RECT) {
|
||||||
|
/* GEN:BUG:1409725701:
|
||||||
|
* "The viewport-specific state used by the SF unit (SCISSOR_RECT) is
|
||||||
|
* stored as an array of up to 16 elements. The location of first
|
||||||
|
* element of the array, as specified by Pointer to SCISSOR_RECT,
|
||||||
|
* should be aligned to a 64-byte boundary.
|
||||||
|
*/
|
||||||
|
uint32_t alignment = 64;
|
||||||
uint32_t scissor_offset =
|
uint32_t scissor_offset =
|
||||||
emit_state(batch, ice->state.dynamic_uploader,
|
emit_state(batch, ice->state.dynamic_uploader,
|
||||||
&ice->state.last_res.scissor,
|
&ice->state.last_res.scissor,
|
||||||
ice->state.scissors,
|
ice->state.scissors,
|
||||||
sizeof(struct pipe_scissor_state) *
|
sizeof(struct pipe_scissor_state) *
|
||||||
ice->state.num_viewports, 32);
|
ice->state.num_viewports, alignment);
|
||||||
|
|
||||||
iris_emit_cmd(batch, GENX(3DSTATE_SCISSOR_STATE_POINTERS), ptr) {
|
iris_emit_cmd(batch, GENX(3DSTATE_SCISSOR_STATE_POINTERS), ptr) {
|
||||||
ptr.ScissorRectPointer = scissor_offset;
|
ptr.ScissorRectPointer = scissor_offset;
|
||||||
|
|
|
@ -51,8 +51,16 @@ gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer)
|
||||||
struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
struct anv_framebuffer *fb = cmd_buffer->state.framebuffer;
|
||||||
uint32_t count = cmd_buffer->state.gfx.dynamic.scissor.count;
|
uint32_t count = cmd_buffer->state.gfx.dynamic.scissor.count;
|
||||||
const VkRect2D *scissors = cmd_buffer->state.gfx.dynamic.scissor.scissors;
|
const VkRect2D *scissors = cmd_buffer->state.gfx.dynamic.scissor.scissors;
|
||||||
|
|
||||||
|
/* GEN:BUG:1409725701:
|
||||||
|
* "The viewport-specific state used by the SF unit (SCISSOR_RECT) is
|
||||||
|
* stored as an array of up to 16 elements. The location of first
|
||||||
|
* element of the array, as specified by Pointer to SCISSOR_RECT, should
|
||||||
|
* be aligned to a 64-byte boundary.
|
||||||
|
*/
|
||||||
|
uint32_t alignment = 64;
|
||||||
struct anv_state scissor_state =
|
struct anv_state scissor_state =
|
||||||
anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, count * 8, 32);
|
anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, count * 8, alignment);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < count; i++) {
|
for (uint32_t i = 0; i < count; i++) {
|
||||||
const VkRect2D *s = &scissors[i];
|
const VkRect2D *s = &scissors[i];
|
||||||
|
|
|
@ -2365,10 +2365,16 @@ genX(upload_scissor_state)(struct brw_context *brw)
|
||||||
|
|
||||||
/* BRW_NEW_VIEWPORT_COUNT */
|
/* BRW_NEW_VIEWPORT_COUNT */
|
||||||
const unsigned viewport_count = brw->clip.viewport_count;
|
const unsigned viewport_count = brw->clip.viewport_count;
|
||||||
|
/* GEN:BUG:1409725701:
|
||||||
|
* "The viewport-specific state used by the SF unit (SCISSOR_RECT) is
|
||||||
|
* stored as an array of up to 16 elements. The location of first
|
||||||
|
* element of the array, as specified by Pointer to SCISSOR_RECT, should
|
||||||
|
* be aligned to a 64-byte boundary.
|
||||||
|
*/
|
||||||
|
const unsigned alignment = 64;
|
||||||
scissor_map = brw_state_batch(
|
scissor_map = brw_state_batch(
|
||||||
brw, GENX(SCISSOR_RECT_length) * sizeof(uint32_t) * viewport_count,
|
brw, GENX(SCISSOR_RECT_length) * sizeof(uint32_t) * viewport_count,
|
||||||
32, &scissor_state_offset);
|
alignment, &scissor_state_offset);
|
||||||
|
|
||||||
/* _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT */
|
/* _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue