anv/pipeline: Implement the depth compare EQUAL workaround on gen8+

This commit is contained in:
Jason Ekstrand 2016-03-05 09:19:01 -08:00
parent 7c1660aa14
commit 1afdfc3e6e

View file

@ -238,6 +238,14 @@ emit_ds_state(struct anv_pipeline *pipeline,
.BackfaceStencilTestFunction = vk_to_gen_compare_op[info->back.compareOp],
};
/* From the Broadwell PRM:
*
* "If Depth_Test_Enable = 1 AND Depth_Test_func = EQUAL, the
* Depth_Write_Enable must be set to 0."
*/
if (info->depthTestEnable && info->depthCompareOp == VK_COMPARE_OP_EQUAL)
wm_depth_stencil.DepthBufferWriteEnable = false;
GENX(3DSTATE_WM_DEPTH_STENCIL_pack)(NULL, dw, &wm_depth_stencil);
}