1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d9] Use new DxvkShader constructor for fixed-function shaders

This commit is contained in:
Philip Rebohle 2022-04-09 14:05:35 +02:00 committed by Philip Rebohle
parent 10bab0c182
commit ab95b61e44

View File

@ -604,9 +604,13 @@ namespace dxvk {
SpirvModule m_module; SpirvModule m_module;
std::vector std::vector
<DxvkResourceSlot> m_resourceSlots; <DxvkResourceSlot> m_resourceSlots;
DxvkInterfaceSlots m_interfaceSlots;
std::vector<uint32_t> m_entryPointInterfaces; std::vector<uint32_t> m_entryPointInterfaces;
uint32_t m_inputMask = 0u;
uint32_t m_outputMask = 0u;
uint32_t m_pushConstOffset = 0u;
uint32_t m_pushConstSize = 0u;
DxsoProgramType m_programType; DxsoProgramType m_programType;
D3D9FFShaderKeyVS m_vsKey; D3D9FFShaderKeyVS m_vsKey;
D3D9FFShaderKeyFS m_fsKey; D3D9FFShaderKeyFS m_fsKey;
@ -706,19 +710,17 @@ namespace dxvk {
m_entryPointInterfaces.size(), m_entryPointInterfaces.size(),
m_entryPointInterfaces.data()); m_entryPointInterfaces.data());
DxvkShaderOptions shaderOptions = { };
DxvkShaderConstData constData = { };
// Create the shader module object // Create the shader module object
return new DxvkShader( DxvkShaderCreateInfo info;
isVS() ? VK_SHADER_STAGE_VERTEX_BIT : VK_SHADER_STAGE_FRAGMENT_BIT, info.stage = isVS() ? VK_SHADER_STAGE_VERTEX_BIT : VK_SHADER_STAGE_FRAGMENT_BIT;
m_resourceSlots.size(), info.resourceSlotCount = m_resourceSlots.size();
m_resourceSlots.data(), info.resourceSlots = m_resourceSlots.data();
m_interfaceSlots, info.inputMask = m_inputMask;
m_module.compile(), info.outputMask = m_outputMask;
shaderOptions, info.pushConstOffset = m_pushConstOffset;
std::move(constData)); info.pushConstSize = m_pushConstOffset;
return new DxvkShader(info, m_module.compile());
} }
@ -728,8 +730,8 @@ namespace dxvk {
? m_isgn : m_osgn; ? m_isgn : m_osgn;
uint32_t& slots = input uint32_t& slots = input
? m_interfaceSlots.inputSlots ? m_inputMask
: m_interfaceSlots.outputSlots; : m_outputMask;
uint32_t i = sgn.elemCount++; uint32_t i = sgn.elemCount++;
@ -1186,13 +1188,13 @@ namespace dxvk {
uint32_t count; uint32_t count;
if (m_programType == DxsoProgramType::PixelShader) { if (m_programType == DxsoProgramType::PixelShader) {
m_interfaceSlots.pushConstOffset = 0; m_pushConstOffset = 0;
m_interfaceSlots.pushConstSize = offsetof(D3D9RenderStateInfo, pointSize); m_pushConstSize = offsetof(D3D9RenderStateInfo, pointSize);
count = 5; count = 5;
} }
else { else {
m_interfaceSlots.pushConstOffset = offsetof(D3D9RenderStateInfo, pointSize); m_pushConstOffset = offsetof(D3D9RenderStateInfo, pointSize);
m_interfaceSlots.pushConstSize = sizeof(float) * 6; m_pushConstSize = sizeof(float) * 6;
count = 11; count = 11;
} }