summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-01-23 12:10:44 +0100
committerSamuel Pitoiset <[email protected]>2018-02-01 09:37:09 +0100
commit4922e7f25c1a42779bab11aff6489d8a39a17061 (patch)
tree6f56b17524bf94465d5463264c108b7771a330d2 /src/amd/vulkan/radv_meta.c
parentcf224014dd2d4e6651ae15d346e624065614e8fd (diff)
radv: use separate bindings for graphics and compute descriptors
The Vulkan spec says: "pipelineBindPoint is a VkPipelineBindPoint indicating whether the descriptors will be used by graphics pipelines or compute pipelines. There is a separate set of bind points for each of graphics and compute, so binding one does not disturb the other." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104732 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta.c')
-rw-r--r--src/amd/vulkan/radv_meta.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c
index f0222470973..56b72d1c99b 100644
--- a/src/amd/vulkan/radv_meta.c
+++ b/src/amd/vulkan/radv_meta.c
@@ -34,6 +34,13 @@ void
radv_meta_save(struct radv_meta_saved_state *state,
struct radv_cmd_buffer *cmd_buffer, uint32_t flags)
{
+ VkPipelineBindPoint bind_point =
+ flags & RADV_META_SAVE_GRAPHICS_PIPELINE ?
+ VK_PIPELINE_BIND_POINT_GRAPHICS :
+ VK_PIPELINE_BIND_POINT_COMPUTE;
+ struct radv_descriptor_state *descriptors_state =
+ radv_get_descriptors_state(cmd_buffer, bind_point);
+
assert(flags & (RADV_META_SAVE_GRAPHICS_PIPELINE |
RADV_META_SAVE_COMPUTE_PIPELINE));
@@ -73,8 +80,8 @@ radv_meta_save(struct radv_meta_saved_state *state,
}
if (state->flags & RADV_META_SAVE_DESCRIPTORS) {
- if (cmd_buffer->state.valid_descriptors & (1 << 0))
- state->old_descriptor_set0 = cmd_buffer->descriptors[0];
+ if (descriptors_state->valid & (1 << 0))
+ state->old_descriptor_set0 = descriptors_state->sets[0];
else
state->old_descriptor_set0 = NULL;
}
@@ -97,6 +104,11 @@ void
radv_meta_restore(const struct radv_meta_saved_state *state,
struct radv_cmd_buffer *cmd_buffer)
{
+ VkPipelineBindPoint bind_point =
+ state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE ?
+ VK_PIPELINE_BIND_POINT_GRAPHICS :
+ VK_PIPELINE_BIND_POINT_COMPUTE;
+
if (state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE) {
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
VK_PIPELINE_BIND_POINT_GRAPHICS,
@@ -127,7 +139,8 @@ radv_meta_restore(const struct radv_meta_saved_state *state,
}
if (state->flags & RADV_META_SAVE_DESCRIPTORS) {
- radv_set_descriptor_set(cmd_buffer, state->old_descriptor_set0, 0);
+ radv_set_descriptor_set(cmd_buffer, bind_point,
+ state->old_descriptor_set0, 0);
}
if (state->flags & RADV_META_SAVE_CONSTANTS) {