diff options
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_tex.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texstate.c | 20 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 4725f38ae8..2d3bb619cd 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -339,6 +339,7 @@ static const __DRItexOffsetExtension radeonTexOffsetExtension = { static const __DRItexBufferExtension radeonTexBufferExtension = { { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, radeonSetTexBuffer, + radeonSetTexBuffer2, }; #endif @@ -358,6 +359,7 @@ static const __DRItexOffsetExtension r200texOffsetExtension = { static const __DRItexBufferExtension r200TexBufferExtension = { { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, r200SetTexBuffer, + r200SetTexBuffer2, }; #endif @@ -370,6 +372,7 @@ static const __DRItexOffsetExtension r300texOffsetExtension = { static const __DRItexBufferExtension r300TexBufferExtension = { { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, r300SetTexBuffer, + r300SetTexBuffer2, }; #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.h b/src/mesa/drivers/dri/radeon/radeon_tex.h index 4c2fba4489..8d8afb4343 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.h +++ b/src/mesa/drivers/dri/radeon/radeon_tex.h @@ -42,6 +42,9 @@ extern void radeonSetTexOffset(__DRIcontext *pDRICtx, GLint texname, GLuint pitch); extern void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv); +externvoid radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_format, + __DRIdrawable *dPriv); + extern void radeonUpdateTextureState( GLcontext *ctx ); extern int radeonUploadTexImages( r100ContextPtr rmesa, radeonTexObjPtr t, diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 0ece1acbeb..78e2a08559 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -637,7 +637,8 @@ void radeonSetTexOffset(__DRIcontext * pDRICtx, GLint texname, } } -void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) +void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_format, + __DRIdrawable *dPriv) { struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; @@ -649,8 +650,11 @@ void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPri struct radeon_framebuffer *rfb; radeonTexObjPtr t; uint32_t pitch_val; + uint32_t internalFormat, type, format; - target = GL_TEXTURE_RECTANGLE_ARB; + type = GL_BGRA; + format = GL_UNSIGNED_BYTE; + internalFormat = (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT ? 3 : 4); radeon = pDRICtx->driverPrivate; rmesa = pDRICtx->driverPrivate; @@ -701,10 +705,11 @@ void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPri radeon_miptree_unreference(rImage->mt); rImage->mt = NULL; } - fprintf(stderr,"settexbuf %d %dx%d@%d\n", rb->pitch, rb->width, rb->height, rb->cpp); _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->width, rb->height, 1, 0, rb->cpp); - texImage->TexFormat = &_mesa_texformat_rgba8888_rev; + texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx, + internalFormat, + type, format); rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; @@ -740,6 +745,13 @@ void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPri return; } + +void radeonSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) +{ + radeonSetTexBuffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv); +} + + #define TEXOBJ_TXFILTER_MASK (RADEON_MAX_MIP_LEVEL_MASK | \ RADEON_MIN_FILTER_MASK | \ RADEON_MAG_FILTER_MASK | \ |