*/
#include "draw/draw_context.h"
+#include "util/u_upload_mgr.h"
#include "nv_object.xml.h"
#include "nv30/nv30-40_3d.xml.h"
if (res->bind & PIPE_BIND_VERTEX_BUFFER) {
for (i = 0; i < nv30->num_vtxbufs; ++i) {
- if (nv30->vtxbuf[i].buffer == res) {
+ if (nv30->vtxbuf[i].buffer.resource == res) {
nv30->dirty |= NV30_NEW_ARRAYS;
nouveau_bufctx_reset(nv30->bufctx, BUFCTX_VTXBUF);
if (!--ref)
}
}
}
- if (res->bind & PIPE_BIND_INDEX_BUFFER) {
- if (nv30->idxbuf.buffer == res) {
- nouveau_bufctx_reset(nv30->bufctx, BUFCTX_IDXBUF);
- if (!--ref)
- return ref;
- }
- }
if (res->bind & PIPE_BIND_SAMPLER_VIEW) {
for (i = 0; i < nv30->fragprog.num_textures; ++i) {
if (nv30->draw)
draw_destroy(nv30->draw);
+ if (nv30->base.pipe.stream_uploader)
+ u_upload_destroy(nv30->base.pipe.stream_uploader);
+
if (nv30->blit_vp)
nouveau_heap_free(&nv30->blit_vp);
} while(0)
struct pipe_context *
-nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
+nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
{
struct nv30_screen *screen = nv30_screen(pscreen);
struct nv30_context *nv30 = CALLOC_STRUCT(nv30_context);
pipe->destroy = nv30_context_destroy;
pipe->flush = nv30_context_flush;
+ nv30->base.pipe.stream_uploader = u_upload_create_default(&nv30->base.pipe);
+ if (!nv30->base.pipe.stream_uploader) {
+ nv30_context_destroy(pipe);
+ return NULL;
+ }
+ nv30->base.pipe.const_uploader = nv30->base.pipe.stream_uploader;
+
/*XXX: *cough* per-context client */
nv30->base.client = screen->base.client;
if (debug_get_bool_option("NV30_SWTNL", false))
nv30->draw_flags |= NV30_NEW_SWTNL;
+ nouveau_context_init(&nv30->base);
nv30->sample_mask = 0xffff;
nv30_vbo_init(pipe);
nv30_query_init(pipe);