r600: minor fixes
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 29 Jul 2009 19:15:36 +0000 (15:15 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 29 Jul 2009 21:25:56 +0000 (17:25 -0400)
- set MAX_LOD properly
- min texel pitch is 8 texels
- emit old command buffer when re-initing base state

src/mesa/drivers/dri/r600/r600_tex.c
src/mesa/drivers/dri/r600/r600_texstate.c
src/mesa/drivers/dri/r600/r700_state.c

index 853f824b2c05f1d7683a47cc4f77246fb51725fd..6d531bf0f938b1eb29f63d26f82bab2c7bb4d41d 100644 (file)
@@ -160,7 +160,7 @@ static void r600SetTexDefaultState(radeonTexObjPtr t)
         SETfield(t->SQ_TEX_SAMPLER0, SQ_TEX_BORDER_COLOR_TRANS_BLACK, BORDER_COLOR_TYPE_shift, BORDER_COLOR_TYPE_mask);
 
         t->SQ_TEX_SAMPLER1                           = 0;
-        SETfield(t->SQ_TEX_SAMPLER1, MAX_LOD_mask, MAX_LOD_shift, MAX_LOD_mask);
+        SETfield(t->SQ_TEX_SAMPLER1, 0x3ff, MAX_LOD_shift, MAX_LOD_mask);
 
         t->SQ_TEX_SAMPLER2                          = 0;
         SETbit(t->SQ_TEX_SAMPLER2, SQ_TEX_SAMPLER_WORD2_0__TYPE_bit);
index 1cf3b484ae6ad3872dd10c5c0242a8480097aff5..70dd5404811e15a5bc6557a6c90a785749ee619e 100644 (file)
@@ -598,6 +598,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex
        uTexelPitch = (firstImage->Width + R700_TEXEL_PITCH_ALIGNMENT_MASK)
                & ~R700_TEXEL_PITCH_ALIGNMENT_MASK;
 
+       /* min pitch is 8 */
+       if (uTexelPitch < 8)
+               uTexelPitch = 8;
+
        SETfield(t->SQ_TEX_RESOURCE0, (uTexelPitch/8)-1, PITCH_shift, PITCH_mask);
        SETfield(t->SQ_TEX_RESOURCE0, firstImage->Width - 1,
                 TEX_WIDTH_shift, TEX_WIDTH_mask);
@@ -751,6 +755,11 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
 
        pitch_val = (pitch_val + R700_TEXEL_PITCH_ALIGNMENT_MASK)
                & ~R700_TEXEL_PITCH_ALIGNMENT_MASK;
+
+       /* min pitch is 8 */
+       if (pitch_val < 8)
+               pitch_val = 8;
+
        SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, PITCH_shift, PITCH_mask);
 }
 
@@ -898,6 +907,10 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = (pitch_val + R700_TEXEL_PITCH_ALIGNMENT_MASK)
                & ~R700_TEXEL_PITCH_ALIGNMENT_MASK;
 
+       /* min pitch is 8 */
+       if (pitch_val < 8)
+               pitch_val = 8;
+
        SETfield(t->SQ_TEX_RESOURCE0, (pitch_val/8)-1, PITCH_shift, PITCH_mask);
        SETfield(t->SQ_TEX_RESOURCE0, rb->base.Width - 1,
                 TEX_WIDTH_shift, TEX_WIDTH_mask);
index 87ea1719c49a31538661d9ade7915b0946bdc24e..e0a57425917bcd685c5dde15e148f5a87e5f83fc 100644 (file)
@@ -1638,9 +1638,10 @@ static void r700InitSQConfig(GLcontext * ctx)
 void r700InitState(GLcontext * ctx) //-------------------
 {
     context_t *context = R700_CONTEXT(ctx);
-
     R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
 
+    radeon_firevertices(&context->radeon);
+
     r700->TA_CNTL_AUX.u32All = 0;
     SETfield(r700->TA_CNTL_AUX.u32All, 28, TD_FIFO_CREDIT_shift, TD_FIFO_CREDIT_mask);
     r700->VC_ENHANCE.u32All = 0;