static void
meta_emit_blit(struct anv_cmd_buffer *cmd_buffer,
- struct anv_surface_view *src,
+ struct anv_image_view *src,
VkOffset3D src_offset,
VkExtent3D src_extent,
struct anv_color_attachment_view *dest,
dest_offset.y + dest_extent.height,
},
.tex_coord = {
- (float)(src_offset.x + src_extent.width) / (float)src->extent.width,
- (float)(src_offset.y + src_extent.height) / (float)src->extent.height,
+ (float)(src_offset.x + src_extent.width) / (float)src->view.extent.width,
+ (float)(src_offset.y + src_extent.height) / (float)src->view.extent.height,
},
};
dest_offset.y + dest_extent.height,
},
.tex_coord = {
- (float)src_offset.x / (float)src->extent.width,
- (float)(src_offset.y + src_extent.height) / (float)src->extent.height,
+ (float)src_offset.x / (float)src->view.extent.width,
+ (float)(src_offset.y + src_extent.height) / (float)src->view.extent.height,
},
};
dest_offset.y,
},
.tex_coord = {
- (float)src_offset.x / (float)src->extent.width,
- (float)src_offset.y / (float)src->extent.height,
+ (float)src_offset.x / (float)src->view.extent.width,
+ (float)src_offset.y / (float)src->view.extent.height,
},
};
.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
.pDescriptors = (VkDescriptorInfo[]) {
{
- .imageView = (VkImageView) src,
+ .imageView = anv_image_view_to_handle(src),
.imageLayout = VK_IMAGE_LAYOUT_GENERAL
},
}
cmd_buffer);
meta_emit_blit(cmd_buffer,
- &src_view.view,
+ &src_view,
(VkOffset3D) { 0, 0, 0 },
(VkExtent3D) { width, height, 1 },
&dest_view,
uint32_t regionCount,
const VkBufferCopy* pRegions)
{
- struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *)cmdBuffer;
- struct anv_buffer *src_buffer = (struct anv_buffer *)srcBuffer;
- struct anv_buffer *dest_buffer = (struct anv_buffer *)destBuffer;
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_buffer, src_buffer, srcBuffer);
+ ANV_FROM_HANDLE(anv_buffer, dest_buffer, destBuffer);
+
struct anv_saved_state saved_state;
meta_prepare_blit(cmd_buffer, &saved_state);
uint32_t regionCount,
const VkImageCopy* pRegions)
{
- struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *)cmdBuffer;
- struct anv_image *src_image = (struct anv_image *)srcImage;
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_image, src_image, srcImage);
+
struct anv_saved_state saved_state;
meta_prepare_blit(cmd_buffer, &saved_state);
cmd_buffer);
meta_emit_blit(cmd_buffer,
- &src_view.view,
+ &src_view,
pRegions[r].srcOffset,
pRegions[r].extent,
&dest_view,
VkTexFilter filter)
{
- struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *)cmdBuffer;
- struct anv_image *src_image = (struct anv_image *)srcImage;
- struct anv_image *dest_image = (struct anv_image *)destImage;
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, cmdBuffer);
+ ANV_FROM_HANDLE(anv_image, src_image, srcImage);
+ ANV_FROM_HANDLE(anv_image, dest_image, destImage);
+
struct anv_saved_state saved_state;
anv_finishme("respect VkTexFilter");
cmd_buffer);
meta_emit_blit(cmd_buffer,
- &src_view.view,
+ &src_view,
pRegions[r].srcOffset,
pRegions[r].srcExtent,
&dest_view,
cmd_buffer);
meta_emit_blit(cmd_buffer,
- &src_view.view,
+ &src_view,
(VkOffset3D) { 0, 0, 0 },
pRegions[r].imageExtent,
&dest_view,
cmd_buffer);
meta_emit_blit(cmd_buffer,
- &src_view.view,
+ &src_view,
pRegions[r].imageOffset,
pRegions[r].imageExtent,
&dest_view,