Lines Matching refs:vp
35 nv30_vertprog_destroy(struct nv30_vertprog *vp) in nv30_vertprog_destroy() argument
37 util_dynarray_fini(&vp->branch_relocs); in nv30_vertprog_destroy()
38 nouveau_heap_free(&vp->exec); in nv30_vertprog_destroy()
39 FREE(vp->insns); in nv30_vertprog_destroy()
40 vp->insns = NULL; in nv30_vertprog_destroy()
41 vp->nr_insns = 0; in nv30_vertprog_destroy()
43 util_dynarray_fini(&vp->const_relocs); in nv30_vertprog_destroy()
44 nouveau_heap_free(&vp->data); in nv30_vertprog_destroy()
45 FREE(vp->consts); in nv30_vertprog_destroy()
46 vp->consts = NULL; in nv30_vertprog_destroy()
47 vp->nr_consts = 0; in nv30_vertprog_destroy()
49 vp->translated = FALSE; in nv30_vertprog_destroy()
57 struct nv30_vertprog *vp = nv30->vertprog.program; in nv30_vertprog_validate() local
64 if (memcmp(vp->texcoord, fp->texcoord, sizeof(vp->texcoord))) { in nv30_vertprog_validate()
65 if (vp->translated) in nv30_vertprog_validate()
66 nv30_vertprog_destroy(vp); in nv30_vertprog_validate()
67 memcpy(vp->texcoord, fp->texcoord, sizeof(vp->texcoord)); in nv30_vertprog_validate()
71 if (nv30->rast && nv30->rast->pipe.clip_plane_enable != vp->enabled_ucps) { in nv30_vertprog_validate()
72 vp->enabled_ucps = nv30->rast->pipe.clip_plane_enable; in nv30_vertprog_validate()
73 if (vp->translated) in nv30_vertprog_validate()
74 nv30_vertprog_destroy(vp); in nv30_vertprog_validate()
77 if (!vp->translated) { in nv30_vertprog_validate()
78 vp->translated = _nvfx_vertprog_translate(nv30, vp); in nv30_vertprog_validate()
79 if (!vp->translated) { in nv30_vertprog_validate()
86 if (!vp->exec) { in nv30_vertprog_validate()
88 struct nv30_shader_reloc *reloc = vp->branch_relocs.data; in nv30_vertprog_validate()
89 unsigned nr_reloc = vp->branch_relocs.size / sizeof(*reloc); in nv30_vertprog_validate()
92 if (nouveau_heap_alloc(heap, vp->nr_insns, &vp->exec, &vp->exec)) { in nv30_vertprog_validate()
93 while (heap->next && heap->size < vp->nr_insns) { in nv30_vertprog_validate()
98 if (nouveau_heap_alloc(heap, vp->nr_insns, &vp->exec, &vp->exec)) { in nv30_vertprog_validate()
106 inst = vp->insns[reloc->location].data; in nv30_vertprog_validate()
107 target = vp->exec->start + reloc->target; in nv30_vertprog_validate()
115 inst = vp->insns[reloc->location].data; in nv30_vertprog_validate()
116 target = vp->exec->start + reloc->target; in nv30_vertprog_validate()
129 if (vp->nr_consts && !vp->data) { in nv30_vertprog_validate()
131 struct nv30_shader_reloc *reloc = vp->const_relocs.data; in nv30_vertprog_validate()
132 unsigned nr_reloc = vp->const_relocs.size / sizeof(*reloc); in nv30_vertprog_validate()
135 if (nouveau_heap_alloc(heap, vp->nr_consts, vp, &vp->data)) { in nv30_vertprog_validate()
136 while (heap->next && heap->size < vp->nr_consts) { in nv30_vertprog_validate()
141 if (nouveau_heap_alloc(heap, vp->nr_consts, vp, &vp->data)) { in nv30_vertprog_validate()
149 inst = vp->insns[reloc->location].data; in nv30_vertprog_validate()
150 target = vp->data->start + reloc->target; in nv30_vertprog_validate()
158 inst = vp->insns[reloc->location].data; in nv30_vertprog_validate()
159 target = vp->data->start + reloc->target; in nv30_vertprog_validate()
171 if (vp->nr_consts) { in nv30_vertprog_validate()
174 for (i = 0; i < vp->nr_consts; i++) { in nv30_vertprog_validate()
175 struct nv30_vertprog_data *data = &vp->consts[i]; in nv30_vertprog_validate()
189 PUSH_DATA (push, vp->data->start + i); in nv30_vertprog_validate()
196 PUSH_DATA (push, vp->exec->start); in nv30_vertprog_validate()
197 for (i = 0; i < vp->nr_insns; i++) { in nv30_vertprog_validate()
199 PUSH_DATAp(push, vp->insns[i].data, 4); in nv30_vertprog_validate()
205 PUSH_DATA (push, vp->exec->start); in nv30_vertprog_validate()
211 PUSH_DATA (push, vp->ir); in nv30_vertprog_validate()
212 PUSH_DATA (push, vp->or | fp->vp_or); in nv30_vertprog_validate()
223 struct nv30_vertprog *vp = CALLOC_STRUCT(nv30_vertprog); in nv30_vp_state_create() local
224 if (!vp) in nv30_vp_state_create()
227 vp->pipe.tokens = tgsi_dup_tokens(cso->tokens); in nv30_vp_state_create()
228 tgsi_scan_shader(vp->pipe.tokens, &vp->info); in nv30_vp_state_create()
229 return vp; in nv30_vp_state_create()
235 struct nv30_vertprog *vp = hwcso; in nv30_vp_state_delete() local
237 if (vp->translated) in nv30_vp_state_delete()
238 nv30_vertprog_destroy(vp); in nv30_vp_state_delete()
239 FREE((void *)vp->pipe.tokens); in nv30_vp_state_delete()
240 FREE(vp); in nv30_vp_state_delete()