1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[dxbc] Only emit depth clamp in fragment shader if necessary

We don't need this if the depth clip extension is supported
by the driver.
This commit is contained in:
Philip Rebohle 2019-02-19 14:27:21 +01:00
parent 9159401b14
commit 38c6eeed26
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 10 additions and 1 deletions

View File

@ -6601,7 +6601,10 @@ namespace dxvk {
this->emitOutputSetup();
this->emitOutputMapping();
if (m_moduleInfo.options.useDepthClipWorkaround)
this->emitOutputDepthClamp();
this->emitFunctionEnd();
}

View File

@ -15,6 +15,8 @@ namespace dxvk {
const DxvkDeviceFeatures& devFeatures = device->features();
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
useDepthClipWorkaround
= !devFeatures.extDepthClipEnable.depthClipEnable;
useStorageImageReadWithoutFormat
= devFeatures.core.features.shaderStorageImageReadWithoutFormat;
useSubgroupOpsForEarlyDiscard

View File

@ -10,6 +10,10 @@ namespace dxvk {
DxbcOptions();
DxbcOptions(const Rc<DxvkDevice>& device, const D3D11Options& options);
// Clamp oDepth in fragment shaders if the depth
// clip device feature is not supported
bool useDepthClipWorkaround = false;
/// Use the ShaderImageReadWithoutFormat capability.
bool useStorageImageReadWithoutFormat = false;