summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30/nv30_vertprog.c
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2008-04-11 23:39:29 +0200
committerPatrice Mandin <pmandin@caramail.com>2008-04-11 23:39:29 +0200
commit186277ee928a7c9ad8a31776f93e502613ad94fd (patch)
treef67f7b44cd1b3058157ce9e746f800abd4cce060 /src/gallium/drivers/nv30/nv30_vertprog.c
parent4c498c1b0c38a3ba93649fa4435937d15689bae1 (diff)
nv30: Move some structures and functions from context to screen
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_vertprog.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_vertprog.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c
index fe1a467565..71aea3a59c 100644
--- a/src/gallium/drivers/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nv30/nv30_vertprog.c
@@ -1,7 +1,6 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
-#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi/util/tgsi_parse.h"
@@ -654,7 +653,7 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
/* Allocate hw vtxprog exec slots */
if (!vp->exec) {
- struct nouveau_resource *heap = nv30->vertprog.exec_heap;
+ struct nouveau_resource *heap = nv30->screen->vp_exec_heap;
uint vplen = vp->nr_insns;
if (nvws->res_alloc(heap, vplen, vp, &vp->exec)) {
@@ -674,7 +673,7 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
/* Allocate hw vtxprog const slots */
if (vp->nr_consts && !vp->data) {
- struct nouveau_resource *heap = nv30->vertprog.data_heap;
+ struct nouveau_resource *heap = nv30->screen->vp_data_heap;
if (nvws->res_alloc(heap, vp->nr_consts, vp, &vp->data)) {
while (heap->next && heap->size < vp->nr_consts) {
@@ -789,9 +788,29 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
void
nv30_vertprog_destroy(struct nv30_context *nv30, struct nv30_vertex_program *vp)
{
- if (vp->nr_consts)
- FREE(vp->consts);
- if (vp->nr_insns)
+ struct nouveau_winsys *nvws = nv30->screen->nvws;
+
+ vp->translated = FALSE;
+
+ if (vp->nr_insns) {
FREE(vp->insns);
+ vp->insns = NULL;
+ vp->nr_insns = 0;
+ }
+
+ if (vp->nr_consts) {
+ FREE(vp->consts);
+ vp->consts = NULL;
+ vp->nr_consts = 0;
+ }
+
+ nvws->res_free(&vp->exec);
+ vp->exec_start = 0;
+ nvws->res_free(&vp->data);
+ vp->data_start = 0;
+ vp->data_start_min = 0;
+
+ /* vp->ir = vp->or = vp->clip_ctrl = 0;
+ so_ref(NULL, &vp->so); */
}