mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-07-12 09:21:08 +00:00
Fix pass textures
This commit is contained in:
parent
2b9b65fe94
commit
e91e2157b2
1 changed files with 21 additions and 6 deletions
|
|
@ -2138,14 +2138,22 @@ static void gfx_process_lua_passes(Gfx *commands, bool *isLuaPassesActive) {
|
|||
gfx_sp_reset(); // resets the rsp
|
||||
sHasInverseCameraMatrix = false;
|
||||
|
||||
// bind pass textures if they exists
|
||||
// bind pass textures if they exist
|
||||
if (i > 0) {
|
||||
int textureSlotOffset = 10;
|
||||
uintptr_t lastValidPassTexture = 0;
|
||||
|
||||
for (int j = 0; j < i; j++) {
|
||||
if (gFramePasses[j].active && gFramePasses[j].passTexture != 0) {
|
||||
gfx_rapi->bind_texture_raw(textureSlotOffset + j, gFramePasses[j].passTexture);
|
||||
lastValidPassTexture = gFramePasses[j].passTexture;
|
||||
}
|
||||
}
|
||||
|
||||
// make the last valid pass texture always bind to slot 10
|
||||
if (lastValidPassTexture != 0) {
|
||||
gfx_rapi->bind_texture_raw(textureSlotOffset, lastValidPassTexture);
|
||||
}
|
||||
}
|
||||
|
||||
if (framePass->drawWorldGeometry) {
|
||||
|
|
@ -2181,11 +2189,6 @@ void gfx_run_basic(Gfx *commands) { // for dummy frames we don't want to do a mu
|
|||
}
|
||||
|
||||
void gfx_run(Gfx *commands) {
|
||||
// Shader TODO: Give directx support for frame passes
|
||||
/*if (gRenderApi == &gfx_direct3d11_api) {
|
||||
gfx_run_basic(commands);
|
||||
return;
|
||||
}*/
|
||||
if (!gfx_wapi->start_frame()) {
|
||||
sDroppedFrame = true;
|
||||
return;
|
||||
|
|
@ -2247,6 +2250,18 @@ void gfx_run(Gfx *commands) {
|
|||
gfx_rapi->bind_texture_raw(textureSlotOffset + i, gFramePasses[i].passTexture);
|
||||
}
|
||||
}
|
||||
|
||||
uintptr_t lastValidPassTexture = 0;
|
||||
for (int i = MAX_CUSTOM_FRAME_PASSES - 1; i >= 0; i--) {
|
||||
if (gFramePasses[i].active && gFramePasses[i].passTexture != 0) {
|
||||
lastValidPassTexture = gFramePasses[i].passTexture;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastValidPassTexture != 0) {
|
||||
gfx_rapi->bind_texture_raw(textureSlotOffset, lastValidPassTexture);
|
||||
}
|
||||
}
|
||||
|
||||
gfx_draw_fullscreen_quad(); // draw final quad
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue