mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[dxvk] Fix poor API design around defining resource slots
This commit is contained in:
parent
326eb0bf80
commit
f58242c58d
@ -10,23 +10,20 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxvkDescriptorSlotMapping::defineSlot(
|
void DxvkDescriptorSlotMapping::defineSlot(
|
||||||
uint32_t slot,
|
|
||||||
VkDescriptorType type,
|
|
||||||
VkImageViewType view,
|
|
||||||
VkShaderStageFlagBits stage,
|
VkShaderStageFlagBits stage,
|
||||||
VkAccessFlags access) {
|
const DxvkResourceSlot& desc) {
|
||||||
uint32_t bindingId = this->getBindingId(slot);
|
uint32_t bindingId = this->getBindingId(desc.slot);
|
||||||
|
|
||||||
if (bindingId != InvalidBinding) {
|
if (bindingId != InvalidBinding) {
|
||||||
m_descriptorSlots[bindingId].stages |= stage;
|
m_descriptorSlots[bindingId].stages |= stage;
|
||||||
m_descriptorSlots[bindingId].access |= access;
|
m_descriptorSlots[bindingId].access |= desc.access;
|
||||||
} else {
|
} else {
|
||||||
DxvkDescriptorSlot slotInfo;
|
DxvkDescriptorSlot slotInfo;
|
||||||
slotInfo.slot = slot;
|
slotInfo.slot = desc.slot;
|
||||||
slotInfo.type = type;
|
slotInfo.type = desc.type;
|
||||||
slotInfo.view = view;
|
slotInfo.view = desc.view;
|
||||||
slotInfo.stages = stage;
|
slotInfo.stages = stage;
|
||||||
slotInfo.access = access;
|
slotInfo.access = desc.access;
|
||||||
m_descriptorSlots.push_back(slotInfo);
|
m_descriptorSlots.push_back(slotInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,18 +81,12 @@ namespace dxvk {
|
|||||||
* defined by another shader stage, this will extend
|
* defined by another shader stage, this will extend
|
||||||
* the stage mask by the given stage. Otherwise, an
|
* the stage mask by the given stage. Otherwise, an
|
||||||
* entirely new binding is added.
|
* entirely new binding is added.
|
||||||
* \param [in] slot Resource slot
|
|
||||||
* \param [in] type Resource type
|
|
||||||
* \param [in] view Image view type
|
|
||||||
* \param [in] stage Shader stage
|
* \param [in] stage Shader stage
|
||||||
* \param [in] access Access flags
|
* \param [in] desc Slot description
|
||||||
*/
|
*/
|
||||||
void defineSlot(
|
void defineSlot(
|
||||||
uint32_t slot,
|
|
||||||
VkDescriptorType type,
|
|
||||||
VkImageViewType view,
|
|
||||||
VkShaderStageFlagBits stage,
|
VkShaderStageFlagBits stage,
|
||||||
VkAccessFlags access);
|
const DxvkResourceSlot& desc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Defines new push constant range
|
* \brief Defines new push constant range
|
||||||
|
@ -150,7 +150,7 @@ namespace dxvk {
|
|||||||
void DxvkShader::defineResourceSlots(
|
void DxvkShader::defineResourceSlots(
|
||||||
DxvkDescriptorSlotMapping& mapping) const {
|
DxvkDescriptorSlotMapping& mapping) const {
|
||||||
for (const auto& slot : m_slots)
|
for (const auto& slot : m_slots)
|
||||||
mapping.defineSlot(slot.slot, slot.type, slot.view, m_stage, slot.access);
|
mapping.defineSlot(m_stage, slot);
|
||||||
|
|
||||||
if (m_interface.pushConstSize) {
|
if (m_interface.pushConstSize) {
|
||||||
mapping.definePushConstRange(m_stage,
|
mapping.definePushConstRange(m_stage,
|
||||||
|
Loading…
Reference in New Issue
Block a user