diff options
author | Jason Ekstrand <[email protected]> | 2016-10-19 11:33:55 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-16 10:11:07 -0800 |
commit | d2b4a9da038a200db3c5c61a11d5ea451cc6cc98 (patch) | |
tree | 2a4b74fc4198128708228164b8225314ff65dcb3 /src/intel/vulkan/anv_private.h | |
parent | e283cd549c4aaf12cd74d7f15ddf4bda3fb009b0 (diff) |
anv: Rework the way render target surfaces are allocated
This commit moves the allocation and filling out of surface state from
CreateImageView time to BeginRenderPass time. Instead of allocating the
render target surface state as part of the image view, we allocate it in
the command buffer state at the same time that we set up clears. For
secondary command buffers, we allocate memory for the surface states in
BeginCommandBuffer but don't fill them out; instead, we use our new
SOL-based memcpy function to copy the surface states from the primary
command buffer. This allows us to handle secondary command buffers without
the user specifying the framebuffer ahead-of-time.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index fea86aa7274..06614d5c29b 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1083,6 +1083,8 @@ void anv_dynamic_state_copy(struct anv_dynamic_state *dest, * The clear value is valid only if there exists a pending clear. */ struct anv_attachment_state { + struct anv_state color_rt_state; + VkImageAspectFlags pending_clear_aspects; VkClearValue clear_value; }; @@ -1123,6 +1125,19 @@ struct anv_cmd_state { */ struct anv_attachment_state * attachments; + /** + * Surface states for color render targets. These are stored in a single + * flat array. For depth-stencil attachments, the surface state is simply + * left blank. + */ + struct anv_state render_pass_states; + + /** + * A null surface state of the right size to match the framebuffer. This + * is one of the states in render_pass_states. + */ + struct anv_state null_surface_state; + struct { struct anv_buffer * index_buffer; uint32_t index_type; /**< 3DSTATE_INDEX_BUFFER.IndexFormat */ @@ -1249,8 +1264,10 @@ void gen8_cmd_buffer_emit_depth_viewport(struct anv_cmd_buffer *cmd_buffer, bool depth_clamp_enable); void gen7_cmd_buffer_emit_scissor(struct anv_cmd_buffer *cmd_buffer); -void anv_cmd_state_setup_attachments(struct anv_cmd_buffer *cmd_buffer, - const VkRenderPassBeginInfo *info); +void anv_cmd_buffer_setup_attachments(struct anv_cmd_buffer *cmd_buffer, + struct anv_render_pass *pass, + struct anv_framebuffer *framebuffer, + const VkClearValue *clear_values); struct anv_state anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer, @@ -1571,9 +1588,6 @@ struct anv_image_view { VkFormat vk_format; VkExtent3D extent; /**< Extent of VkImageViewCreateInfo::baseMipLevel. */ - /** RENDER_SURFACE_STATE when using image as a color render target. */ - struct anv_state color_rt_surface_state; - /** RENDER_SURFACE_STATE when using image as a sampler surface. */ struct anv_state sampler_surface_state; |