mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-01 17:52:13 +01:00
c0c1565cba
Takes me from 340 -> 460fps in A Hat in Time's main menu when CPU bound.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#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);
|
|
|
|
} |