From ec4c74a9dc10039d97ad24c4f16bd2400517991d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 9 Oct 2012 18:18:31 +0200 Subject: [PATCH] st/mesa: use the renderbuffer chosen by core Mesa in CopyTexSubImage Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_cb_texture.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 473ff3a94c5..a5d997efca4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -915,8 +915,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, { struct st_texture_image *stImage = st_texture_image(texImage); const GLenum texBaseFormat = texImage->_BaseFormat; - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct st_renderbuffer *strb; + struct st_renderbuffer *strb = st_renderbuffer(rb); struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; @@ -933,16 +932,6 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, */ if (0) st_validate_state(st); - /* determine if copying depth or color data */ - if (texBaseFormat == GL_DEPTH_COMPONENT || - texBaseFormat == GL_DEPTH_STENCIL) { - strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); - } - else { - /* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */ - strb = st_renderbuffer(fb->_ColorReadBuffer); - } - if (!strb || !strb->surface || !stImage->pt) { debug_printf("%s: null strb or stImage\n", __FUNCTION__); return; -- 2.30.2