mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
nvc0: upload sample locations on GM20x
This fixes a bunch of multisample piglit tests on GM206, like bin/arb_texture_multisample-texelfetch 2 -auto -fbo Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
2f57e57881
commit
e7b2ce5fd8
3 changed files with 31 additions and 5 deletions
|
|
@ -502,10 +502,8 @@ nvc0_bufctx_fence(struct nvc0_context *nvc0, struct nouveau_bufctx *bufctx,
|
|||
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] = {
|
||||
|
|
@ -537,8 +535,22 @@ nvc0_context_get_sample_position(struct pipe_context *pipe,
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ struct pipe_context *nvc0_create(struct pipe_screen *, void *, unsigned flags);
|
|||
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 *);
|
||||
|
|
|
|||
|
|
@ -211,6 +211,19 @@ nvc0_validate_fb(struct nvc0_context *nvc0)
|
|||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue