diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
commit | 0f68236a2487dbeb0396b996debcda595b0b54a1 (patch) | |
tree | 938ae3b779349b6dba6f5a891550604f9a9ca895 /src/mesa/drivers/dri/r600/evergreen_tex.c | |
parent | d047168d81cfeb39a98f3ae16416872facc6237c (diff) | |
parent | 237880463d5168cad8df0bae6018b5fd76617777 (diff) |
Merge remote branch 'origin/master' into nvc0-new
Diffstat (limited to 'src/mesa/drivers/dri/r600/evergreen_tex.c')
-rw-r--r-- | src/mesa/drivers/dri/r600/evergreen_tex.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.c b/src/mesa/drivers/dri/r600/evergreen_tex.c index 58420ed123..3b5448a0e4 100644 --- a/src/mesa/drivers/dri/r600/evergreen_tex.c +++ b/src/mesa/drivers/dri/r600/evergreen_tex.c @@ -31,9 +31,7 @@ #include "main/enums.h" #include "main/image.h" #include "main/teximage.h" -#include "main/mipmap.h" #include "main/simple_list.h" -#include "main/texstore.h" #include "main/texobj.h" #include "texmem.h" @@ -1024,15 +1022,15 @@ static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask); SETfield(t->SQ_TEX_SAMPLER1, - EG_S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 6), + EG_S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 8), EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_shift, EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_mask); SETfield(t->SQ_TEX_SAMPLER1, - EG_S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 6), + EG_S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 8), EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_mask); SETfield(t->SQ_TEX_SAMPLER2, - EG_S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 6), + EG_S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 8), EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_shift, EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_mask); @@ -1152,6 +1150,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur radeonTexObjPtr t; uint32_t pitch_val; uint32_t internalFormat, type, format; + gl_format texFormat; type = GL_BGRA; format = GL_UNSIGNED_BYTE; @@ -1191,10 +1190,6 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur radeon_miptree_unreference(&t->mt); radeon_miptree_unreference(&rImage->mt); - _mesa_init_teximage_fields(radeon->glCtx, target, texImage, - rb->base.Width, rb->base.Height, 1, 0, rb->cpp); - texImage->RowStride = rb->pitch / rb->cpp; - rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; @@ -1205,6 +1200,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur switch (rb->cpp) { case 4: if (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB) { + texFormat = MESA_FORMAT_RGB888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); @@ -1218,6 +1214,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); } else { + texFormat = MESA_FORMAT_ARGB8888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); @@ -1236,6 +1233,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur case 3: default: // FMT_8_8_8 ??? + texFormat = MESA_FORMAT_RGB888; SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); @@ -1251,6 +1249,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur pitch_val /= 4; break; case 2: + texFormat = MESA_FORMAT_RGB565; SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask); @@ -1267,6 +1266,11 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur break; } + _mesa_init_teximage_fields(radeon->glCtx, target, texImage, + rb->base.Width, rb->base.Height, 1, 0, + rb->cpp, texFormat); + texImage->RowStride = rb->pitch / rb->cpp; + pitch_val = (pitch_val + R700_TEXEL_PITCH_ALIGNMENT_MASK) & ~R700_TEXEL_PITCH_ALIGNMENT_MASK; |