Lines Matching refs:shader
72 calc_addr(struct ureg_program *shader, struct ureg_dst addr[2], in calc_addr() argument
88 ureg_MOV(shader, ureg_writemask(addr[0], wm_start), ureg_scalar(start, sw_start)); in calc_addr()
89 ureg_MOV(shader, ureg_writemask(addr[0], wm_tc), ureg_scalar(tc, sw_tc)); in calc_addr()
91 …ureg_ADD(shader, ureg_writemask(addr[1], wm_start), ureg_scalar(start, sw_start), ureg_imm1f(shade… in calc_addr()
92 ureg_MOV(shader, ureg_writemask(addr[1], wm_tc), ureg_scalar(tc, sw_tc)); in calc_addr()
96 increment_addr(struct ureg_program *shader, struct ureg_dst daddr[2], in increment_addr() argument
108 ureg_MOV(shader, ureg_writemask(daddr[0], wm_start), saddr[0]); in increment_addr()
109 ureg_ADD(shader, ureg_writemask(daddr[0], wm_tc), saddr[0], ureg_imm1f(shader, pos / size)); in increment_addr()
110 ureg_MOV(shader, ureg_writemask(daddr[1], wm_start), saddr[1]); in increment_addr()
111 ureg_ADD(shader, ureg_writemask(daddr[1], wm_tc), saddr[1], ureg_imm1f(shader, pos / size)); in increment_addr()
115 fetch_four(struct ureg_program *shader, struct ureg_dst m[2], struct ureg_src addr[2], in fetch_four() argument
118 ureg_TEX(shader, m[0], resource3d ? TGSI_TEXTURE_3D : TGSI_TEXTURE_2D, addr[0], sampler); in fetch_four()
119 ureg_TEX(shader, m[1], resource3d ? TGSI_TEXTURE_3D : TGSI_TEXTURE_2D, addr[1], sampler); in fetch_four()
123 matrix_mul(struct ureg_program *shader, struct ureg_dst dst, struct ureg_dst l[2], struct ureg_dst … in matrix_mul() argument
127 tmp = ureg_DECL_temporary(shader); in matrix_mul()
133 ureg_DP4(shader, ureg_writemask(tmp, TGSI_WRITEMASK_X), ureg_src(l[0]), ureg_src(r[0])); in matrix_mul()
134 ureg_DP4(shader, ureg_writemask(tmp, TGSI_WRITEMASK_Y), ureg_src(l[1]), ureg_src(r[1])); in matrix_mul()
135 ureg_ADD(shader, dst, in matrix_mul()
139 ureg_release_temporary(shader, tmp); in matrix_mul()
145 struct ureg_program *shader; in create_mismatch_vert_shader() local
151 shader = ureg_create(PIPE_SHADER_VERTEX); in create_mismatch_vert_shader()
152 if (!shader) in create_mismatch_vert_shader()
155 vpos = ureg_DECL_vs_input(shader, VS_I_VPOS); in create_mismatch_vert_shader()
157 t_tex = ureg_DECL_temporary(shader); in create_mismatch_vert_shader()
159 o_vpos = ureg_DECL_output(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS); in create_mismatch_vert_shader()
161 o_addr[0] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR0); in create_mismatch_vert_shader()
162 o_addr[1] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR1); in create_mismatch_vert_shader()
174 scale = ureg_imm2f(shader, in create_mismatch_vert_shader()
178 ureg_MAD(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_XY), vpos, scale, scale); in create_mismatch_vert_shader()
179 ureg_MOV(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_ZW), ureg_imm1f(shader, 1.0f)); in create_mismatch_vert_shader()
181 ureg_MUL(shader, ureg_writemask(t_tex, TGSI_WRITEMASK_XY), vpos, scale); in create_mismatch_vert_shader()
182 … calc_addr(shader, o_addr, ureg_src(t_tex), ureg_src(t_tex), false, false, idct->buffer_width / 4); in create_mismatch_vert_shader()
184 ureg_release_temporary(shader, t_tex); in create_mismatch_vert_shader()
186 ureg_END(shader); in create_mismatch_vert_shader()
188 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_mismatch_vert_shader()
194 struct ureg_program *shader; in create_mismatch_frag_shader() local
203 shader = ureg_create(PIPE_SHADER_FRAGMENT); in create_mismatch_frag_shader()
204 if (!shader) in create_mismatch_frag_shader()
207 …addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR0, TGSI_INTERPOLATE_LINEAR); in create_mismatch_frag_shader()
208 …addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR1, TGSI_INTERPOLATE_LINEAR); in create_mismatch_frag_shader()
210 fragment = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, 0); in create_mismatch_frag_shader()
213 m[i][0] = ureg_DECL_temporary(shader); in create_mismatch_frag_shader()
214 m[i][1] = ureg_DECL_temporary(shader); in create_mismatch_frag_shader()
218 increment_addr(shader, m[i], addr, false, false, i, idct->buffer_height); in create_mismatch_frag_shader()
225 fetch_four(shader, m[i], s_addr, ureg_DECL_sampler(shader, 0), false); in create_mismatch_frag_shader()
229 ureg_ADD(shader, m[0][0], ureg_src(m[0][0]), ureg_src(m[i][0])); in create_mismatch_frag_shader()
230 ureg_ADD(shader, m[0][1], ureg_src(m[0][1]), ureg_src(m[i][1])); in create_mismatch_frag_shader()
233 ureg_ADD(shader, m[0][0], ureg_src(m[0][0]), ureg_src(m[0][1])); in create_mismatch_frag_shader()
234 ureg_DP4(shader, m[0][0], ureg_abs(ureg_src(m[0][0])), ureg_imm1f(shader, 1 << 14)); in create_mismatch_frag_shader()
236 …ureg_MUL(shader, ureg_writemask(m[0][0], TGSI_WRITEMASK_W), ureg_abs(ureg_src(m[7][1])), ureg_imm1… in create_mismatch_frag_shader()
237 ureg_FRC(shader, m[0][0], ureg_src(m[0][0])); in create_mismatch_frag_shader()
238 ureg_SGT(shader, m[0][0], ureg_imm1f(shader, 0.5f), ureg_abs(ureg_src(m[0][0]))); in create_mismatch_frag_shader()
240 ureg_CMP(shader, ureg_writemask(m[0][0], TGSI_WRITEMASK_W), ureg_negate(ureg_src(m[0][0])), in create_mismatch_frag_shader()
241 ureg_imm1f(shader, 1.0f / (1 << 15)), ureg_imm1f(shader, -1.0f / (1 << 15))); in create_mismatch_frag_shader()
242 ureg_MUL(shader, ureg_writemask(m[0][0], TGSI_WRITEMASK_W), ureg_src(m[0][0]), in create_mismatch_frag_shader()
245 ureg_MOV(shader, ureg_writemask(fragment, TGSI_WRITEMASK_XYZ), ureg_src(m[7][1])); in create_mismatch_frag_shader()
246 …ureg_ADD(shader, ureg_writemask(fragment, TGSI_WRITEMASK_W), ureg_src(m[0][0]), ureg_src(m[7][1])); in create_mismatch_frag_shader()
249 ureg_release_temporary(shader, m[i][0]); in create_mismatch_frag_shader()
250 ureg_release_temporary(shader, m[i][1]); in create_mismatch_frag_shader()
253 ureg_END(shader); in create_mismatch_frag_shader()
255 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_mismatch_frag_shader()
261 struct ureg_program *shader; in create_stage1_vert_shader() local
267 shader = ureg_create(PIPE_SHADER_VERTEX); in create_stage1_vert_shader()
268 if (!shader) in create_stage1_vert_shader()
271 vrect = ureg_DECL_vs_input(shader, VS_I_RECT); in create_stage1_vert_shader()
272 vpos = ureg_DECL_vs_input(shader, VS_I_VPOS); in create_stage1_vert_shader()
274 t_tex = ureg_DECL_temporary(shader); in create_stage1_vert_shader()
275 t_start = ureg_DECL_temporary(shader); in create_stage1_vert_shader()
277 o_vpos = ureg_DECL_output(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS); in create_stage1_vert_shader()
279 o_l_addr[0] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR0); in create_stage1_vert_shader()
280 o_l_addr[1] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR1); in create_stage1_vert_shader()
282 o_r_addr[0] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_R_ADDR0); in create_stage1_vert_shader()
283 o_r_addr[1] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_R_ADDR1); in create_stage1_vert_shader()
297 scale = ureg_imm2f(shader, in create_stage1_vert_shader()
301 ureg_ADD(shader, ureg_writemask(t_tex, TGSI_WRITEMASK_XY), vpos, vrect); in create_stage1_vert_shader()
302 ureg_MUL(shader, ureg_writemask(t_tex, TGSI_WRITEMASK_XY), ureg_src(t_tex), scale); in create_stage1_vert_shader()
304 ureg_MOV(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_XY), ureg_src(t_tex)); in create_stage1_vert_shader()
305 ureg_MOV(shader, ureg_writemask(o_vpos, TGSI_WRITEMASK_ZW), ureg_imm1f(shader, 1.0f)); in create_stage1_vert_shader()
307 ureg_MUL(shader, ureg_writemask(t_start, TGSI_WRITEMASK_XY), vpos, scale); in create_stage1_vert_shader()
309 …calc_addr(shader, o_l_addr, ureg_src(t_tex), ureg_src(t_start), false, false, idct->buffer_width /… in create_stage1_vert_shader()
310 calc_addr(shader, o_r_addr, vrect, ureg_imm1f(shader, 0.0f), true, true, VL_BLOCK_WIDTH / 4); in create_stage1_vert_shader()
312 ureg_release_temporary(shader, t_tex); in create_stage1_vert_shader()
313 ureg_release_temporary(shader, t_start); in create_stage1_vert_shader()
315 ureg_END(shader); in create_stage1_vert_shader()
317 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_stage1_vert_shader()
323 struct ureg_program *shader; in create_stage1_frag_shader() local
330 shader = ureg_create(PIPE_SHADER_FRAGMENT); in create_stage1_frag_shader()
331 if (!shader) in create_stage1_frag_shader()
336 …l_addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR0, TGSI_INTERPOLATE_LINEA… in create_stage1_frag_shader()
337 …l_addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_L_ADDR1, TGSI_INTERPOLATE_LINEA… in create_stage1_frag_shader()
339 …r_addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_R_ADDR0, TGSI_INTERPOLATE_LINEA… in create_stage1_frag_shader()
340 …r_addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_R_ADDR1, TGSI_INTERPOLATE_LINEA… in create_stage1_frag_shader()
343 fragment[i] = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, i); in create_stage1_frag_shader()
346 l[i][0] = ureg_DECL_temporary(shader); in create_stage1_frag_shader()
347 l[i][1] = ureg_DECL_temporary(shader); in create_stage1_frag_shader()
350 r[0] = ureg_DECL_temporary(shader); in create_stage1_frag_shader()
351 r[1] = ureg_DECL_temporary(shader); in create_stage1_frag_shader()
354 increment_addr(shader, l[i], l_addr, false, false, i - 2, idct->buffer_height); in create_stage1_frag_shader()
361 fetch_four(shader, l[i], s_addr, ureg_DECL_sampler(shader, 0), false); in create_stage1_frag_shader()
367 …increment_addr(shader, r, r_addr, true, true, i - (signed)idct->nr_of_render_targets / 2, VL_BLOCK… in create_stage1_frag_shader()
371 fetch_four(shader, r, s_addr, ureg_DECL_sampler(shader, 1), false); in create_stage1_frag_shader()
374 matrix_mul(shader, ureg_writemask(fragment[i], TGSI_WRITEMASK_X << j), l[j], r); in create_stage1_frag_shader()
379 ureg_release_temporary(shader, l[i][0]); in create_stage1_frag_shader()
380 ureg_release_temporary(shader, l[i][1]); in create_stage1_frag_shader()
382 ureg_release_temporary(shader, r[0]); in create_stage1_frag_shader()
383 ureg_release_temporary(shader, r[1]); in create_stage1_frag_shader()
385 ureg_END(shader); in create_stage1_frag_shader()
389 return ureg_create_shader_and_destroy(shader, idct->pipe); in create_stage1_frag_shader()
393 vl_idct_stage2_vert_shader(struct vl_idct *idct, struct ureg_program *shader, in vl_idct_stage2_vert_shader() argument
401 vrect = ureg_DECL_vs_input(shader, VS_I_RECT); in vl_idct_stage2_vert_shader()
402 vpos = ureg_DECL_vs_input(shader, VS_I_VPOS); in vl_idct_stage2_vert_shader()
404 t_start = ureg_DECL_temporary(shader); in vl_idct_stage2_vert_shader()
408 o_l_addr[0] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, first_output + VS_O_L_ADDR0); in vl_idct_stage2_vert_shader()
409 o_l_addr[1] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, first_output + VS_O_L_ADDR1); in vl_idct_stage2_vert_shader()
411 o_r_addr[0] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, first_output + VS_O_R_ADDR0); in vl_idct_stage2_vert_shader()
412 o_r_addr[1] = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, first_output + VS_O_R_ADDR1); in vl_idct_stage2_vert_shader()
414 scale = ureg_imm2f(shader, in vl_idct_stage2_vert_shader()
418 ureg_MUL(shader, ureg_writemask(tex, TGSI_WRITEMASK_Z), in vl_idct_stage2_vert_shader()
420 ureg_imm1f(shader, VL_BLOCK_WIDTH / idct->nr_of_render_targets)); in vl_idct_stage2_vert_shader()
421 ureg_MUL(shader, ureg_writemask(t_start, TGSI_WRITEMASK_XY), vpos, scale); in vl_idct_stage2_vert_shader()
423 calc_addr(shader, o_l_addr, vrect, ureg_imm1f(shader, 0.0f), false, false, VL_BLOCK_WIDTH / 4); in vl_idct_stage2_vert_shader()
424 …calc_addr(shader, o_r_addr, ureg_src(tex), ureg_src(t_start), true, false, idct->buffer_height / 4… in vl_idct_stage2_vert_shader()
426 ureg_MOV(shader, ureg_writemask(o_r_addr[0], TGSI_WRITEMASK_Z), ureg_src(tex)); in vl_idct_stage2_vert_shader()
427 ureg_MOV(shader, ureg_writemask(o_r_addr[1], TGSI_WRITEMASK_Z), ureg_src(tex)); in vl_idct_stage2_vert_shader()
431 vl_idct_stage2_frag_shader(struct vl_idct *idct, struct ureg_program *shader, in vl_idct_stage2_frag_shader() argument
440 …l_addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, first_input + VS_O_L_ADDR0, TGSI_INT… in vl_idct_stage2_frag_shader()
441 …l_addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, first_input + VS_O_L_ADDR1, TGSI_INT… in vl_idct_stage2_frag_shader()
443 …r_addr[0] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, first_input + VS_O_R_ADDR0, TGSI_INT… in vl_idct_stage2_frag_shader()
444 …r_addr[1] = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, first_input + VS_O_R_ADDR1, TGSI_INT… in vl_idct_stage2_frag_shader()
446 l[0] = ureg_DECL_temporary(shader); in vl_idct_stage2_frag_shader()
447 l[1] = ureg_DECL_temporary(shader); in vl_idct_stage2_frag_shader()
448 r[0] = ureg_DECL_temporary(shader); in vl_idct_stage2_frag_shader()
449 r[1] = ureg_DECL_temporary(shader); in vl_idct_stage2_frag_shader()
451 fetch_four(shader, l, l_addr, ureg_DECL_sampler(shader, 1), false); in vl_idct_stage2_frag_shader()
452 fetch_four(shader, r, r_addr, ureg_DECL_sampler(shader, 0), true); in vl_idct_stage2_frag_shader()
454 matrix_mul(shader, fragment, l, r); in vl_idct_stage2_frag_shader()
456 ureg_release_temporary(shader, l[0]); in vl_idct_stage2_frag_shader()
457 ureg_release_temporary(shader, l[1]); in vl_idct_stage2_frag_shader()
458 ureg_release_temporary(shader, r[0]); in vl_idct_stage2_frag_shader()
459 ureg_release_temporary(shader, r[1]); in vl_idct_stage2_frag_shader()