mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 19:25:18 +02:00
Fix vertex preview at odd render resolutions.
Note that the Windows resolution menu no longer seems to send a resize event?
This commit is contained in:
@@ -181,11 +181,17 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
|
||||
glScissor(x, y, fw, fh);
|
||||
BindPreviewProgram(previewProgram);
|
||||
|
||||
float scale[] = {
|
||||
480.0f / (float)PSP_CoreParameter().renderWidth,
|
||||
272.0f / (float)PSP_CoreParameter().renderHeight,
|
||||
};
|
||||
|
||||
Matrix4x4 ortho;
|
||||
ortho.setOrtho(0, frameWindow->TexWidth(), frameWindow->TexHeight(), 0, -1, 1);
|
||||
ortho.setOrtho(0, frameWindow->TexWidth() * scale[0], frameWindow->TexHeight() * scale[1], 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);
|
||||
|
||||
if (indices.empty()) {
|
||||
glDrawArrays(glprim[prim], 0, count);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user