• Home
  • Raw
  • Download

Lines Matching refs:zscan

92 create_vert_shader(struct vl_zscan *zscan)  in create_vert_shader()  argument
109 o_vtex = MALLOC(zscan->num_channels * sizeof(struct ureg_dst)); in create_vert_shader()
112 (float)VL_BLOCK_WIDTH / zscan->buffer_width, in create_vert_shader()
113 (float)VL_BLOCK_HEIGHT / zscan->buffer_height); in create_vert_shader()
123 for (i = 0; i < zscan->num_channels; ++i) in create_vert_shader()
143 ureg_imm1f(shader, 1.0f / zscan->blocks_per_line)); in create_vert_shader()
148 for (i = 0; i < zscan->num_channels; ++i) { in create_vert_shader()
150 ureg_imm1f(shader, 1.0f / (zscan->blocks_per_line * VL_BLOCK_WIDTH) in create_vert_shader()
151 * (i - (signed)zscan->num_channels / 2))); in create_vert_shader()
154 ureg_imm1f(shader, 1.0f / zscan->blocks_per_line), ureg_src(tmp)); in create_vert_shader()
158 ureg_imm1f(shader, (float)zscan->blocks_per_line / zscan->blocks_total)); in create_vert_shader()
166 return ureg_create_shader_and_destroy(shader, zscan->pipe); in create_vert_shader()
170 create_frag_shader(struct vl_zscan *zscan) in create_frag_shader() argument
186 vtex = MALLOC(zscan->num_channels * sizeof(struct ureg_src)); in create_frag_shader()
187 tmp = MALLOC(zscan->num_channels * sizeof(struct ureg_dst)); in create_frag_shader()
189 for (i = 0; i < zscan->num_channels; ++i) in create_frag_shader()
196 for (i = 0; i < zscan->num_channels; ++i) in create_frag_shader()
207 for (i = 0; i < zscan->num_channels; ++i) in create_frag_shader()
210 for (i = 0; i < zscan->num_channels; ++i) in create_frag_shader()
213 for (i = 0; i < zscan->num_channels; ++i) { in create_frag_shader()
221 for (i = 0; i < zscan->num_channels; ++i) in create_frag_shader()
228 return ureg_create_shader_and_destroy(shader, zscan->pipe); in create_frag_shader()
232 init_shaders(struct vl_zscan *zscan) in init_shaders() argument
234 assert(zscan); in init_shaders()
236 zscan->vs = create_vert_shader(zscan); in init_shaders()
237 if (!zscan->vs) in init_shaders()
240 zscan->fs = create_frag_shader(zscan); in init_shaders()
241 if (!zscan->fs) in init_shaders()
247 zscan->pipe->delete_vs_state(zscan->pipe, zscan->vs); in init_shaders()
254 cleanup_shaders(struct vl_zscan *zscan) in cleanup_shaders() argument
256 assert(zscan); in cleanup_shaders()
258 zscan->pipe->delete_vs_state(zscan->pipe, zscan->vs); in cleanup_shaders()
259 zscan->pipe->delete_fs_state(zscan->pipe, zscan->fs); in cleanup_shaders()
263 init_state(struct vl_zscan *zscan) in init_state() argument
270 assert(zscan); in init_state()
275 zscan->rs_state = zscan->pipe->create_rasterizer_state(zscan->pipe, &rs_state); in init_state()
276 if (!zscan->rs_state) in init_state()
294 zscan->blend = zscan->pipe->create_blend_state(zscan->pipe, &blend); in init_state()
295 if (!zscan->blend) in init_state()
309 zscan->samplers[i] = zscan->pipe->create_sampler_state(zscan->pipe, &sampler); in init_state()
310 if (!zscan->samplers[i]) in init_state()
318 if (zscan->samplers[i]) in init_state()
319 zscan->pipe->delete_sampler_state(zscan->pipe, zscan->samplers[i]); in init_state()
321 zscan->pipe->delete_rasterizer_state(zscan->pipe, zscan->rs_state); in init_state()
324 zscan->pipe->delete_blend_state(zscan->pipe, zscan->blend); in init_state()
331 cleanup_state(struct vl_zscan *zscan) in cleanup_state() argument
335 assert(zscan); in cleanup_state()
338 zscan->pipe->delete_sampler_state(zscan->pipe, zscan->samplers[i]); in cleanup_state()
340 zscan->pipe->delete_rasterizer_state(zscan->pipe, zscan->rs_state); in cleanup_state()
341 zscan->pipe->delete_blend_state(zscan->pipe, zscan->blend); in cleanup_state()
433 vl_zscan_init(struct vl_zscan *zscan, struct pipe_context *pipe, in vl_zscan_init() argument
438 assert(zscan && pipe); in vl_zscan_init()
440 zscan->pipe = pipe; in vl_zscan_init()
441 zscan->buffer_width = buffer_width; in vl_zscan_init()
442 zscan->buffer_height = buffer_height; in vl_zscan_init()
443 zscan->num_channels = num_channels; in vl_zscan_init()
444 zscan->blocks_per_line = blocks_per_line; in vl_zscan_init()
445 zscan->blocks_total = blocks_total; in vl_zscan_init()
447 if(!init_shaders(zscan)) in vl_zscan_init()
450 if(!init_state(zscan)) { in vl_zscan_init()
451 cleanup_shaders(zscan); in vl_zscan_init()
459 vl_zscan_cleanup(struct vl_zscan *zscan) in vl_zscan_cleanup() argument
461 assert(zscan); in vl_zscan_cleanup()
463 cleanup_shaders(zscan); in vl_zscan_cleanup()
464 cleanup_state(zscan); in vl_zscan_cleanup()
468 vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, in vl_zscan_init_buffer() argument
474 assert(zscan && buffer); in vl_zscan_init_buffer()
497 res_tmpl.width0 = VL_BLOCK_WIDTH * zscan->blocks_per_line; in vl_zscan_init_buffer()
504 res = zscan->pipe->screen->resource_create(zscan->pipe->screen, &res_tmpl); in vl_zscan_init_buffer()
511 buffer->quant = zscan->pipe->create_sampler_view(zscan->pipe, res, &sv_tmpl); in vl_zscan_init_buffer()
540 vl_zscan_upload_quant(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, in vl_zscan_upload_quant() argument
559 pipe = zscan->pipe; in vl_zscan_upload_quant()
561 rect.width *= zscan->blocks_per_line; in vl_zscan_upload_quant()
578 for (i = 0; i < zscan->blocks_per_line; ++i) in vl_zscan_upload_quant()
593 vl_zscan_render(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer, unsigned num_instances) in vl_zscan_render() argument
597 zscan->pipe->bind_rasterizer_state(zscan->pipe, zscan->rs_state); in vl_zscan_render()
598 zscan->pipe->bind_blend_state(zscan->pipe, zscan->blend); in vl_zscan_render()
599 zscan->pipe->bind_fragment_sampler_states(zscan->pipe, 3, zscan->samplers); in vl_zscan_render()
600 zscan->pipe->set_framebuffer_state(zscan->pipe, &buffer->fb_state); in vl_zscan_render()
601 zscan->pipe->set_viewport_state(zscan->pipe, &buffer->viewport); in vl_zscan_render()
602 zscan->pipe->set_fragment_sampler_views(zscan->pipe, 3, &buffer->src); in vl_zscan_render()
603 zscan->pipe->bind_vs_state(zscan->pipe, zscan->vs); in vl_zscan_render()
604 zscan->pipe->bind_fs_state(zscan->pipe, zscan->fs); in vl_zscan_render()
605 util_draw_arrays_instanced(zscan->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_instances); in vl_zscan_render()