color write meows

This commit is contained in:
CamilleLaVey
2026-08-22 21:55:02 -04:00
parent 16b9b5aa0c
commit 9392ccf124
@@ -1877,19 +1877,13 @@ void RasterizerVulkan::UpdateColorWriteEnable(Tegra::Engines::Maxwell3D::Regs& r
if (!state_tracker.TouchColorMask()) {
return;
}
size_t num_attachments{};
for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) {
if (regs.rt[index].format != Tegra::RenderTargetFormat::NONE) {
num_attachments = index + 1;
}
}
std::array<VkBool32, Maxwell::NumRenderTargets> setup_enables{};
for (size_t index = 0; index < Maxwell::NumRenderTargets; index++) {
const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : index];
setup_enables[index] = (mask.R || mask.G || mask.B || mask.A) ? VK_TRUE : VK_FALSE;
}
scheduler.Record([setup_enables, num_attachments](vk::CommandBuffer cmdbuf) {
cmdbuf.SetColorWriteEnableEXT(vk::Span<VkBool32>(setup_enables.data(), num_attachments));
scheduler.Record([setup_enables](vk::CommandBuffer cmdbuf) {
cmdbuf.SetColorWriteEnableEXT(setup_enables);
});
}