r600: set tiling correctly for texturing from depth buffer
authorAlex Deucher <alexdeucher@gmail.com>
Sat, 16 Jan 2010 01:54:12 +0000 (20:54 -0500)
committerAlex Deucher <alexdeucher@gmail.com>
Sat, 16 Jan 2010 04:04:09 +0000 (23:04 -0500)
src/mesa/drivers/dri/r600/r600_texstate.c

index fb5abdcadcae6a11e0fec376b0815f165243e77d..61c97306277db194ae3cd9380780f742b9e1f030 100644 (file)
@@ -85,6 +85,7 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
        CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
        CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
        CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
+       CLEARbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit);
 
        SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED,
                 FORMAT_COMP_X_shift, FORMAT_COMP_X_mask);
@@ -95,6 +96,11 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
        SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED,
                 FORMAT_COMP_W_shift, FORMAT_COMP_W_mask);
 
+       CLEARbit(t->SQ_TEX_RESOURCE0, TILE_TYPE_bit);
+       SETfield(t->SQ_TEX_RESOURCE0, ARRAY_LINEAR_GENERAL,
+                SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_shift,
+                SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_mask);
+
        switch (mesa_format) /* This is mesa format. */
        {
        case MESA_FORMAT_RGBA8888:
@@ -515,6 +521,10 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
        case MESA_FORMAT_Z24_S8:
        case MESA_FORMAT_Z32:
        case MESA_FORMAT_S8:
+               SETbit(t->SQ_TEX_RESOURCE0, TILE_TYPE_bit);
+               SETfield(t->SQ_TEX_RESOURCE0, ARRAY_1D_TILED_THIN1,
+                        SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_shift,
+                        SQ_TEX_RESOURCE_WORD0_0__TILE_MODE_mask);
                switch (mesa_format) {
                case MESA_FORMAT_Z16:
                        SETfield(t->SQ_TEX_RESOURCE1, FMT_16,