• Home
  • Raw
  • Download

Lines Matching refs:ureg

107 src_in_mask(struct ureg_program *ureg,  in src_in_mask()  argument
115 ureg_MOV(ureg, dst, src); in src_in_mask()
116 ureg_MUL(ureg, ureg_writemask(dst, TGSI_WRITEMASK_W), in src_in_mask()
119 ureg_MUL(ureg, dst, src, ureg_scalar(mask, TGSI_SWIZZLE_X)); in src_in_mask()
122 ureg_MUL(ureg, dst, src, ureg_scalar(mask, TGSI_SWIZZLE_W)); in src_in_mask()
124 ureg_MUL(ureg, dst, src, mask); in src_in_mask()
128 vs_normalize_coords(struct ureg_program *ureg, in vs_normalize_coords() argument
132 struct ureg_dst tmp = ureg_DECL_temporary(ureg); in vs_normalize_coords()
135 ureg_MAD(ureg, tmp, coords, const0, const1); in vs_normalize_coords()
137 ureg_release_temporary(ureg, tmp); in vs_normalize_coords()
144 struct ureg_program *ureg; in create_vs() local
155 ureg = ureg_create(PIPE_SHADER_VERTEX); in create_vs()
156 if (ureg == NULL) in create_vs()
159 const0 = ureg_DECL_constant(ureg, 0); in create_vs()
160 const1 = ureg_DECL_constant(ureg, 1); in create_vs()
163 src = ureg_DECL_vs_input(ureg, input_slot++); in create_vs()
164 dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_POSITION, 0); in create_vs()
165 src = vs_normalize_coords(ureg, src, const0, const1); in create_vs()
166 ureg_MOV(ureg, dst, src); in create_vs()
169 src = ureg_DECL_vs_input(ureg, input_slot++); in create_vs()
170 dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 0); in create_vs()
171 ureg_MOV(ureg, dst, src); in create_vs()
176 src = ureg_DECL_vs_input(ureg, input_slot++); in create_vs()
177 dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 0); in create_vs()
178 ureg_MOV(ureg, dst, src); in create_vs()
182 src = ureg_DECL_vs_input(ureg, input_slot++); in create_vs()
183 dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 1); in create_vs()
184 ureg_MOV(ureg, dst, src); in create_vs()
188 ureg_END(ureg); in create_vs()
190 return ureg_create_shader_and_destroy(ureg, pipe); in create_vs()
194 create_yuv_shader(struct pipe_context *pipe, struct ureg_program *ureg) in create_yuv_shader() argument
200 struct ureg_dst out = ureg_DECL_output(ureg, in create_yuv_shader()
204 pos = ureg_DECL_fs_input(ureg, in create_yuv_shader()
208 rgb = ureg_DECL_temporary(ureg); in create_yuv_shader()
209 y = ureg_DECL_temporary(ureg); in create_yuv_shader()
210 u = ureg_DECL_temporary(ureg); in create_yuv_shader()
211 v = ureg_DECL_temporary(ureg); in create_yuv_shader()
213 y_sampler = ureg_DECL_sampler(ureg, 0); in create_yuv_shader()
214 u_sampler = ureg_DECL_sampler(ureg, 1); in create_yuv_shader()
215 v_sampler = ureg_DECL_sampler(ureg, 2); in create_yuv_shader()
217 ureg_DECL_sampler_view(ureg, 0, TGSI_TEXTURE_2D, in create_yuv_shader()
220 ureg_DECL_sampler_view(ureg, 1, TGSI_TEXTURE_2D, in create_yuv_shader()
223 ureg_DECL_sampler_view(ureg, 2, TGSI_TEXTURE_2D, in create_yuv_shader()
227 matrow0 = ureg_DECL_constant(ureg, 0); in create_yuv_shader()
228 matrow1 = ureg_DECL_constant(ureg, 1); in create_yuv_shader()
229 matrow2 = ureg_DECL_constant(ureg, 2); in create_yuv_shader()
230 matrow3 = ureg_DECL_constant(ureg, 3); in create_yuv_shader()
232 ureg_TEX(ureg, y, TGSI_TEXTURE_2D, pos, y_sampler); in create_yuv_shader()
233 ureg_TEX(ureg, u, TGSI_TEXTURE_2D, pos, u_sampler); in create_yuv_shader()
234 ureg_TEX(ureg, v, TGSI_TEXTURE_2D, pos, v_sampler); in create_yuv_shader()
236 ureg_MOV(ureg, rgb, matrow3); in create_yuv_shader()
237 ureg_MAD(ureg, rgb, in create_yuv_shader()
239 ureg_MAD(ureg, rgb, in create_yuv_shader()
241 ureg_MAD(ureg, rgb, in create_yuv_shader()
244 ureg_MOV(ureg, out, ureg_src(rgb)); in create_yuv_shader()
246 ureg_release_temporary(ureg, rgb); in create_yuv_shader()
247 ureg_release_temporary(ureg, y); in create_yuv_shader()
248 ureg_release_temporary(ureg, u); in create_yuv_shader()
249 ureg_release_temporary(ureg, v); in create_yuv_shader()
251 ureg_END(ureg); in create_yuv_shader()
253 return ureg_create_shader_and_destroy(ureg, pipe); in create_yuv_shader()
257 xrender_tex(struct ureg_program *ureg, in xrender_tex() argument
265 struct ureg_dst tmp0 = ureg_DECL_temporary(ureg); in xrender_tex()
266 struct ureg_dst tmp1 = ureg_DECL_temporary(ureg); in xrender_tex()
268 ureg_SGT(ureg, tmp1, ureg_swizzle(coords, in xrender_tex()
274 ureg_SLT(ureg, tmp0, in xrender_tex()
278 ureg_MIN(ureg, tmp0, ureg_src(tmp0), ureg_src(tmp1)); in xrender_tex()
279 ureg_MIN(ureg, tmp0, ureg_scalar(ureg_src(tmp0), TGSI_SWIZZLE_X), in xrender_tex()
281 ureg_TEX(ureg, tmp1, TGSI_TEXTURE_2D, coords, sampler); in xrender_tex()
283 ureg_MOV(ureg, tmp1, ureg_swizzle(ureg_src(tmp1), in xrender_tex()
288 ureg_MOV(ureg, in xrender_tex()
291 ureg_MUL(ureg, dst, ureg_src(tmp1), ureg_src(tmp0)); in xrender_tex()
292 ureg_release_temporary(ureg, tmp0); in xrender_tex()
293 ureg_release_temporary(ureg, tmp1); in xrender_tex()
296 struct ureg_dst tmp = ureg_DECL_temporary(ureg); in xrender_tex()
298 ureg_TEX(ureg, tmp, TGSI_TEXTURE_2D, coords, sampler); in xrender_tex()
299 ureg_MOV(ureg, dst, ureg_swizzle(ureg_src(tmp), in xrender_tex()
303 ureg_release_temporary(ureg, tmp); in xrender_tex()
305 ureg_TEX(ureg, dst, TGSI_TEXTURE_2D, coords, sampler); in xrender_tex()
308 ureg_MOV(ureg, in xrender_tex()
315 read_input(struct ureg_program *ureg, in read_input() argument
324 input = ureg_DECL_constant(ureg, (*cur_constant)++); in read_input()
325 ureg_MOV(ureg, dst, input); in read_input()
327 sampler = ureg_DECL_sampler(ureg, *cur_sampler); in read_input()
328 ureg_DECL_sampler_view(ureg, *cur_sampler, TGSI_TEXTURE_2D, in read_input()
331 input = ureg_DECL_fs_input(ureg, in read_input()
334 xrender_tex(ureg, dst, input, sampler, imm0, in read_input()
342 struct ureg_program *ureg; in create_fs() local
369 ureg = ureg_create(PIPE_SHADER_FRAGMENT); in create_fs()
370 if (ureg == NULL) in create_fs()
374 return create_yuv_shader(pipe, ureg); in create_fs()
376 out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0); in create_fs()
380 imm0 = ureg_imm4f(ureg, 0, 0, 0, 1); in create_fs()
384 ureg_DECL_temporary(ureg) : out; in create_fs()
386 read_input(ureg, src, &imm0, src_repeat_none, src_swizzle, in create_fs()
390 ureg_MOV(ureg, src, ureg_scalar(ureg_src(src), TGSI_SWIZZLE_X)); in create_fs()
391 ureg_MOV(ureg, ureg_writemask(src, TGSI_WRITEMASK_XYZ), in create_fs()
394 ureg_MOV(ureg, out, ureg_src(src)); in create_fs()
398 mask = ureg_DECL_temporary(ureg); in create_fs()
399 read_input(ureg, mask, &imm0, mask_repeat_none, in create_fs()
403 src_in_mask(ureg, (dst_luminance) ? src : out, ureg_src(src), in create_fs()
406 ureg_release_temporary(ureg, mask); in create_fs()
413 ureg_MOV(ureg, out, ureg_scalar(ureg_src(src), TGSI_SWIZZLE_W)); in create_fs()
416 ureg_END(ureg); in create_fs()
418 return ureg_create_shader_and_destroy(ureg, pipe); in create_fs()