Lines Matching refs:nvc0
194 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_blend_state_bind() local
196 nvc0->blend = hwcso; in nvc0_blend_state_bind()
197 nvc0->dirty |= NVC0_NEW_BLEND; in nvc0_blend_state_bind()
322 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_rasterizer_state_bind() local
324 nvc0->rast = hwcso; in nvc0_rasterizer_state_bind()
325 nvc0->dirty |= NVC0_NEW_RASTERIZER; in nvc0_rasterizer_state_bind()
393 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_zsa_state_bind() local
395 nvc0->zsa = hwcso; in nvc0_zsa_state_bind()
396 nvc0->dirty |= NVC0_NEW_ZSA; in nvc0_zsa_state_bind()
445 nvc0_stage_sampler_states_bind(struct nvc0_context *nvc0, int s, in nvc0_stage_sampler_states_bind() argument
451 struct nv50_tsc_entry *old = nvc0->samplers[s][i]; in nvc0_stage_sampler_states_bind()
455 nvc0->samplers_dirty[s] |= 1 << i; in nvc0_stage_sampler_states_bind()
457 nvc0->samplers[s][i] = nv50_tsc_entry(hwcso[i]); in nvc0_stage_sampler_states_bind()
459 nvc0_screen_tsc_unlock(nvc0->screen, old); in nvc0_stage_sampler_states_bind()
461 for (; i < nvc0->num_samplers[s]; ++i) { in nvc0_stage_sampler_states_bind()
462 if (nvc0->samplers[s][i]) { in nvc0_stage_sampler_states_bind()
463 nvc0_screen_tsc_unlock(nvc0->screen, nvc0->samplers[s][i]); in nvc0_stage_sampler_states_bind()
464 nvc0->samplers[s][i] = NULL; in nvc0_stage_sampler_states_bind()
468 nvc0->num_samplers[s] = nr; in nvc0_stage_sampler_states_bind()
470 nvc0->dirty |= NVC0_NEW_SAMPLERS; in nvc0_stage_sampler_states_bind()
504 nvc0_stage_set_sampler_views(struct nvc0_context *nvc0, int s, in nvc0_stage_set_sampler_views() argument
511 struct nv50_tic_entry *old = nv50_tic_entry(nvc0->textures[s][i]); in nvc0_stage_set_sampler_views()
513 if (views[i] == nvc0->textures[s][i]) in nvc0_stage_set_sampler_views()
515 nvc0->textures_dirty[s] |= 1 << i; in nvc0_stage_set_sampler_views()
518 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); in nvc0_stage_set_sampler_views()
519 nvc0_screen_tic_unlock(nvc0->screen, old); in nvc0_stage_set_sampler_views()
522 pipe_sampler_view_reference(&nvc0->textures[s][i], views[i]); in nvc0_stage_set_sampler_views()
525 for (i = nr; i < nvc0->num_textures[s]; ++i) { in nvc0_stage_set_sampler_views()
526 struct nv50_tic_entry *old = nv50_tic_entry(nvc0->textures[s][i]); in nvc0_stage_set_sampler_views()
528 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(s, i)); in nvc0_stage_set_sampler_views()
529 nvc0_screen_tic_unlock(nvc0->screen, old); in nvc0_stage_set_sampler_views()
530 pipe_sampler_view_reference(&nvc0->textures[s][i], NULL); in nvc0_stage_set_sampler_views()
534 nvc0->num_textures[s] = nr; in nvc0_stage_set_sampler_views()
536 nvc0->dirty |= NVC0_NEW_TEXTURES; in nvc0_stage_set_sampler_views()
608 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_vp_state_bind() local
610 nvc0->vertprog = hwcso; in nvc0_vp_state_bind()
611 nvc0->dirty |= NVC0_NEW_VERTPROG; in nvc0_vp_state_bind()
624 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_fp_state_bind() local
626 nvc0->fragprog = hwcso; in nvc0_fp_state_bind()
627 nvc0->dirty |= NVC0_NEW_FRAGPROG; in nvc0_fp_state_bind()
640 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_gp_state_bind() local
642 nvc0->gmtyprog = hwcso; in nvc0_gp_state_bind()
643 nvc0->dirty |= NVC0_NEW_GMTYPROG; in nvc0_gp_state_bind()
650 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_constant_buffer() local
658 if (nvc0->constbuf[s][i].user) in nvc0_set_constant_buffer()
659 nvc0->constbuf[s][i].u.buf = NULL; in nvc0_set_constant_buffer()
661 if (nvc0->constbuf[s][i].u.buf) in nvc0_set_constant_buffer()
662 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CB(s, i)); in nvc0_set_constant_buffer()
664 pipe_resource_reference(&nvc0->constbuf[s][i].u.buf, res); in nvc0_set_constant_buffer()
666 nvc0->constbuf[s][i].user = (cb && cb->user_buffer) ? TRUE : FALSE; in nvc0_set_constant_buffer()
667 if (nvc0->constbuf[s][i].user) { in nvc0_set_constant_buffer()
668 nvc0->constbuf[s][i].u.data = cb->user_buffer; in nvc0_set_constant_buffer()
669 nvc0->constbuf[s][i].size = cb->buffer_size; in nvc0_set_constant_buffer()
672 nvc0->constbuf[s][i].offset = cb->buffer_offset; in nvc0_set_constant_buffer()
673 nvc0->constbuf[s][i].size = align(cb->buffer_size, 0x100); in nvc0_set_constant_buffer()
676 nvc0->constbuf_dirty[s] |= 1 << i; in nvc0_set_constant_buffer()
678 nvc0->dirty |= NVC0_NEW_CONSTBUF; in nvc0_set_constant_buffer()
688 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_blend_color() local
690 nvc0->blend_colour = *bcol; in nvc0_set_blend_color()
691 nvc0->dirty |= NVC0_NEW_BLEND_COLOUR; in nvc0_set_blend_color()
698 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_stencil_ref() local
700 nvc0->stencil_ref = *sr; in nvc0_set_stencil_ref()
701 nvc0->dirty |= NVC0_NEW_STENCIL_REF; in nvc0_set_stencil_ref()
708 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_clip_state() local
710 memcpy(nvc0->clip.ucp, clip->ucp, sizeof(clip->ucp)); in nvc0_set_clip_state()
712 nvc0->dirty |= NVC0_NEW_CLIP; in nvc0_set_clip_state()
718 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_sample_mask() local
720 nvc0->sample_mask = sample_mask; in nvc0_set_sample_mask()
721 nvc0->dirty |= NVC0_NEW_SAMPLE_MASK; in nvc0_set_sample_mask()
729 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_framebuffer_state() local
732 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB); in nvc0_set_framebuffer_state()
735 pipe_surface_reference(&nvc0->framebuffer.cbufs[i], fb->cbufs[i]); in nvc0_set_framebuffer_state()
736 for (; i < nvc0->framebuffer.nr_cbufs; ++i) in nvc0_set_framebuffer_state()
737 pipe_surface_reference(&nvc0->framebuffer.cbufs[i], NULL); in nvc0_set_framebuffer_state()
739 nvc0->framebuffer.nr_cbufs = fb->nr_cbufs; in nvc0_set_framebuffer_state()
741 nvc0->framebuffer.width = fb->width; in nvc0_set_framebuffer_state()
742 nvc0->framebuffer.height = fb->height; in nvc0_set_framebuffer_state()
744 pipe_surface_reference(&nvc0->framebuffer.zsbuf, fb->zsbuf); in nvc0_set_framebuffer_state()
746 nvc0->dirty |= NVC0_NEW_FRAMEBUFFER; in nvc0_set_framebuffer_state()
753 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_polygon_stipple() local
755 nvc0->stipple = *stipple; in nvc0_set_polygon_stipple()
756 nvc0->dirty |= NVC0_NEW_STIPPLE; in nvc0_set_polygon_stipple()
763 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_scissor_state() local
765 nvc0->scissor = *scissor; in nvc0_set_scissor_state()
766 nvc0->dirty |= NVC0_NEW_SCISSOR; in nvc0_set_scissor_state()
773 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_viewport_state() local
775 nvc0->viewport = *vpt; in nvc0_set_viewport_state()
776 nvc0->dirty |= NVC0_NEW_VIEWPORT; in nvc0_set_viewport_state()
784 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_vertex_buffers() local
788 nvc0->vbo_user = 0; in nvc0_set_vertex_buffers()
790 if (count != nvc0->num_vtxbufs) { in nvc0_set_vertex_buffers()
792 pipe_resource_reference(&nvc0->vtxbuf[i].buffer, vb[i].buffer); in nvc0_set_vertex_buffers()
794 nvc0->vbo_user |= 1 << i; in nvc0_set_vertex_buffers()
795 nvc0->vtxbuf[i].user_buffer = vb[i].user_buffer; in nvc0_set_vertex_buffers()
799 nvc0->vtxbuf[i].buffer_offset = vb[i].buffer_offset; in nvc0_set_vertex_buffers()
801 nvc0->vtxbuf[i].stride = vb[i].stride; in nvc0_set_vertex_buffers()
803 for (; i < nvc0->num_vtxbufs; ++i) in nvc0_set_vertex_buffers()
804 pipe_resource_reference(&nvc0->vtxbuf[i].buffer, NULL); in nvc0_set_vertex_buffers()
806 nvc0->num_vtxbufs = count; in nvc0_set_vertex_buffers()
807 nvc0->dirty |= NVC0_NEW_ARRAYS; in nvc0_set_vertex_buffers()
811 nvc0->vtxbuf[i].user_buffer = vb[i].user_buffer; in nvc0_set_vertex_buffers()
812 nvc0->vbo_user |= 1 << i; in nvc0_set_vertex_buffers()
817 if (nvc0->vtxbuf[i].buffer == vb[i].buffer && in nvc0_set_vertex_buffers()
818 nvc0->vtxbuf[i].buffer_offset == vb[i].buffer_offset && in nvc0_set_vertex_buffers()
819 nvc0->vtxbuf[i].stride == vb[i].stride) in nvc0_set_vertex_buffers()
821 pipe_resource_reference(&nvc0->vtxbuf[i].buffer, vb[i].buffer); in nvc0_set_vertex_buffers()
822 nvc0->vtxbuf[i].buffer_offset = vb[i].buffer_offset; in nvc0_set_vertex_buffers()
823 nvc0->vtxbuf[i].stride = vb[i].stride; in nvc0_set_vertex_buffers()
824 nvc0->dirty |= NVC0_NEW_ARRAYS; in nvc0_set_vertex_buffers()
827 if (constant_vbos != nvc0->constant_vbos) { in nvc0_set_vertex_buffers()
828 nvc0->constant_vbos = constant_vbos; in nvc0_set_vertex_buffers()
829 nvc0->dirty |= NVC0_NEW_ARRAYS; in nvc0_set_vertex_buffers()
832 if (nvc0->dirty & NVC0_NEW_ARRAYS) in nvc0_set_vertex_buffers()
833 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_VTX); in nvc0_set_vertex_buffers()
840 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_index_buffer() local
842 if (nvc0->idxbuf.buffer) in nvc0_set_index_buffer()
843 nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); in nvc0_set_index_buffer()
846 pipe_resource_reference(&nvc0->idxbuf.buffer, ib->buffer); in nvc0_set_index_buffer()
847 nvc0->idxbuf.index_size = ib->index_size; in nvc0_set_index_buffer()
849 nvc0->idxbuf.offset = ib->offset; in nvc0_set_index_buffer()
850 nvc0->dirty |= NVC0_NEW_IDXBUF; in nvc0_set_index_buffer()
852 nvc0->idxbuf.user_buffer = ib->user_buffer; in nvc0_set_index_buffer()
853 nvc0->dirty &= ~NVC0_NEW_IDXBUF; in nvc0_set_index_buffer()
856 nvc0->dirty &= ~NVC0_NEW_IDXBUF; in nvc0_set_index_buffer()
857 pipe_resource_reference(&nvc0->idxbuf.buffer, NULL); in nvc0_set_index_buffer()
864 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_vertex_state_bind() local
866 nvc0->vertex = hwcso; in nvc0_vertex_state_bind()
867 nvc0->dirty |= NVC0_NEW_VERTEX; in nvc0_vertex_state_bind()
912 struct nvc0_context *nvc0 = nvc0_context(pipe); in nvc0_set_transform_feedback_targets() local
919 if (nvc0->tfbbuf[i] == targets[i] && (append_mask & (1 << i))) in nvc0_set_transform_feedback_targets()
921 nvc0->tfbbuf_dirty |= 1 << i; in nvc0_set_transform_feedback_targets()
923 if (nvc0->tfbbuf[i] && nvc0->tfbbuf[i] != targets[i]) in nvc0_set_transform_feedback_targets()
924 nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize); in nvc0_set_transform_feedback_targets()
929 pipe_so_target_reference(&nvc0->tfbbuf[i], targets[i]); in nvc0_set_transform_feedback_targets()
931 for (; i < nvc0->num_tfbbufs; ++i) { in nvc0_set_transform_feedback_targets()
932 nvc0->tfbbuf_dirty |= 1 << i; in nvc0_set_transform_feedback_targets()
933 nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize); in nvc0_set_transform_feedback_targets()
934 pipe_so_target_reference(&nvc0->tfbbuf[i], NULL); in nvc0_set_transform_feedback_targets()
936 nvc0->num_tfbbufs = num_targets; in nvc0_set_transform_feedback_targets()
938 if (nvc0->tfbbuf_dirty) in nvc0_set_transform_feedback_targets()
939 nvc0->dirty |= NVC0_NEW_TFB_TARGETS; in nvc0_set_transform_feedback_targets()
943 nvc0_init_state_functions(struct nvc0_context *nvc0) in nvc0_init_state_functions() argument
945 struct pipe_context *pipe = &nvc0->base.pipe; in nvc0_init_state_functions()