summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/cayman_msaa.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-05-06 18:20:58 +0200
committerMarek Olšák <[email protected]>2014-06-02 12:58:22 +0200
commit99d9d7c0d69c076d84334892ee12f921fe243319 (patch)
tree4fec2ba3be5f6470af9dbe3fb2099de66ee6eaab /src/gallium/drivers/radeon/cayman_msaa.c
parent5b06fc376df8ac4e63603d1768cd0dccc9e4b491 (diff)
radeonsi: implement SAMPLEPOS fragment shader input
The sample positions are read from a constant buffer.
Diffstat (limited to 'src/gallium/drivers/radeon/cayman_msaa.c')
-rw-r--r--src/gallium/drivers/radeon/cayman_msaa.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/cayman_msaa.c b/src/gallium/drivers/radeon/cayman_msaa.c
index 8727f3e2359..47fc5c497f1 100644
--- a/src/gallium/drivers/radeon/cayman_msaa.c
+++ b/src/gallium/drivers/radeon/cayman_msaa.c
@@ -123,6 +123,23 @@ void cayman_get_sample_position(struct pipe_context *ctx, unsigned sample_count,
}
}
+void cayman_init_msaa(struct pipe_context *ctx)
+{
+ struct r600_common_context *rctx = (struct r600_common_context*)ctx;
+ int i;
+
+ cayman_get_sample_position(ctx, 1, 0, rctx->sample_locations_1x[0]);
+
+ for (i = 0; i < 2; i++)
+ cayman_get_sample_position(ctx, 2, i, rctx->sample_locations_2x[i]);
+ for (i = 0; i < 4; i++)
+ cayman_get_sample_position(ctx, 4, i, rctx->sample_locations_4x[i]);
+ for (i = 0; i < 8; i++)
+ cayman_get_sample_position(ctx, 8, i, rctx->sample_locations_8x[i]);
+ for (i = 0; i < 16; i++)
+ cayman_get_sample_position(ctx, 16, i, rctx->sample_locations_16x[i]);
+}
+
void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples)
{
switch (nr_samples) {