mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
renderer_vulkan: Skip tessellation isolines if not supported. (#2384)
This commit is contained in:
parent
5d4812d1a6
commit
15b520f4a2
3 changed files with 21 additions and 4 deletions
|
@ -214,6 +214,9 @@ bool Instance::CreateDevice() {
|
||||||
vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT,
|
vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT,
|
||||||
vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
|
vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
|
||||||
features = feature_chain.get().features;
|
features = feature_chain.get().features;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
portability_features = feature_chain.get<vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
|
||||||
|
#endif
|
||||||
|
|
||||||
const vk::StructureChain properties_chain = physical_device.getProperties2<
|
const vk::StructureChain properties_chain = physical_device.getProperties2<
|
||||||
vk::PhysicalDeviceProperties2, vk::PhysicalDeviceVulkan11Properties,
|
vk::PhysicalDeviceProperties2, vk::PhysicalDeviceVulkan11Properties,
|
||||||
|
@ -282,7 +285,7 @@ bool Instance::CreateDevice() {
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// Required by Vulkan spec if supported.
|
// Required by Vulkan spec if supported.
|
||||||
add_extension(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
|
portability_subset = add_extension(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const auto family_properties = physical_device.getQueueFamilyProperties();
|
const auto family_properties = physical_device.getQueueFamilyProperties();
|
||||||
|
@ -403,7 +406,7 @@ bool Instance::CreateDevice() {
|
||||||
.legacyVertexAttributes = true,
|
.legacyVertexAttributes = true,
|
||||||
},
|
},
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
feature_chain.get<vk::PhysicalDevicePortabilitySubsetFeaturesKHR>(),
|
portability_features,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,16 @@ public:
|
||||||
return features.tessellationShader;
|
return features.tessellationShader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true when tessellation isolines are supported by the device
|
||||||
|
bool IsTessellationIsolinesSupported() const {
|
||||||
|
return !portability_subset || portability_features.tessellationIsolines;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true when tessellation point mode is supported by the device
|
||||||
|
bool IsTessellationPointModeSupported() const {
|
||||||
|
return !portability_subset || portability_features.tessellationPointMode;
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the vendor ID of the physical device
|
/// Returns the vendor ID of the physical device
|
||||||
u32 GetVendorID() const {
|
u32 GetVendorID() const {
|
||||||
return properties.vendorID;
|
return properties.vendorID;
|
||||||
|
@ -285,6 +295,7 @@ private:
|
||||||
vk::PhysicalDeviceVulkan12Properties vk12_props;
|
vk::PhysicalDeviceVulkan12Properties vk12_props;
|
||||||
vk::PhysicalDevicePushDescriptorPropertiesKHR push_descriptor_props;
|
vk::PhysicalDevicePushDescriptorPropertiesKHR push_descriptor_props;
|
||||||
vk::PhysicalDeviceFeatures features;
|
vk::PhysicalDeviceFeatures features;
|
||||||
|
vk::PhysicalDevicePortabilitySubsetFeaturesKHR portability_features;
|
||||||
vk::DriverIdKHR driver_id;
|
vk::DriverIdKHR driver_id;
|
||||||
vk::UniqueDebugUtilsMessengerEXT debug_callback{};
|
vk::UniqueDebugUtilsMessengerEXT debug_callback{};
|
||||||
std::string vendor_name;
|
std::string vendor_name;
|
||||||
|
@ -308,6 +319,7 @@ private:
|
||||||
bool image_load_store_lod{};
|
bool image_load_store_lod{};
|
||||||
bool amd_gcn_shader{};
|
bool amd_gcn_shader{};
|
||||||
bool tooling_info{};
|
bool tooling_info{};
|
||||||
|
bool portability_subset{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Vulkan
|
} // namespace Vulkan
|
||||||
|
|
|
@ -412,8 +412,10 @@ bool PipelineCache::RefreshGraphicsKey() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Liverpool::ShaderStageEnable::VgtStages::LsHs: {
|
case Liverpool::ShaderStageEnable::VgtStages::LsHs: {
|
||||||
if (!instance.IsTessellationSupported()) {
|
if (!instance.IsTessellationSupported() ||
|
||||||
break;
|
(regs.tess_config.type == AmdGpu::TessellationType::Isoline &&
|
||||||
|
!instance.IsTessellationIsolinesSupported())) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (!TryBindStage(Stage::Hull, LogicalStage::TessellationControl)) {
|
if (!TryBindStage(Stage::Hull, LogicalStage::TessellationControl)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue