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

[dxbc] Add option to use subgroup ops for atomic counter operations

This can greatly reduce the number of atomic operations when using
append/consume buffers.
This commit is contained in:
Philip Rebohle 2019-05-15 18:49:02 +02:00
parent 78ab26347d
commit d94d89c3ef
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 9 additions and 0 deletions

View File

@ -14,11 +14,16 @@ namespace dxvk {
const DxvkDeviceFeatures& devFeatures = device->features();
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
const VkShaderStageFlags allShaderStages = device->getShaderPipelineStages();
useDepthClipWorkaround
= !devFeatures.extDepthClipEnable.depthClipEnable;
useStorageImageReadWithoutFormat
= devFeatures.core.features.shaderStorageImageReadWithoutFormat;
useSubgroupOpsForAtomicCounters
= (devInfo.coreSubgroup.supportedStages & allShaderStages) == allShaderStages
&& (devInfo.coreSubgroup.supportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT);
useSubgroupOpsForEarlyDiscard
= (devInfo.coreSubgroup.subgroupSize >= 4)
&& (devInfo.coreSubgroup.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT)

View File

@ -17,6 +17,10 @@ namespace dxvk {
/// Use the ShaderImageReadWithoutFormat capability.
bool useStorageImageReadWithoutFormat = false;
/// Use subgroup operations to reduce the number of
/// atomic operations for append/consume buffers.
bool useSubgroupOpsForAtomicCounters = false;
/// Use subgroup operations to discard fragment
/// shader invocations if derivatives remain valid.
bool useSubgroupOpsForEarlyDiscard = false;