Browse Source

[vk] Fix vertex attribute dirty range off by 1?

pull/2783/head
Ribbit 5 months ago
parent
commit
bf9ba2ca37
  1. 8
      src/video_core/renderer_vulkan/vk_rasterizer.cpp

8
src/video_core/renderer_vulkan/vk_rasterizer.cpp

@ -1583,13 +1583,16 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs)
// There seems to be a bug on Nvidia's driver where updating only higher attributes ends up // There seems to be a bug on Nvidia's driver where updating only higher attributes ends up
// generating dirty state. Track the highest dirty attribute and update all attributes until // generating dirty state. Track the highest dirty attribute and update all attributes until
// that one. // that one.
size_t highest_dirty_attr{};
size_t highest_dirty_attr = 0;
bool has_dirty_attr = false;
for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) {
if (dirty[Dirty::VertexAttribute0 + index]) { if (dirty[Dirty::VertexAttribute0 + index]) {
highest_dirty_attr = index; highest_dirty_attr = index;
has_dirty_attr = true;
} }
} }
for (size_t index = 0; index < highest_dirty_attr; ++index) {
if (has_dirty_attr) {
for (size_t index = 0; index <= highest_dirty_attr; ++index) {
const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]}; const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]};
const u32 binding{attribute.buffer}; const u32 binding{attribute.buffer};
dirty[Dirty::VertexAttribute0 + index] = false; dirty[Dirty::VertexAttribute0 + index] = false;
@ -1605,6 +1608,7 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs)
}); });
} }
} }
}
for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) {
if (!dirty[Dirty::VertexBinding0 + index]) { if (!dirty[Dirty::VertexBinding0 + index]) {
continue; continue;

Loading…
Cancel
Save