mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-29 11:20:40 +00:00
Fix vertex preview when framebuf is an odd size.
The previous stuff was wrong, just happened to work.
This commit is contained in:
parent
ed16e42ca8
commit
6d6dff6041
@ -77,6 +77,14 @@ struct SimpleGLWindow {
|
||||
return h_;
|
||||
}
|
||||
|
||||
int TexWidth() {
|
||||
return tw_;
|
||||
}
|
||||
|
||||
int TexHeight() {
|
||||
return th_;
|
||||
}
|
||||
|
||||
void GetContentSize(float &x, float &y, float &fw, float &fh);
|
||||
|
||||
static void RegisterClass();
|
||||
|
@ -177,12 +177,12 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glViewport(x, -y, fw, fh);
|
||||
glViewport(x, y, fw, fh);
|
||||
glScissor(x, y, fw, fh);
|
||||
BindPreviewProgram(previewProgram);
|
||||
|
||||
Matrix4x4 ortho;
|
||||
ortho.setOrtho(0, fw, fh, 0, -1, 1);
|
||||
ortho.setOrtho(0, frameWindow->TexWidth(), frameWindow->TexHeight(), 0, -1, 1);
|
||||
glUniformMatrix4fv(previewProgram->u_viewproj, 1, GL_FALSE, ortho.getReadPtr());
|
||||
glEnableVertexAttribArray(previewProgram->a_position);
|
||||
glVertexAttribPointer(previewProgram->a_position, 3, GL_FLOAT, GL_FALSE, sizeof(GPUDebugVertex), (float *)vertices.data() + 2);
|
||||
|
Loading…
Reference in New Issue
Block a user