summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_zscan.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-13 23:33:20 +0200
committerChristian König <[email protected]>2011-07-13 23:33:20 +0200
commitd4cbd1272b723ba0da03a9664ee85452f8f2d457 (patch)
treec254b4b349fa290e97e3a612957ccccc31e12348 /src/gallium/auxiliary/vl/vl_zscan.c
parented24e19070b7dff12670151b2d184f31c845ccae (diff)
[g3dvl] don't upload all quant buffer layers at once
There seems to be a bug in r600g when uploading more than one layer of a 3D resource at once with a hardware blit. So just do them one at a time to workaround this.
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_zscan.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_zscan.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index 58cee0070d8..a26d8398f92 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -525,26 +525,23 @@ vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *la
}
void
-vl_zscan_upload_quant(struct vl_zscan_buffer *buffer,
- const uint8_t intra_matrix[64],
- const uint8_t non_intra_matrix[64])
+vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], bool intra)
{
struct pipe_context *pipe;
struct pipe_transfer *buf_transfer;
unsigned x, y, i, pitch;
- uint8_t *intra, *non_intra;
+ uint8_t *data;
struct pipe_box rect =
{
- 0, 0, 0,
+ 0, 0, intra ? 1 : 0,
BLOCK_WIDTH,
BLOCK_HEIGHT,
- 2
+ 1
};
assert(buffer);
- assert(intra_matrix);
- assert(non_intra_matrix);
+ assert(matrix);
pipe = buffer->zscan->pipe;
@@ -561,18 +558,14 @@ vl_zscan_upload_quant(struct vl_zscan_buffer *buffer,
pitch = buf_transfer->stride;
- non_intra = pipe->transfer_map(pipe, buf_transfer);
- if (!non_intra)
+ data = pipe->transfer_map(pipe, buf_transfer);
+ if (!data)
goto error_map;
- intra = non_intra + BLOCK_HEIGHT * pitch;
-
for (i = 0; i < buffer->zscan->blocks_per_line; ++i)
for (y = 0; y < BLOCK_HEIGHT; ++y)
- for (x = 0; x < BLOCK_WIDTH; ++x) {
- intra[i * BLOCK_WIDTH + y * pitch + x] = intra_matrix[x + y * BLOCK_WIDTH];
- non_intra[i * BLOCK_WIDTH + y * pitch + x] = non_intra_matrix[x + y * BLOCK_WIDTH];
- }
+ for (x = 0; x < BLOCK_WIDTH; ++x)
+ data[i * BLOCK_WIDTH + y * pitch + x] = matrix[x + y * BLOCK_WIDTH];
pipe->transfer_unmap(pipe, buf_transfer);