summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_transfer.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-12-29 18:18:38 +0100
committerMarek Olšák <[email protected]>2012-01-01 11:47:05 +0100
commitce9d61fec64138ebf8d0bec2511e66593297b7d5 (patch)
tree3e60c2743b8df17392415e7d22b0e10446343624 /src/gallium/drivers/r300/r300_transfer.c
parentce31970af16558ebd60cfae33c000252bc3e1cbf (diff)
r300g: rework resource_copy_region, not changing pipe_resource
Changing pipe_resource was wrong, because it can be used by other contexts at the same time. This fixes the last possible race condition in r300g that I know of. This also fixes blitting NPOT compressed textures. Random pixels sometimes appeared at the right-hand edge of the texture. Finally, this removes r300_texture_desc::stride_in_pixels. It makes little sense with sampler views and surfaces being able to override width0, height0, and the format entirely.
Diffstat (limited to 'src/gallium/drivers/r300/r300_transfer.c')
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 57d60a0e0fe..afdd530d15d 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -87,9 +87,7 @@ r300_texture_get_transfer(struct pipe_context *ctx,
struct r300_resource *tex = r300_resource(texture);
struct r300_transfer *trans;
struct pipe_resource base;
- boolean referenced_cs, referenced_hw, blittable;
- const struct util_format_description *desc =
- util_format_description(texture->format);
+ boolean referenced_cs, referenced_hw;
referenced_cs =
r300->rws->cs_is_buffer_referenced(r300->cs, tex->cs_buf);
@@ -100,10 +98,6 @@ r300_texture_get_transfer(struct pipe_context *ctx,
r300->rws->buffer_is_busy(tex->buf, RADEON_USAGE_READWRITE);
}
- blittable = desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ||
- desc->layout == UTIL_FORMAT_LAYOUT_S3TC ||
- desc->layout == UTIL_FORMAT_LAYOUT_RGTC;
-
trans = CALLOC_STRUCT(r300_transfer);
if (trans) {
/* Initialize the transfer object. */
@@ -116,7 +110,8 @@ r300_texture_get_transfer(struct pipe_context *ctx,
* for this transfer.
* Also make write transfers pipelined. */
if (tex->tex.microtile || tex->tex.macrotile[level] ||
- (referenced_hw && blittable && !(usage & PIPE_TRANSFER_READ))) {
+ (referenced_hw && !(usage & PIPE_TRANSFER_READ) &&
+ r300_is_blit_supported(texture->format))) {
if (r300->blitter->running) {
fprintf(stderr, "r300: ERROR: Blitter recursion in texture_get_transfer.\n");
os_break();