Lines Matching refs:svga
49 svga_hwtnl_create(struct svga_context *svga) in svga_hwtnl_create() argument
55 hwtnl->svga = svga; in svga_hwtnl_create()
57 hwtnl->cmd.swc = svga->swc; in svga_hwtnl_create()
91 struct svga_screen *svgascreen = svga_screen(hwtnl->svga->pipe.screen); in svga_hwtnl_set_flatshade()
194 struct svga_context *svga = hwtnl->svga; in draw_vgpu9() local
211 if (svga->state.hw_draw.num_backed_views) { in draw_vgpu9()
212 for (i = 0; i < svga->state.hw_draw.num_views; i++) { in draw_vgpu9()
213 struct svga_hw_view_state *view = &svga->state.hw_draw.views[i]; in draw_vgpu9()
217 svga_validate_sampler_view(svga, view->v); in draw_vgpu9()
223 handle = svga_buffer_handle(svga, hwtnl->cmd.vbufs[j].buffer.resource, in draw_vgpu9()
233 handle = svga_buffer_handle(svga, hwtnl->cmd.prim_ib[i], in draw_vgpu9()
244 if (svga->rebind.flags.rendertargets) { in draw_vgpu9()
245 ret = svga_reemit_framebuffer_bindings(svga); in draw_vgpu9()
251 if (svga->rebind.flags.texture_samplers) { in draw_vgpu9()
252 ret = svga_reemit_tss_bindings(svga); in draw_vgpu9()
258 if (svga->rebind.flags.vs) { in draw_vgpu9()
259 ret = svga_reemit_vs_bindings(svga); in draw_vgpu9()
265 if (svga->rebind.flags.fs) { in draw_vgpu9()
266 ret = svga_reemit_fs_bindings(svga); in draw_vgpu9()
273 svga->curr.framebuffer.cbufs[0] ? in draw_vgpu9()
274 svga_surface(svga->curr.framebuffer.cbufs[0])->handle : NULL, in draw_vgpu9()
346 validate_sampler_resources(struct svga_context *svga) in validate_sampler_resources() argument
350 assert(svga_have_vgpu10(svga)); in validate_sampler_resources()
353 unsigned count = svga->curr.num_sampler_views[shader]; in validate_sampler_resources()
364 svga_pipe_sampler_view(svga->curr.sampler_views[shader][i]); in validate_sampler_resources()
368 surfaces[i] = svga_buffer_handle(svga, sv->base.texture, in validate_sampler_resources()
381 svga->curr.rast->templ.poly_stipple_enable) { in validate_sampler_resources()
382 const unsigned unit = svga->state.hw_draw.fs->pstipple_sampler_unit; in validate_sampler_resources()
384 svga->polygon_stipple.sampler_view; in validate_sampler_resources()
392 if (svga->rebind.flags.texture_samplers) { in validate_sampler_resources()
395 ret = svga->swc->resource_rebind(svga->swc, in validate_sampler_resources()
405 svga->rebind.flags.texture_samplers = FALSE; in validate_sampler_resources()
412 validate_constant_buffers(struct svga_context *svga) in validate_constant_buffers() argument
416 assert(svga_have_vgpu10(svga)); in validate_constant_buffers()
425 if (svga->rebind.flags.constbufs) { in validate_constant_buffers()
426 buffer = svga_buffer(svga->state.hw_draw.constbuf[shader]); in validate_constant_buffers()
428 ret = svga->swc->resource_rebind(svga->swc, in validate_constant_buffers()
441 enabled_constbufs = svga->state.hw_draw.enabled_constbufs[shader] & ~1u; in validate_constant_buffers()
444 buffer = svga_buffer(svga->curr.constbufs[shader][i].buffer); in validate_constant_buffers()
446 handle = svga_buffer_handle(svga, &buffer->b.b, in validate_constant_buffers()
449 if (svga->rebind.flags.constbufs) { in validate_constant_buffers()
450 ret = svga->swc->resource_rebind(svga->swc, in validate_constant_buffers()
460 svga->rebind.flags.constbufs = FALSE; in validate_constant_buffers()
477 last_command_was_draw(const struct svga_context *svga) in last_command_was_draw() argument
479 switch (SVGA3D_GetLastCommand(svga->swc)) { in last_command_was_draw()
518 struct svga_context *svga = hwtnl->svga; in draw_vgpu10() local
527 assert(svga_have_vgpu10(svga)); in draw_vgpu10()
535 if (svga->rebind.val) { in draw_vgpu10()
536 ret = svga_rebind_framebuffer_bindings(svga); in draw_vgpu10()
540 ret = svga_rebind_shaders(svga); in draw_vgpu10()
545 ret = svga_rebind_stream_output_targets(svga); in draw_vgpu10()
556 ret = validate_sampler_resources(svga); in draw_vgpu10()
560 ret = validate_constant_buffers(svga); in draw_vgpu10()
569 vbuffer_handles[i] = svga_buffer_handle(svga, &sbuf->b.b, in draw_vgpu10()
583 for (; i < svga->state.hw_draw.num_vbuffers; i++) { in draw_vgpu10()
592 ib_handle = svga_buffer_handle(svga, ib, PIPE_BIND_INDEX_BUFFER); in draw_vgpu10()
604 if (svga->state.hw_draw.layout_id != hwtnl->cmd.vdecl_layout_id) { in draw_vgpu10()
605 ret = SVGA3D_vgpu10_SetInputLayout(svga->swc, in draw_vgpu10()
610 svga->state.hw_draw.layout_id = hwtnl->cmd.vdecl_layout_id; in draw_vgpu10()
627 vbuf_count != svga->state.hw_draw.num_vbuffers || in draw_vgpu10()
631 svga->state.hw_draw.vbuffer_attrs, in draw_vgpu10()
632 svga->state.hw_draw.vbuffers)) { in draw_vgpu10()
640 num_vbuffers = MAX2(vbuf_count, svga->state.hw_draw.num_vbuffers); in draw_vgpu10()
667 &svga->state.hw_draw.vbuffer_attrs[i], in draw_vgpu10()
668 &svga->state.hw_draw.vbuffers[i]); in draw_vgpu10()
685 ret = SVGA3D_vgpu10_SetVertexBuffers(svga->swc, in draw_vgpu10()
703 svga->state.hw_draw.num_vbuffers = last_vbuf + 1; in draw_vgpu10()
704 memcpy(svga->state.hw_draw.vbuffer_attrs, vbuffer_attrs, in draw_vgpu10()
707 pipe_resource_reference(&svga->state.hw_draw.vbuffers[i], in draw_vgpu10()
717 if (vbuffer_handles[i] && !last_command_was_draw(svga)) { in draw_vgpu10()
718 ret = svga->swc->resource_rebind(svga->swc, vbuffer_handles[i], in draw_vgpu10()
728 if (svga->state.hw_draw.topology != range->primType) { in draw_vgpu10()
729 ret = SVGA3D_vgpu10_SetTopology(svga->swc, range->primType); in draw_vgpu10()
733 svga->state.hw_draw.topology = range->primType; in draw_vgpu10()
741 if (ib != svga->state.hw_draw.ib || in draw_vgpu10()
742 indexFormat != svga->state.hw_draw.ib_format || in draw_vgpu10()
743 range->indexArray.offset != svga->state.hw_draw.ib_offset) { in draw_vgpu10()
746 ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, ib_handle, in draw_vgpu10()
752 pipe_resource_reference(&svga->state.hw_draw.ib, ib); in draw_vgpu10()
753 svga->state.hw_draw.ib_format = indexFormat; in draw_vgpu10()
754 svga->state.hw_draw.ib_offset = range->indexArray.offset; in draw_vgpu10()
760 if (!last_command_was_draw(svga)) { in draw_vgpu10()
761 ret = svga->swc->resource_rebind(svga->swc, ib_handle, in draw_vgpu10()
769 ret = SVGA3D_vgpu10_DrawIndexedInstanced(svga->swc, in draw_vgpu10()
780 ret = SVGA3D_vgpu10_DrawIndexed(svga->swc, in draw_vgpu10()
790 if (svga->state.hw_draw.ib_format != SVGA3D_FORMAT_INVALID || in draw_vgpu10()
791 svga->state.hw_draw.ib != NULL) { in draw_vgpu10()
793 ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, NULL, in draw_vgpu10()
797 pipe_resource_reference(&svga->state.hw_draw.ib, NULL); in draw_vgpu10()
798 svga->state.hw_draw.ib_format = SVGA3D_FORMAT_INVALID; in draw_vgpu10()
801 assert(svga->state.hw_draw.ib == NULL); in draw_vgpu10()
804 ret = SVGA3D_vgpu10_DrawInstanced(svga->swc, in draw_vgpu10()
814 ret = SVGA3D_vgpu10_Draw(svga->swc, in draw_vgpu10()
841 SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLFLUSH); in svga_hwtnl_flush()
843 if (!svga_have_vgpu10(hwtnl->svga) && hwtnl->cmd.prim_count) { in svga_hwtnl_flush()
848 SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws); in svga_hwtnl_flush()
876 assert(!svga_have_vgpu10(hwtnl->svga)); in check_draw_params()
1023 SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLPRIM); in svga_hwtnl_prim()
1025 if (svga_have_vgpu10(hwtnl->svga)) { in svga_hwtnl_prim()
1030 svga_context_flush(hwtnl->svga, NULL); in svga_hwtnl_prim()
1064 SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws); in svga_hwtnl_prim()