summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2013-02-15 11:03:08 -0800
committerAnuj Phogat <[email protected]>2013-02-22 12:03:59 -0800
commitcff862f90dbcf32395b0b2940c2446959314538a (patch)
treee612031cbee485d1dddb029b6ce5a888c3a47c92 /src/mesa
parent92a204b493b447b1cbb06a3d2d350a1e6d2c6887 (diff)
meta: Allocate texture before initializing texture coordinates
tex->Sright and tex->Ttop are initialized during texture allocation. This fixes depth buffer blitting failures in khronos conformance tests when run on desktop GL 3.0. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59495 Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/meta.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 4e32b506675..29a209edee1 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1910,6 +1910,14 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLuint *tmp = malloc(srcW * srcH * sizeof(GLuint));
if (tmp) {
+
+ newTex = alloc_texture(depthTex, srcW, srcH, GL_DEPTH_COMPONENT);
+ _mesa_ReadPixels(srcX, srcY, srcW, srcH, GL_DEPTH_COMPONENT,
+ GL_UNSIGNED_INT, tmp);
+ setup_drawpix_texture(ctx, depthTex, newTex, GL_DEPTH_COMPONENT,
+ srcW, srcH, GL_DEPTH_COMPONENT,
+ GL_UNSIGNED_INT, tmp);
+
/* texcoords (after texture allocation!) */
{
verts[0].s = 0.0F;
@@ -1928,15 +1936,6 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
if (!blit->DepthFP)
init_blit_depth_pixels(ctx);
- /* maybe change tex format here */
- newTex = alloc_texture(depthTex, srcW, srcH, GL_DEPTH_COMPONENT);
-
- _mesa_ReadPixels(srcX, srcY, srcW, srcH,
- GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp);
-
- setup_drawpix_texture(ctx, depthTex, newTex, GL_DEPTH_COMPONENT, srcW, srcH,
- GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp);
-
_mesa_BindProgramARB(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP);
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_TRUE);
_mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);