mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +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:
parent
78ab26347d
commit
d94d89c3ef
@ -14,11 +14,16 @@ namespace dxvk {
|
|||||||
|
|
||||||
const DxvkDeviceFeatures& devFeatures = device->features();
|
const DxvkDeviceFeatures& devFeatures = device->features();
|
||||||
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
|
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
|
||||||
|
|
||||||
|
const VkShaderStageFlags allShaderStages = device->getShaderPipelineStages();
|
||||||
|
|
||||||
useDepthClipWorkaround
|
useDepthClipWorkaround
|
||||||
= !devFeatures.extDepthClipEnable.depthClipEnable;
|
= !devFeatures.extDepthClipEnable.depthClipEnable;
|
||||||
useStorageImageReadWithoutFormat
|
useStorageImageReadWithoutFormat
|
||||||
= devFeatures.core.features.shaderStorageImageReadWithoutFormat;
|
= devFeatures.core.features.shaderStorageImageReadWithoutFormat;
|
||||||
|
useSubgroupOpsForAtomicCounters
|
||||||
|
= (devInfo.coreSubgroup.supportedStages & allShaderStages) == allShaderStages
|
||||||
|
&& (devInfo.coreSubgroup.supportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT);
|
||||||
useSubgroupOpsForEarlyDiscard
|
useSubgroupOpsForEarlyDiscard
|
||||||
= (devInfo.coreSubgroup.subgroupSize >= 4)
|
= (devInfo.coreSubgroup.subgroupSize >= 4)
|
||||||
&& (devInfo.coreSubgroup.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT)
|
&& (devInfo.coreSubgroup.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT)
|
||||||
|
@ -17,6 +17,10 @@ namespace dxvk {
|
|||||||
/// Use the ShaderImageReadWithoutFormat capability.
|
/// Use the ShaderImageReadWithoutFormat capability.
|
||||||
bool useStorageImageReadWithoutFormat = false;
|
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
|
/// Use subgroup operations to discard fragment
|
||||||
/// shader invocations if derivatives remain valid.
|
/// shader invocations if derivatives remain valid.
|
||||||
bool useSubgroupOpsForEarlyDiscard = false;
|
bool useSubgroupOpsForEarlyDiscard = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user