Check for supportsMultipleViewports feature before usage

If the host only supports a single viewport then we set `viewportCount` and `scissorCount` in `VkPipelineViewportStateCreateInfo` to 1.
This commit is contained in:
PixelyIon 2021-12-01 22:59:31 +05:30
parent 3e45006d14
commit e9ed771b48
3 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,10 @@ namespace skyline::gpu::interconnect {
public:
GraphicsContext(GPU &gpu, soc::gm20b::ChannelContext &channelCtx, gpu::interconnect::CommandExecutor &executor) : gpu(gpu), channelCtx(channelCtx), executor(executor) {
scissors.fill(DefaultScissor);
if (!gpu.quirks.supportsMultipleViewports) {
viewportState.viewportCount = 1;
viewportState.scissorCount = 1;
}
u32 bindingIndex{};
for (auto &vertexBinding : vertexBindings)

View File

@ -39,12 +39,13 @@ namespace skyline {
}
FEAT_SET(vk::PhysicalDeviceFeatures2, features.logicOp, supportsLogicOp)
FEAT_SET(vk::PhysicalDeviceFeatures2, features.multiViewport, supportsMultipleViewports)
FEAT_SET(vk::PhysicalDeviceVertexAttributeDivisorFeaturesEXT, vertexAttributeInstanceRateZeroDivisor, supportsVertexAttributeZeroDivisor)
#undef FEAT_SET
}
std::string QuirkManager::Summary() {
return fmt::format("\n* Supports Last Provoking Vertex: {}\n* Supports Logical Operations: {}\n* Supports Vertex Attribute Divisor: {}\n* Supports Vertex Attribute Zero Divisor: {}", supportsLastProvokingVertex, supportsLogicOp, supportsVertexAttributeDivisor, supportsVertexAttributeZeroDivisor);
return fmt::format("\n* Supports Last Provoking Vertex: {}\n* Supports Logical Operations: {}\n* Supports Vertex Attribute Divisor: {}\n* Supports Vertex Attribute Zero Divisor: {}\n* Supports Multiple Viewports: {}", supportsLastProvokingVertex, supportsLogicOp, supportsVertexAttributeDivisor, supportsVertexAttributeZeroDivisor, supportsMultipleViewports);
}
}

View File

@ -16,6 +16,7 @@ namespace skyline {
bool supportsLogicOp{}; //!< If the device supports framebuffer logical operations during blending
bool supportsVertexAttributeDivisor{}; //!< If the device supports a divisor for instance-rate vertex attributes (with VK_EXT_vertex_attribute_divisor)
bool supportsVertexAttributeZeroDivisor{}; //!< If the device supports a zero divisor for instance-rate vertex attributes (with VK_EXT_vertex_attribute_divisor)
bool supportsMultipleViewports{}; //!< If the device supports more than one viewport
QuirkManager() = default;