* SOFTWARE.
*/
-#include "draw/draw_context.h"
#include "pipe/p_defines.h"
#include "util/u_framebuffer.h"
+#ifdef NVC0_WITH_DRAW_MODULE
+#include "draw/draw_context.h"
+#endif
+
#include "nvc0_context.h"
#include "nvc0_screen.h"
#include "nvc0_resource.h"
static void
nvc0_flush(struct pipe_context *pipe,
- struct pipe_fence_handle **fence)
+ struct pipe_fence_handle **fence,
+ enum pipe_flush_flags flags)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_screen *screen = &nvc0->screen->base;
for (i = 0; i < nvc0->num_textures[s]; ++i)
pipe_sampler_view_reference(&nvc0->textures[s][i], NULL);
- for (i = 0; i < 16; ++i)
- pipe_resource_reference(&nvc0->constbuf[s][i], NULL);
+ for (i = 0; i < NVC0_MAX_PIPE_CONSTBUFS; ++i)
+ if (!nvc0->constbuf[s][i].user)
+ pipe_resource_reference(&nvc0->constbuf[s][i].u.buf, NULL);
}
for (i = 0; i < nvc0->num_tfbbufs; ++i)
nvc0_context_unreference_resources(nvc0);
+#ifdef NVC0_WITH_DRAW_MODULE
draw_destroy(nvc0->draw);
+#endif
- FREE(nvc0);
+ nouveau_context_destroy(&nvc0->base);
}
void
return NULL;
pipe = &nvc0->base.pipe;
+ if (!nvc0_blitctx_create(nvc0))
+ goto out_err;
+
nvc0->base.pushbuf = screen->base.pushbuf;
ret = nouveau_bufctx_new(screen->base.client, NVC0_BIND_COUNT,
goto out_err;
nvc0->screen = screen;
- nvc0->base.screen = &screen->base;
- nvc0->base.copy_data = nvc0_m2mf_copy_linear;
- nvc0->base.push_data = nvc0_m2mf_push_linear;
- nvc0->base.push_cb = nvc0_cb_push;
+ nvc0->base.screen = &screen->base;
pipe->screen = pscreen;
pipe->priv = priv;
nvc0_init_query_functions(nvc0);
nvc0_init_surface_functions(nvc0);
nvc0_init_state_functions(nvc0);
+ nvc0_init_transfer_functions(nvc0);
nvc0_init_resource_functions(pipe);
+#ifdef NVC0_WITH_DRAW_MODULE
+ /* no software fallbacks implemented */
nvc0->draw = draw_create(pipe);
assert(nvc0->draw);
draw_set_rasterize_stage(nvc0->draw, nvc0_draw_render_stage(nvc0));
+#endif
nouveau_context_init_vdec(&nvc0->base);
flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RD;
BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->text);
- BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->uniforms);
+ BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->uniform_bo);
BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->txc);
+ BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->poly_cache);
flags = NOUVEAU_BO_GART | NOUVEAU_BO_WR;
BCTX_REFN_bo(nvc0->bufctx_3d, SCREEN, flags, screen->fence.bo);
BCTX_REFN_bo(nvc0->bufctx, FENCE, flags, screen->fence.bo);
+ nvc0->base.scratch.bo_size = 2 << 20;
+
+ memset(nvc0->tex_handles, ~0, sizeof(nvc0->tex_handles));
+
return pipe;
out_err:
nouveau_bufctx_del(&nvc0->bufctx_3d);
if (nvc0->bufctx)
nouveau_bufctx_del(&nvc0->bufctx);
+ if (nvc0->blit)
+ FREE(nvc0->blit);
FREE(nvc0);
}
return NULL;