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;
}
void nvc0_bufctx_fence(struct nvc0_context *, struct nouveau_bufctx *,
bool on_flush);
void nvc0_default_kick_notify(struct nouveau_pushbuf *);
+const void *nvc0_get_sample_locations(unsigned);
/* nvc0_draw.c */
extern struct draw_stage *nvc0_draw_render_stage(struct nvc0_context *);
PUSH_DATAf(push, xy[1]);
}
+ if (screen->base.class_3d >= GM200_3D_CLASS) {
+ const uint8_t (*ptr)[2] = nvc0_get_sample_locations(ms);
+ uint32_t val[4] = {};
+
+ for (i = 0; i < 16; i++) {
+ val[i / 4] |= ptr[i % ms][0] << (((i % 4) * 8) + 0);
+ val[i / 4] |= ptr[i % ms][1] << (((i % 4) * 8) + 4);
+ }
+
+ BEGIN_NVC0(push, SUBC_3D(0x11e0), 4);
+ PUSH_DATAp(push, val, 4);
+ }
+
if (serialize)
IMMED_NVC0(push, NVC0_3D(SERIALIZE), 0);