Standardize design pattern for enumerations of Vulkan struct pNext chains.
Consistently use for-loops, VkBaseInStructure and VkBaseOutStructure. Remove redundant MVKVkAPIStructHeader structure. Remove unnecessary null tests on incoming Vulkan struct pointers.
This commit is contained in:
parent
efde388cbd
commit
2b3cf6f395
@ -261,18 +261,17 @@ VkResult MVKCmdPushDescriptorSet::setContent(MVKCommandBuffer* cmdBuff,
|
|||||||
}
|
}
|
||||||
if (mvkDvc->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
if (mvkDvc->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
||||||
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
||||||
for (auto* next = (VkWriteDescriptorSetInlineUniformBlockEXT*)descWrite.pNext; next; next = (VkWriteDescriptorSetInlineUniformBlockEXT*)next->pNext)
|
for (const auto* next = (VkBaseInStructure*)descWrite.pNext; next; next = next->pNext) {
|
||||||
{
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
||||||
pInlineUniformBlock = next;
|
pInlineUniformBlock = (VkWriteDescriptorSetInlineUniformBlockEXT*)next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pInlineUniformBlock != nullptr) {
|
if (pInlineUniformBlock) {
|
||||||
auto *pNewInlineUniformBlock = new VkWriteDescriptorSetInlineUniformBlockEXT(*pInlineUniformBlock);
|
auto *pNewInlineUniformBlock = new VkWriteDescriptorSetInlineUniformBlockEXT(*pInlineUniformBlock);
|
||||||
pNewInlineUniformBlock->pNext = nullptr; // clear pNext just in case, no other extensions are supported at this time
|
pNewInlineUniformBlock->pNext = nullptr; // clear pNext just in case, no other extensions are supported at this time
|
||||||
descWrite.pNext = pNewInlineUniformBlock;
|
descWrite.pNext = pNewInlineUniformBlock;
|
||||||
@ -300,11 +299,10 @@ void MVKCmdPushDescriptorSet::clearDescriptorWrites() {
|
|||||||
if (descWrite.pTexelBufferView) { delete[] descWrite.pTexelBufferView; }
|
if (descWrite.pTexelBufferView) { delete[] descWrite.pTexelBufferView; }
|
||||||
|
|
||||||
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
||||||
for (auto* next = (VkWriteDescriptorSetInlineUniformBlockEXT*)descWrite.pNext; next; next = (VkWriteDescriptorSetInlineUniformBlockEXT*)next->pNext)
|
for (const auto* next = (VkBaseInStructure*)descWrite.pNext; next; next = next->pNext) {
|
||||||
{
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
||||||
pInlineUniformBlock = next;
|
pInlineUniformBlock = (VkWriteDescriptorSetInlineUniformBlockEXT*)next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -109,11 +109,10 @@ void MVKDescriptorSetLayout::pushDescriptorSet(MVKCommandEncoder* cmdEncoder,
|
|||||||
const VkBufferView* pTexelBufferView = descWrite.pTexelBufferView;
|
const VkBufferView* pTexelBufferView = descWrite.pTexelBufferView;
|
||||||
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
||||||
if (_device->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
if (_device->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
||||||
for (auto* next = (VkWriteDescriptorSetInlineUniformBlockEXT*)descWrite.pNext; next; next = (VkWriteDescriptorSetInlineUniformBlockEXT*)next->pNext)
|
for (const auto* next = (VkBaseInStructure*)descWrite.pNext; next; next = next->pNext) {
|
||||||
{
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
||||||
pInlineUniformBlock = next;
|
pInlineUniformBlock = (VkWriteDescriptorSetInlineUniformBlockEXT*)next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -689,11 +688,10 @@ void mvkUpdateDescriptorSets(uint32_t writeCount,
|
|||||||
|
|
||||||
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
const VkWriteDescriptorSetInlineUniformBlockEXT* pInlineUniformBlock = nullptr;
|
||||||
if (dstSet->getDevice()->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
if (dstSet->getDevice()->_enabledExtensions.vk_EXT_inline_uniform_block.enabled) {
|
||||||
for (auto* next = (VkWriteDescriptorSetInlineUniformBlockEXT*)pDescWrite->pNext; next; next = (VkWriteDescriptorSetInlineUniformBlockEXT*)next->pNext)
|
for (const auto* next = (VkBaseInStructure*)pDescWrite->pNext; next; next = next->pNext) {
|
||||||
{
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT: {
|
||||||
pInlineUniformBlock = next;
|
pInlineUniformBlock = (VkWriteDescriptorSetInlineUniformBlockEXT*)next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -62,156 +62,152 @@ VkResult MVKPhysicalDevice::getExtensionProperties(const char* pLayerName, uint3
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures* features) {
|
void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures* features) {
|
||||||
if (features) { *features = _features; }
|
*features = _features;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures2* features) {
|
void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures2* features) {
|
||||||
if (features) {
|
features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
||||||
features->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
features->features = _features;
|
||||||
features->features = _features;
|
for (auto* next = (VkBaseOutStructure*)features->pNext; next; next = next->pNext) {
|
||||||
for (auto* next = (VkBaseOutStructure*)features->pNext; next; next = next->pNext) {
|
switch ((uint32_t)next->sType) {
|
||||||
switch ((uint32_t)next->sType) {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: {
|
auto* storageFeatures = (VkPhysicalDevice16BitStorageFeatures*)next;
|
||||||
auto* storageFeatures = (VkPhysicalDevice16BitStorageFeatures*)next;
|
storageFeatures->storageBuffer16BitAccess = true;
|
||||||
storageFeatures->storageBuffer16BitAccess = true;
|
storageFeatures->uniformAndStorageBuffer16BitAccess = true;
|
||||||
storageFeatures->uniformAndStorageBuffer16BitAccess = true;
|
storageFeatures->storagePushConstant16 = true;
|
||||||
storageFeatures->storagePushConstant16 = true;
|
storageFeatures->storageInputOutput16 = true;
|
||||||
storageFeatures->storageInputOutput16 = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: {
|
auto* storageFeatures = (VkPhysicalDevice8BitStorageFeaturesKHR*)next;
|
||||||
auto* storageFeatures = (VkPhysicalDevice8BitStorageFeaturesKHR*)next;
|
storageFeatures->storageBuffer8BitAccess = true;
|
||||||
storageFeatures->storageBuffer8BitAccess = true;
|
storageFeatures->uniformAndStorageBuffer8BitAccess = true;
|
||||||
storageFeatures->uniformAndStorageBuffer8BitAccess = true;
|
storageFeatures->storagePushConstant8 = true;
|
||||||
storageFeatures->storagePushConstant8 = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR: {
|
auto* f16Features = (VkPhysicalDeviceFloat16Int8FeaturesKHR*)next;
|
||||||
auto* f16Features = (VkPhysicalDeviceFloat16Int8FeaturesKHR*)next;
|
f16Features->shaderFloat16 = true;
|
||||||
f16Features->shaderFloat16 = true;
|
f16Features->shaderInt8 = true;
|
||||||
f16Features->shaderInt8 = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: {
|
auto* uboLayoutFeatures = (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR*)next;
|
||||||
auto* uboLayoutFeatures = (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR*)next;
|
uboLayoutFeatures->uniformBufferStandardLayout = true;
|
||||||
uboLayoutFeatures->uniformBufferStandardLayout = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: {
|
auto* varPtrFeatures = (VkPhysicalDeviceVariablePointerFeatures*)next;
|
||||||
auto* varPtrFeatures = (VkPhysicalDeviceVariablePointerFeatures*)next;
|
varPtrFeatures->variablePointersStorageBuffer = true;
|
||||||
varPtrFeatures->variablePointersStorageBuffer = true;
|
varPtrFeatures->variablePointers = true;
|
||||||
varPtrFeatures->variablePointers = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: {
|
auto* interlockFeatures = (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*)next;
|
||||||
auto* interlockFeatures = (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*)next;
|
interlockFeatures->fragmentShaderSampleInterlock = _metalFeatures.rasterOrderGroups;
|
||||||
interlockFeatures->fragmentShaderSampleInterlock = _metalFeatures.rasterOrderGroups;
|
interlockFeatures->fragmentShaderPixelInterlock = _metalFeatures.rasterOrderGroups;
|
||||||
interlockFeatures->fragmentShaderPixelInterlock = _metalFeatures.rasterOrderGroups;
|
interlockFeatures->fragmentShaderShadingRateInterlock = false; // Requires variable rate shading; not supported yet in Metal
|
||||||
interlockFeatures->fragmentShaderShadingRateInterlock = false; // Requires variable rate shading; not supported yet in Metal
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: {
|
auto* hostQueryResetFeatures = (VkPhysicalDeviceHostQueryResetFeaturesEXT*)next;
|
||||||
auto* hostQueryResetFeatures = (VkPhysicalDeviceHostQueryResetFeaturesEXT*)next;
|
hostQueryResetFeatures->hostQueryReset = true;
|
||||||
hostQueryResetFeatures->hostQueryReset = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: {
|
auto* scalarLayoutFeatures = (VkPhysicalDeviceScalarBlockLayoutFeaturesEXT*)next;
|
||||||
auto* scalarLayoutFeatures = (VkPhysicalDeviceScalarBlockLayoutFeaturesEXT*)next;
|
scalarLayoutFeatures->scalarBlockLayout = true;
|
||||||
scalarLayoutFeatures->scalarBlockLayout = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
|
auto* texelBuffAlignFeatures = (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*)next;
|
||||||
auto* texelBuffAlignFeatures = (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*)next;
|
texelBuffAlignFeatures->texelBufferAlignment = _metalFeatures.texelBuffers && [_mtlDevice respondsToSelector: @selector(minimumLinearTextureAlignmentForPixelFormat:)];
|
||||||
texelBuffAlignFeatures->texelBufferAlignment = _metalFeatures.texelBuffers && [_mtlDevice respondsToSelector: @selector(minimumLinearTextureAlignmentForPixelFormat:)];
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: {
|
auto* divisorFeatures = (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*)next;
|
||||||
auto* divisorFeatures = (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*)next;
|
divisorFeatures->vertexAttributeInstanceRateDivisor = true;
|
||||||
divisorFeatures->vertexAttributeInstanceRateDivisor = true;
|
divisorFeatures->vertexAttributeInstanceRateZeroDivisor = true;
|
||||||
divisorFeatures->vertexAttributeInstanceRateZeroDivisor = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_EXTX: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_EXTX: {
|
auto* portabilityFeatures = (VkPhysicalDevicePortabilitySubsetFeaturesEXTX*)next;
|
||||||
auto* portabilityFeatures = (VkPhysicalDevicePortabilitySubsetFeaturesEXTX*)next;
|
portabilityFeatures->triangleFans = false;
|
||||||
portabilityFeatures->triangleFans = false;
|
portabilityFeatures->separateStencilMaskRef = true;
|
||||||
portabilityFeatures->separateStencilMaskRef = true;
|
portabilityFeatures->events = true;
|
||||||
portabilityFeatures->events = true;
|
portabilityFeatures->standardImageViews = _mvkInstance->getMoltenVKConfiguration()->fullImageViewSwizzle || _metalFeatures.nativeTextureSwizzle;
|
||||||
portabilityFeatures->standardImageViews = _mvkInstance->getMoltenVKConfiguration()->fullImageViewSwizzle || _metalFeatures.nativeTextureSwizzle;
|
portabilityFeatures->samplerMipLodBias = false;
|
||||||
portabilityFeatures->samplerMipLodBias = false;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: {
|
auto* shaderIntFuncsFeatures = (VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*)next;
|
||||||
auto* shaderIntFuncsFeatures = (VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*)next;
|
shaderIntFuncsFeatures->shaderIntegerFunctions2 = true;
|
||||||
shaderIntFuncsFeatures->shaderIntegerFunctions2 = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: {
|
auto* inlineUniformBlockFeatures = (VkPhysicalDeviceInlineUniformBlockFeaturesEXT*)next;
|
||||||
auto* inlineUniformBlockFeatures = (VkPhysicalDeviceInlineUniformBlockFeaturesEXT*)next;
|
inlineUniformBlockFeatures->inlineUniformBlock = true;
|
||||||
inlineUniformBlockFeatures->inlineUniformBlock = true;
|
inlineUniformBlockFeatures->descriptorBindingInlineUniformBlockUpdateAfterBind = true;
|
||||||
inlineUniformBlockFeatures->descriptorBindingInlineUniformBlockUpdateAfterBind = true;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
default:
|
||||||
default:
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties* properties) {
|
void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties* properties) {
|
||||||
if (properties) { *properties = _properties; }
|
*properties = _properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties2* properties) {
|
void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties2* properties) {
|
||||||
if (properties) {
|
properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
|
||||||
properties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
|
properties->properties = _properties;
|
||||||
properties->properties = _properties;
|
for (auto* next = (VkBaseOutStructure*)properties->pNext; next; next = next->pNext) {
|
||||||
for (auto* next = (VkBaseOutStructure*)properties; next; next = next->pNext) {
|
switch ((uint32_t)next->sType) {
|
||||||
switch ((uint32_t)next->sType) {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
|
auto* pointClipProps = (VkPhysicalDevicePointClippingProperties*)next;
|
||||||
auto* pointClipProps = (VkPhysicalDevicePointClippingProperties*)next;
|
pointClipProps->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES;
|
||||||
pointClipProps->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
|
|
||||||
auto* maint3Props = (VkPhysicalDeviceMaintenance3Properties*)next;
|
|
||||||
maint3Props->maxPerSetDescriptors = (_metalFeatures.maxPerStageBufferCount + _metalFeatures.maxPerStageTextureCount + _metalFeatures.maxPerStageSamplerCount) * 4;
|
|
||||||
maint3Props->maxMemoryAllocationSize = _metalFeatures.maxMTLBufferSize;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
|
|
||||||
auto* pushDescProps = (VkPhysicalDevicePushDescriptorPropertiesKHR*)next;
|
|
||||||
pushDescProps->maxPushDescriptors = _properties.limits.maxPerStageResources;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
|
|
||||||
auto* texelBuffAlignProps = (VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*)next;
|
|
||||||
// Save the 'next' pointer; we'll unintentionally overwrite it
|
|
||||||
// on the next line. Put it back when we're done.
|
|
||||||
void* savedNext = texelBuffAlignProps->pNext;
|
|
||||||
*texelBuffAlignProps = _texelBuffAlignProperties;
|
|
||||||
texelBuffAlignProps->pNext = savedNext;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
|
|
||||||
auto* divisorProps = (VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*)next;
|
|
||||||
divisorProps->maxVertexAttribDivisor = kMVKUndefinedLargeUInt32;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
|
|
||||||
populate((VkPhysicalDeviceIDProperties*)next);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_EXTX: {
|
|
||||||
auto* portabilityProps = (VkPhysicalDevicePortabilitySubsetPropertiesEXTX*)next;
|
|
||||||
portabilityProps->minVertexInputBindingStrideAlignment = 4;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: {
|
||||||
|
auto* maint3Props = (VkPhysicalDeviceMaintenance3Properties*)next;
|
||||||
|
maint3Props->maxPerSetDescriptors = (_metalFeatures.maxPerStageBufferCount + _metalFeatures.maxPerStageTextureCount + _metalFeatures.maxPerStageSamplerCount) * 4;
|
||||||
|
maint3Props->maxMemoryAllocationSize = _metalFeatures.maxMTLBufferSize;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR: {
|
||||||
|
auto* pushDescProps = (VkPhysicalDevicePushDescriptorPropertiesKHR*)next;
|
||||||
|
pushDescProps->maxPushDescriptors = _properties.limits.maxPerStageResources;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
|
||||||
|
auto* texelBuffAlignProps = (VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*)next;
|
||||||
|
// Save the 'next' pointer; we'll unintentionally overwrite it
|
||||||
|
// on the next line. Put it back when we're done.
|
||||||
|
void* savedNext = texelBuffAlignProps->pNext;
|
||||||
|
*texelBuffAlignProps = _texelBuffAlignProperties;
|
||||||
|
texelBuffAlignProps->pNext = savedNext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: {
|
||||||
|
auto* divisorProps = (VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*)next;
|
||||||
|
divisorProps->maxVertexAttribDivisor = kMVKUndefinedLargeUInt32;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
|
||||||
|
populate((VkPhysicalDeviceIDProperties*)next);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_EXTX: {
|
||||||
|
auto* portabilityProps = (VkPhysicalDevicePortabilitySubsetPropertiesEXTX*)next;
|
||||||
|
portabilityProps->minVertexInputBindingStrideAlignment = 4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populates the device ID properties structure
|
// Populates the device ID properties structure
|
||||||
@ -270,17 +266,12 @@ void MVKPhysicalDevice::populate(VkPhysicalDeviceIDProperties* pDevIdProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getFormatProperties(VkFormat format, VkFormatProperties* pFormatProperties) {
|
void MVKPhysicalDevice::getFormatProperties(VkFormat format, VkFormatProperties* pFormatProperties) {
|
||||||
if (pFormatProperties) {
|
*pFormatProperties = _pixelFormats.getVkFormatProperties(format);
|
||||||
*pFormatProperties = _pixelFormats.getVkFormatProperties(format);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MVKPhysicalDevice::getFormatProperties(VkFormat format,
|
void MVKPhysicalDevice::getFormatProperties(VkFormat format, VkFormatProperties2KHR* pFormatProperties) {
|
||||||
VkFormatProperties2KHR* pFormatProperties) {
|
pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR;
|
||||||
if (pFormatProperties) {
|
pFormatProperties->formatProperties = _pixelFormats.getVkFormatProperties(format);
|
||||||
pFormatProperties->sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR;
|
|
||||||
pFormatProperties->formatProperties = _pixelFormats.getVkFormatProperties(format);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult MVKPhysicalDevice::getImageFormatProperties(VkFormat format,
|
VkResult MVKPhysicalDevice::getImageFormatProperties(VkFormat format,
|
||||||
@ -419,13 +410,13 @@ VkResult MVKPhysicalDevice::getImageFormatProperties(VkFormat format,
|
|||||||
VkResult MVKPhysicalDevice::getImageFormatProperties(const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo,
|
VkResult MVKPhysicalDevice::getImageFormatProperties(const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo,
|
||||||
VkImageFormatProperties2* pImageFormatProperties) {
|
VkImageFormatProperties2* pImageFormatProperties) {
|
||||||
|
|
||||||
for (const auto* nextInfo = (VkBaseInStructure*)pImageFormatInfo; nextInfo; nextInfo = nextInfo->pNext) {
|
for (const auto* nextInfo = (VkBaseInStructure*)pImageFormatInfo->pNext; nextInfo; nextInfo = nextInfo->pNext) {
|
||||||
switch ((uint32_t)nextInfo->sType) {
|
switch (nextInfo->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: {
|
||||||
// Return information about external memory support for MTLTexture.
|
// Return information about external memory support for MTLTexture.
|
||||||
// Search VkImageFormatProperties2 for the corresponding VkExternalImageFormatProperties and populate it.
|
// Search VkImageFormatProperties2 for the corresponding VkExternalImageFormatProperties and populate it.
|
||||||
auto* pExtImgFmtInfo = (VkPhysicalDeviceExternalImageFormatInfo*)nextInfo;
|
auto* pExtImgFmtInfo = (VkPhysicalDeviceExternalImageFormatInfo*)nextInfo;
|
||||||
for (auto* nextProps = (VkBaseOutStructure*)pImageFormatProperties; nextProps; nextProps = nextProps->pNext) {
|
for (auto* nextProps = (VkBaseOutStructure*)pImageFormatProperties->pNext; nextProps; nextProps = nextProps->pNext) {
|
||||||
if (nextProps->sType == VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES) {
|
if (nextProps->sType == VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES) {
|
||||||
auto* pExtImgFmtProps = (VkExternalImageFormatProperties*)nextProps;
|
auto* pExtImgFmtProps = (VkExternalImageFormatProperties*)nextProps;
|
||||||
|
|
||||||
@ -453,8 +444,7 @@ VkResult MVKPhysicalDevice::getImageFormatProperties(const VkPhysicalDeviceImage
|
|||||||
|
|
||||||
// If the image format info links portability image view info, test if an image view of that configuration is supported
|
// If the image format info links portability image view info, test if an image view of that configuration is supported
|
||||||
bool MVKPhysicalDevice::getImageViewIsSupported(const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo) {
|
bool MVKPhysicalDevice::getImageViewIsSupported(const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo) {
|
||||||
auto* next = (MVKVkAPIStructHeader*)pImageFormatInfo->pNext;
|
for (const auto* next = (VkBaseInStructure*)pImageFormatInfo->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch ((uint32_t)next->sType) {
|
switch ((uint32_t)next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_SUPPORT_EXTX: {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_SUPPORT_EXTX: {
|
||||||
auto* portImgViewInfo = (VkPhysicalDeviceImageViewSupportEXTX*)next;
|
auto* portImgViewInfo = (VkPhysicalDeviceImageViewSupportEXTX*)next;
|
||||||
@ -462,7 +452,7 @@ bool MVKPhysicalDevice::getImageViewIsSupported(const VkPhysicalDeviceImageForma
|
|||||||
// Create an image view and test whether it could be configured
|
// Create an image view and test whether it could be configured
|
||||||
VkImageViewCreateInfo viewInfo = {
|
VkImageViewCreateInfo viewInfo = {
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||||
.pNext = (VkStructureType*)portImgViewInfo->pNext,
|
.pNext = portImgViewInfo->pNext,
|
||||||
.flags = portImgViewInfo->flags,
|
.flags = portImgViewInfo->flags,
|
||||||
.image = nullptr,
|
.image = nullptr,
|
||||||
.viewType = portImgViewInfo->viewType,
|
.viewType = portImgViewInfo->viewType,
|
||||||
@ -483,7 +473,6 @@ bool MVKPhysicalDevice::getImageViewIsSupported(const VkPhysicalDeviceImageForma
|
|||||||
mtlPixFmt, useSwizzle) == VK_SUCCESS);
|
mtlPixFmt, useSwizzle) == VK_SUCCESS);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -823,11 +812,10 @@ VkResult MVKPhysicalDevice::getMemoryProperties(VkPhysicalDeviceMemoryProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
VkResult MVKPhysicalDevice::getMemoryProperties(VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
|
VkResult MVKPhysicalDevice::getMemoryProperties(VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {
|
||||||
if (pMemoryProperties) {
|
pMemoryProperties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
|
||||||
pMemoryProperties->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
|
pMemoryProperties->memoryProperties = _memoryProperties;
|
||||||
pMemoryProperties->memoryProperties = _memoryProperties;
|
for (auto* next = (VkBaseOutStructure*)pMemoryProperties->pNext; next; next = next->pNext) {
|
||||||
for (auto* next = (VkBaseOutStructure*)pMemoryProperties->pNext; next; next = next->pNext) {
|
switch (next->sType) {
|
||||||
switch (next->sType) {
|
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: {
|
||||||
auto* budgetProps = (VkPhysicalDeviceMemoryBudgetPropertiesEXT*)next;
|
auto* budgetProps = (VkPhysicalDeviceMemoryBudgetPropertiesEXT*)next;
|
||||||
mvkClear(budgetProps->heapBudget, VK_MAX_MEMORY_HEAPS);
|
mvkClear(budgetProps->heapBudget, VK_MAX_MEMORY_HEAPS);
|
||||||
@ -842,7 +830,6 @@ VkResult MVKPhysicalDevice::getMemoryProperties(VkPhysicalDeviceMemoryProperties
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
@ -2909,8 +2896,7 @@ void MVKDevice::enableFeatures(const VkDeviceCreateInfo* pCreateInfo) {
|
|||||||
&pdFeats2.features.robustBufferAccess, 55);
|
&pdFeats2.features.robustBufferAccess, 55);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* next = (MVKVkAPIStructHeader*)pCreateInfo->pNext;
|
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch ((uint32_t)next->sType) {
|
switch ((uint32_t)next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: {
|
||||||
auto* requestedFeatures = (VkPhysicalDeviceFeatures2*)next;
|
auto* requestedFeatures = (VkPhysicalDeviceFeatures2*)next;
|
||||||
@ -2999,7 +2985,6 @@ void MVKDevice::enableFeatures(const VkDeviceCreateInfo* pCreateInfo) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,11 +1002,9 @@ VkResult MVKPeerSwapchainImage::bindDeviceMemory2(const void* pBindInfo) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (swapchainInfo) { break; }
|
|
||||||
}
|
|
||||||
if (!swapchainInfo) {
|
|
||||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
|
||||||
}
|
}
|
||||||
|
if (!swapchainInfo) { return VK_ERROR_OUT_OF_DEVICE_MEMORY; }
|
||||||
|
|
||||||
_swapchainIndex = swapchainInfo->imageIndex;
|
_swapchainIndex = swapchainInfo->imageIndex;
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -1114,17 +1112,14 @@ MVKImageView::MVKImageView(MVKDevice* device,
|
|||||||
_image = (MVKImage*)pCreateInfo->image;
|
_image = (MVKImage*)pCreateInfo->image;
|
||||||
_usage = _image->_usage;
|
_usage = _image->_usage;
|
||||||
|
|
||||||
auto* next = (MVKVkAPIStructHeader*)pCreateInfo->pNext;
|
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
switch (next->sType) {
|
||||||
switch ((uint32_t)next->sType) {
|
|
||||||
case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
|
case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: {
|
||||||
auto* pViewUsageInfo = (VkImageViewUsageCreateInfo*)next;
|
auto* pViewUsageInfo = (VkImageViewUsageCreateInfo*)next;
|
||||||
if (!(pViewUsageInfo->usage & ~_usage)) { _usage = pViewUsageInfo->usage; }
|
if (!(pViewUsageInfo->usage & ~_usage)) { _usage = pViewUsageInfo->usage; }
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,8 +383,7 @@ void MVKInstance::initDebugCallbacks(const VkInstanceCreateInfo* pCreateInfo) {
|
|||||||
_hasDebugUtilsMessengers = false;
|
_hasDebugUtilsMessengers = false;
|
||||||
_debugReportCallbackLayerPrefix = getDriverLayer()->getName();
|
_debugReportCallbackLayerPrefix = getDriverLayer()->getName();
|
||||||
|
|
||||||
MVKVkAPIStructHeader* next = (MVKVkAPIStructHeader*)pCreateInfo->pNext;
|
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT:
|
case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT:
|
||||||
createDebugReportCallback((VkDebugReportCallbackCreateInfoEXT*)next, nullptr);
|
createDebugReportCallback((VkDebugReportCallbackCreateInfoEXT*)next, nullptr);
|
||||||
@ -395,7 +394,6 @@ void MVKInstance::initDebugCallbacks(const VkInstanceCreateInfo* pCreateInfo) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -944,15 +944,12 @@ bool MVKGraphicsPipeline::addVertexInputToPipeline(MTLRenderPipelineDescriptor*
|
|||||||
const SPIRVToMSLConversionConfiguration& shaderContext) {
|
const SPIRVToMSLConversionConfiguration& shaderContext) {
|
||||||
// Collect extension structures
|
// Collect extension structures
|
||||||
VkPipelineVertexInputDivisorStateCreateInfoEXT* pVertexInputDivisorState = nullptr;
|
VkPipelineVertexInputDivisorStateCreateInfoEXT* pVertexInputDivisorState = nullptr;
|
||||||
auto* next = (MVKVkAPIStructHeader*)pVI->pNext;
|
for (const auto* next = (VkBaseInStructure*)pVI->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT:
|
case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT:
|
||||||
pVertexInputDivisorState = (VkPipelineVertexInputDivisorStateCreateInfoEXT*)next;
|
pVertexInputDivisorState = (VkPipelineVertexInputDivisorStateCreateInfoEXT*)next;
|
||||||
next = (MVKVkAPIStructHeader*)pVertexInputDivisorState->pNext;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1032,15 +1029,12 @@ void MVKGraphicsPipeline::addTessellationToPipeline(MTLRenderPipelineDescriptor*
|
|||||||
|
|
||||||
VkPipelineTessellationDomainOriginStateCreateInfo* pTessDomainOriginState = nullptr;
|
VkPipelineTessellationDomainOriginStateCreateInfo* pTessDomainOriginState = nullptr;
|
||||||
if (reflectData.patchKind == spv::ExecutionModeTriangles) {
|
if (reflectData.patchKind == spv::ExecutionModeTriangles) {
|
||||||
auto* next = (MVKVkAPIStructHeader*)pTS->pNext;
|
for (const auto* next = (VkBaseInStructure*)pTS->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO:
|
case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO:
|
||||||
pTessDomainOriginState = (VkPipelineTessellationDomainOriginStateCreateInfo*)next;
|
pTessDomainOriginState = (VkPipelineTessellationDomainOriginStateCreateInfo*)next;
|
||||||
next = (MVKVkAPIStructHeader*)pTessDomainOriginState->pNext;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1131,15 +1125,12 @@ void MVKGraphicsPipeline::initMVKShaderConverterContext(SPIRVToMSLConversionConf
|
|||||||
|
|
||||||
VkPipelineTessellationDomainOriginStateCreateInfo* pTessDomainOriginState = nullptr;
|
VkPipelineTessellationDomainOriginStateCreateInfo* pTessDomainOriginState = nullptr;
|
||||||
if (pCreateInfo->pTessellationState) {
|
if (pCreateInfo->pTessellationState) {
|
||||||
auto* next = (MVKVkAPIStructHeader*)pCreateInfo->pTessellationState->pNext;
|
for (const auto* next = (VkBaseInStructure*)pCreateInfo->pTessellationState->pNext; next; next = next->pNext) {
|
||||||
while (next) {
|
|
||||||
switch (next->sType) {
|
switch (next->sType) {
|
||||||
case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO:
|
case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO:
|
||||||
pTessDomainOriginState = (VkPipelineTessellationDomainOriginStateCreateInfo*)next;
|
pTessDomainOriginState = (VkPipelineTessellationDomainOriginStateCreateInfo*)next;
|
||||||
next = (MVKVkAPIStructHeader*)pTessDomainOriginState->pNext;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
next = (MVKVkAPIStructHeader*)next->pNext;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,12 +55,6 @@ typedef uint16_t MVKHalfFloat;
|
|||||||
/** A representation of the value of 1.0 as a 16-bit half-float. */
|
/** A representation of the value of 1.0 as a 16-bit half-float. */
|
||||||
#define kHalfFloat1 0x3C00
|
#define kHalfFloat1 0x3C00
|
||||||
|
|
||||||
/** Common header for many standard Vulkan API structures. */
|
|
||||||
typedef struct {
|
|
||||||
VkStructureType sType;
|
|
||||||
const void* pNext;
|
|
||||||
} MVKVkAPIStructHeader;
|
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Vertex content structures
|
#pragma mark Vertex content structures
|
||||||
|
Loading…
x
Reference in New Issue
Block a user