Skip to content

Commit

Permalink
[d3d8] Remove some uses of goto in CopyRects
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Jul 7, 2024
1 parent 137dbeb commit f73a82e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/d3d8/d3d8_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ namespace dxvk {

res = D3DERR_INVALIDCALL;

auto unhandled = [&] {
Logger::debug(str::format("CopyRects: Hit unhandled case from src pool ", srcDesc.Pool, " to dst pool ", dstDesc.Pool));
return D3DERR_INVALIDCALL;
};

switch (dstDesc.Pool) {

// Dest: DEFAULT
Expand Down Expand Up @@ -659,7 +664,7 @@ namespace dxvk {
case D3DPOOL_SCRATCH:
default: {
// TODO: Unhandled case.
goto unhandled;
return unhandled();
}
} break;

Expand Down Expand Up @@ -703,7 +708,7 @@ namespace dxvk {
case D3DPOOL_SCRATCH:
default: {
// TODO: Unhandled case.
goto unhandled;
return unhandled();
}
} break;

Expand Down Expand Up @@ -759,7 +764,7 @@ namespace dxvk {
case D3DPOOL_SCRATCH:
default: {
// TODO: Unhandled case.
goto unhandled;
return unhandled();
}
} break;
}
Expand All @@ -768,13 +773,9 @@ namespace dxvk {
case D3DPOOL_SCRATCH:
default: {
// TODO: Unhandled case.
goto unhandled;
return unhandled();
}
}

unhandled:
Logger::debug(str::format("CopyRects: Hit unhandled case from src pool ", srcDesc.Pool, " to dst pool ", dstDesc.Pool));
return D3DERR_INVALIDCALL;

done:
if (FAILED(res)) {
Expand Down

0 comments on commit f73a82e

Please sign in to comment.