r600g: fix "Fixed-Point Data Conversions"
authorChristian König <deathsimple@vodafone.de>
Sat, 21 May 2011 13:37:29 +0000 (15:37 +0200)
committerChristian König <deathsimple@vodafone.de>
Sat, 21 May 2011 14:40:20 +0000 (16:40 +0200)
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 654b04ea1bd42a8e5031323b22fa640841d8df31..187f00e1e52cf05f0c00bafbc7d0c2c5c9386729 100644 (file)
@@ -424,7 +424,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
                                (tmp->offset[1] + r600_bo_offset(bo[1])) >> 8, 0xFFFFFFFF, bo[1]);
        r600_pipe_state_add_reg(rstate, R_030010_RESOURCE0_WORD4,
                                word4 |
-                               S_030010_SRF_MODE_ALL(V_030010_SRF_MODE_NO_ZERO) |
+                               S_030010_SRF_MODE_ALL(V_030010_SRF_MODE_ZERO_CLAMP_MINUS_ONE) |
                                S_030010_ENDIAN_SWAP(endian) |
                                S_030010_BASE_LEVEL(state->u.tex.first_level), 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_030014_RESOURCE0_WORD5,
index 960fb29c6e1215513b27c19dd71ac51359959c90..21e6abcb1f6e34923d8dfbc2027d6803ccd0a8c7 100644 (file)
@@ -485,7 +485,7 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
                                (tmp->offset[1] + r600_bo_offset(bo[1])) >> 8, 0xFFFFFFFF, bo[1]);
        r600_pipe_state_add_reg(rstate, R_038010_RESOURCE0_WORD4,
                                word4 |
-                               S_038010_SRF_MODE_ALL(V_038010_SRF_MODE_NO_ZERO) |
+                               S_038010_SRF_MODE_ALL(V_038010_SRF_MODE_ZERO_CLAMP_MINUS_ONE) |
                                S_038010_REQUEST_SIZE(1) |
                                S_038010_ENDIAN_SWAP(endian) |
                                S_038010_BASE_LEVEL(state->u.tex.first_level), 0xFFFFFFFF, NULL);