Module: Mesa
Branch: master
Commit: 9e847eedd5e71fa102003326a3e04e485884fe24
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e847eedd5e71fa102003326a3e04e485884fe24

Author: Bas Nieuwenhuizen <[email protected]>
Date:   Tue May  2 23:39:29 2017 +0200

radv: Don't set dynamic state for pipelines with rasterizer dicard.

All of the dynamic states apply to rasterization & fragment processing,
so we don't need to set them if we don't rasterize.

We don't clear the dirty flags for them though, so we don't miss any
updates for the next pipeline with rasterization.

Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Fixes: 76603aa90b8 "radv: Drop the default viewport when 0 viewports are given."

---

 src/amd/vulkan/radv_cmd_buffer.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index d165512eb6..edd7122125 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1192,6 +1192,15 @@ radv_cmd_buffer_flush_dynamic_state(struct 
radv_cmd_buffer *cmd_buffer)
 {
        struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
 
+       if 
(G_028810_DX_RASTERIZATION_KILL(cmd_buffer->state.pipeline->graphics.raster.pa_cl_clip_cntl))
+               return;
+
+       if (cmd_buffer->state.dirty & (RADV_CMD_DIRTY_DYNAMIC_VIEWPORT))
+               radv_emit_viewport(cmd_buffer);
+
+       if (cmd_buffer->state.dirty & (RADV_CMD_DIRTY_DYNAMIC_SCISSOR | 
RADV_CMD_DIRTY_DYNAMIC_VIEWPORT))
+               radv_emit_scissor(cmd_buffer);
+
        if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_DYNAMIC_LINE_WIDTH) {
                unsigned width = cmd_buffer->state.dynamic.line_width * 8;
                radeon_set_context_reg(cmd_buffer->cs, R_028A08_PA_SU_LINE_CNTL,
@@ -1536,12 +1545,6 @@ radv_cmd_buffer_flush_state(struct radv_cmd_buffer 
*cmd_buffer,
        if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_RENDER_TARGETS)
                radv_emit_framebuffer_state(cmd_buffer);
 
-       if (cmd_buffer->state.dirty & (RADV_CMD_DIRTY_DYNAMIC_VIEWPORT))
-               radv_emit_viewport(cmd_buffer);
-
-       if (cmd_buffer->state.dirty & (RADV_CMD_DIRTY_DYNAMIC_SCISSOR | 
RADV_CMD_DIRTY_DYNAMIC_VIEWPORT))
-               radv_emit_scissor(cmd_buffer);
-
        ia_multi_vgt_param = si_get_ia_multi_vgt_param(cmd_buffer, 
instanced_draw, indirect_draw, draw_vertex_count);
        if (cmd_buffer->state.last_ia_multi_vgt_param != ia_multi_vgt_param) {
                if (cmd_buffer->device->physical_device->rad_info.chip_class >= 
CIK)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to