diff options
author | Kristian Høgsberg <[email protected]> | 2015-05-19 14:14:24 -0700 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2015-05-20 20:34:52 -0700 |
commit | a1bd426393fb24a53d2cb180b21db4473ed71330 (patch) | |
tree | dbe7d3cc6a6a8b21b648db27d37cffa8786be4c3 /src/vulkan/meta.c | |
parent | 01504057f5a456bd9d2fc8ed969eda05421d3ebc (diff) |
vk: Stream surface state instead of using the surface pool
Since the binding table pointer is only 16 bits, we can only have 64kb
of binding table state allocated at any given time. With a block size of
1kb, that amounts to just 64 command buffers, which is not enough.
Diffstat (limited to 'src/vulkan/meta.c')
-rw-r--r-- | src/vulkan/meta.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/vulkan/meta.c b/src/vulkan/meta.c index b088e777dd2..976a0ee3b6a 100644 --- a/src/vulkan/meta.c +++ b/src/vulkan/meta.c @@ -174,6 +174,27 @@ anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer, ANV_CMD_BUFFER_DESCRIPTOR_SET_DIRTY; } +static void +anv_cmd_buffer_copy_render_targets(struct anv_cmd_buffer *cmd_buffer, + struct anv_saved_state *state) +{ + struct anv_framebuffer *fb = cmd_buffer->framebuffer; + struct anv_bindings *old_bindings = state->old_bindings; + struct anv_bindings *bindings = cmd_buffer->bindings; + + for (uint32_t i = 0; i < fb->color_attachment_count; i++) { + bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].surfaces[i] = + old_bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].surfaces[i]; + + bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].relocs[i].bo = + old_bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].relocs[i].bo; + bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].relocs[i].offset = + old_bindings->descriptors[VK_SHADER_STAGE_FRAGMENT].relocs[i].offset; + } + + cmd_buffer->dirty |= ANV_CMD_BUFFER_DESCRIPTOR_SET_DIRTY; +} + struct vue_header { uint32_t Reserved; uint32_t RTAIndex; @@ -241,9 +262,7 @@ anv_cmd_buffer_clear(struct anv_cmd_buffer *cmd_buffer, }; anv_cmd_buffer_save(cmd_buffer, &saved_state); - - /* Initialize render targets for the meta bindings. */ - anv_cmd_buffer_fill_render_targets(cmd_buffer); + anv_cmd_buffer_copy_render_targets(cmd_buffer, &saved_state); anv_CmdBindVertexBuffers((VkCmdBuffer) cmd_buffer, 0, 2, (VkBuffer[]) { |