Lines Matching full:svga
48 svga_hwtnl_create(struct svga_context *svga)
54 hwtnl->svga = svga;
56 hwtnl->cmd.swc = svga->swc;
90 struct svga_screen *svgascreen = svga_screen(hwtnl->svga->pipe.screen);
180 struct svga_context *svga = hwtnl->svga;
191 handle = svga_buffer_handle(svga, hwtnl->cmd.vbufs[j].buffer);
200 handle = svga_buffer_handle(svga, hwtnl->cmd.prim_ib[i]);
210 if (svga->rebind.flags.rendertargets) {
211 ret = svga_reemit_framebuffer_bindings(svga);
217 if (svga->rebind.flags.texture_samplers) {
218 ret = svga_reemit_tss_bindings(svga);
224 if (svga->rebind.flags.vs) {
225 ret = svga_reemit_vs_bindings(svga);
231 if (svga->rebind.flags.fs) {
232 ret = svga_reemit_fs_bindings(svga);
239 svga->curr.framebuffer.cbufs[0] ?
240 svga_surface(svga->curr.framebuffer.cbufs[0])->handle : NULL,
312 validate_sampler_resources(struct svga_context *svga)
316 assert(svga_have_vgpu10(svga));
319 unsigned count = svga->curr.num_sampler_views[shader];
330 svga_pipe_sampler_view(svga->curr.sampler_views[shader][i]);
334 surfaces[i] = svga_buffer_handle(svga, sv->base.texture);
346 svga->curr.rast->templ.poly_stipple_enable) {
347 const unsigned unit = svga->state.hw_draw.fs->pstipple_sampler_unit;
349 svga->polygon_stipple.sampler_view;
357 if (svga->rebind.flags.texture_samplers) {
360 ret = svga->swc->resource_rebind(svga->swc,
370 svga->rebind.flags.texture_samplers = FALSE;
377 validate_constant_buffers(struct svga_context *svga)
381 assert(svga_have_vgpu10(svga));
390 if (svga->rebind.flags.constbufs) {
391 buffer = svga_buffer(svga->state.hw_draw.constbuf[shader]);
393 ret = svga->swc->resource_rebind(svga->swc,
406 enabled_constbufs = svga->state.hw_draw.enabled_constbufs[shader] & ~1u;
409 buffer = svga_buffer(svga->curr.constbufs[shader][i].buffer);
411 handle = svga_buffer_handle(svga, &buffer->b.b);
413 if (svga->rebind.flags.constbufs) {
414 ret = svga->swc->resource_rebind(svga->swc,
424 svga->rebind.flags.constbufs = FALSE;
441 last_command_was_draw(const struct svga_context *svga)
443 switch (SVGA3D_GetLastCommand(svga->swc)) {
464 struct svga_context *svga = hwtnl->svga;
473 assert(svga_have_vgpu10(svga));
481 if (svga->rebind.val) {
482 ret = svga_rebind_framebuffer_bindings(svga);
486 ret = svga_rebind_shaders(svga);
491 ret = svga_rebind_stream_output_targets(svga);
502 ret = validate_sampler_resources(svga);
506 ret = validate_constant_buffers(svga);
516 vbuffer_handles[i] = svga_buffer_handle(svga, &sbuf->b.b);
528 for (; i < svga->state.hw_draw.num_vbuffers; i++) {
540 ib_handle = svga_buffer_handle(svga, ib);
549 if (svga->state.hw_draw.layout_id != hwtnl->cmd.vdecl_layout_id) {
550 ret = SVGA3D_vgpu10_SetInputLayout(svga->swc,
555 svga->state.hw_draw.layout_id = hwtnl->cmd.vdecl_layout_id;
572 vbuf_count != svga->state.hw_draw.num_vbuffers ||
573 memcmp(vbuffer_attrs, svga->state.hw_draw.vbuffer_attrs,
575 memcmp(vbuffers, svga->state.hw_draw.vbuffers,
584 num_vbuffers = MAX2(vbuf_count, svga->state.hw_draw.num_vbuffers);
588 ret = SVGA3D_vgpu10_SetVertexBuffers(svga->swc, num_vbuffers,
598 svga->state.hw_draw.num_vbuffers = last_vbuf + 1;
599 memcpy(svga->state.hw_draw.vbuffer_attrs, vbuffer_attrs,
602 pipe_resource_reference(&svga->state.hw_draw.vbuffers[i],
612 if (vbuffer_handles[i] && !last_command_was_draw(svga)) {
613 ret = svga->swc->resource_rebind(svga->swc, vbuffer_handles[i],
623 if (svga->state.hw_draw.topology != range->primType) {
624 ret = SVGA3D_vgpu10_SetTopology(svga->swc, range->primType);
628 svga->state.hw_draw.topology = range->primType;
636 if (ib != svga->state.hw_draw.ib ||
637 indexFormat != svga->state.hw_draw.ib_format ||
638 range->indexArray.offset != svga->state.hw_draw.ib_offset) {
641 ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, ib_handle,
647 pipe_resource_reference(&svga->state.hw_draw.ib, ib);
648 svga->state.hw_draw.ib_format = indexFormat;
649 svga->state.hw_draw.ib_offset = range->indexArray.offset;
655 if (!last_command_was_draw(svga)) {
656 ret = svga->swc->resource_rebind(svga->swc, ib_handle,
664 ret = SVGA3D_vgpu10_DrawIndexedInstanced(svga->swc,
675 ret = SVGA3D_vgpu10_DrawIndexed(svga->swc,
685 if (svga->state.hw_draw.ib_format != SVGA3D_FORMAT_INVALID ||
686 svga->state.hw_draw.ib != NULL) {
688 ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, NULL,
692 pipe_resource_reference(&svga->state.hw_draw.ib, NULL);
693 svga->state.hw_draw.ib_format = SVGA3D_FORMAT_INVALID;
696 assert(svga->state.hw_draw.ib == NULL);
699 ret = SVGA3D_vgpu10_DrawInstanced(svga->swc,
709 ret = SVGA3D_vgpu10_Draw(svga->swc,
736 SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLFLUSH);
738 if (!svga_have_vgpu10(hwtnl->svga) && hwtnl->cmd.prim_count) {
743 SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws);
771 assert(!svga_have_vgpu10(hwtnl->svga));
918 SVGA_STATS_TIME_PUSH(svga_sws(hwtnl->svga), SVGA_STATS_TIME_HWTNLPRIM);
920 if (svga_have_vgpu10(hwtnl->svga)) {
925 svga_context_flush(hwtnl->svga, NULL);
959 SVGA_STATS_TIME_POP(svga_screen(hwtnl->svga->pipe.screen)->sws);