diff options
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_idct.c')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_idct.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c index 75e76c09f63..645d06a0925 100644 --- a/src/gallium/auxiliary/vl/vl_idct.c +++ b/src/gallium/auxiliary/vl/vl_idct.c @@ -32,6 +32,7 @@ #include <util/u_draw.h> #include <util/u_sampler.h> +#include <util/u_memory.h> #include <tgsi/tgsi_ureg.h> @@ -219,7 +220,9 @@ create_mismatch_frag_shader(struct vl_idct *idct) } for (i = 0; i < 8; ++i) { - struct ureg_src s_addr[2] = { ureg_src(m[i][0]), ureg_src(m[i][1]) }; + struct ureg_src s_addr[2]; + s_addr[0] = ureg_src(m[i][0]); + s_addr[1] = ureg_src(m[i][1]); fetch_four(shader, m[i], s_addr, ureg_DECL_sampler(shader, 0), false); } @@ -323,7 +326,7 @@ create_stage1_frag_shader(struct vl_idct *idct) struct ureg_src l_addr[2], r_addr[2]; struct ureg_dst l[4][2], r[2]; - struct ureg_dst fragment[idct->nr_of_render_targets]; + struct ureg_dst *fragment; int i, j; @@ -331,6 +334,8 @@ create_stage1_frag_shader(struct vl_idct *idct) if (!shader) return NULL; + fragment = MALLOC(idct->nr_of_render_targets * sizeof(struct ureg_dst)); + l_addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR0, TGSI_INTERPOLATE_LINEAR); l_addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR1, TGSI_INTERPOLATE_LINEAR); @@ -353,14 +358,19 @@ create_stage1_frag_shader(struct vl_idct *idct) } for (i = 0; i < 4; ++i) { - struct ureg_src s_addr[2] = { ureg_src(l[i][0]), ureg_src(l[i][1]) }; + struct ureg_src s_addr[2]; + s_addr[0] = ureg_src(l[i][0]); + s_addr[1] = ureg_src(l[i][1]); fetch_four(shader, l[i], s_addr, ureg_DECL_sampler(shader, 0), false); } for (i = 0; i < idct->nr_of_render_targets; ++i) { + struct ureg_src s_addr[2]; + increment_addr(shader, r, r_addr, true, true, i - (signed)idct->nr_of_render_targets / 2, BLOCK_HEIGHT); - struct ureg_src s_addr[2] = { ureg_src(r[0]), ureg_src(r[1]) }; + s_addr[0] = ureg_src(r[0]); + s_addr[1] = ureg_src(r[1]); fetch_four(shader, r, s_addr, ureg_DECL_sampler(shader, 1), false); for (j = 0; j < 4; ++j) { @@ -377,6 +387,8 @@ create_stage1_frag_shader(struct vl_idct *idct) ureg_END(shader); + FREE(fragment); + return ureg_create_shader_and_destroy(shader, idct->pipe); } |