From cec540fbc6f00049b8393b70219b6fe0b303b7b0 Mon Sep 17 00:00:00 2001 From: Sergii Romantsov Date: Thu, 12 Jul 2018 15:47:48 +0300 Subject: [PATCH] intel/batch_decoder: decoding of 3DSTATE_CONSTANT_BODY. SNB doesn't have a definition of 3DSTATE_CONSTANT_BODY, thats why we got segmentation fault when used INTEL_DEBUG=bat. Fixed by adding of 3DSTATE_CONSTANT_BODY into 3DSTATE_CONSTANT of VS, GS and PS structures. v2: added definition of 3DSTATE_CONSTANT_BODY to the gen6.xml Fixes: 169d8e011ae (intel: Fix 3DSTATE_CONSTANT buffer decoding.) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107190 Signed-off-by: Sergii Romantsov Reviewed-by: Kenneth Graunke --- src/intel/genxml/gen6.xml | 38 +++++++------------ src/mesa/drivers/dri/i965/genX_state_upload.c | 12 +++--- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/src/intel/genxml/gen6.xml b/src/intel/genxml/gen6.xml index c2967cd423d..62d2574d480 100644 --- a/src/intel/genxml/gen6.xml +++ b/src/intel/genxml/gen6.xml @@ -622,6 +622,17 @@ + + + + + + + + + + + @@ -633,14 +644,7 @@ - - - - - - - - + @@ -654,14 +658,7 @@ - - - - - - - - + @@ -675,14 +672,7 @@ - - - - - - - - + diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 4a68bbe3d13..9e0a17b9d93 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -1879,8 +1879,8 @@ genX(upload_wm)(struct brw_context *brw) /* Pointer to the WM constant buffer. Covered by the set of * state flags from gen6_upload_wm_push_constants. */ - wmcp.PointertoPSConstantBuffer0 = stage_state->push_const_offset; - wmcp.PSConstantBuffer0ReadLength = stage_state->push_const_size - 1; + wmcp.ConstantBody.PointertoConstantBuffer0 = stage_state->push_const_offset; + wmcp.ConstantBody.ConstantBuffer0ReadLength = stage_state->push_const_size - 1; } } #endif @@ -2215,8 +2215,8 @@ genX(upload_vs_state)(struct brw_context *brw) brw_batch_emit(brw, GENX(3DSTATE_CONSTANT_VS), cvs) { if (stage_state->push_const_size != 0) { cvs.Buffer0Valid = true; - cvs.PointertoVSConstantBuffer0 = stage_state->push_const_offset; - cvs.VSConstantBuffer0ReadLength = stage_state->push_const_size - 1; + cvs.ConstantBody.PointertoConstantBuffer0 = stage_state->push_const_offset; + cvs.ConstantBody.ConstantBuffer0ReadLength = stage_state->push_const_size - 1; } } #endif @@ -2707,8 +2707,8 @@ genX(upload_gs_state)(struct brw_context *brw) brw_batch_emit(brw, GENX(3DSTATE_CONSTANT_GS), cgs) { if (active && stage_state->push_const_size != 0) { cgs.Buffer0Valid = true; - cgs.PointertoGSConstantBuffer0 = stage_state->push_const_offset; - cgs.GSConstantBuffer0ReadLength = stage_state->push_const_size - 1; + cgs.ConstantBody.PointertoConstantBuffer0 = stage_state->push_const_offset; + cgs.ConstantBody.ConstantBuffer0ReadLength = stage_state->push_const_size - 1; } } #endif -- 2.30.2