summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30/nv30_vertprog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_vertprog.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_vertprog.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c
index eaf543b8f79..c7514efcfea 100644
--- a/src/gallium/drivers/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nv30/nv30_vertprog.c
@@ -1,6 +1,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
+#include "pipe/p_inlines.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi/tgsi_parse.h"
@@ -645,8 +646,7 @@ out_err:
static boolean
nv30_vertprog_validate(struct nv30_context *nv30)
{
- struct nouveau_winsys *nvws = nv30->nvws;
- struct pipe_winsys *ws = nv30->pipe.winsys;
+ struct pipe_screen *pscreen = nv30->pipe.screen;
struct nouveau_grobj *rankine = nv30->screen->rankine;
struct nv30_vertex_program *vp;
struct pipe_buffer *constbuf;
@@ -669,15 +669,15 @@ nv30_vertprog_validate(struct nv30_context *nv30)
struct nouveau_stateobj *so;
uint vplen = vp->nr_insns;
- if (nvws->res_alloc(heap, vplen, vp, &vp->exec)) {
+ if (nouveau_resource_alloc(heap, vplen, vp, &vp->exec)) {
while (heap->next && heap->size < vplen) {
struct nv30_vertex_program *evict;
evict = heap->next->priv;
- nvws->res_free(&evict->exec);
+ nouveau_resource_free(&evict->exec);
}
- if (nvws->res_alloc(heap, vplen, vp, &vp->exec))
+ if (nouveau_resource_alloc(heap, vplen, vp, &vp->exec))
assert(0);
}
@@ -694,15 +694,16 @@ nv30_vertprog_validate(struct nv30_context *nv30)
if (vp->nr_consts && !vp->data) {
struct nouveau_resource *heap = nv30->screen->vp_data_heap;
- if (nvws->res_alloc(heap, vp->nr_consts, vp, &vp->data)) {
+ if (nouveau_resource_alloc(heap, vp->nr_consts, vp, &vp->data)) {
while (heap->next && heap->size < vp->nr_consts) {
struct nv30_vertex_program *evict;
evict = heap->next->priv;
- nvws->res_free(&evict->data);
+ nouveau_resource_free(&evict->data);
}
- if (nvws->res_alloc(heap, vp->nr_consts, vp, &vp->data))
+ if (nouveau_resource_alloc(heap, vp->nr_consts, vp,
+ &vp->data))
assert(0);
}
@@ -750,8 +751,8 @@ nv30_vertprog_validate(struct nv30_context *nv30)
float *map = NULL;
if (constbuf) {
- map = ws->buffer_map(ws, constbuf,
- PIPE_BUFFER_USAGE_CPU_READ);
+ map = pipe_buffer_map(pscreen, constbuf,
+ PIPE_BUFFER_USAGE_CPU_READ);
}
for (i = 0; i < vp->nr_consts; i++) {
@@ -771,9 +772,8 @@ nv30_vertprog_validate(struct nv30_context *nv30)
OUT_RINGp ((uint32_t *)vpd->value, 4);
}
- if (constbuf) {
- ws->buffer_unmap(ws, constbuf);
- }
+ if (constbuf)
+ pipe_buffer_unmap(pscreen, constbuf);
}
/* Upload vtxprog */
@@ -804,8 +804,6 @@ nv30_vertprog_validate(struct nv30_context *nv30)
void
nv30_vertprog_destroy(struct nv30_context *nv30, struct nv30_vertex_program *vp)
{
- struct nouveau_winsys *nvws = nv30->screen->nvws;
-
vp->translated = FALSE;
if (vp->nr_insns) {
@@ -820,9 +818,9 @@ nv30_vertprog_destroy(struct nv30_context *nv30, struct nv30_vertex_program *vp)
vp->nr_consts = 0;
}
- nvws->res_free(&vp->exec);
+ nouveau_resource_free(&vp->exec);
vp->exec_start = 0;
- nvws->res_free(&vp->data);
+ nouveau_resource_free(&vp->data);
vp->data_start = 0;
vp->data_start_min = 0;