mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
r300: fix viewport inversion for FBOs
This commit is contained in:
parent
8ab7c77dc2
commit
712478cfdd
1 changed files with 12 additions and 2 deletions
|
|
@ -933,11 +933,21 @@ static void r300UpdateWindow(GLcontext * ctx)
|
|||
GLfloat xoffset = dPriv ? (GLfloat) dPriv->x : 0;
|
||||
GLfloat yoffset = dPriv ? (GLfloat) dPriv->y + dPriv->h : 0;
|
||||
const GLfloat *v = ctx->Viewport._WindowMap.m;
|
||||
const GLboolean render_to_fbo = (ctx->DrawBuffer ? (ctx->DrawBuffer->Name != 0) : 0);
|
||||
GLfloat y_scale, y_bias;
|
||||
|
||||
if (render_to_fbo) {
|
||||
y_scale = 1.0;
|
||||
y_bias = 0;
|
||||
} else {
|
||||
y_scale = -1.0;
|
||||
y_bias = yoffset;
|
||||
}
|
||||
|
||||
GLfloat sx = v[MAT_SX];
|
||||
GLfloat tx = v[MAT_TX] + xoffset + SUBPIXEL_X;
|
||||
GLfloat sy = -v[MAT_SY];
|
||||
GLfloat ty = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
|
||||
GLfloat sy = v[MAT_SY] * y_scale;
|
||||
GLfloat ty = (v[MAT_TY] * y_scale) + y_bias + SUBPIXEL_Y;
|
||||
GLfloat sz = v[MAT_SZ] * rmesa->radeon.state.depth.scale;
|
||||
GLfloat tz = v[MAT_TZ] * rmesa->radeon.state.depth.scale;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue