Skip to content

Commit bf2e070

Browse files
committed
fix(d3d11): handle scissor boundary of UAV only rendering
1 parent d8c63f2 commit bf2e070

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/d3d11/d3d11_context_impl.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4513,8 +4513,12 @@ template <typename ContextInternalState> class MTLD3D11DeviceContextImplBase : p
45134513
});
45144514
}
45154515
if (dirty_state.any(DirtyState::Scissors)) {
4516-
auto render_target_width = state_.OutputMerger.RenderTargetWidth;
4517-
auto render_target_height = state_.OutputMerger.RenderTargetHeight;
4516+
auto render_target_width = state_.OutputMerger.RenderTargetWidth == 0
4517+
? state_.Rasterizer.viewports[0].Width
4518+
: state_.OutputMerger.RenderTargetWidth;
4519+
auto render_target_height = state_.OutputMerger.RenderTargetHeight == 0
4520+
? state_.Rasterizer.viewports[0].Height
4521+
: state_.OutputMerger.RenderTargetHeight;
45184522
auto scissors = AllocateCommandData<WMTScissorRect>(state_.Rasterizer.NumViewports);
45194523
for (unsigned i = 0; i < state_.Rasterizer.NumViewports; i++) {
45204524
if (allow_scissor) {

0 commit comments

Comments
 (0)