Merge branch 'mesa_7_5_branch'

This commit is contained in:
Brian Paul
2009-05-01 18:21:02 -06:00
2 changed files with 27 additions and 6 deletions
+16 -5
View File
@@ -51,6 +51,17 @@
#include "mtypes.h"
/**
* State changes which we care about for glCopyTex[Sub]Image() calls.
* In particular, we care about pixel transfer state and buffer state
* (such as glReadBuffer to make sure we read from the right renderbuffer).
*/
#define NEW_COPY_TEX_STATE (_MESA_NEW_TRANSFER_STATE | \
_NEW_BUFFERS | \
_NEW_PIXEL)
/**
* We allocate texture memory on 512-byte boundaries so we can use MMX/SSE
* elsewhere.
@@ -3008,7 +3019,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
if (ctx->NewState & NEW_COPY_TEX_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -3073,7 +3084,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
if (ctx->NewState & NEW_COPY_TEX_STATE)
_mesa_update_state(ctx);
#if FEATURE_convolve
@@ -3141,7 +3152,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
if (ctx->NewState & NEW_COPY_TEX_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 1, target, level))
@@ -3196,7 +3207,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
if (ctx->NewState & NEW_COPY_TEX_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 2, target, level))
@@ -3251,7 +3262,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->NewState & _MESA_NEW_TRANSFER_STATE)
if (ctx->NewState & NEW_COPY_TEX_STATE)
_mesa_update_state(ctx);
if (copytexsubimage_error_check1(ctx, 3, target, level))
+11 -1
View File
@@ -345,6 +345,7 @@ st_render_texture(GLcontext *ctx,
struct gl_framebuffer *fb,
struct gl_renderbuffer_attachment *att)
{
struct pipe_screen *screen = ctx->st->pipe->screen;
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
@@ -367,6 +368,8 @@ st_render_texture(GLcontext *ctx,
rb->AllocStorage = NULL; /* should not get called */
strb = st_renderbuffer(rb);
assert(strb->Base.RefCount > 0);
/* get the texture for the texture object */
stObj = st_texture_object(att->Texture);
@@ -386,7 +389,14 @@ st_render_texture(GLcontext *ctx,
pipe_surface_reference(&strb->surface, NULL);
/* the new surface will be created during framebuffer validation */
/* new surface for rendering into the texture */
strb->surface = screen->get_tex_surface(screen,
strb->texture,
strb->rtt_face,
strb->rtt_level,
strb->rtt_slice,
PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_GPU_WRITE);
init_renderbuffer_bits(strb, pt->format);