radv: avoid context rolls when binding graphics pipelines
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 18 Jan 2019 20:17:35 +0000 (20:17 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 21 Jan 2019 14:37:53 +0000 (14:37 +0000)
commite4c6423c5efbcba66fd473e004c6526d9beb6430
tree618eea534d3a2f309e907d794850204eb5153041
parent5564a797f23b91cb0115966c236b0ba3ab91b687
radv: avoid context rolls when binding graphics pipelines

It's common in some applications to bind a new graphics pipeline without
ending up changing any context registers.

This has a pipline have two command buffers: one for setting context
registers and one for everything else. The context register command buffer
is only emitted if it differs from the previous pipeline's.

v2: ensure late scissor emission is done when radv_emit_rbplus_state() is
    called
v2: make use of cmd_buffer->state.workaround_scissor_bug
v3: rename "workaround_scissor_bug" to
    "context_roll_without_scissor_emitted"

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h