diff options
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/src/dxso/dxso_util.h')
-rw-r--r-- | src/libs/dxvk-native-1.9.2a/src/dxso/dxso_util.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_util.h b/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_util.h new file mode 100644 index 00000000..fac03d73 --- /dev/null +++ b/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_util.h @@ -0,0 +1,47 @@ +#pragma once + +#include <cstdint> + +#include "dxso_common.h" +#include "dxso_decoder.h" + +namespace dxvk { + + enum class DxsoBindingType : uint32_t { + ConstantBuffer, + Image, + }; + + enum DxsoConstantBuffers : uint32_t { + VSConstantBuffer = 0, + VSClipPlanes = 1, + VSFixedFunction = 2, + VSVertexBlendData = 3, + VSCount, + + PSConstantBuffer = 0, + PSFixedFunction = 1, + PSShared = 2, + PSCount + }; + + constexpr uint32_t computeResourceSlotId( + DxsoProgramType shaderStage, + DxsoBindingType bindingType, + uint32_t bindingIndex) { + const uint32_t stageOffset = 8 * uint32_t(shaderStage); + + if (bindingType == DxsoBindingType::ConstantBuffer) + return bindingIndex + stageOffset; + else // if (bindingType == DxsoBindingType::Image) + return bindingIndex + stageOffset + (shaderStage == DxsoProgramType::PixelShader ? PSCount : VSCount); + } + + // TODO: Intergrate into compute resource slot ID/refactor all of this? + constexpr uint32_t getSWVPBufferSlot() { + return 27; // From last pixel shader slot, above. + } + + uint32_t RegisterLinkerSlot(DxsoSemantic semantic); + +}
\ No newline at end of file |