Lines Matching refs:vc4
75 vc4_start_draw(struct vc4_context *vc4) in vc4_start_draw() argument
77 struct vc4_job *job = vc4->job; in vc4_start_draw()
113 job->draw_width = vc4->framebuffer.width; in vc4_start_draw()
114 job->draw_height = vc4->framebuffer.height; in vc4_start_draw()
123 struct vc4_context *vc4 = vc4_context(pctx); in vc4_predraw_check_textures() local
133 vc4_flush_jobs_writing_resource(vc4, view->texture); in vc4_predraw_check_textures()
138 vc4_emit_gl_shader_state(struct vc4_context *vc4, in vc4_emit_gl_shader_state() argument
142 struct vc4_job *job = vc4->job; in vc4_emit_gl_shader_state()
144 struct vc4_vertex_stateobj *vtx = vc4->vtx; in vc4_emit_gl_shader_state()
146 struct vc4_vertexbuf_stateobj *vertexbuf = &vc4->vertexbuf; in vc4_emit_gl_shader_state()
158 (vc4->prog.fs->fs_threaded ? in vc4_emit_gl_shader_state()
161 vc4->rasterizer->base.point_size_per_vertex) ? in vc4_emit_gl_shader_state()
166 cl_u8(&shader_rec, vc4->prog.fs->num_inputs); in vc4_emit_gl_shader_state()
167 cl_reloc(job, &job->shader_rec, &shader_rec, vc4->prog.fs->bo, 0); in vc4_emit_gl_shader_state()
172 cl_u8(&shader_rec, vc4->prog.vs->vattrs_live); in vc4_emit_gl_shader_state()
173 cl_u8(&shader_rec, vc4->prog.vs->vattr_offsets[8]); in vc4_emit_gl_shader_state()
174 cl_reloc(job, &job->shader_rec, &shader_rec, vc4->prog.vs->bo, 0); in vc4_emit_gl_shader_state()
179 cl_u8(&shader_rec, vc4->prog.cs->vattrs_live); in vc4_emit_gl_shader_state()
180 cl_u8(&shader_rec, vc4->prog.cs->vattr_offsets[8]); in vc4_emit_gl_shader_state()
181 cl_reloc(job, &job->shader_rec, &shader_rec, vc4->prog.cs->bo, 0); in vc4_emit_gl_shader_state()
202 cl_u8(&shader_rec, vc4->prog.vs->vattr_offsets[i]); in vc4_emit_gl_shader_state()
203 cl_u8(&shader_rec, vc4->prog.cs->vattr_offsets[i]); in vc4_emit_gl_shader_state()
213 struct vc4_bo *bo = vc4_bo_alloc(vc4->screen, 4096, "scratch VBO"); in vc4_emit_gl_shader_state()
233 vc4_write_uniforms(vc4, vc4->prog.fs, in vc4_emit_gl_shader_state()
234 &vc4->constbuf[PIPE_SHADER_FRAGMENT], in vc4_emit_gl_shader_state()
235 &vc4->fragtex); in vc4_emit_gl_shader_state()
236 vc4_write_uniforms(vc4, vc4->prog.vs, in vc4_emit_gl_shader_state()
237 &vc4->constbuf[PIPE_SHADER_VERTEX], in vc4_emit_gl_shader_state()
238 &vc4->verttex); in vc4_emit_gl_shader_state()
239 vc4_write_uniforms(vc4, vc4->prog.cs, in vc4_emit_gl_shader_state()
240 &vc4->constbuf[PIPE_SHADER_VERTEX], in vc4_emit_gl_shader_state()
241 &vc4->verttex); in vc4_emit_gl_shader_state()
243 vc4->last_index_bias = info->index_bias + extra_index_bias; in vc4_emit_gl_shader_state()
244 vc4->max_index = max_index; in vc4_emit_gl_shader_state()
271 struct vc4_context *vc4 = vc4_context(pctx); in vc4_hw_2116_workaround() local
272 struct vc4_job *job = vc4_get_job_for_fbo(vc4); in vc4_hw_2116_workaround()
277 vc4_job_submit(vc4, job); in vc4_hw_2116_workaround()
284 struct vc4_context *vc4 = vc4_context(pctx); in vc4_draw_vbo() local
287 util_primconvert_save_index_buffer(vc4->primconvert, &vc4->indexbuf); in vc4_draw_vbo()
288 util_primconvert_save_rasterizer_state(vc4->primconvert, &vc4->rasterizer->base); in vc4_draw_vbo()
289 util_primconvert_draw_vbo(vc4->primconvert, info); in vc4_draw_vbo()
296 vc4_predraw_check_textures(pctx, &vc4->verttex); in vc4_draw_vbo()
297 vc4_predraw_check_textures(pctx, &vc4->fragtex); in vc4_draw_vbo()
301 struct vc4_job *job = vc4_get_job_for_fbo(vc4); in vc4_draw_vbo()
305 if (vc4->prim_mode != info->mode) { in vc4_draw_vbo()
306 vc4->prim_mode = info->mode; in vc4_draw_vbo()
307 vc4->dirty |= VC4_DIRTY_PRIM_MODE; in vc4_draw_vbo()
310 vc4_start_draw(vc4); in vc4_draw_vbo()
311 if (!vc4_update_compiled_shaders(vc4, info->mode)) { in vc4_draw_vbo()
318 if ((vc4->dirty & (VC4_DIRTY_VTXBUF | in vc4_draw_vbo()
325 vc4->prog.cs->uniform_dirty_bits | in vc4_draw_vbo()
326 vc4->prog.vs->uniform_dirty_bits | in vc4_draw_vbo()
327 vc4->prog.fs->uniform_dirty_bits)) || in vc4_draw_vbo()
328 vc4->last_index_bias != info->index_bias) { in vc4_draw_vbo()
329 vc4_emit_gl_shader_state(vc4, info, 0); in vc4_draw_vbo()
332 vc4->dirty = 0; in vc4_draw_vbo()
339 uint32_t offset = vc4->indexbuf.offset; in vc4_draw_vbo()
340 uint32_t index_size = vc4->indexbuf.index_size; in vc4_draw_vbo()
342 if (vc4->indexbuf.index_size == 4) { in vc4_draw_vbo()
343 prsc = vc4_get_shadow_index_buffer(pctx, &vc4->indexbuf, in vc4_draw_vbo()
347 if (vc4->indexbuf.user_buffer) { in vc4_draw_vbo()
349 u_upload_data(vc4->uploader, 0, in vc4_draw_vbo()
351 vc4->indexbuf.user_buffer, in vc4_draw_vbo()
354 prsc = vc4->indexbuf.buffer; in vc4_draw_vbo()
368 cl_u32(&bcl, vc4->max_index); in vc4_draw_vbo()
371 if (vc4->indexbuf.index_size == 4 || vc4->indexbuf.user_buffer) in vc4_draw_vbo()
396 vc4_emit_gl_shader_state(vc4, info, in vc4_draw_vbo()
452 if (vc4->zsa && vc4->framebuffer.zsbuf) { in vc4_draw_vbo()
454 vc4_resource(vc4->framebuffer.zsbuf->texture); in vc4_draw_vbo()
456 if (vc4->zsa->base.depth.enabled) { in vc4_draw_vbo()
461 if (vc4->zsa->base.stencil[0].enabled) { in vc4_draw_vbo()
495 struct vc4_context *vc4 = vc4_context(pctx); in vc4_clear() local
496 struct vc4_job *job = vc4_get_job_for_fbo(vc4); in vc4_clear()
503 vc4_job_submit(vc4, job); in vc4_clear()
504 job = vc4_get_job_for_fbo(vc4); in vc4_clear()
509 vc4_resource(vc4->framebuffer.cbufs[0]->texture); in vc4_clear()
512 if (vc4_rt_format_is_565(vc4->framebuffer.cbufs[0]->format)) { in vc4_clear()
523 pack_rgba(vc4->framebuffer.cbufs[0]->format, in vc4_clear()
532 vc4_resource(vc4->framebuffer.zsbuf->texture); in vc4_clear()
542 util_format_is_depth_and_stencil(vc4->framebuffer.zsbuf->format)) { in vc4_clear()
545 vc4_blitter_save(vc4); in vc4_clear()
546 util_blitter_clear(vc4->blitter, in vc4_clear()
547 vc4->framebuffer.width, in vc4_clear()
548 vc4->framebuffer.height, in vc4_clear()
572 job->draw_max_x = vc4->framebuffer.width; in vc4_clear()
573 job->draw_max_y = vc4->framebuffer.height; in vc4_clear()
577 vc4_start_draw(vc4); in vc4_clear()