diff --git a/core/rend/dx11/dx11_renderer.cpp b/core/rend/dx11/dx11_renderer.cpp index ebb15ede2..4363d04a2 100644 --- a/core/rend/dx11/dx11_renderer.cpp +++ b/core/rend/dx11/dx11_renderer.cpp @@ -886,6 +886,7 @@ void DX11Renderer::drawModVols(int first, int count) setCullMode(0); //enable color writes deviceContext->OMSetBlendState(blendStates.getState(true, 4, 5), nullptr, 0xffffffff); + deviceContext->RSSetScissorRects(1, &scissorRect); //black out any stencil with '1' //only pixels that are Modvol enabled, and in area 1 diff --git a/core/rend/dx9/d3d_renderer.cpp b/core/rend/dx9/d3d_renderer.cpp index f3554a56d..7d2e55028 100644 --- a/core/rend/dx9/d3d_renderer.cpp +++ b/core/rend/dx9/d3d_renderer.cpp @@ -697,6 +697,7 @@ void D3DRenderer::drawModVols(int first, int count) devCache.SetRenderState(D3DRS_COLORWRITEENABLE, 0); int mod_base = -1; + int clip_rect[4] = {}; for (int cmv = 0; cmv < count; cmv++) { @@ -715,7 +716,6 @@ void D3DRenderer::drawModVols(int first, int count) else setMVS_Mode(Xor, param.isp); // XOR'ing (closed volume) - int clip_rect[4] = {}; setTileClip(param.tileclip, clip_rect); //TODO inside clipping @@ -733,6 +733,7 @@ void D3DRenderer::drawModVols(int first, int count) devCache.SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); //enable color writes devCache.SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE); + setTileClip(0, clip_rect); //black out any stencil with '1' devCache.SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index d79d8e824..38239508e 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -570,6 +570,7 @@ void DrawModVols(int first, int count) SetCull(0); //enable color writes glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); + SetBaseClipping(); //black out any stencil with '1' glcache.Enable(GL_BLEND); diff --git a/core/rend/vulkan/drawer.cpp b/core/rend/vulkan/drawer.cpp index 60b60363d..abfb99338 100644 --- a/core/rend/vulkan/drawer.cpp +++ b/core/rend/vulkan/drawer.cpp @@ -297,6 +297,7 @@ void Drawer::DrawModVols(const vk::CommandBuffer& cmdBuffer, int first, int coun int mod_base = -1; vk::Pipeline pipeline; + vk::Rect2D scissorRect; for (int cmv = 0; cmv < count; cmv++) { @@ -317,7 +318,6 @@ void Drawer::DrawModVols(const vk::CommandBuffer& cmdBuffer, int first, int coun cmdBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline); descriptorSets.bindPerPolyDescriptorSets(cmdBuffer, param, first + cmv, curMainBuffer, offsets.naomi2ModVolOffset); - vk::Rect2D scissorRect; SetTileClip(cmdBuffer, param.tileclip, scissorRect); // TODO inside clipping @@ -333,6 +333,7 @@ void Drawer::DrawModVols(const vk::CommandBuffer& cmdBuffer, int first, int coun } } cmdBuffer.bindVertexBuffers(0, curMainBuffer, {0}); + SetTileClip(cmdBuffer, 0, scissorRect); const std::array pushConstants = { 1 - FPU_SHAD_SCALE.scale_factor / 256.f, 0, 0, 0, 0, 0 }; cmdBuffer.pushConstants(pipelineManager->GetPipelineLayout(), vk::ShaderStageFlagBits::eFragment, 0, pushConstants);