Skip to content

Commit 2ab5942

Browse files
committed
Fix depth-only rendering.
1 parent 24dddf9 commit 2ab5942

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

MarathonRecomp/gpu/video.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,8 +3474,7 @@ static void SetDefaultViewport(GuestDevice* device, GuestSurface* surface)
34743474

34753475
static void SetRenderTarget(GuestDevice* device, uint32_t index, GuestSurface* renderTarget)
34763476
{
3477-
// printf("SetRenderTarget %x %d %x\n", device, index, renderTarget);
3478-
if (renderTarget != nullptr)
3477+
if (index == 0)
34793478
{
34803479
RenderCommand cmd;
34813480
cmd.type = RenderCommandType::SetRenderTarget;
@@ -3484,6 +3483,11 @@ static void SetRenderTarget(GuestDevice* device, uint32_t index, GuestSurface* r
34843483

34853484
SetDefaultViewport(device, renderTarget);
34863485
}
3486+
else
3487+
{
3488+
// Multiple targets are not currently handled. Make sure any attempt to set them is nullptr.
3489+
assert(renderTarget == nullptr);
3490+
}
34873491
}
34883492

34893493
static void ProcSetRenderTarget(const RenderCommand& cmd)
@@ -3499,7 +3503,6 @@ static void ProcSetRenderTarget(const RenderCommand& cmd)
34993503

35003504
static void SetDepthStencilSurface(GuestDevice* device, GuestSurface* depthStencil)
35013505
{
3502-
// printf("SetDepthStencilSurface: %x\n", depthStencil);
35033506
RenderCommand cmd;
35043507
cmd.type = RenderCommandType::SetDepthStencilSurface;
35053508
cmd.setDepthStencilSurface.depthStencil = depthStencil;

0 commit comments

Comments
 (0)