#include "pipe/p_defines.h"
#include "util/u_framebuffer.h"
+#include "util/u_upload_mgr.h"
#include "nvc0/nvc0_context.h"
#include "nvc0/nvc0_screen.h"
}
static void
-nvc0_texture_barrier(struct pipe_context *pipe)
+nvc0_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct nouveau_pushbuf *push = nvc0_context(pipe)->base.pushbuf;
nvc0->screen->save_state.tfb = NULL;
}
+ if (nvc0->base.pipe.stream_uploader)
+ u_upload_destroy(nvc0->base.pipe.stream_uploader);
+
/* Unset bufctx, we don't want to revalidate any resources after the flush.
* Other contexts will always set their bufctx again on action calls.
*/
pipe->screen = pscreen;
pipe->priv = priv;
+ pipe->stream_uploader = u_upload_create_default(pipe);
+ if (!pipe->stream_uploader)
+ goto out_err;
+ pipe->const_uploader = pipe->stream_uploader;
pipe->destroy = nvc0_destroy;
flags = NV_VRAM_DOMAIN(&screen->base) | NOUVEAU_BO_RD;
- BCTX_REFN_bo(nvc0->bufctx_3d, 3D_SCREEN, flags, screen->text);
+ BCTX_REFN_bo(nvc0->bufctx_3d, 3D_TEXT, flags, screen->text);
BCTX_REFN_bo(nvc0->bufctx_3d, 3D_SCREEN, flags, screen->uniform_bo);
BCTX_REFN_bo(nvc0->bufctx_3d, 3D_SCREEN, flags, screen->txc);
if (screen->compute) {
- BCTX_REFN_bo(nvc0->bufctx_cp, CP_SCREEN, flags, screen->text);
+ BCTX_REFN_bo(nvc0->bufctx_cp, CP_TEXT, flags, screen->text);
BCTX_REFN_bo(nvc0->bufctx_cp, CP_SCREEN, flags, screen->uniform_bo);
BCTX_REFN_bo(nvc0->bufctx_cp, CP_SCREEN, flags, screen->txc);
}
out_err:
if (nvc0) {
+ if (pipe->stream_uploader)
+ u_upload_destroy(pipe->stream_uploader);
if (nvc0->bufctx_3d)
nouveau_bufctx_del(&nvc0->bufctx_3d);
if (nvc0->bufctx_cp)
NOUVEAU_DRV_STAT(&nvc0->screen->base, resource_validate_count, count);
}
-static void
-nvc0_context_get_sample_position(struct pipe_context *pipe,
- unsigned sample_count, unsigned sample_index,
- float *xy)
+const void *
+nvc0_get_sample_locations(unsigned sample_count)
{
static const uint8_t ms1[1][2] = { { 0x8, 0x8 } };
static const uint8_t ms2[2][2] = {
case 8: ptr = ms8; break;
default:
assert(0);
- return; /* bad sample count -> undefined locations */
+ return NULL; /* bad sample count -> undefined locations */
}
+ return ptr;
+}
+
+static void
+nvc0_context_get_sample_position(struct pipe_context *pipe,
+ unsigned sample_count, unsigned sample_index,
+ float *xy)
+{
+ const uint8_t (*ptr)[2];
+
+ ptr = nvc0_get_sample_locations(sample_count);
+ if (!ptr)
+ return;
+
xy[0] = ptr[sample_index][0] * 0.0625f;
xy[1] = ptr[sample_index][1] * 0.0625f;
}