1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 10:24:10 +01:00

[d3d9] Use new DxvkShader constructor for SWVP emulation

This commit is contained in:
Philip Rebohle 2022-04-09 14:13:23 +02:00 committed by Philip Rebohle
parent ab95b61e44
commit 98ec79f6fa

View File

@ -130,12 +130,10 @@ namespace dxvk {
m_module.decorateDescriptorSet(buffer, 0); m_module.decorateDescriptorSet(buffer, 0);
m_module.decorateBinding(buffer, bufferSlot); m_module.decorateBinding(buffer, bufferSlot);
DxvkResourceSlot bufferRes; m_bufferResource.slot = bufferSlot;
bufferRes.slot = bufferSlot; m_bufferResource.type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
bufferRes.type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; m_bufferResource.view = VK_IMAGE_VIEW_TYPE_MAX_ENUM;
bufferRes.view = VK_IMAGE_VIEW_TYPE_MAX_ENUM; m_bufferResource.access = VK_ACCESS_SHADER_WRITE_BIT;
bufferRes.access = VK_ACCESS_SHADER_WRITE_BIT;
m_resourceSlots.push_back(bufferRes);
// Load our builtins // Load our builtins
uint32_t primitiveIdPtr = m_module.newVar(m_module.defPointerType(uint_t, spv::StorageClassInput), spv::StorageClassInput); uint32_t primitiveIdPtr = m_module.newVar(m_module.defPointerType(uint_t, spv::StorageClassInput), spv::StorageClassInput);
@ -168,7 +166,7 @@ namespace dxvk {
uint32_t slotIdx = RegisterLinkerSlot(semantic); uint32_t slotIdx = RegisterLinkerSlot(semantic);
m_module.decorateLocation(elementPtr, slotIdx); m_module.decorateLocation(elementPtr, slotIdx);
m_interfaceSlots.inputSlots |= 1u << slotIdx; m_inputMask |= 1u << slotIdx;
} }
uint32_t zero = m_module.constu32(0); uint32_t zero = m_module.constu32(0);
@ -283,16 +281,13 @@ namespace dxvk {
m_entryPointInterfaces.data()); m_entryPointInterfaces.data());
m_module.setDebugName(m_entryPointId, "main"); m_module.setDebugName(m_entryPointId, "main");
DxvkShaderConstData constData = { }; DxvkShaderCreateInfo info;
info.stage = VK_SHADER_STAGE_GEOMETRY_BIT;
info.resourceSlotCount = 1;
info.resourceSlots = &m_bufferResource;
info.inputMask = m_inputMask;
return new DxvkShader( return new DxvkShader(info, m_module.compile());
VK_SHADER_STAGE_GEOMETRY_BIT,
m_resourceSlots.size(),
m_resourceSlots.data(),
m_interfaceSlots,
m_module.compile(),
DxvkShaderOptions(),
std::move(constData));
} }
private: private:
@ -301,9 +296,8 @@ namespace dxvk {
std::vector<uint32_t> m_entryPointInterfaces; std::vector<uint32_t> m_entryPointInterfaces;
uint32_t m_entryPointId = 0; uint32_t m_entryPointId = 0;
uint32_t m_inputMask = 0u;
std::vector<DxvkResourceSlot> m_resourceSlots; DxvkResourceSlot m_bufferResource;
DxvkInterfaceSlots m_interfaceSlots;
}; };