Commit 44bd43a5 by Nicolas Capens Committed by Nicolas Capens

Use UNIMPLEMENTED() for missing functionality we claim support for

The parent change replaced all UNIMPLEMENTED() with UNSUPPORTED(), since we are now Vulkan 1.1 conformant and the majority of these UNIMPLEMENTED() uses was for functionality that is not mandatory to still implement and is instead part of a currently unsupported feature. This change conservatively restores uses of UNIMPLEMENTED() for things that we might hit with correctly behaving apps. Bugs will be filed for each of these and tests will be added where necessary to provide coverage of these code paths. Bug: b/131243109 Change-Id: Iaf547983c8495ad8d6d0c783a4c656273d8c0195 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40409 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 865f8890
...@@ -1750,7 +1750,7 @@ void Blitter::blit(const vk::Image *src, vk::Image *dst, VkImageBlit region, VkF ...@@ -1750,7 +1750,7 @@ void Blitter::blit(const vk::Image *src, vk::Image *dst, VkImageBlit region, VkF
if((region.srcSubresource.layerCount != region.dstSubresource.layerCount) || if((region.srcSubresource.layerCount != region.dstSubresource.layerCount) ||
(region.srcSubresource.aspectMask != region.dstSubresource.aspectMask)) (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask))
{ {
UNSUPPORTED("region"); UNIMPLEMENTED("region");
} }
if(region.dstOffsets[0].x > region.dstOffsets[1].x) if(region.dstOffsets[0].x > region.dstOffsets[1].x)
...@@ -1892,7 +1892,7 @@ Blitter::CornerUpdateRoutineType Blitter::generateCornerUpdate(const State &stat ...@@ -1892,7 +1892,7 @@ Blitter::CornerUpdateRoutineType Blitter::generateCornerUpdate(const State &stat
if(state.srcSamples != 1) if(state.srcSamples != 1)
{ {
UNSUPPORTED("state.srcSamples %d", state.srcSamples); UNIMPLEMENTED("state.srcSamples %d", state.srcSamples);
} }
CornerUpdateFunction function; CornerUpdateFunction function;
...@@ -1924,7 +1924,7 @@ void Blitter::updateBorders(vk::Image *image, const VkImageSubresourceLayers &su ...@@ -1924,7 +1924,7 @@ void Blitter::updateBorders(vk::Image *image, const VkImageSubresourceLayers &su
{ {
if(image->getArrayLayers() < (subresourceLayers.baseArrayLayer + 6)) if(image->getArrayLayers() < (subresourceLayers.baseArrayLayer + 6))
{ {
UNSUPPORTED("image->getArrayLayers() %d, baseArrayLayer %d", UNIMPLEMENTED("image->getArrayLayers() %d, baseArrayLayer %d",
image->getArrayLayers(), subresourceLayers.baseArrayLayer); image->getArrayLayers(), subresourceLayers.baseArrayLayer);
} }
...@@ -1982,7 +1982,7 @@ void Blitter::updateBorders(vk::Image *image, const VkImageSubresourceLayers &su ...@@ -1982,7 +1982,7 @@ void Blitter::updateBorders(vk::Image *image, const VkImageSubresourceLayers &su
if(samples != VK_SAMPLE_COUNT_1_BIT) if(samples != VK_SAMPLE_COUNT_1_BIT)
{ {
UNSUPPORTED("Multi-sampled cube: %d samples", static_cast<int>(samples)); UNIMPLEMENTED("Multi-sampled cube: %d samples", static_cast<int>(samples));
} }
auto cornerUpdateRoutine = getCornerUpdateRoutine(state); auto cornerUpdateRoutine = getCornerUpdateRoutine(state);
......
...@@ -272,7 +272,7 @@ SpirvShader::SpirvShader( ...@@ -272,7 +272,7 @@ SpirvShader::SpirvShader(
} }
case spv::StorageClassAtomicCounter: case spv::StorageClassAtomicCounter:
case spv::StorageClassImage: case spv::StorageClassImage:
UNSUPPORTED("StorageClass %d not yet implemented", (int)storageClass); UNSUPPORTED("StorageClass %d not yet supported", (int)storageClass);
break; break;
case spv::StorageClassCrossWorkgroup: case spv::StorageClassCrossWorkgroup:
......
...@@ -581,14 +581,16 @@ SpirvShader::EmitResult SpirvShader::EmitFunctionCall(InsnIterator insn, EmitSta ...@@ -581,14 +581,16 @@ SpirvShader::EmitResult SpirvShader::EmitFunctionCall(InsnIterator insn, EmitSta
{ {
if(insnNumber > 1) if(insnNumber > 1)
{ {
UNSUPPORTED("Function block number of instructions: %d", insnNumber); UNIMPLEMENTED("Function block number of instructions: %d", insnNumber);
return EmitResult::Continue; return EmitResult::Continue;
} }
if(blockInsn.opcode() != wrapOpKill[insnNumber++]) if(blockInsn.opcode() != wrapOpKill[insnNumber++])
{ {
UNSUPPORTED("Function block instruction %d : %s", insnNumber - 1, OpcodeName(blockInsn.opcode()).c_str()); UNIMPLEMENTED("Function block instruction %d : %s", insnNumber - 1, OpcodeName(blockInsn.opcode()).c_str());
return EmitResult::Continue; return EmitResult::Continue;
} }
if(blockInsn.opcode() == spv::OpKill) if(blockInsn.opcode() == spv::OpKill)
{ {
EmitInstruction(blockInsn, state); EmitInstruction(blockInsn, state);
......
...@@ -225,8 +225,9 @@ SpirvShader::EmitResult SpirvShader::EmitVariable(InsnIterator insn, EmitState * ...@@ -225,8 +225,9 @@ SpirvShader::EmitResult SpirvShader::EmitVariable(InsnIterator insn, EmitState *
Object::ID initializerId = insn.word(4); Object::ID initializerId = insn.word(4);
if(getObject(initializerId).kind != Object::Kind::Constant) if(getObject(initializerId).kind != Object::Kind::Constant)
{ {
UNSUPPORTED("Non-constant initializers not yet implemented"); UNIMPLEMENTED("Non-constant initializers not yet implemented");
} }
switch(objectTy.storageClass) switch(objectTy.storageClass)
{ {
case spv::StorageClassOutput: case spv::StorageClassOutput:
......
...@@ -547,26 +547,30 @@ public: ...@@ -547,26 +547,30 @@ public:
context.depthBias = executionState.dynamicState.depthBiasConstantFactor; context.depthBias = executionState.dynamicState.depthBiasConstantFactor;
context.slopeDepthBias = executionState.dynamicState.depthBiasSlopeFactor; context.slopeDepthBias = executionState.dynamicState.depthBiasSlopeFactor;
} }
if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_DEPTH_BOUNDS) && context.depthBoundsTestEnable) if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_DEPTH_BOUNDS) && context.depthBoundsTestEnable)
{ {
// Unless the VK_EXT_depth_range_unrestricted extension is enabled minDepthBounds and maxDepthBounds must be between 0.0 and 1.0, inclusive // Unless the VK_EXT_depth_range_unrestricted extension is enabled, minDepthBounds and maxDepthBounds must be between 0.0 and 1.0, inclusive
ASSERT(executionState.dynamicState.minDepthBounds >= 0.0f && ASSERT(executionState.dynamicState.minDepthBounds >= 0.0f &&
executionState.dynamicState.minDepthBounds <= 1.0f); executionState.dynamicState.minDepthBounds <= 1.0f);
ASSERT(executionState.dynamicState.maxDepthBounds >= 0.0f && ASSERT(executionState.dynamicState.maxDepthBounds >= 0.0f &&
executionState.dynamicState.maxDepthBounds <= 1.0f); executionState.dynamicState.maxDepthBounds <= 1.0f);
UNSUPPORTED("depthBoundsTestEnable"); UNSUPPORTED("VkPhysicalDeviceFeatures::depthBounds");
} }
if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK) && context.stencilEnable) if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK) && context.stencilEnable)
{ {
context.frontStencil.compareMask = executionState.dynamicState.compareMask[0]; context.frontStencil.compareMask = executionState.dynamicState.compareMask[0];
context.backStencil.compareMask = executionState.dynamicState.compareMask[1]; context.backStencil.compareMask = executionState.dynamicState.compareMask[1];
} }
if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK) && context.stencilEnable) if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK) && context.stencilEnable)
{ {
context.frontStencil.writeMask = executionState.dynamicState.writeMask[0]; context.frontStencil.writeMask = executionState.dynamicState.writeMask[0];
context.backStencil.writeMask = executionState.dynamicState.writeMask[1]; context.backStencil.writeMask = executionState.dynamicState.writeMask[1];
} }
if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_REFERENCE) && context.stencilEnable) if(pipeline->hasDynamicState(VK_DYNAMIC_STATE_STENCIL_REFERENCE) && context.stencilEnable)
{ {
context.frontStencil.reference = executionState.dynamicState.reference[0]; context.frontStencil.reference = executionState.dynamicState.reference[0];
...@@ -593,7 +597,7 @@ public: ...@@ -593,7 +597,7 @@ public:
processPrimitiveRestart(static_cast<uint32_t *>(indexBuffer), count, pipeline, indexBuffers); processPrimitiveRestart(static_cast<uint32_t *>(indexBuffer), count, pipeline, indexBuffers);
break; break;
default: default:
UNSUPPORTED("executionState.indexType %d", int(executionState.indexType)); UNSUPPORTED("VkIndexType %d", int(executionState.indexType));
} }
} }
else else
...@@ -1319,6 +1323,17 @@ VkResult CommandBuffer::begin(VkCommandBufferUsageFlags flags, const VkCommandBu ...@@ -1319,6 +1323,17 @@ VkResult CommandBuffer::begin(VkCommandBufferUsageFlags flags, const VkCommandBu
// pInheritanceInfo merely contains optimization hints, so we currently ignore it // pInheritanceInfo merely contains optimization hints, so we currently ignore it
// "pInheritanceInfo is a pointer to a VkCommandBufferInheritanceInfo structure, used if commandBuffer is a
// secondary command buffer. If this is a primary command buffer, then this value is ignored."
if(level == VK_COMMAND_BUFFER_LEVEL_SECONDARY)
{
if(pInheritanceInfo->queryFlags != 0)
{
// "If the inherited queries feature is not enabled, queryFlags must be 0"
UNSUPPORTED("VkPhysicalDeviceFeatures::inheritedQueries");
}
}
if(state != INITIAL) if(state != INITIAL)
{ {
// Implicit reset // Implicit reset
...@@ -1427,7 +1442,7 @@ void CommandBuffer::bindPipeline(VkPipelineBindPoint pipelineBindPoint, Pipeline ...@@ -1427,7 +1442,7 @@ void CommandBuffer::bindPipeline(VkPipelineBindPoint pipelineBindPoint, Pipeline
addCommand<::CmdPipelineBind>(pipelineBindPoint, pipeline); addCommand<::CmdPipelineBind>(pipelineBindPoint, pipeline);
break; break;
default: default:
UNSUPPORTED("pipelineBindPoint"); UNSUPPORTED("VkPipelineBindPoint %d", int(pipelineBindPoint));
} }
} }
...@@ -1476,7 +1491,7 @@ void CommandBuffer::setViewport(uint32_t firstViewport, uint32_t viewportCount, ...@@ -1476,7 +1491,7 @@ void CommandBuffer::setViewport(uint32_t firstViewport, uint32_t viewportCount,
{ {
if(firstViewport != 0 || viewportCount > 1) if(firstViewport != 0 || viewportCount > 1)
{ {
UNSUPPORTED("viewport"); UNSUPPORTED("VkPhysicalDeviceFeatures::multiViewport");
} }
for(uint32_t i = 0; i < viewportCount; i++) for(uint32_t i = 0; i < viewportCount; i++)
...@@ -1489,7 +1504,7 @@ void CommandBuffer::setScissor(uint32_t firstScissor, uint32_t scissorCount, con ...@@ -1489,7 +1504,7 @@ void CommandBuffer::setScissor(uint32_t firstScissor, uint32_t scissorCount, con
{ {
if(firstScissor != 0 || scissorCount > 1) if(firstScissor != 0 || scissorCount > 1)
{ {
UNSUPPORTED("scissor"); UNSUPPORTED("VkPhysicalDeviceFeatures::multiViewport");
} }
for(uint32_t i = 0; i < scissorCount; i++) for(uint32_t i = 0; i < scissorCount; i++)
......
...@@ -93,7 +93,7 @@ Device::Device(const VkDeviceCreateInfo *pCreateInfo, void *mem, PhysicalDevice ...@@ -93,7 +93,7 @@ Device::Device(const VkDeviceCreateInfo *pCreateInfo, void *mem, PhysicalDevice
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->enabledLayerCount)
{ {
// "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations."
UNSUPPORTED("enabledLayerCount"); // TODO(b/119321052): UNSUPPORTED() should be used only for features that must still be implemented. Use a more informational macro here. UNSUPPORTED("enabledLayerCount");
} }
// FIXME (b/119409619): use an allocator here so we can control all memory allocations // FIXME (b/119409619): use an allocator here so we can control all memory allocations
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
if(exportInfo->handleTypes != VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) if(exportInfo->handleTypes != VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)
{ {
UNSUPPORTED("exportInfo->handleTypes"); UNIMPLEMENTED("exportInfo->handleTypes");
} }
exportAhb = true; exportAhb = true;
} }
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
static VkResult getAhbProperties(const struct AHardwareBuffer *buffer, VkAndroidHardwareBufferPropertiesANDROID *pProperties) static VkResult getAhbProperties(const struct AHardwareBuffer *buffer, VkAndroidHardwareBufferPropertiesANDROID *pProperties)
{ {
UNSUPPORTED("getAhbProperties"); UNIMPLEMENTED("getAhbProperties");
return VK_SUCCESS; return VK_SUCCESS;
} }
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
if(importInfo->handleType != VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) if(importInfo->handleType != VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT)
{ {
UNSUPPORTED("importInfo->handleType"); UNIMPLEMENTED("importInfo->handleType");
} }
importFd = true; importFd = true;
fd = importInfo->fd; fd = importInfo->fd;
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
if(exportInfo->handleTypes != VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT) if(exportInfo->handleTypes != VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT)
{ {
UNSUPPORTED("exportInfo->handleTypes"); UNIMPLEMENTED("exportInfo->handleTypes");
} }
exportFd = true; exportFd = true;
} }
......
...@@ -894,7 +894,7 @@ void Image::clear(const VkClearColorValue &color, const VkImageSubresourceRange ...@@ -894,7 +894,7 @@ void Image::clear(const VkClearColorValue &color, const VkImageSubresourceRange
{ {
if(!(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)) if(!(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT))
{ {
UNSUPPORTED("aspectMask"); UNIMPLEMENTED("aspectMask");
} }
device->getBlitter()->clear((void *)color.float32, getClearFormat(), this, format, subresourceRange); device->getBlitter()->clear((void *)color.float32, getClearFormat(), this, format, subresourceRange);
...@@ -905,7 +905,7 @@ void Image::clear(const VkClearDepthStencilValue &color, const VkImageSubresourc ...@@ -905,7 +905,7 @@ void Image::clear(const VkClearDepthStencilValue &color, const VkImageSubresourc
if((subresourceRange.aspectMask & ~(VK_IMAGE_ASPECT_DEPTH_BIT | if((subresourceRange.aspectMask & ~(VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) VK_IMAGE_ASPECT_STENCIL_BIT)) != 0)
{ {
UNSUPPORTED("aspectMask"); UNIMPLEMENTED("aspectMask");
} }
if(subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) if(subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)
...@@ -929,7 +929,7 @@ void Image::clear(const VkClearValue &clearValue, const vk::Format &viewFormat, ...@@ -929,7 +929,7 @@ void Image::clear(const VkClearValue &clearValue, const vk::Format &viewFormat,
(subresourceRange.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT | (subresourceRange.aspectMask & (VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT)))) VK_IMAGE_ASPECT_STENCIL_BIT))))
{ {
UNSUPPORTED("subresourceRange"); UNIMPLEMENTED("subresourceRange");
} }
if(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) if(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
......
...@@ -120,12 +120,12 @@ void ImageView::clear(const VkClearValue &clearValue, const VkImageAspectFlags a ...@@ -120,12 +120,12 @@ void ImageView::clear(const VkClearValue &clearValue, const VkImageAspectFlags a
if(!imageTypesMatch(image->getImageType())) if(!imageTypesMatch(image->getImageType()))
{ {
UNSUPPORTED("imageTypesMatch"); UNIMPLEMENTED("imageTypesMatch");
} }
if(!format.isCompatible(image->getFormat())) if(!format.isCompatible(image->getFormat()))
{ {
UNSUPPORTED("incompatible formats"); UNIMPLEMENTED("incompatible formats");
} }
VkImageSubresourceRange sr = subresourceRange; VkImageSubresourceRange sr = subresourceRange;
...@@ -139,12 +139,12 @@ void ImageView::clear(const VkClearValue &clearValue, const VkImageAspectFlags a ...@@ -139,12 +139,12 @@ void ImageView::clear(const VkClearValue &clearValue, const VkImageAspectFlags a
if(!imageTypesMatch(image->getImageType())) if(!imageTypesMatch(image->getImageType()))
{ {
UNSUPPORTED("imageTypesMatch"); UNIMPLEMENTED("imageTypesMatch");
} }
if(!format.isCompatible(image->getFormat())) if(!format.isCompatible(image->getFormat()))
{ {
UNSUPPORTED("incompatible formats"); UNIMPLEMENTED("incompatible formats");
} }
VkImageSubresourceRange sr; VkImageSubresourceRange sr;
...@@ -173,7 +173,7 @@ void ImageView::resolve(ImageView *resolveAttachment, int layer) ...@@ -173,7 +173,7 @@ void ImageView::resolve(ImageView *resolveAttachment, int layer)
{ {
if((subresourceRange.levelCount != 1) || (resolveAttachment->subresourceRange.levelCount != 1)) if((subresourceRange.levelCount != 1) || (resolveAttachment->subresourceRange.levelCount != 1))
{ {
UNSUPPORTED("levelCount"); UNIMPLEMENTED("levelCount");
} }
VkImageCopy region; VkImageCopy region;
...@@ -201,7 +201,7 @@ void ImageView::resolve(ImageView *resolveAttachment) ...@@ -201,7 +201,7 @@ void ImageView::resolve(ImageView *resolveAttachment)
{ {
if((subresourceRange.levelCount != 1) || (resolveAttachment->subresourceRange.levelCount != 1)) if((subresourceRange.levelCount != 1) || (resolveAttachment->subresourceRange.levelCount != 1))
{ {
UNSUPPORTED("levelCount"); UNIMPLEMENTED("levelCount");
} }
VkImageCopy region; VkImageCopy region;
...@@ -244,7 +244,7 @@ const Image *ImageView::getImage(Usage usage) const ...@@ -244,7 +244,7 @@ const Image *ImageView::getImage(Usage usage) const
case SAMPLING: case SAMPLING:
return image->getSampledImage(format); return image->getSampledImage(format);
default: default:
UNSUPPORTED("usage %d", int(usage)); UNREACHABLE("usage %d", int(usage));
return nullptr; return nullptr;
} }
} }
......
...@@ -149,17 +149,27 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -149,17 +149,27 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
{ {
context.robustBufferAccess = robustBufferAccess; context.robustBufferAccess = robustBufferAccess;
if(((pCreateInfo->flags & if((pCreateInfo->flags &
~(VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT | ~(VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT |
VK_PIPELINE_CREATE_DERIVATIVE_BIT | VK_PIPELINE_CREATE_DERIVATIVE_BIT |
VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT)) != 0) || VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT)) != 0)
(pCreateInfo->pTessellationState != nullptr))
{ {
UNSUPPORTED("pCreateInfo settings"); UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
}
if(pCreateInfo->pTessellationState != nullptr)
{
UNSUPPORTED("pCreateInfo->pTessellationState");
} }
if(pCreateInfo->pDynamicState) if(pCreateInfo->pDynamicState)
{ {
if(pCreateInfo->pDynamicState->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pDynamicState->flags %d", int(pCreateInfo->pDynamicState->flags));
}
for(uint32_t i = 0; i < pCreateInfo->pDynamicState->dynamicStateCount; i++) for(uint32_t i = 0; i < pCreateInfo->pDynamicState->dynamicStateCount; i++)
{ {
VkDynamicState dynamicState = pCreateInfo->pDynamicState->pDynamicStates[i]; VkDynamicState dynamicState = pCreateInfo->pDynamicState->pDynamicStates[i];
...@@ -178,14 +188,16 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -178,14 +188,16 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
dynamicStateFlags |= (1 << dynamicState); dynamicStateFlags |= (1 << dynamicState);
break; break;
default: default:
UNSUPPORTED("dynamic state"); UNSUPPORTED("VkDynamicState %d", int(dynamicState));
} }
} }
} }
const VkPipelineVertexInputStateCreateInfo *vertexInputState = pCreateInfo->pVertexInputState; const VkPipelineVertexInputStateCreateInfo *vertexInputState = pCreateInfo->pVertexInputState;
if(vertexInputState->flags != 0) if(vertexInputState->flags != 0)
{ {
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("vertexInputState->flags"); UNSUPPORTED("vertexInputState->flags");
} }
...@@ -214,23 +226,30 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -214,23 +226,30 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
input.instanceStride = instanceStrides[desc.binding]; input.instanceStride = instanceStrides[desc.binding];
} }
const VkPipelineInputAssemblyStateCreateInfo *assemblyState = pCreateInfo->pInputAssemblyState; const VkPipelineInputAssemblyStateCreateInfo *inputAssemblyState = pCreateInfo->pInputAssemblyState;
if(assemblyState->flags != 0)
if(inputAssemblyState->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->pInputAssemblyState settings"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pInputAssemblyState->flags %d", int(pCreateInfo->pInputAssemblyState->flags));
} }
primitiveRestartEnable = (assemblyState->primitiveRestartEnable != VK_FALSE); primitiveRestartEnable = (inputAssemblyState->primitiveRestartEnable != VK_FALSE);
context.topology = assemblyState->topology; context.topology = inputAssemblyState->topology;
const VkPipelineViewportStateCreateInfo *viewportState = pCreateInfo->pViewportState; const VkPipelineViewportStateCreateInfo *viewportState = pCreateInfo->pViewportState;
if(viewportState) if(viewportState)
{ {
if((viewportState->flags != 0) || if(viewportState->flags != 0)
(viewportState->viewportCount != 1) || {
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pViewportState->flags %d", int(pCreateInfo->pViewportState->flags));
}
if((viewportState->viewportCount != 1) ||
(viewportState->scissorCount != 1)) (viewportState->scissorCount != 1))
{ {
UNSUPPORTED("pCreateInfo->pViewportState settings"); UNSUPPORTED("VkPhysicalDeviceFeatures::multiViewport");
} }
if(!hasDynamicState(VK_DYNAMIC_STATE_SCISSOR)) if(!hasDynamicState(VK_DYNAMIC_STATE_SCISSOR))
...@@ -245,10 +264,16 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -245,10 +264,16 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
} }
const VkPipelineRasterizationStateCreateInfo *rasterizationState = pCreateInfo->pRasterizationState; const VkPipelineRasterizationStateCreateInfo *rasterizationState = pCreateInfo->pRasterizationState;
if((rasterizationState->flags != 0) ||
(rasterizationState->depthClampEnable != VK_FALSE)) if(rasterizationState->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pRasterizationState->flags %d", int(pCreateInfo->pRasterizationState->flags));
}
if(rasterizationState->depthClampEnable != VK_FALSE)
{ {
UNSUPPORTED("pCreateInfo->pRasterizationState settings"); UNSUPPORTED("VkPhysicalDeviceFeatures::depthClamp");
} }
context.rasterizerDiscard = (rasterizationState->rasterizerDiscardEnable != VK_FALSE); context.rasterizerDiscard = (rasterizationState->rasterizerDiscardEnable != VK_FALSE);
...@@ -290,6 +315,22 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -290,6 +315,22 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
const VkPipelineMultisampleStateCreateInfo *multisampleState = pCreateInfo->pMultisampleState; const VkPipelineMultisampleStateCreateInfo *multisampleState = pCreateInfo->pMultisampleState;
if(multisampleState) if(multisampleState)
{ {
if(multisampleState->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pMultisampleState->flags %d", int(pCreateInfo->pMultisampleState->flags));
}
if(multisampleState->sampleShadingEnable != VK_FALSE)
{
UNSUPPORTED("VkPhysicalDeviceFeatures::sampleRateShading");
}
if(multisampleState->alphaToOneEnable != VK_FALSE)
{
UNSUPPORTED("VkPhysicalDeviceFeatures::alphaToOne");
}
switch(multisampleState->rasterizationSamples) switch(multisampleState->rasterizationSamples)
{ {
case VK_SAMPLE_COUNT_1_BIT: case VK_SAMPLE_COUNT_1_BIT:
...@@ -308,13 +349,6 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -308,13 +349,6 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
} }
context.alphaToCoverage = (multisampleState->alphaToCoverageEnable != VK_FALSE); context.alphaToCoverage = (multisampleState->alphaToCoverageEnable != VK_FALSE);
if((multisampleState->flags != 0) ||
(multisampleState->sampleShadingEnable != VK_FALSE) ||
(multisampleState->alphaToOneEnable != VK_FALSE))
{
UNSUPPORTED("multisampleState");
}
} }
else else
{ {
...@@ -324,10 +358,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -324,10 +358,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
const VkPipelineDepthStencilStateCreateInfo *depthStencilState = pCreateInfo->pDepthStencilState; const VkPipelineDepthStencilStateCreateInfo *depthStencilState = pCreateInfo->pDepthStencilState;
if(depthStencilState) if(depthStencilState)
{ {
if((depthStencilState->flags != 0) || if(depthStencilState->flags != 0)
(depthStencilState->depthBoundsTestEnable != VK_FALSE)) {
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pDepthStencilState->flags %d", int(pCreateInfo->pDepthStencilState->flags));
}
if(depthStencilState->depthBoundsTestEnable != VK_FALSE)
{ {
UNSUPPORTED("depthStencilState"); UNSUPPORTED("VkPhysicalDeviceFeatures::depthBounds");
} }
context.depthBoundsTestEnable = (depthStencilState->depthBoundsTestEnable != VK_FALSE); context.depthBoundsTestEnable = (depthStencilState->depthBoundsTestEnable != VK_FALSE);
...@@ -346,10 +385,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn ...@@ -346,10 +385,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo *pCreateIn
const VkPipelineColorBlendStateCreateInfo *colorBlendState = pCreateInfo->pColorBlendState; const VkPipelineColorBlendStateCreateInfo *colorBlendState = pCreateInfo->pColorBlendState;
if(colorBlendState) if(colorBlendState)
{ {
if((colorBlendState->flags != 0) || if(pCreateInfo->pColorBlendState->flags != 0)
((colorBlendState->logicOpEnable != VK_FALSE))) {
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->pColorBlendState->flags %d", int(pCreateInfo->pColorBlendState->flags));
}
if(colorBlendState->logicOpEnable != VK_FALSE)
{ {
UNSUPPORTED("colorBlendState"); UNSUPPORTED("VkPhysicalDeviceFeatures::logicOp");
} }
if(!hasDynamicState(VK_DYNAMIC_STATE_BLEND_CONSTANTS)) if(!hasDynamicState(VK_DYNAMIC_STATE_BLEND_CONSTANTS))
...@@ -427,7 +471,8 @@ void GraphicsPipeline::compileShaders(const VkAllocationCallbacks *pAllocator, c ...@@ -427,7 +471,8 @@ void GraphicsPipeline::compileShaders(const VkAllocationCallbacks *pAllocator, c
{ {
if(pStage->flags != 0) if(pStage->flags != 0)
{ {
UNSUPPORTED("pStage->flags"); // Vulkan 1.2: "flags must be 0"
UNSUPPORTED("pStage->flags %d", int(pStage->flags));
} }
const ShaderModule *module = vk::Cast(pStage->module); const ShaderModule *module = vk::Cast(pStage->module);
...@@ -479,7 +524,7 @@ uint32_t GraphicsPipeline::computePrimitiveCount(uint32_t vertexCount) const ...@@ -479,7 +524,7 @@ uint32_t GraphicsPipeline::computePrimitiveCount(uint32_t vertexCount) const
case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN: case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
return std::max<uint32_t>(vertexCount, 2) - 2; return std::max<uint32_t>(vertexCount, 2) - 2;
default: default:
UNSUPPORTED("context.topology %d", int(context.topology)); UNSUPPORTED("VkPrimitiveTopology %d", int(context.topology));
} }
return 0; return 0;
......
...@@ -92,7 +92,7 @@ QueryPool::QueryPool(const VkQueryPoolCreateInfo *pCreateInfo, void *mem) ...@@ -92,7 +92,7 @@ QueryPool::QueryPool(const VkQueryPoolCreateInfo *pCreateInfo, void *mem)
, type(pCreateInfo->queryType) , type(pCreateInfo->queryType)
, count(pCreateInfo->queryCount) , count(pCreateInfo->queryCount)
{ {
// According to the Vulkan spec, section 34.1. Features: // According to the Vulkan 1.2 spec, section 30. Features:
// "pipelineStatisticsQuery specifies whether the pipeline statistics // "pipelineStatisticsQuery specifies whether the pipeline statistics
// queries are supported. If this feature is not enabled, queries of // queries are supported. If this feature is not enabled, queries of
// type VK_QUERY_TYPE_PIPELINE_STATISTICS cannot be created, and // type VK_QUERY_TYPE_PIPELINE_STATISTICS cannot be created, and
...@@ -100,7 +100,7 @@ QueryPool::QueryPool(const VkQueryPoolCreateInfo *pCreateInfo, void *mem) ...@@ -100,7 +100,7 @@ QueryPool::QueryPool(const VkQueryPoolCreateInfo *pCreateInfo, void *mem)
// pipelineStatistics member of the VkQueryPoolCreateInfo structure." // pipelineStatistics member of the VkQueryPoolCreateInfo structure."
if(type == VK_QUERY_TYPE_PIPELINE_STATISTICS) if(type == VK_QUERY_TYPE_PIPELINE_STATISTICS)
{ {
UNSUPPORTED("pCreateInfo->queryType"); UNSUPPORTED("VkPhysicalDeviceFeatures::pipelineStatisticsQuery");
} }
// Construct all queries // Construct all queries
...@@ -189,7 +189,7 @@ void QueryPool::begin(uint32_t query, VkQueryControlFlags flags) ...@@ -189,7 +189,7 @@ void QueryPool::begin(uint32_t query, VkQueryControlFlags flags)
if(flags != 0) if(flags != 0)
{ {
UNSUPPORTED("flags"); UNIMPLEMENTED("vkCmdBeginQuery::flags %d", int(flags));
} }
pool[query].prepare(type); pool[query].prepare(type);
......
...@@ -178,7 +178,7 @@ void Queue::taskLoop(marl::Scheduler *scheduler) ...@@ -178,7 +178,7 @@ void Queue::taskLoop(marl::Scheduler *scheduler)
submitQueue(task); submitQueue(task);
break; break;
default: default:
UNSUPPORTED("task.type %d", static_cast<int>(task.type)); UNREACHABLE("task.type %d", static_cast<int>(task.type));
break; break;
} }
} }
......
...@@ -56,7 +56,7 @@ struct SemaphoreCreateInfo ...@@ -56,7 +56,7 @@ struct SemaphoreCreateInfo
exportSemaphore = true; exportSemaphore = true;
if(exportInfo->handleTypes != Semaphore::External::kExternalSemaphoreHandleType) if(exportInfo->handleTypes != Semaphore::External::kExternalSemaphoreHandleType)
{ {
UNSUPPORTED("exportInfo->handleTypes"); UNIMPLEMENTED("exportInfo->handleTypes");
} }
break; break;
} }
......
...@@ -265,9 +265,15 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre ...@@ -265,9 +265,15 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre
initializeLibrary(); initializeLibrary();
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->enabledLayerCount"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
}
if(pCreateInfo->enabledLayerCount != 0)
{
UNIMPLEMENTED("pCreateInfo->enabledLayerCount != 0");
} }
uint32_t extensionPropertiesCount = sizeof(instanceExtensionProperties) / sizeof(instanceExtensionProperties[0]); uint32_t extensionPropertiesCount = sizeof(instanceExtensionProperties) / sizeof(instanceExtensionProperties[0]);
...@@ -371,7 +377,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysic ...@@ -371,7 +377,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysic
break; break;
default: default:
UNSUPPORTED("tiling"); UNSUPPORTED("VkImageTiling %d", int(tiling));
features = 0; features = 0;
} }
...@@ -504,10 +510,16 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -504,10 +510,16 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
TRACE("(VkPhysicalDevice physicalDevice = %p, const VkDeviceCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDevice* pDevice = %p)", TRACE("(VkPhysicalDevice physicalDevice = %p, const VkDeviceCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDevice* pDevice = %p)",
physicalDevice, pCreateInfo, pAllocator, pDevice); physicalDevice, pCreateInfo, pAllocator, pDevice);
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
}
if(pCreateInfo->enabledLayerCount != 0)
{ {
// "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations."
UNSUPPORTED("pCreateInfo->enabledLayerCount"); UNSUPPORTED("pCreateInfo->enabledLayerCount != 0");
} }
uint32_t extensionPropertiesCount = sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]); uint32_t extensionPropertiesCount = sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]);
...@@ -660,9 +672,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -660,9 +672,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
for(uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) for(uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++)
{ {
const VkDeviceQueueCreateInfo &queueCreateInfo = pCreateInfo->pQueueCreateInfos[i]; const VkDeviceQueueCreateInfo &queueCreateInfo = pCreateInfo->pQueueCreateInfos[i];
if(queueCreateInfo.flags) if(queueCreateInfo.flags != 0)
{ {
UNSUPPORTED("queueCreateInfo.flags"); UNSUPPORTED("pCreateInfo->pQueueCreateInfos[%d]->flags %d", i, queueCreateInfo.flags);
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(queueCreateInfo.pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(queueCreateInfo.pNext);
...@@ -939,6 +951,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memor ...@@ -939,6 +951,12 @@ VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memor
TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p, VkDeviceSize offset = %d, VkDeviceSize size = %d, VkMemoryMapFlags flags = %d, void** ppData = %p)", TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p, VkDeviceSize offset = %d, VkDeviceSize size = %d, VkMemoryMapFlags flags = %d, void** ppData = %p)",
device, static_cast<void *>(memory), int(offset), int(size), flags, ppData); device, static_cast<void *>(memory), int(offset), int(size), flags, ppData);
if(flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("flags %d", int(flags));
}
return vk::Cast(memory)->map(offset, size, ppData); return vk::Cast(memory)->map(offset, size, ppData);
} }
...@@ -1112,9 +1130,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaph ...@@ -1112,9 +1130,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaph
TRACE("(VkDevice device = %p, const VkSemaphoreCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSemaphore* pSemaphore = %p)", TRACE("(VkDevice device = %p, const VkSemaphoreCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSemaphore* pSemaphore = %p)",
device, pCreateInfo, pAllocator, pSemaphore); device, pCreateInfo, pAllocator, pSemaphore);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
return vk::Semaphore::Create(pAllocator, pCreateInfo, pSemaphore, pAllocator); return vk::Semaphore::Create(pAllocator, pCreateInfo, pSemaphore, pAllocator);
...@@ -1136,7 +1155,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR(VkDevice device, const VkSema ...@@ -1136,7 +1155,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR(VkDevice device, const VkSema
if(pGetFdInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) if(pGetFdInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT)
{ {
UNSUPPORTED("pGetFdInfo->handleType"); UNSUPPORTED("pGetFdInfo->handleType %d", int(pGetFdInfo->handleType));
} }
return vk::Cast(pGetFdInfo->semaphore)->exportFd(pFd); return vk::Cast(pGetFdInfo->semaphore)->exportFd(pFd);
...@@ -1149,7 +1168,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR(VkDevice device, const VkI ...@@ -1149,7 +1168,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreFdKHR(VkDevice device, const VkI
if(pImportSemaphoreInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) if(pImportSemaphoreInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT)
{ {
UNSUPPORTED("pImportSemaphoreInfo->handleType"); UNSUPPORTED("pImportSemaphoreInfo->handleType %d", int(pImportSemaphoreInfo->handleType));
} }
bool temporaryImport = (pImportSemaphoreInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) != 0; bool temporaryImport = (pImportSemaphoreInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) != 0;
...@@ -1167,7 +1186,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA( ...@@ -1167,7 +1186,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
if(pImportSemaphoreZirconHandleInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA) if(pImportSemaphoreZirconHandleInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA)
{ {
UNSUPPORTED("pImportSemaphoreZirconHandleInfo->handleType"); UNSUPPORTED("pImportSemaphoreZirconHandleInfo->handleType %d", int(pImportSemaphoreZirconHandleInfo->handleType));
} }
bool temporaryImport = (pImportSemaphoreZirconHandleInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) != 0; bool temporaryImport = (pImportSemaphoreZirconHandleInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) != 0;
...@@ -1184,7 +1203,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA( ...@@ -1184,7 +1203,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
if(pGetZirconHandleInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA) if(pGetZirconHandleInfo->handleType != VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA)
{ {
UNSUPPORTED("pGetZirconHandleInfo->handleType"); UNSUPPORTED("pGetZirconHandleInfo->handleType %d", int(pGetZirconHandleInfo->handleType));
} }
return vk::Cast(pGetZirconHandleInfo->semaphore)->exportHandle(pZirconHandle); return vk::Cast(pGetZirconHandleInfo->semaphore)->exportHandle(pZirconHandle);
...@@ -1196,14 +1215,16 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreat ...@@ -1196,14 +1215,16 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreat
TRACE("(VkDevice device = %p, const VkEventCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkEvent* pEvent = %p)", TRACE("(VkDevice device = %p, const VkEventCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkEvent* pEvent = %p)",
device, pCreateInfo, pAllocator, pEvent); device, pCreateInfo, pAllocator, pEvent);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
while(extInfo) while(extInfo)
{ {
// Vulkan 1.2: "pNext must be NULL"
WARN("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str()); WARN("pCreateInfo->pNext sType = %s", vk::Stringify(extInfo->sType).c_str());
extInfo = extInfo->pNext; extInfo = extInfo->pNext;
} }
...@@ -1249,9 +1270,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryP ...@@ -1249,9 +1270,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryP
TRACE("(VkDevice device = %p, const VkQueryPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkQueryPool* pQueryPool = %p)", TRACE("(VkDevice device = %p, const VkQueryPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkQueryPool* pQueryPool = %p)",
device, pCreateInfo, pAllocator, pQueryPool); device, pCreateInfo, pAllocator, pQueryPool);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
...@@ -1316,9 +1338,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBuffe ...@@ -1316,9 +1338,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBuffe
TRACE("(VkDevice device = %p, const VkBufferViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkBufferView* pView = %p)", TRACE("(VkDevice device = %p, const VkBufferViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkBufferView* pView = %p)",
device, pCreateInfo, pAllocator, pView); device, pCreateInfo, pAllocator, pView);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
...@@ -1450,9 +1473,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageV ...@@ -1450,9 +1473,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageV
TRACE("(VkDevice device = %p, const VkImageViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkImageView* pView = %p)", TRACE("(VkDevice device = %p, const VkImageViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkImageView* pView = %p)",
device, pCreateInfo, pAllocator, pView); device, pCreateInfo, pAllocator, pView);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -1506,9 +1529,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkSha ...@@ -1506,9 +1529,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkSha
TRACE("(VkDevice device = %p, const VkShaderModuleCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkShaderModule* pShaderModule = %p)", TRACE("(VkDevice device = %p, const VkShaderModuleCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkShaderModule* pShaderModule = %p)",
device, pCreateInfo, pAllocator, pShaderModule); device, pCreateInfo, pAllocator, pShaderModule);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -1534,9 +1558,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPi ...@@ -1534,9 +1558,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPi
TRACE("(VkDevice device = %p, const VkPipelineCacheCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineCache* pPipelineCache = %p)", TRACE("(VkDevice device = %p, const VkPipelineCacheCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineCache* pPipelineCache = %p)",
device, pCreateInfo, pAllocator, pPipelineCache); device, pCreateInfo, pAllocator, pPipelineCache);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
...@@ -1650,9 +1675,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkP ...@@ -1650,9 +1675,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkP
TRACE("(VkDevice device = %p, const VkPipelineLayoutCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineLayout* pPipelineLayout = %p)", TRACE("(VkDevice device = %p, const VkPipelineLayoutCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineLayout* pPipelineLayout = %p)",
device, pCreateInfo, pAllocator, pPipelineLayout); device, pCreateInfo, pAllocator, pPipelineLayout);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -1678,9 +1704,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerC ...@@ -1678,9 +1704,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerC
TRACE("(VkDevice device = %p, const VkSamplerCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSampler* pSampler = %p)", TRACE("(VkDevice device = %p, const VkSamplerCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSampler* pSampler = %p)",
device, pCreateInfo, pAllocator, pSampler); device, pCreateInfo, pAllocator, pSampler);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -1776,9 +1802,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescript ...@@ -1776,9 +1802,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescript
TRACE("(VkDevice device = %p, VkDescriptorPool descriptorPool = %p, VkDescriptorPoolResetFlags flags = 0x%x)", TRACE("(VkDevice device = %p, VkDescriptorPool descriptorPool = %p, VkDescriptorPoolResetFlags flags = 0x%x)",
device, static_cast<void *>(descriptorPool), int(flags)); device, static_cast<void *>(descriptorPool), int(flags));
if(flags) if(flags != 0)
{ {
UNSUPPORTED("flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("flags %d", int(flags));
} }
return vk::Cast(descriptorPool)->reset(); return vk::Cast(descriptorPool)->reset();
...@@ -1822,9 +1849,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram ...@@ -1822,9 +1849,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram
TRACE("(VkDevice device = %p, const VkFramebufferCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkFramebuffer* pFramebuffer = %p)", TRACE("(VkDevice device = %p, const VkFramebufferCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkFramebuffer* pFramebuffer = %p)",
device, pCreateInfo, pAllocator, pFramebuffer); device, pCreateInfo, pAllocator, pFramebuffer);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); auto *nextInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -1850,9 +1877,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRende ...@@ -1850,9 +1877,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRende
TRACE("(VkDevice device = %p, const VkRenderPassCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkRenderPass* pRenderPass = %p)", TRACE("(VkDevice device = %p, const VkRenderPassCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkRenderPass* pRenderPass = %p)",
device, pCreateInfo, pAllocator, pRenderPass); device, pCreateInfo, pAllocator, pRenderPass);
if(pCreateInfo->flags) if(pCreateInfo->flags != 0)
{ {
UNSUPPORTED("pCreateInfo->flags"); // Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
} }
const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); const VkBaseInStructure *extensionCreateInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
...@@ -2502,7 +2530,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, u ...@@ -2502,7 +2530,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, u
device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
ASSERT(localDeviceIndex != remoteDeviceIndex); // "localDeviceIndex must not equal remoteDeviceIndex" ASSERT(localDeviceIndex != remoteDeviceIndex); // "localDeviceIndex must not equal remoteDeviceIndex"
UNREACHABLE("remoteDeviceIndex: %d", int(remoteDeviceIndex)); // Only one physical device is supported, and since the device indexes can't be equal, this should never be called. UNSUPPORTED("remoteDeviceIndex: %d", int(remoteDeviceIndex)); // Only one physical device is supported, and since the device indexes can't be equal, this should never be called.
} }
VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask)
...@@ -2973,6 +3001,12 @@ VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool comm ...@@ -2973,6 +3001,12 @@ VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool comm
TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, VkCommandPoolTrimFlags flags = %d)", TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, VkCommandPoolTrimFlags flags = %d)",
device, static_cast<void *>(commandPool), flags); device, static_cast<void *>(commandPool), flags);
if(flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("flags %d", int(flags));
}
vk::Cast(commandPool)->trim(flags); vk::Cast(commandPool)->trim(flags);
} }
...@@ -2988,19 +3022,17 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu ...@@ -2988,19 +3022,17 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu
extInfo = extInfo->pNext; extInfo = extInfo->pNext;
} }
if(pQueueInfo->flags != 0)
{
// The only flag that can be set here is VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT // The only flag that can be set here is VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT
// According to the Vulkan spec, 4.3.1. Queue Family Properties: // According to the Vulkan 1.2.132 spec, 4.3.1. Queue Family Properties:
// "VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT specifies that the device queue is a // "VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT specifies that the device queue is a
// protected-capable queue. If the protected memory feature is not enabled, // protected-capable queue. If the protected memory feature is not enabled,
// the VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT bit of flags must not be set." // the VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT bit of flags must not be set."
if(pQueueInfo->flags) UNSUPPORTED("VkPhysicalDeviceVulkan11Features::protectedMemory");
{
*pQueue = VK_NULL_HANDLE;
} }
else
{
vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue); vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue);
}
} }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion) VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion)
...@@ -3031,9 +3063,15 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, ...@@ -3031,9 +3063,15 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device,
TRACE("(VkDevice device = %p, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate = %p)", TRACE("(VkDevice device = %p, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate = %p)",
device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate);
if(pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)) if(pCreateInfo->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
}
if(pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)
{ {
UNSUPPORTED("pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)"); UNSUPPORTED("pCreateInfo->templateType %d", int(pCreateInfo->templateType));
} }
auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext); auto extInfo = reinterpret_cast<VkBaseInStructure const *>(pCreateInfo->pNext);
...@@ -3099,7 +3137,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, ...@@ -3099,7 +3137,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer,
TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t lineStippleFactor = %u, uint16_t lineStipplePattern = %u", TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t lineStippleFactor = %u, uint16_t lineStipplePattern = %u",
commandBuffer, lineStippleFactor, lineStipplePattern); commandBuffer, lineStippleFactor, lineStipplePattern);
UNSUPPORTED("Line stipple not supported"); UNSUPPORTED("VkPhysicalDeviceLineRasterizationFeaturesEXT::stippled*Lines");
} }
#ifdef VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XCB_KHR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment