diff options
author | Jason Ekstrand <[email protected]> | 2015-11-18 15:14:05 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-12-07 21:08:26 -0800 |
commit | 43ac954e25f28d240da65ed816458d3529675a04 (patch) | |
tree | cbcbacaee2af33d0394107c6e886e08ee89f37a2 /src/vulkan/anv_cmd_buffer.c | |
parent | 1eb731d9fe41bdf5813a8e3646a7df36121b244c (diff) |
anv: Add initial support for pushing image params
The helper to fill out the image params data-structure is stilly a dummy,
but this puts the infastructure in place.
Diffstat (limited to 'src/vulkan/anv_cmd_buffer.c')
-rw-r--r-- | src/vulkan/anv_cmd_buffer.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index ee437aa6330..aacd2ab60e3 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -668,6 +668,16 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, if (layout == NULL) goto out; + if (layout->stage[stage].image_count > 0) { + VkResult result = + anv_cmd_buffer_ensure_push_constant_field(cmd_buffer, stage, images); + if (result != VK_SUCCESS) + return result; + + cmd_buffer->state.push_constants_dirty |= 1 << stage; + } + + uint32_t image = 0; for (uint32_t s = 0; s < layout->stage[stage].surface_count; s++) { struct anv_pipeline_binding *binding = &layout->stage[stage].surface_to_descriptor[s]; @@ -713,7 +723,20 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, bo_offset = desc->image_view->offset; break; - case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: + case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: { + surface_state = desc->image_view->storage_surface_state; + bo = desc->image_view->bo; + bo_offset = desc->image_view->offset; + + struct brw_image_param *image_param = + &cmd_buffer->state.push_constants[stage]->images[image++]; + + anv_image_view_fill_image_param(cmd_buffer->device, desc->image_view, + image_param); + image_param->surface_idx = bias + s; + break; + } + case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: assert(!"Unsupported descriptor type"); @@ -727,6 +750,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, bt_map[bias + s] = surface_state.offset + state_offset; add_surface_state_reloc(cmd_buffer, surface_state, bo, bo_offset); } + assert(image == layout->stage[stage].image_count); out: if (!cmd_buffer->device->info.has_llc) |