diff options
author | Chad Versace <[email protected]> | 2015-11-03 13:42:28 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-11-03 13:46:40 -0800 |
commit | 4d1c76485ba8868d494b268675d26e76a40c088c (patch) | |
tree | 4f83eab11b2049c5b67bcf7859bdde15d4f601a6 /src/vulkan/anv_cmd_buffer.c | |
parent | 584f9d444238baaaacc138c81c46c88af98438f9 (diff) |
anv: Drop stale comment in anv_cmd_buffer_emit_binding_table()
When emitting the binding table for the fragment shader stage, we no
longer "walk all of the attachments, [inserting only] the color
attachments into the binding table". Instead, we iterate only over the
subpass's color attachments, which is the minimal possible iteration.
While killing the comment, also rename the variable 'attachments' to
'color_count', as it's no longer a count of all framebuffer attachments
but only the subpass's color attachment count.
Diffstat (limited to 'src/vulkan/anv_cmd_buffer.c')
-rw-r--r-- | src/vulkan/anv_cmd_buffer.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 78c7635ef6d..99f10981f69 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -546,7 +546,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, struct anv_framebuffer *fb = cmd_buffer->state.framebuffer; struct anv_subpass *subpass = cmd_buffer->state.subpass; struct anv_pipeline_layout *layout; - uint32_t attachments, bias, state_offset; + uint32_t color_count, bias, state_offset; if (stage == VK_SHADER_STAGE_COMPUTE) layout = cmd_buffer->state.compute_pipeline->layout; @@ -555,10 +555,10 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, if (stage == VK_SHADER_STAGE_FRAGMENT) { bias = MAX_RTS; - attachments = subpass->color_count; + color_count = subpass->color_count; } else { bias = 0; - attachments = 0; + color_count = 0; } /* This is a little awkward: layout can be NULL but we still have to @@ -566,7 +566,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, * targets. */ uint32_t surface_count = layout ? layout->stage[stage].surface_count : 0; - if (attachments + surface_count == 0) + if (color_count + surface_count == 0) return VK_SUCCESS; *bt_state = anv_cmd_buffer_alloc_binding_table(cmd_buffer, @@ -577,13 +577,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, if (bt_state->map == NULL) return VK_ERROR_OUT_OF_DEVICE_MEMORY; - /* This is highly annoying. The Vulkan spec puts the depth-stencil - * attachments in with the color attachments. Unfortunately, thanks to - * other aspects of the API, we cana't really saparate them before this - * point. Therefore, we have to walk all of the attachments but only - * put the color attachments into the binding table. - */ - for (uint32_t a = 0; a < attachments; a++) { + for (uint32_t a = 0; a < color_count; a++) { const struct anv_image_view *iview = fb->attachments[subpass->color_attachments[a]]; |