mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 04:29:14 +01:00
[dxvk] Clean up updateShaderResources a bit
This commit is contained in:
parent
81e7a8d1f6
commit
5e3336d79b
@ -3445,10 +3445,10 @@ namespace dxvk {
|
|||||||
&& m_state.cp.pipeline->layout()->hasStaticBufferBindings())) {
|
&& m_state.cp.pipeline->layout()->hasStaticBufferBindings())) {
|
||||||
m_flags.clr(DxvkContextFlag::CpDirtyResources);
|
m_flags.clr(DxvkContextFlag::CpDirtyResources);
|
||||||
|
|
||||||
this->updateShaderResources(
|
if (this->updateShaderResources(
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE,
|
VK_PIPELINE_BIND_POINT_COMPUTE,
|
||||||
m_state.cp.state.bsBindingMask,
|
m_state.cp.pipeline->layout()))
|
||||||
m_state.cp.pipeline->layout());
|
m_flags.set(DxvkContextFlag::CpDirtyPipelineState);
|
||||||
|
|
||||||
m_flags.set(
|
m_flags.set(
|
||||||
DxvkContextFlag::CpDirtyDescriptorSet,
|
DxvkContextFlag::CpDirtyDescriptorSet,
|
||||||
@ -3488,10 +3488,10 @@ namespace dxvk {
|
|||||||
&& m_state.gp.pipeline->layout()->hasStaticBufferBindings())) {
|
&& m_state.gp.pipeline->layout()->hasStaticBufferBindings())) {
|
||||||
m_flags.clr(DxvkContextFlag::GpDirtyResources);
|
m_flags.clr(DxvkContextFlag::GpDirtyResources);
|
||||||
|
|
||||||
this->updateShaderResources(
|
if (this->updateShaderResources(
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS,
|
VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
m_state.gp.state.bsBindingMask,
|
m_state.gp.pipeline->layout()))
|
||||||
m_state.gp.pipeline->layout());
|
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||||
|
|
||||||
m_flags.set(
|
m_flags.set(
|
||||||
DxvkContextFlag::GpDirtyDescriptorSet,
|
DxvkContextFlag::GpDirtyDescriptorSet,
|
||||||
@ -3522,9 +3522,8 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxvkContext::updateShaderResources(
|
bool DxvkContext::updateShaderResources(
|
||||||
VkPipelineBindPoint bindPoint,
|
VkPipelineBindPoint bindPoint,
|
||||||
DxvkBindingMask& bindMask,
|
|
||||||
const DxvkPipelineLayout* layout) {
|
const DxvkPipelineLayout* layout) {
|
||||||
bool updatePipelineState = false;
|
bool updatePipelineState = false;
|
||||||
|
|
||||||
@ -3541,6 +3540,11 @@ namespace dxvk {
|
|||||||
depthLayout = depthAttachment.layout;
|
depthLayout = depthAttachment.layout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select the bound resource mask to update
|
||||||
|
auto& bindMask = bindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS
|
||||||
|
? m_state.gp.state.bsBindingMask
|
||||||
|
: m_state.cp.state.bsBindingMask;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
||||||
const auto& binding = layout->binding(i);
|
const auto& binding = layout->binding(i);
|
||||||
@ -3654,11 +3658,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updatePipelineState) {
|
return updatePipelineState;
|
||||||
m_flags.set(bindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS
|
|
||||||
? DxvkContextFlag::GpDirtyPipelineState
|
|
||||||
: DxvkContextFlag::CpDirtyPipelineState);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1092,9 +1092,8 @@ namespace dxvk {
|
|||||||
void updateShaderSamplers(
|
void updateShaderSamplers(
|
||||||
const DxvkPipelineLayout* layout);
|
const DxvkPipelineLayout* layout);
|
||||||
|
|
||||||
void updateShaderResources(
|
bool updateShaderResources(
|
||||||
VkPipelineBindPoint bindPoint,
|
VkPipelineBindPoint bindPoint,
|
||||||
DxvkBindingMask& bindMask,
|
|
||||||
const DxvkPipelineLayout* layout);
|
const DxvkPipelineLayout* layout);
|
||||||
|
|
||||||
VkDescriptorSet updateShaderDescriptors(
|
VkDescriptorSet updateShaderDescriptors(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user