vk/0.170.2: Update VkImageSubresourceRange
Replace 'aspect' with 'aspectMask'.
This commit is contained in:
parent
568654d606
commit
7a089bd1a6
|
@ -1505,7 +1505,7 @@ typedef struct {
|
|||
} VkChannelMapping;
|
||||
|
||||
typedef struct {
|
||||
VkImageAspect aspect;
|
||||
VkImageAspectFlags aspectMask;
|
||||
uint32_t baseMipLevel;
|
||||
uint32_t mipLevels;
|
||||
uint32_t baseArraySlice;
|
||||
|
|
|
@ -415,8 +415,7 @@ anv_validate_CreateImageView(VkDevice _device,
|
|||
assert(pCreateInfo->channels.a <= VK_CHANNEL_SWIZZLE_END_RANGE);
|
||||
|
||||
/* Validate subresource. */
|
||||
assert(subresource->aspect >= VK_IMAGE_ASPECT_BEGIN_RANGE);
|
||||
assert(subresource->aspect <= VK_IMAGE_ASPECT_END_RANGE);
|
||||
assert(subresource->aspectMask != 0);
|
||||
assert(subresource->mipLevels > 0);
|
||||
assert(subresource->arraySize > 0);
|
||||
assert(subresource->baseMipLevel < image->levels);
|
||||
|
@ -430,28 +429,33 @@ anv_validate_CreateImageView(VkDevice _device,
|
|||
assert(subresource->arraySize % 6 == 0);
|
||||
}
|
||||
|
||||
const VkImageAspectFlags ds_flags = VK_IMAGE_ASPECT_DEPTH_BIT
|
||||
| VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
|
||||
/* Validate format. */
|
||||
switch (subresource->aspect) {
|
||||
case VK_IMAGE_ASPECT_COLOR:
|
||||
if (subresource->aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) {
|
||||
assert(subresource->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT);
|
||||
assert(!image->format->depth_format);
|
||||
assert(!image->format->has_stencil);
|
||||
assert(!view_format_info->depth_format);
|
||||
assert(!view_format_info->has_stencil);
|
||||
assert(view_format_info->cpp == image->format->cpp);
|
||||
break;
|
||||
case VK_IMAGE_ASPECT_DEPTH:
|
||||
assert(image->format->depth_format);
|
||||
assert(view_format_info->depth_format);
|
||||
assert(view_format_info->cpp == image->format->cpp);
|
||||
break;
|
||||
case VK_IMAGE_ASPECT_STENCIL:
|
||||
/* FINISHME: Is it legal to have an R8 view of S8? */
|
||||
assert(image->format->has_stencil);
|
||||
assert(view_format_info->has_stencil);
|
||||
break;
|
||||
default:
|
||||
assert(!"bad VkImageAspect");
|
||||
break;
|
||||
} else if (subresource->aspectMask & ds_flags) {
|
||||
assert((subresource->aspectMask & ~ds_flags) == 0);
|
||||
|
||||
if (subresource->aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) {
|
||||
assert(image->format->depth_format);
|
||||
assert(view_format_info->depth_format);
|
||||
assert(view_format_info->cpp == image->format->cpp);
|
||||
}
|
||||
|
||||
if (subresource->aspectMask & VK_IMAGE_ASPECT_STENCIL) {
|
||||
/* FINISHME: Is it legal to have an R8 view of S8? */
|
||||
assert(image->format->has_stencil);
|
||||
assert(view_format_info->has_stencil);
|
||||
}
|
||||
} else {
|
||||
assert(!"bad VkImageSubresourceRange::aspectFlags");
|
||||
}
|
||||
|
||||
return anv_CreateImageView(_device, pCreateInfo, pView);
|
||||
|
@ -528,19 +532,27 @@ anv_depth_stencil_view_init(struct anv_depth_stencil_view *view,
|
|||
}
|
||||
|
||||
struct anv_surface *
|
||||
anv_image_get_surface_for_aspect(struct anv_image *image, VkImageAspect aspect)
|
||||
anv_image_get_surface_for_aspect_mask(struct anv_image *image, VkImageAspectFlags aspect_mask)
|
||||
{
|
||||
switch (aspect) {
|
||||
case VK_IMAGE_ASPECT_COLOR:
|
||||
switch (aspect_mask) {
|
||||
case VK_IMAGE_ASPECT_COLOR_BIT:
|
||||
assert(anv_format_is_color(image->format));
|
||||
return &image->color_surface;
|
||||
case VK_IMAGE_ASPECT_DEPTH:
|
||||
case VK_IMAGE_ASPECT_DEPTH_BIT:
|
||||
assert(image->format->depth_format);
|
||||
return &image->depth_surface;
|
||||
case VK_IMAGE_ASPECT_STENCIL:
|
||||
case VK_IMAGE_ASPECT_STENCIL_BIT:
|
||||
assert(image->format->has_stencil);
|
||||
anv_finishme("stencil image views");
|
||||
return &image->stencil_surface;
|
||||
case VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT:
|
||||
/* FINISHME: Support combined depthstencil aspect. Does the Vulkan spec
|
||||
* allow is to reject it? Until we support it, filter out the stencil
|
||||
* aspect and use only the depth aspect.
|
||||
*/
|
||||
anv_finishme("combined depthstencil aspect");
|
||||
assert(image->format->depth_format);
|
||||
return &image->depth_surface;
|
||||
default:
|
||||
unreachable("image does not have aspect");
|
||||
return NULL;
|
||||
|
|
|
@ -1013,7 +1013,7 @@ do_buffer_copy(struct anv_cmd_buffer *cmd_buffer,
|
|||
VK_CHANNEL_SWIZZLE_A
|
||||
},
|
||||
.subresourceRange = {
|
||||
.aspect = VK_IMAGE_ASPECT_COLOR,
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.baseMipLevel = 0,
|
||||
.mipLevels = 1,
|
||||
.baseArraySlice = 0,
|
||||
|
@ -1161,7 +1161,7 @@ void anv_CmdCopyImage(
|
|||
VK_CHANNEL_SWIZZLE_A
|
||||
},
|
||||
.subresourceRange = {
|
||||
.aspect = pRegions[r].srcSubresource.aspect,
|
||||
.aspectMask = 1 << pRegions[r].srcSubresource.aspect,
|
||||
.baseMipLevel = pRegions[r].srcSubresource.mipLevel,
|
||||
.mipLevels = 1,
|
||||
.baseArraySlice = pRegions[r].srcSubresource.arraySlice,
|
||||
|
@ -1247,7 +1247,7 @@ void anv_CmdBlitImage(
|
|||
VK_CHANNEL_SWIZZLE_A
|
||||
},
|
||||
.subresourceRange = {
|
||||
.aspect = pRegions[r].srcSubresource.aspect,
|
||||
.aspectMask = 1 << pRegions[r].srcSubresource.aspect,
|
||||
.baseMipLevel = pRegions[r].srcSubresource.mipLevel,
|
||||
.mipLevels = 1,
|
||||
.baseArraySlice = pRegions[r].srcSubresource.arraySlice,
|
||||
|
@ -1377,7 +1377,7 @@ void anv_CmdCopyBufferToImage(
|
|||
VK_CHANNEL_SWIZZLE_A
|
||||
},
|
||||
.subresourceRange = {
|
||||
.aspect = proxy_aspect,
|
||||
.aspectMask = 1 << proxy_aspect,
|
||||
.baseMipLevel = 0,
|
||||
.mipLevels = 1,
|
||||
.baseArraySlice = 0,
|
||||
|
@ -1464,7 +1464,7 @@ void anv_CmdCopyImageToBuffer(
|
|||
VK_CHANNEL_SWIZZLE_A
|
||||
},
|
||||
.subresourceRange = {
|
||||
.aspect = pRegions[r].imageSubresource.aspect,
|
||||
.aspectMask = 1 << pRegions[r].imageSubresource.aspect,
|
||||
.baseMipLevel = pRegions[r].imageSubresource.mipLevel,
|
||||
.mipLevels = 1,
|
||||
.baseArraySlice = pRegions[r].imageSubresource.arraySlice,
|
||||
|
|
|
@ -1273,7 +1273,8 @@ VkResult anv_image_create(VkDevice _device,
|
|||
VkImage *pImage);
|
||||
|
||||
struct anv_surface *
|
||||
anv_image_get_surface_for_aspect(struct anv_image *image, VkImageAspect aspect);
|
||||
anv_image_get_surface_for_aspect_mask(struct anv_image *image,
|
||||
VkImageAspectFlags aspect_mask);
|
||||
|
||||
struct anv_surface *
|
||||
anv_image_get_surface_for_color_attachment(struct anv_image *image);
|
||||
|
|
|
@ -274,7 +274,7 @@ gen7_image_view_init(struct anv_image_view *iview,
|
|||
const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
|
||||
struct anv_surface_view *view = &iview->view;
|
||||
struct anv_surface *surface =
|
||||
anv_image_get_surface_for_aspect(image, range->aspect);
|
||||
anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
|
||||
|
||||
const struct anv_format *format =
|
||||
anv_format_for_vk_format(pCreateInfo->format);
|
||||
|
|
|
@ -150,7 +150,7 @@ gen8_image_view_init(struct anv_image_view *iview,
|
|||
const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
|
||||
struct anv_surface_view *view = &iview->view;
|
||||
struct anv_surface *surface =
|
||||
anv_image_get_surface_for_aspect(image, range->aspect);
|
||||
anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
|
||||
|
||||
uint32_t depth = 1; /* RENDER_SURFACE_STATE::Depth */
|
||||
uint32_t rt_view_extent = 1; /* RENDER_SURFACE_STATE::RenderTargetViewExtent */
|
||||
|
|
Loading…
Reference in New Issue