mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
anv: Perform rasterizer discard in the SOL stage instead of the clipper.
See commit b0629e6894, where we discovered
that the SOL stage's "Rendering Disable" feature is a lot faster at
throwing away all geometry than the clipper's "reject all" mode.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
99a47391e4
commit
b5661c1d70
4 changed files with 12 additions and 3 deletions
|
|
@ -119,6 +119,7 @@ genX(graphics_pipeline_create)(
|
|||
|
||||
emit_3dstate_clip(pipeline, pCreateInfo->pViewportState,
|
||||
pCreateInfo->pRasterizationState, extra);
|
||||
emit_3dstate_streamout(pipeline, pCreateInfo->pRasterizationState);
|
||||
|
||||
if (pCreateInfo->pMultisampleState &&
|
||||
pCreateInfo->pMultisampleState->rasterizationSamples > 1)
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ genX(graphics_pipeline_create)(
|
|||
|
||||
emit_3dstate_clip(pipeline, pCreateInfo->pViewportState,
|
||||
pCreateInfo->pRasterizationState, extra);
|
||||
emit_3dstate_streamout(pipeline, pCreateInfo->pRasterizationState);
|
||||
|
||||
const struct brw_wm_prog_data *wm_prog_data = get_wm_prog_data(pipeline);
|
||||
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_WM), wm) {
|
||||
|
|
|
|||
|
|
@ -666,8 +666,7 @@ emit_3dstate_clip(struct anv_pipeline *pipeline,
|
|||
clip.APIMode = APIMODE_D3D,
|
||||
clip.ViewportXYClipTestEnable = true;
|
||||
|
||||
clip.ClipMode = rs_info->rasterizerDiscardEnable ?
|
||||
CLIPMODE_REJECT_ALL : CLIPMODE_NORMAL;
|
||||
clip.ClipMode = CLIPMODE_NORMAL;
|
||||
|
||||
clip.TriangleStripListProvokingVertexSelect = 0;
|
||||
clip.LineStripListProvokingVertexSelect = 0;
|
||||
|
|
@ -687,3 +686,12 @@ emit_3dstate_clip(struct anv_pipeline *pipeline,
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
emit_3dstate_streamout(struct anv_pipeline *pipeline,
|
||||
const VkPipelineRasterizationStateCreateInfo *rs_info)
|
||||
{
|
||||
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_STREAMOUT), so) {
|
||||
so.RenderingDisable = rs_info->rasterizerDiscardEnable;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ genX(init_device_state)(struct anv_device *device)
|
|||
anv_batch_emit(&batch, GENX(3DSTATE_TE), ts);
|
||||
anv_batch_emit(&batch, GENX(3DSTATE_DS), ds);
|
||||
|
||||
anv_batch_emit(&batch, GENX(3DSTATE_STREAMOUT), so);
|
||||
anv_batch_emit(&batch, GENX(3DSTATE_AA_LINE_PARAMETERS), aa);
|
||||
|
||||
anv_batch_emit(&batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue