summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-10-10 20:35:34 +0100
committerDave Airlie <[email protected]>2011-10-10 20:53:26 +0100
commit95fd5e5aba2e21ab20cb971506a81c0049b5a694 (patch)
treed112a103a7b42cbe2f6c431b22552bdcde9e7f90 /src/gallium/drivers
parent8d3e505ed66cbaa93782acdd5b296704392fcb06 (diff)
r600g: drop force int type workaround
now that we have integer texture types I can drop this workaround so that copies of values is done properly (as floats would fail on some corner cases). Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c14
-rw-r--r--src/gallium/drivers/r600/r600_blit.c6
-rw-r--r--src/gallium/drivers/r600/r600_resource.h4
-rw-r--r--src/gallium/drivers/r600/r600_state.c9
4 files changed, 5 insertions, 28 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index bc16be7dd92..92600f8d6d6 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1059,11 +1059,6 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
endian = r600_colorformat_endian_swap(format);
- if (tmp->force_int_type) {
- word4 &= C_030010_NUM_FORMAT_ALL;
- word4 |= S_030010_NUM_FORMAT_ALL(V_030010_SQ_NUM_FORMAT_INT);
- }
-
height = texture->height0;
depth = texture->depth0;
@@ -1361,6 +1356,8 @@ static void evergreen_cb(struct r600_pipe_context *rctx, struct r600_pipe_state
break;
}
}
+
+ ntype = V_028C70_NUMBER_UNORM;
if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB)
ntype = V_028C70_NUMBER_SRGB;
else if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
@@ -1373,8 +1370,7 @@ static void evergreen_cb(struct r600_pipe_context *rctx, struct r600_pipe_state
ntype = V_028C70_NUMBER_UNORM;
else if (desc->channel[i].pure_integer)
ntype = V_028C70_NUMBER_UINT;
- } else
- ntype = V_028C70_NUMBER_UNORM;
+ }
format = r600_translate_colorformat(surf->base.format);
swap = r600_translate_colorswap(surf->base.format);
@@ -1384,10 +1380,6 @@ static void evergreen_cb(struct r600_pipe_context *rctx, struct r600_pipe_state
endian = r600_colorformat_endian_swap(format);
}
- /* disable when gallium grows int textures */
- if ((format == FMT_32_32_32_32 || format == FMT_16_16_16_16) && rtex->force_int_type)
- ntype = V_028C70_NUMBER_UINT;
-
/* blend clamp should be set for all NORM/SRGB types */
if (ntype == V_028C70_NUMBER_UNORM || ntype == V_028C70_NUMBER_SNORM ||
ntype == V_028C70_NUMBER_SRGB)
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index 28e0e3c613a..6c4a66471ff 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -282,14 +282,13 @@ static void r600_compressed_to_blittable(struct pipe_resource *tex,
orig->height0 = tex->height0;
if (pixsize == 8)
- new_format = PIPE_FORMAT_R16G16B16A16_UNORM; /* 64-bit block */
+ new_format = PIPE_FORMAT_R16G16B16A16_UINT; /* 64-bit block */
else
- new_format = PIPE_FORMAT_R32G32B32A32_UNORM; /* 128-bit block */
+ new_format = PIPE_FORMAT_R32G32B32A32_UINT; /* 128-bit block */
new_width = util_format_get_nblocksx(tex->format, orig->width0);
new_height = util_format_get_nblocksy(tex->format, orig->height0);
- rtex->force_int_type = true;
tex->width0 = new_width;
tex->height0 = new_height;
tex->format = new_format;
@@ -300,7 +299,6 @@ static void r600_reset_blittable_to_compressed(struct pipe_resource *tex,
struct texture_orig_info *orig)
{
struct r600_resource_texture *rtex = (struct r600_resource_texture*)tex;
- rtex->force_int_type = false;
tex->format = orig->format;
tex->width0 = orig->width0;
diff --git a/src/gallium/drivers/r600/r600_resource.h b/src/gallium/drivers/r600/r600_resource.h
index 5120e27865c..ee10f3447ed 100644
--- a/src/gallium/drivers/r600/r600_resource.h
+++ b/src/gallium/drivers/r600/r600_resource.h
@@ -60,10 +60,6 @@ struct r600_resource_texture {
struct r600_resource_texture *stencil; /* Stencil is in a separate buffer on Evergreen. */
struct r600_resource_texture *flushed_depth_texture;
boolean is_flushing_texture;
-
- /* on some cards we have to use integer 64/128-bit types
- for s3tc blits, do this until gallium grows int formats */
- boolean force_int_type;
};
#define R600_TEX_IS_TILED(tex, level) ((tex)->array_mode[level] != V_038000_ARRAY_LINEAR_GENERAL && (tex)->array_mode[level] != V_038000_ARRAY_LINEAR_ALIGNED)
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 9c6c5deb907..23f308682e8 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -1097,11 +1097,6 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
endian = r600_colorformat_endian_swap(format);
- if (tmp->force_int_type) {
- word4 &= C_038010_NUM_FORMAT_ALL;
- word4 |= S_038010_NUM_FORMAT_ALL(V_038010_SQ_NUM_FORMAT_INT);
- }
-
offset_level = state->u.tex.first_level;
last_level = state->u.tex.last_level - offset_level;
width = u_minify(texture->width0, offset_level);
@@ -1487,10 +1482,6 @@ static void r600_cb(struct r600_pipe_context *rctx, struct r600_pipe_state *rsta
endian = r600_colorformat_endian_swap(format);
}
- /* disable when gallium grows int textures */
- if ((format == FMT_32_32_32_32 || format == FMT_16_16_16_16) && rtex->force_int_type)
- ntype = V_0280A0_NUMBER_UINT;
-
color_info = S_0280A0_FORMAT(format) |
S_0280A0_COMP_SWAP(swap) |
S_0280A0_ARRAY_MODE(rtex->array_mode[level]) |