r600g: use format from the sampler view not from the texture.

we want to use the format from the sampler view which isn't always the
same as the texture format when creating sampler views.
This commit is contained in:
Dave Airlie 2010-10-07 15:13:09 +10:00
parent 84457701b0
commit 97eea87bde
2 changed files with 6 additions and 6 deletions

View file

@ -424,15 +424,15 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
swizzle[1] = state->swizzle_g;
swizzle[2] = state->swizzle_b;
swizzle[3] = state->swizzle_a;
format = r600_translate_texformat(texture->format,
format = r600_translate_texformat(state->format,
swizzle,
&word4, &yuv_format);
if (format == ~0) {
format = 0;
}
desc = util_format_description(texture->format);
desc = util_format_description(state->format);
if (desc == NULL) {
R600_ERR("unknow format %d\n", texture->format);
R600_ERR("unknow format %d\n", state->format);
}
tmp = (struct r600_resource_texture*)texture;
rbuffer = &tmp->resource;

View file

@ -626,15 +626,15 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
swizzle[1] = state->swizzle_g;
swizzle[2] = state->swizzle_b;
swizzle[3] = state->swizzle_a;
format = r600_translate_texformat(texture->format,
format = r600_translate_texformat(state->format,
swizzle,
&word4, &yuv_format);
if (format == ~0) {
format = 0;
}
desc = util_format_description(texture->format);
desc = util_format_description(state->format);
if (desc == NULL) {
R600_ERR("unknow format %d\n", texture->format);
R600_ERR("unknow format %d\n", state->format);
}
tmp = (struct r600_resource_texture*)texture;
rbuffer = &tmp->resource;