#include "anv_private.h"
+/* FIXME: We shouldn't be using the actual hardware enum values here. They
+ * change across gens. Once we get that fixed, this include needs to go.
+ */
+#include "gen8_pack.h"
+
static const uint8_t anv_halign[] = {
[4] = HALIGN4,
[8] = HALIGN8,
{
VkImageUsageFlags usage = info->usage;
- if (usage & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) {
+ if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
/* Meta will transfer from the image by binding it as a texture. */
usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
}
- if (usage & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) {
+ if (usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
/* Meta will transfer to the image by binding it as a color attachment,
* even if the image format is not a color format.
*/
layout->size = surface->stride * image->extent.height;
}
-VkResult anv_GetImageSubresourceLayout(
+void anv_GetImageSubresourceLayout(
VkDevice device,
VkImage _image,
const VkImageSubresource* pSubresource,
pSubresource, pLayout);
break;
default:
- return vk_error(VK_UNSUPPORTED);
+ assert(!"Invalid image aspect");
}
-
- return VK_SUCCESS;
}
VkResult
view_format_info = anv_format_for_vk_format(pCreateInfo->format);
/* Validate channel swizzles. */
- assert(pCreateInfo->channels.r >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
- assert(pCreateInfo->channels.r <= VK_CHANNEL_SWIZZLE_END_RANGE);
- assert(pCreateInfo->channels.g >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
- assert(pCreateInfo->channels.g <= VK_CHANNEL_SWIZZLE_END_RANGE);
- assert(pCreateInfo->channels.b >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
- assert(pCreateInfo->channels.b <= VK_CHANNEL_SWIZZLE_END_RANGE);
- assert(pCreateInfo->channels.a >= VK_CHANNEL_SWIZZLE_BEGIN_RANGE);
- assert(pCreateInfo->channels.a <= VK_CHANNEL_SWIZZLE_END_RANGE);
+ assert(pCreateInfo->components.r >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+ assert(pCreateInfo->components.r <= VK_COMPONENT_SWIZZLE_END_RANGE);
+ assert(pCreateInfo->components.g >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+ assert(pCreateInfo->components.g <= VK_COMPONENT_SWIZZLE_END_RANGE);
+ assert(pCreateInfo->components.b >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+ assert(pCreateInfo->components.b <= VK_COMPONENT_SWIZZLE_END_RANGE);
+ assert(pCreateInfo->components.a >= VK_COMPONENT_SWIZZLE_BEGIN_RANGE);
+ assert(pCreateInfo->components.a <= VK_COMPONENT_SWIZZLE_END_RANGE);
/* Validate subresource. */
assert(subresource->aspectMask != 0);
switch (device->info.gen) {
case 7:
- gen7_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+ if (device->info.is_haswell)
+ gen75_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+ else
+ gen7_image_view_init(iview, device, pCreateInfo, cmd_buffer);
break;
case 8:
gen8_image_view_init(iview, device, pCreateInfo, cmd_buffer);
break;
+ case 9:
+ gen9_image_view_init(iview, device, pCreateInfo, cmd_buffer);
+ break;
default:
unreachable("unsupported gen\n");
}