mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
anv: rework Wa_14017076903 to only apply with occlusion queries
Fixes KHR-GL46.transform_feedback.* tests with zink+anv on DG2 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes:c34916f841("anv: implement occlusion query related Wa_14017076903") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22586> (cherry picked from commit56840e4c89)
This commit is contained in:
parent
0b47ece7ae
commit
ba5c0f0ffd
5 changed files with 41 additions and 12 deletions
|
|
@ -355,7 +355,7 @@
|
|||
"description": "anv: rework Wa_14017076903 to only apply with occlusion queries",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "c34916f841d35c6ec76981b0f56df25feef04b70"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2574,6 +2574,8 @@ struct anv_cmd_graphics_state {
|
|||
|
||||
bool object_preemption;
|
||||
bool has_uint_rt;
|
||||
|
||||
uint32_t n_occlusion_queries;
|
||||
};
|
||||
|
||||
enum anv_depth_reg_mode {
|
||||
|
|
|
|||
|
|
@ -3277,6 +3277,39 @@ cmd_buffer_emit_streamout(struct anv_cmd_buffer *cmd_buffer)
|
|||
.RenderStreamSelect = dyn->rs.rasterization_stream,
|
||||
};
|
||||
|
||||
#if INTEL_NEEDS_WA_14017076903
|
||||
/* Wa_14017076903 :
|
||||
*
|
||||
* SKL PRMs, Volume 7: 3D-Media-GPGPU, Stream Output Logic (SOL) Stage:
|
||||
*
|
||||
* SOL_INT::Render_Enable =
|
||||
* (3DSTATE_STREAMOUT::Force_Rending == Force_On) ||
|
||||
* (
|
||||
* (3DSTATE_STREAMOUT::Force_Rending != Force_Off) &&
|
||||
* !(3DSTATE_GS::Enable && 3DSTATE_GS::Output Vertex Size == 0) &&
|
||||
* !3DSTATE_STREAMOUT::API_Render_Disable &&
|
||||
* (
|
||||
* 3DSTATE_DEPTH_STENCIL_STATE::Stencil_TestEnable ||
|
||||
* 3DSTATE_DEPTH_STENCIL_STATE::Depth_TestEnable ||
|
||||
* 3DSTATE_DEPTH_STENCIL_STATE::Depth_WriteEnable ||
|
||||
* 3DSTATE_PS_EXTRA::PS_Valid ||
|
||||
* 3DSTATE_WM::Legacy Depth_Buffer_Clear ||
|
||||
* 3DSTATE_WM::Legacy Depth_Buffer_Resolve_Enable ||
|
||||
* 3DSTATE_WM::Legacy Hierarchical_Depth_Buffer_Resolve_Enable
|
||||
* )
|
||||
* )
|
||||
*
|
||||
* If SOL_INT::Render_Enable is false, the SO stage will not forward any
|
||||
* topologies down the pipeline. Which is not what we want for occlusion
|
||||
* queries.
|
||||
*
|
||||
* Here we force rendering to get SOL_INT::Render_Enable when occlusion
|
||||
* queries are active.
|
||||
*/
|
||||
if (!so.RenderingDisable && cmd_buffer->state.gfx.n_occlusion_queries > 0)
|
||||
so.ForceRendering = Force_on;
|
||||
#endif
|
||||
|
||||
switch (dyn->rs.provoking_vertex) {
|
||||
case VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT:
|
||||
so.ReorderMode = LEADING;
|
||||
|
|
@ -3739,6 +3772,9 @@ genX(BeginCommandBuffer)(
|
|||
*/
|
||||
cmd_buffer->state.conditional_render_enabled =
|
||||
conditional_rendering_info && conditional_rendering_info->conditionalRenderingEnable;
|
||||
|
||||
if (pBeginInfo->pInheritanceInfo->occlusionQueryEnable)
|
||||
cmd_buffer->state.gfx.n_occlusion_queries = 1;
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -1103,17 +1103,6 @@ emit_3dstate_streamout(struct anv_graphics_pipeline *pipeline,
|
|||
so.Stream2VertexReadLength = urb_entry_read_length - 1;
|
||||
so.Stream3VertexReadOffset = urb_entry_read_offset;
|
||||
so.Stream3VertexReadLength = urb_entry_read_length - 1;
|
||||
|
||||
#if INTEL_NEEDS_WA_14017076903
|
||||
/* Wa_14017076903 : SOL should be programmed to force the
|
||||
* rendering to be enabled.
|
||||
*
|
||||
* This fixes a rare case where SOL must render to get correct
|
||||
* occlusion query results even when no PS and depth buffers are
|
||||
* bound.
|
||||
*/
|
||||
so.ForceRendering = Force_on;
|
||||
#endif
|
||||
}
|
||||
|
||||
GENX(3DSTATE_STREAMOUT_pack)(NULL, pipeline->gfx8.streamout_state, &so);
|
||||
|
|
|
|||
|
|
@ -1022,6 +1022,7 @@ void genX(CmdBeginQueryIndexedEXT)(
|
|||
|
||||
switch (pool->type) {
|
||||
case VK_QUERY_TYPE_OCCLUSION:
|
||||
cmd_buffer->state.gfx.n_occlusion_queries++;
|
||||
emit_ps_depth_count(cmd_buffer, anv_address_add(query_addr, 8));
|
||||
break;
|
||||
|
||||
|
|
@ -1213,6 +1214,7 @@ void genX(CmdEndQueryIndexedEXT)(
|
|||
case VK_QUERY_TYPE_OCCLUSION:
|
||||
emit_ps_depth_count(cmd_buffer, anv_address_add(query_addr, 16));
|
||||
emit_query_pc_availability(cmd_buffer, query_addr, true);
|
||||
cmd_buffer->state.gfx.n_occlusion_queries--;
|
||||
break;
|
||||
|
||||
case VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue