vk/0.170.2: Update VkImageFormatProperties
This commit is contained in:
parent
98c2bb6917
commit
81e1dcc42c
|
@ -1210,8 +1210,11 @@ typedef struct {
|
||||||
} VkExtent3D;
|
} VkExtent3D;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t maxResourceSize;
|
VkExtent3D maxExtent;
|
||||||
uint32_t maxSamples;
|
uint32_t maxMipLevels;
|
||||||
|
uint32_t maxArraySize;
|
||||||
|
VkSampleCountFlags sampleCounts;
|
||||||
|
VkDeviceSize maxResourceSize;
|
||||||
} VkImageFormatProperties;
|
} VkImageFormatProperties;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -344,6 +344,9 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
|
||||||
const struct anv_format *format = anv_format_for_vk_format(_format);
|
const struct anv_format *format = anv_format_for_vk_format(_format);
|
||||||
VkFormatProperties format_props;
|
VkFormatProperties format_props;
|
||||||
VkFormatFeatureFlags format_feature_flags;
|
VkFormatFeatureFlags format_feature_flags;
|
||||||
|
VkExtent3D maxExtent;
|
||||||
|
uint32_t maxMipLevels;
|
||||||
|
uint32_t maxArraySize;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
result = anv_physical_device_get_format_properties(physical_device, format,
|
result = anv_physical_device_get_format_properties(physical_device, format,
|
||||||
|
@ -362,6 +365,35 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
|
||||||
unreachable("bad VkImageTiling");
|
unreachable("bad VkImageTiling");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
default:
|
||||||
|
unreachable("bad VkImageType");
|
||||||
|
case VK_IMAGE_TYPE_1D:
|
||||||
|
maxExtent.width = 16384;
|
||||||
|
maxExtent.height = 1;
|
||||||
|
maxExtent.depth = 1;
|
||||||
|
maxMipLevels = 15; /* log2(maxWidth) + 1 */
|
||||||
|
maxArraySize = 2048;
|
||||||
|
break;
|
||||||
|
case VK_IMAGE_TYPE_2D:
|
||||||
|
/* FINISHME: Does this really differ for cube maps? The documentation
|
||||||
|
* for RENDER_SURFACE_STATE suggests so.
|
||||||
|
*/
|
||||||
|
maxExtent.width = 16384;
|
||||||
|
maxExtent.height = 16384;
|
||||||
|
maxExtent.depth = 1;
|
||||||
|
maxMipLevels = 15; /* log2(maxWidth) + 1 */
|
||||||
|
maxArraySize = 2048;
|
||||||
|
break;
|
||||||
|
case VK_IMAGE_TYPE_3D:
|
||||||
|
maxExtent.width = 2048;
|
||||||
|
maxExtent.height = 2048;
|
||||||
|
maxExtent.depth = 2048;
|
||||||
|
maxMipLevels = 12; /* log2(maxWidth) + 1 */
|
||||||
|
maxArraySize = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (usage & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) {
|
if (usage & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) {
|
||||||
/* Meta implements transfers by sampling from the source image. */
|
/* Meta implements transfers by sampling from the source image. */
|
||||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
|
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
|
||||||
|
@ -415,8 +447,12 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
|
||||||
}
|
}
|
||||||
|
|
||||||
*pImageFormatProperties = (VkImageFormatProperties) {
|
*pImageFormatProperties = (VkImageFormatProperties) {
|
||||||
|
.maxExtent = maxExtent,
|
||||||
|
.maxMipLevels = maxMipLevels,
|
||||||
|
.maxArraySize = maxArraySize,
|
||||||
|
|
||||||
/* FINISHME: Support multisampling */
|
/* FINISHME: Support multisampling */
|
||||||
.maxSamples = 1,
|
.sampleCounts = VK_SAMPLE_COUNT_1_BIT,
|
||||||
|
|
||||||
/* FINISHME: Accurately calculate
|
/* FINISHME: Accurately calculate
|
||||||
* VkImageFormatProperties::maxResourceSize.
|
* VkImageFormatProperties::maxResourceSize.
|
||||||
|
@ -428,7 +464,10 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
|
||||||
|
|
||||||
unsupported:
|
unsupported:
|
||||||
*pImageFormatProperties = (VkImageFormatProperties) {
|
*pImageFormatProperties = (VkImageFormatProperties) {
|
||||||
.maxSamples = 0,
|
.maxExtent = { 0, 0, 0 },
|
||||||
|
.maxMipLevels = 0,
|
||||||
|
.maxArraySize = 0,
|
||||||
|
.sampleCounts = 0,
|
||||||
.maxResourceSize = 0,
|
.maxResourceSize = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue