summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/DX12Context.cpp
diff options
context:
space:
mode:
authorTellowKrinkle <tellowkrinkle@gmail.com>2022-06-20 02:55:49 -0500
committerTellowKrinkle <tellowkrinkle@gmail.com>2022-09-19 16:28:24 -0500
commitdae56a24b8494e71d91b406f38fcbde7244fc8a2 (patch)
tree18fb8c3f30d54b3b318a044fe5b4d8351db62c24 /Source/Core/VideoBackends/D3D12/DX12Context.cpp
parent936b4d5d0d4aae87507fb4952f9ad570ee7522fe (diff)
VideoBackends:D3D12: Dynamic vertex loader support
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/DX12Context.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/DX12Context.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/D3D12/DX12Context.cpp b/Source/Core/VideoBackends/D3D12/DX12Context.cpp
index e3ff8a7417..5cf0e414c4 100644
--- a/Source/Core/VideoBackends/D3D12/DX12Context.cpp
+++ b/Source/Core/VideoBackends/D3D12/DX12Context.cpp
@@ -261,6 +261,16 @@ bool DXContext::CreateDescriptorHeaps()
return true;
}
+static void SetRootParamConstant(D3D12_ROOT_PARAMETER* rp, u32 shader_reg, u32 num_values,
+ D3D12_SHADER_VISIBILITY visibility)
+{
+ rp->ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
+ rp->Constants.Num32BitValues = num_values;
+ rp->Constants.ShaderRegister = shader_reg;
+ rp->Constants.RegisterSpace = 0;
+ rp->ShaderVisibility = visibility;
+}
+
static void SetRootParamCBV(D3D12_ROOT_PARAMETER* rp, u32 shader_reg,
D3D12_SHADER_VISIBILITY visibility)
{
@@ -345,6 +355,11 @@ bool DXContext::CreateGXRootSignature()
param_count++;
SetRootParamCBV(&params[param_count], 0, D3D12_SHADER_VISIBILITY_GEOMETRY);
param_count++;
+ SetRootParamTable(&params[param_count], &ranges[param_count], D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 3,
+ 1, D3D12_SHADER_VISIBILITY_VERTEX);
+ param_count++;
+ SetRootParamConstant(&params[param_count], 2, 1, D3D12_SHADER_VISIBILITY_VERTEX);
+ param_count++;
// Since these must be contiguous, pixel lighting goes to bbox if not enabled.
if (g_ActiveConfig.bBBoxEnable)