Skip to content

Commit

Permalink
Workaround driver bugs(?) with D3D11 GL interop
Browse files Browse the repository at this point in the history
  • Loading branch information
CasualPokePlayer committed Jun 2, 2024
1 parent 1d5a9e5 commit 43a38a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Binary file modified Assets/dll/melonDS.wbx.zst
Binary file not shown.
9 changes: 4 additions & 5 deletions waterbox/melon/BizGLPresenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ out vec4 oColor;
void main()
{
vec4 pixel = texture(ScreenTex, fTexcoord);
oColor = vec4(pixel.bgr, 1.0);
}
)";
Expand Down Expand Up @@ -135,9 +134,9 @@ void Init(u32 scale)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, NDS_WIDTH, paddedHeight, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);
static u8 zeroData[NDS_WIDTH * 4 * 4]{};
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, NDS_HEIGHT / 2, NDS_WIDTH, 2, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, zeroData);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, NDS_WIDTH, paddedHeight, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);
static u32 zeroData[NDS_WIDTH * 2]{};
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, NDS_HEIGHT / 2, NDS_WIDTH, 2, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, zeroData);

glGenBuffers(1, &OutputPboID);

Expand Down Expand Up @@ -285,7 +284,7 @@ ECL_EXPORT void SetScreenSettings(const ScreenSettings* screenSettings, u32* wid
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Width, Height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, Width, Height, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);

glDeleteFramebuffers(1, &OutputFboID);
glGenFramebuffers(1, &OutputFboID);
Expand Down

0 comments on commit 43a38a0

Please sign in to comment.