aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_zscan.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-01-25 11:53:00 +0100
committerChristian König <[email protected]>2012-02-06 10:35:59 +0100
commit70a7695b4d1bd3f609eb9f98dd6872f1a5b89762 (patch)
treef9e9a19aa5210f3cab5092bdfdf9c7eb551ba316 /src/gallium/auxiliary/vl/vl_zscan.c
parent3ac959492d27a8473256bb7a25135f44b5d1a0f4 (diff)
vl: prefix size defines with VL_
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_zscan.c')
-rw-r--r--src/gallium/auxiliary/vl/vl_zscan.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index 6ff4056a241..762ab3f2841 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -109,8 +109,8 @@ create_vert_shader(struct vl_zscan *zscan)
o_vtex = MALLOC(zscan->num_channels * sizeof(struct ureg_dst));
scale = ureg_imm2f(shader,
- (float)BLOCK_WIDTH / zscan->buffer_width,
- (float)BLOCK_HEIGHT / zscan->buffer_height);
+ (float)VL_BLOCK_WIDTH / zscan->buffer_width,
+ (float)VL_BLOCK_HEIGHT / zscan->buffer_height);
vrect = ureg_DECL_vs_input(shader, VS_I_RECT);
vpos = ureg_DECL_vs_input(shader, VS_I_VPOS);
@@ -147,7 +147,8 @@ create_vert_shader(struct vl_zscan *zscan)
for (i = 0; i < zscan->num_channels; ++i) {
ureg_ADD(shader, ureg_writemask(tmp, TGSI_WRITEMASK_X), ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_Y),
- ureg_imm1f(shader, 1.0f / (zscan->blocks_per_line * BLOCK_WIDTH) * (i - (signed)zscan->num_channels / 2)));
+ ureg_imm1f(shader, 1.0f / (zscan->blocks_per_line * VL_BLOCK_WIDTH)
+ * (i - (signed)zscan->num_channels / 2)));
ureg_MAD(shader, ureg_writemask(o_vtex[i], TGSI_WRITEMASK_X), vrect,
ureg_imm1f(shader, 1.0f / zscan->blocks_per_line), ureg_src(tmp));
@@ -343,7 +344,7 @@ cleanup_state(struct vl_zscan *zscan)
struct pipe_sampler_view *
vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks_per_line)
{
- const unsigned total_size = blocks_per_line * BLOCK_WIDTH * BLOCK_HEIGHT;
+ const unsigned total_size = blocks_per_line * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT;
int patched_layout[64];
@@ -356,8 +357,8 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks
struct pipe_box rect =
{
0, 0, 0,
- BLOCK_WIDTH * blocks_per_line,
- BLOCK_HEIGHT,
+ VL_BLOCK_WIDTH * blocks_per_line,
+ VL_BLOCK_HEIGHT,
1
};
@@ -369,8 +370,8 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks
memset(&res_tmpl, 0, sizeof(res_tmpl));
res_tmpl.target = PIPE_TEXTURE_2D;
res_tmpl.format = PIPE_FORMAT_R32_FLOAT;
- res_tmpl.width0 = BLOCK_WIDTH * blocks_per_line;
- res_tmpl.height0 = BLOCK_HEIGHT;
+ res_tmpl.width0 = VL_BLOCK_WIDTH * blocks_per_line;
+ res_tmpl.height0 = VL_BLOCK_HEIGHT;
res_tmpl.depth0 = 1;
res_tmpl.array_size = 1;
res_tmpl.usage = PIPE_USAGE_IMMUTABLE;
@@ -396,14 +397,14 @@ vl_zscan_layout(struct pipe_context *pipe, const int layout[64], unsigned blocks
goto error_map;
for (i = 0; i < blocks_per_line; ++i)
- for (y = 0; y < BLOCK_HEIGHT; ++y)
- for (x = 0; x < BLOCK_WIDTH; ++x) {
- float addr = patched_layout[x + y * BLOCK_WIDTH] +
- i * BLOCK_WIDTH * BLOCK_HEIGHT;
+ for (y = 0; y < VL_BLOCK_HEIGHT; ++y)
+ for (x = 0; x < VL_BLOCK_WIDTH; ++x) {
+ float addr = patched_layout[x + y * VL_BLOCK_WIDTH] +
+ i * VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT;
addr /= total_size;
- f[i * BLOCK_WIDTH + y * pitch + x] = addr;
+ f[i * VL_BLOCK_WIDTH + y * pitch + x] = addr;
}
pipe->transfer_unmap(pipe, buf_transfer);
@@ -493,8 +494,8 @@ vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
memset(&res_tmpl, 0, sizeof(res_tmpl));
res_tmpl.target = PIPE_TEXTURE_3D;
res_tmpl.format = PIPE_FORMAT_R8_UNORM;
- res_tmpl.width0 = BLOCK_WIDTH * zscan->blocks_per_line;
- res_tmpl.height0 = BLOCK_HEIGHT;
+ res_tmpl.width0 = VL_BLOCK_WIDTH * zscan->blocks_per_line;
+ res_tmpl.height0 = VL_BLOCK_HEIGHT;
res_tmpl.depth0 = 2;
res_tmpl.array_size = 1;
res_tmpl.usage = PIPE_USAGE_IMMUTABLE;
@@ -547,8 +548,8 @@ vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
struct pipe_box rect =
{
0, 0, intra ? 1 : 0,
- BLOCK_WIDTH,
- BLOCK_HEIGHT,
+ VL_BLOCK_WIDTH,
+ VL_BLOCK_HEIGHT,
1
};
@@ -575,9 +576,9 @@ vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
goto error_map;
for (i = 0; i < zscan->blocks_per_line; ++i)
- for (y = 0; y < BLOCK_HEIGHT; ++y)
- for (x = 0; x < BLOCK_WIDTH; ++x)
- data[i * BLOCK_WIDTH + y * pitch + x] = matrix[x + y * BLOCK_WIDTH];
+ for (y = 0; y < VL_BLOCK_HEIGHT; ++y)
+ for (x = 0; x < VL_BLOCK_WIDTH; ++x)
+ data[i * VL_BLOCK_WIDTH + y * pitch + x] = matrix[x + y * VL_BLOCK_WIDTH];
pipe->transfer_unmap(pipe, buf_transfer);