VkFramebuffer framebuffer;
} VkCommandBufferBeginInfo;
-typedef struct {
+typedef struct VkBufferCopy {
VkDeviceSize srcOffset;
- VkDeviceSize destOffset;
- VkDeviceSize copySize;
+ VkDeviceSize dstOffset;
+ VkDeviceSize size;
} VkBufferCopy;
-typedef struct {
- VkImageAspect aspect;
+typedef struct VkImageSubresourceLayers {
+ VkImageAspectFlags aspectMask;
uint32_t mipLevel;
- uint32_t arrayLayer;
- uint32_t arraySize;
-} VkImageSubresourceCopy;
+ uint32_t baseArrayLayer;
+ uint32_t layerCount;
+} VkImageSubresourceLayers;
-typedef struct {
- VkImageSubresourceCopy srcSubresource;
+typedef struct VkImageCopy {
+ VkImageSubresourceLayers srcSubresource;
VkOffset3D srcOffset;
- VkImageSubresourceCopy destSubresource;
- VkOffset3D destOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
VkExtent3D extent;
} VkImageCopy;
-typedef struct {
- VkImageSubresourceCopy srcSubresource;
+typedef struct VkImageBlit {
+ VkImageSubresourceLayers srcSubresource;
VkOffset3D srcOffset;
VkExtent3D srcExtent;
- VkImageSubresourceCopy destSubresource;
- VkOffset3D destOffset;
- VkExtent3D destExtent;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D dstExtent;
} VkImageBlit;
-typedef struct {
+typedef struct VkBufferImageCopy {
VkDeviceSize bufferOffset;
uint32_t bufferRowLength;
uint32_t bufferImageHeight;
- VkImageSubresourceCopy imageSubresource;
+ VkImageSubresourceLayers imageSubresource;
VkOffset3D imageOffset;
VkExtent3D imageExtent;
} VkBufferImageCopy;
-typedef union {
+typedef union VkClearColorValue {
float float32[4];
int32_t int32[4];
uint32_t uint32[4];
} VkClearColorValue;
-typedef struct {
+typedef struct VkClearDepthStencilValue {
float depth;
uint32_t stencil;
} VkClearDepthStencilValue;
-typedef struct {
- VkOffset3D offset;
- VkExtent3D extent;
-} VkRect3D;
+typedef union VkClearValue {
+ VkClearColorValue color;
+ VkClearDepthStencilValue depthStencil;
+} VkClearValue;
-typedef struct {
- VkImageSubresourceCopy srcSubresource;
+typedef struct VkClearAttachment {
+ VkImageAspectFlags aspectMask;
+ uint32_t colorAttachment;
+ VkClearValue clearValue;
+} VkClearAttachment;
+
+typedef struct VkClearRect {
+ VkRect2D rect;
+ uint32_t baseArrayLayer;
+ uint32_t layerCount;
+} VkClearRect;
+
+typedef struct VkImageResolve {
+ VkImageSubresourceLayers srcSubresource;
VkOffset3D srcOffset;
- VkImageSubresourceCopy destSubresource;
- VkOffset3D destOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
VkExtent3D extent;
} VkImageResolve;
-typedef union {
- VkClearColorValue color;
- VkClearDepthStencilValue depthStencil;
-} VkClearValue;
-
typedef struct {
VkStructureType sType;
const void* pNext;
typedef void (VKAPI_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data);
typedef void (VKAPI_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
-typedef void (VKAPI_PTR *PFN_vkCmdClearColorAttachment)(VkCommandBuffer commandBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects);
-typedef void (VKAPI_PTR *PFN_vkCmdClearDepthStencilAttachment)(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects);
-typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
+typedef void (VKAPI_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects);
+typedef void (VKAPI_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
typedef void (VKAPI_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
typedef void (VKAPI_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers);
VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
- VkBuffer destBuffer,
+ VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions);
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
- VkImage destImage,
- VkImageLayout destImageLayout,
+ VkImage dstImage,
+ VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageCopy* pRegions);
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
- VkImage destImage,
- VkImageLayout destImageLayout,
+ VkImage dstImage,
+ VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageBlit* pRegions,
VkTexFilter filter);
VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
- VkImage destImage,
- VkImageLayout destImageLayout,
+ VkImage dstImage,
+ VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkBufferImageCopy* pRegions);
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
- VkBuffer destBuffer,
+ VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferImageCopy* pRegions);
VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(
VkCommandBuffer commandBuffer,
- VkBuffer destBuffer,
- VkDeviceSize destOffset,
+ VkBuffer dstBuffer,
+ VkDeviceSize dstOffset,
VkDeviceSize dataSize,
const uint32_t* pData);
VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(
VkCommandBuffer commandBuffer,
- VkBuffer destBuffer,
- VkDeviceSize destOffset,
- VkDeviceSize fillSize,
+ VkBuffer dstBuffer,
+ VkDeviceSize dstOffset,
+ VkDeviceSize size,
uint32_t data);
VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges);
-VKAPI_ATTR void VKAPI_CALL vkCmdClearColorAttachment(
- VkCommandBuffer commandBuffer,
- uint32_t colorAttachment,
- VkImageLayout imageLayout,
- const VkClearColorValue* pColor,
- uint32_t rectCount,
- const VkRect3D* pRects);
-
-VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilAttachment(
+VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(
VkCommandBuffer commandBuffer,
- VkImageAspectFlags aspectMask,
- VkImageLayout imageLayout,
- const VkClearDepthStencilValue* pDepthStencil,
+ uint32_t attachmentCount,
+ const VkClearAttachment* pAttachments,
uint32_t rectCount,
- const VkRect3D* pRects);
+ const VkClearRect* pRects);
VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
- VkImage destImage,
- VkImageLayout destImageLayout,
+ VkImage dstImage,
+ VkImageLayout dstImageLayout,
uint32_t regionCount,
const VkImageResolve* pRegions);
copy_image, VK_IMAGE_LAYOUT_GENERAL, 1,
&(VkImageBlit) {
.srcSubresource = {
- .aspect = VK_IMAGE_ASPECT_COLOR,
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.mipLevel = miplevel,
- .arrayLayer = array_layer,
- .arraySize = 1,
+ .baseArrayLayer = array_layer,
+ .layerCount = 1,
},
.srcOffset = (VkOffset3D) { 0, 0, 0 },
.srcExtent = (VkExtent3D) {
extent.height,
1
},
- .destSubresource = {
- .aspect = VK_IMAGE_ASPECT_COLOR,
+ .dstSubresource = {
+ .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.mipLevel = 0,
- .arrayLayer = 0,
- .arraySize = 1,
+ .baseArrayLayer = 0,
+ .layerCount = 1,
},
- .destOffset = (VkOffset3D) { 0, 0, 0 },
- .destExtent = (VkExtent3D) {
+ .dstOffset = (VkOffset3D) { 0, 0, 0 },
+ .dstExtent = (VkExtent3D) {
extent.width,
extent.height,
1
static uint32_t
meta_blit_get_dest_view_base_array_slice(const struct anv_image *dest_image,
- const VkImageSubresourceCopy *dest_subresource,
+ const VkImageSubresourceLayers *dest_subresource,
const VkOffset3D *dest_offset)
{
switch (dest_image->type) {
case VK_IMAGE_TYPE_1D:
case VK_IMAGE_TYPE_2D:
- return dest_subresource->arrayLayer;
+ return dest_subresource->baseArrayLayer;
case VK_IMAGE_TYPE_3D:
/* HACK: Vulkan does not allow attaching a 3D image to a framebuffer,
* but meta does it anyway. When doing so, we translate the
for (unsigned r = 0; r < regionCount; r++) {
uint64_t src_offset = src_buffer->offset + pRegions[r].srcOffset;
- uint64_t dest_offset = dest_buffer->offset + pRegions[r].destOffset;
- uint64_t copy_size = pRegions[r].copySize;
+ uint64_t dest_offset = dest_buffer->offset + pRegions[r].dstOffset;
+ uint64_t copy_size = pRegions[r].size;
/* First, we compute the biggest format that can be used with the
* given offsets and size.
bs = MIN2(bs, 1 << fs);
assert(dest_offset % bs == 0);
- fs = ffs(pRegions[r].copySize) - 1;
+ fs = ffs(pRegions[r].size) - 1;
if (fs != -1)
bs = MIN2(bs, 1 << fs);
- assert(pRegions[r].copySize % bs == 0);
+ assert(pRegions[r].size % bs == 0);
VkFormat copy_format = vk_format_for_size(bs);
.viewType = src_iview_type,
.format = src_image->format->vk_format,
.subresourceRange = {
- .aspectMask = 1 << pRegions[r].srcSubresource.aspect,
+ .aspectMask = pRegions[r].srcSubresource.aspectMask,
.baseMipLevel = pRegions[r].srcSubresource.mipLevel,
.mipLevels = 1,
- .baseArrayLayer = pRegions[r].srcSubresource.arrayLayer,
- .arraySize = pRegions[r].destSubresource.arraySize,
+ .baseArrayLayer = pRegions[r].srcSubresource.baseArrayLayer,
+ .arraySize = pRegions[r].dstSubresource.layerCount,
},
},
cmd_buffer);
const VkOffset3D dest_offset = {
- .x = pRegions[r].destOffset.x,
- .y = pRegions[r].destOffset.y,
+ .x = pRegions[r].dstOffset.x,
+ .y = pRegions[r].dstOffset.y,
.z = 0,
};
unsigned num_slices;
if (src_image->type == VK_IMAGE_TYPE_3D) {
- assert(pRegions[r].srcSubresource.arraySize == 1 &&
- pRegions[r].destSubresource.arraySize == 1);
+ assert(pRegions[r].srcSubresource.layerCount == 1 &&
+ pRegions[r].dstSubresource.layerCount == 1);
num_slices = pRegions[r].extent.depth;
} else {
- assert(pRegions[r].srcSubresource.arraySize ==
- pRegions[r].destSubresource.arraySize);
+ assert(pRegions[r].srcSubresource.layerCount ==
+ pRegions[r].dstSubresource.layerCount);
assert(pRegions[r].extent.depth == 1);
- num_slices = pRegions[r].destSubresource.arraySize;
+ num_slices = pRegions[r].dstSubresource.layerCount;
}
const uint32_t dest_base_array_slice =
meta_blit_get_dest_view_base_array_slice(dest_image,
- &pRegions[r].destSubresource,
- &pRegions[r].destOffset);
+ &pRegions[r].dstSubresource,
+ &pRegions[r].dstOffset);
for (unsigned slice = 0; slice < num_slices; slice++) {
VkOffset3D src_offset = pRegions[r].srcOffset;
.format = dest_image->format->vk_format,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
- .baseMipLevel = pRegions[r].destSubresource.mipLevel,
+ .baseMipLevel = pRegions[r].dstSubresource.mipLevel,
.mipLevels = 1,
.baseArrayLayer = dest_base_array_slice + slice,
.arraySize = 1
.viewType = src_iview_type,
.format = src_image->format->vk_format,
.subresourceRange = {
- .aspectMask = 1 << pRegions[r].srcSubresource.aspect,
+ .aspectMask = pRegions[r].srcSubresource.aspectMask,
.baseMipLevel = pRegions[r].srcSubresource.mipLevel,
.mipLevels = 1,
- .baseArrayLayer = pRegions[r].srcSubresource.arrayLayer,
+ .baseArrayLayer = pRegions[r].srcSubresource.baseArrayLayer,
.arraySize = 1
},
},
cmd_buffer);
const VkOffset3D dest_offset = {
- .x = pRegions[r].destOffset.x,
- .y = pRegions[r].destOffset.y,
+ .x = pRegions[r].dstOffset.x,
+ .y = pRegions[r].dstOffset.y,
.z = 0,
};
const uint32_t dest_array_slice =
meta_blit_get_dest_view_base_array_slice(dest_image,
- &pRegions[r].destSubresource,
- &pRegions[r].destOffset);
+ &pRegions[r].dstSubresource,
+ &pRegions[r].dstOffset);
- if (pRegions[r].srcSubresource.arraySize > 1)
+ if (pRegions[r].srcSubresource.layerCount > 1)
anv_finishme("FINISHME: copy multiple array layers");
- if (pRegions[r].destExtent.depth > 1)
+ if (pRegions[r].dstExtent.depth > 1)
anv_finishme("FINISHME: copy multiple depth layers");
struct anv_image_view dest_iview;
.format = dest_image->format->vk_format,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
- .baseMipLevel = pRegions[r].destSubresource.mipLevel,
+ .baseMipLevel = pRegions[r].dstSubresource.mipLevel,
.mipLevels = 1,
.baseArrayLayer = dest_array_slice,
.arraySize = 1
pRegions[r].srcExtent,
dest_image, &dest_iview,
dest_offset,
- pRegions[r].destExtent,
+ pRegions[r].dstExtent,
filter);
}
for (unsigned r = 0; r < regionCount; r++) {
VkFormat proxy_format = orig_format;
- VkImageAspect proxy_aspect = pRegions[r].imageSubresource.aspect;
+ VkImageAspectFlags proxy_aspect = pRegions[r].imageSubresource.aspectMask;
if (orig_format == VK_FORMAT_S8_UINT) {
proxy_format = VK_FORMAT_R8_UINT;
- proxy_aspect = VK_IMAGE_ASPECT_COLOR;
+ proxy_aspect = VK_IMAGE_ASPECT_COLOR_BIT;
}
struct anv_image *src_image =
unsigned num_slices;
if (dest_image->type == VK_IMAGE_TYPE_3D) {
- assert(pRegions[r].imageSubresource.arraySize == 1);
+ assert(pRegions[r].imageSubresource.layerCount == 1);
num_slices = pRegions[r].imageExtent.depth;
} else {
assert(pRegions[r].imageExtent.depth == 1);
- num_slices = pRegions[r].imageSubresource.arraySize;
+ num_slices = pRegions[r].imageSubresource.layerCount;
}
for (unsigned slice = 0; slice < num_slices; slice++) {
.viewType = VK_IMAGE_VIEW_TYPE_2D,
.format = proxy_format,
.subresourceRange = {
- .aspectMask = 1 << proxy_aspect,
+ .aspectMask = proxy_aspect,
.baseMipLevel = 0,
.mipLevels = 1,
.baseArrayLayer = 0,
.viewType = src_iview_type,
.format = src_image->format->vk_format,
.subresourceRange = {
- .aspectMask = 1 << pRegions[r].imageSubresource.aspect,
+ .aspectMask = pRegions[r].imageSubresource.aspectMask,
.baseMipLevel = pRegions[r].imageSubresource.mipLevel,
.mipLevels = 1,
- .baseArrayLayer = pRegions[r].imageSubresource.arrayLayer,
- .arraySize = pRegions[r].imageSubresource.arraySize,
+ .baseArrayLayer = pRegions[r].imageSubresource.baseArrayLayer,
+ .arraySize = pRegions[r].imageSubresource.layerCount,
},
},
cmd_buffer);
unsigned num_slices;
if (src_image->type == VK_IMAGE_TYPE_3D) {
- assert(pRegions[r].imageSubresource.arraySize == 1);
+ assert(pRegions[r].imageSubresource.layerCount == 1);
num_slices = pRegions[r].imageExtent.depth;
} else {
assert(pRegions[r].imageExtent.depth == 1);
- num_slices = pRegions[r].imageSubresource.arraySize;
+ num_slices = pRegions[r].imageSubresource.layerCount;
}
for (unsigned slice = 0; slice < num_slices; slice++) {
stub();
}
-void anv_CmdClearColorAttachment(
+void anv_CmdClearAttachments(
VkCommandBuffer commandBuffer,
- uint32_t colorAttachment,
- VkImageLayout imageLayout,
- const VkClearColorValue* pColor,
- uint32_t rectCount,
- const VkRect3D* pRects)
-{
- stub();
-}
-
-void anv_CmdClearDepthStencilAttachment(
- VkCommandBuffer commandBuffer,
- VkImageAspectFlags aspectMask,
- VkImageLayout imageLayout,
- const VkClearDepthStencilValue* pDepthStencil,
+ uint32_t attachmentCount,
+ const VkClearAttachment* pAttachments,
uint32_t rectCount,
- const VkRect3D* pRects)
+ const VkClearRect* pRects)
{
stub();
}