Mesa (master): r300g: fix loading compressed textures
Marek Olšák
mareko at kemper.freedesktop.org
Tue Jun 8 22:18:56 UTC 2010
Module: Mesa
Branch: master
Commit: 25470dcbb16a462294ee6a714176929be8a26bf1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=25470dcbb16a462294ee6a714176929be8a26bf1
Author: Marek Olšák <maraeo at gmail.com>
Date: Wed Jun 9 00:18:02 2010 +0200
r300g: fix loading compressed textures
---
src/gallium/drivers/r300/r300_transfer.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 0d88d74..3eabe23 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -107,7 +107,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
struct r300_screen *r300screen = r300_screen(ctx->screen);
struct r300_transfer *trans;
struct pipe_resource base;
- boolean referenced_cs, referenced_hw;
+ boolean referenced_cs, referenced_hw, blittable;
referenced_cs = r300screen->rws->is_buffer_referenced(
r300screen->rws, tex->buffer, R300_REF_CS);
@@ -118,6 +118,10 @@ r300_texture_get_transfer(struct pipe_context *ctx,
r300screen->rws, tex->buffer, R300_REF_HW);
}
+ blittable = ctx->screen->is_format_supported(
+ ctx->screen, texture->format, texture->target, 0,
+ PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, 0);
+
trans = CALLOC_STRUCT(r300_transfer);
if (trans) {
/* Initialize the transfer object. */
@@ -130,7 +134,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
* for this transfer.
* Also make write transfers pipelined. */
if (tex->microtile || tex->macrotile ||
- (referenced_hw & !(usage & PIPE_TRANSFER_READ))) {
+ ((referenced_hw & !(usage & PIPE_TRANSFER_READ)) && blittable)) {
base.target = PIPE_TEXTURE_2D;
base.format = texture->format;
base.width0 = box->width;
More information about the mesa-commit
mailing list