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 <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2011-10-10 20:35:34 +01:00
parent 8d3e505ed6
commit 95fd5e5aba
4 changed files with 5 additions and 28 deletions
+3 -11
View File
@@ -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)
+2 -4
View File
@@ -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;
-4
View File
@@ -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)
-9
View File
@@ -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]) |