Skip to content

i965: Fix indirect parameters draw during conditional rendering on hsw+

Illia Iorin requested to merge GL/mesa:cond_and_indr into main

Both extensions GL_ARB_indirect_parameters and GL_NV_conditional_render use MI_PREDICATE for their work so when conditional rendering was enabled GL_ARB_indirect_parameters incorrectly handled already present predicate result and didn't restore it in the end.

Instead we add special code path for this case.

for each draw call mi_math is used to compute mi_predicate_result as: ( (draw index < draw count) && stored_mi_predicate_result )

After the loop mi_predicate is restored to the original value.

Also the amount of loadings to GPU registers was reduced by moving loadings which were constant in respect to the draw loop outside of it.

On hsw reading and writing from/to MI_PREDICATE_RESULT is prohibited. So we reserve 15-th HSW_CS_GPR for storing PREDICATE_RESULT_REG In the only place MI_PREDICATE_RESULT is computed for queries we add manual computation via MI_MATH to store into PREDICATE_RESULT_REG.

Signed-off-by: Illia Iorin illia.iorin@gloaballogic.com
Signed-off-by: Danylo Piliaiev danylo.piliaiev@globallogic.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108759

Piglit test that shows the fixed issue: https://patchwork.freedesktop.org/patch/287253/

Merge request reports