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

[dxvk] Clean up updateShaderResources a bit

This commit is contained in:
Philip Rebohle 2019-06-23 23:21:47 +02:00
parent 81e7a8d1f6
commit 5e3336d79b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 17 deletions

View File

@ -3445,10 +3445,10 @@ namespace dxvk {
&& m_state.cp.pipeline->layout()->hasStaticBufferBindings())) {
m_flags.clr(DxvkContextFlag::CpDirtyResources);
this->updateShaderResources(
if (this->updateShaderResources(
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(
DxvkContextFlag::CpDirtyDescriptorSet,
@ -3488,10 +3488,10 @@ namespace dxvk {
&& m_state.gp.pipeline->layout()->hasStaticBufferBindings())) {
m_flags.clr(DxvkContextFlag::GpDirtyResources);
this->updateShaderResources(
if (this->updateShaderResources(
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(
DxvkContextFlag::GpDirtyDescriptorSet,
@ -3522,9 +3522,8 @@ namespace dxvk {
}
void DxvkContext::updateShaderResources(
bool DxvkContext::updateShaderResources(
VkPipelineBindPoint bindPoint,
DxvkBindingMask& bindMask,
const DxvkPipelineLayout* layout) {
bool updatePipelineState = false;
@ -3542,6 +3541,11 @@ namespace dxvk {
}
}
// 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++) {
const auto& binding = layout->binding(i);
const auto& res = m_rc[binding.slot];
@ -3654,11 +3658,7 @@ namespace dxvk {
}
}
if (updatePipelineState) {
m_flags.set(bindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS
? DxvkContextFlag::GpDirtyPipelineState
: DxvkContextFlag::CpDirtyPipelineState);
}
return updatePipelineState;
}

View File

@ -1092,9 +1092,8 @@ namespace dxvk {
void updateShaderSamplers(
const DxvkPipelineLayout* layout);
void updateShaderResources(
bool updateShaderResources(
VkPipelineBindPoint bindPoint,
DxvkBindingMask& bindMask,
const DxvkPipelineLayout* layout);
VkDescriptorSet updateShaderDescriptors(