summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-30 13:54:56 -0700
committerJason Ekstrand <[email protected]>2016-04-08 15:57:49 -0700
commit85b9a007acb9bf53e509974f4112accb8e9a29f4 (patch)
tree51c54041b6ea25e008d4efd28d7c476021fd8032
parent28eb02e345c5642d49037759b5b0eee8d71e7feb (diff)
anv/blit2d: Add layouts for using a texel buffer source
Reviewed-by: Nanley Chery <[email protected]>
-rw-r--r--src/intel/vulkan/anv_meta_blit2d.c59
-rw-r--r--src/intel/vulkan/anv_private.h6
2 files changed, 53 insertions, 12 deletions
diff --git a/src/intel/vulkan/anv_meta_blit2d.c b/src/intel/vulkan/anv_meta_blit2d.c
index 878ae3f096e..22b763aee2d 100644
--- a/src/intel/vulkan/anv_meta_blit2d.c
+++ b/src/intel/vulkan/anv_meta_blit2d.c
@@ -168,7 +168,7 @@ blit2d_bind_src(struct anv_cmd_buffer *cmd_buffer,
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
.descriptorPool = tmp->desc_pool,
.descriptorSetCount = 1,
- .pSetLayouts = &device->meta_state.blit2d.image_ds_layout
+ .pSetLayouts = &device->meta_state.blit2d.img_ds_layout
}, &tmp->set);
anv_UpdateDescriptorSets(vk_device,
@@ -193,7 +193,7 @@ blit2d_bind_src(struct anv_cmd_buffer *cmd_buffer,
anv_CmdBindDescriptorSets(anv_cmd_buffer_to_handle(cmd_buffer),
VK_PIPELINE_BIND_POINT_GRAPHICS,
- device->meta_state.blit2d.image_p_layout, 0, 1,
+ device->meta_state.blit2d.img_p_layout, 0, 1,
&tmp->set, 0, NULL);
}
@@ -473,15 +473,27 @@ anv_device_finish_meta_blit2d_state(struct anv_device *device)
&device->meta_state.alloc);
}
- if (device->meta_state.blit2d.image_p_layout) {
+ if (device->meta_state.blit2d.img_p_layout) {
anv_DestroyPipelineLayout(anv_device_to_handle(device),
- device->meta_state.blit2d.image_p_layout,
+ device->meta_state.blit2d.img_p_layout,
&device->meta_state.alloc);
}
- if (device->meta_state.blit2d.image_ds_layout) {
+ if (device->meta_state.blit2d.img_ds_layout) {
anv_DestroyDescriptorSetLayout(anv_device_to_handle(device),
- device->meta_state.blit2d.image_ds_layout,
+ device->meta_state.blit2d.img_ds_layout,
+ &device->meta_state.alloc);
+ }
+
+ if (device->meta_state.blit2d.buf_p_layout) {
+ anv_DestroyPipelineLayout(anv_device_to_handle(device),
+ device->meta_state.blit2d.buf_p_layout,
+ &device->meta_state.alloc);
+ }
+
+ if (device->meta_state.blit2d.buf_ds_layout) {
+ anv_DestroyDescriptorSetLayout(anv_device_to_handle(device),
+ device->meta_state.blit2d.buf_ds_layout,
&device->meta_state.alloc);
}
}
@@ -539,7 +551,34 @@ anv_device_init_meta_blit2d_state(struct anv_device *device)
.pImmutableSamplers = NULL
},
}
- }, &device->meta_state.alloc, &device->meta_state.blit2d.image_ds_layout);
+ }, &device->meta_state.alloc, &device->meta_state.blit2d.img_ds_layout);
+ if (result != VK_SUCCESS)
+ goto fail;
+
+ result = anv_CreatePipelineLayout(anv_device_to_handle(device),
+ &(VkPipelineLayoutCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+ .setLayoutCount = 1,
+ .pSetLayouts = &device->meta_state.blit2d.img_ds_layout,
+ },
+ &device->meta_state.alloc, &device->meta_state.blit2d.img_p_layout);
+ if (result != VK_SUCCESS)
+ goto fail;
+
+ result = anv_CreateDescriptorSetLayout(anv_device_to_handle(device),
+ &(VkDescriptorSetLayoutCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
+ .bindingCount = 1,
+ .pBindings = (VkDescriptorSetLayoutBinding[]) {
+ {
+ .binding = 0,
+ .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
+ .descriptorCount = 1,
+ .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
+ .pImmutableSamplers = NULL
+ },
+ }
+ }, &device->meta_state.alloc, &device->meta_state.blit2d.buf_ds_layout);
if (result != VK_SUCCESS)
goto fail;
@@ -547,9 +586,9 @@ anv_device_init_meta_blit2d_state(struct anv_device *device)
&(VkPipelineLayoutCreateInfo) {
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
.setLayoutCount = 1,
- .pSetLayouts = &device->meta_state.blit2d.image_ds_layout,
+ .pSetLayouts = &device->meta_state.blit2d.buf_ds_layout,
},
- &device->meta_state.alloc, &device->meta_state.blit2d.image_p_layout);
+ &device->meta_state.alloc, &device->meta_state.blit2d.buf_p_layout);
if (result != VK_SUCCESS)
goto fail;
@@ -678,7 +717,7 @@ anv_device_init_meta_blit2d_state(struct anv_device *device)
},
},
.flags = 0,
- .layout = device->meta_state.blit2d.image_p_layout,
+ .layout = device->meta_state.blit2d.img_p_layout,
.renderPass = device->meta_state.blit2d.render_pass,
.subpass = 0,
};
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 9e3978a4691..7c140a33cb7 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -612,8 +612,10 @@ struct anv_meta_state {
/** Pipeline that copies from a 2D image. */
VkPipeline pipeline_2d_src;
- VkPipelineLayout image_p_layout;
- VkDescriptorSetLayout image_ds_layout;
+ VkPipelineLayout img_p_layout;
+ VkDescriptorSetLayout img_ds_layout;
+ VkPipelineLayout buf_p_layout;
+ VkDescriptorSetLayout buf_ds_layout;
} blit2d;
struct {