zink: Use u_default_get_sample_position
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22383>
This commit is contained in:
committed by
Marge Bot
parent
6b211e9b43
commit
43f9903d0c
@@ -45,6 +45,7 @@
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_helpers.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_sample_positions.h"
|
||||
#include "util/u_string.h"
|
||||
#include "util/u_thread.h"
|
||||
#include "util/perf/u_trace.h"
|
||||
@@ -1195,68 +1196,7 @@ zink_get_sample_position(struct pipe_context *ctx,
|
||||
{
|
||||
/* TODO: handle this I guess */
|
||||
assert(zink_screen(ctx->screen)->info.props.limits.standardSampleLocations);
|
||||
/* from 26.4. Multisampling */
|
||||
switch (sample_count) {
|
||||
case 0:
|
||||
case 1: {
|
||||
float pos[][2] = { {0.5,0.5}, };
|
||||
out_value[0] = pos[sample_index][0];
|
||||
out_value[1] = pos[sample_index][1];
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
float pos[][2] = { {0.75,0.75},
|
||||
{0.25,0.25}, };
|
||||
out_value[0] = pos[sample_index][0];
|
||||
out_value[1] = pos[sample_index][1];
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
float pos[][2] = { {0.375, 0.125},
|
||||
{0.875, 0.375},
|
||||
{0.125, 0.625},
|
||||
{0.625, 0.875}, };
|
||||
out_value[0] = pos[sample_index][0];
|
||||
out_value[1] = pos[sample_index][1];
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
float pos[][2] = { {0.5625, 0.3125},
|
||||
{0.4375, 0.6875},
|
||||
{0.8125, 0.5625},
|
||||
{0.3125, 0.1875},
|
||||
{0.1875, 0.8125},
|
||||
{0.0625, 0.4375},
|
||||
{0.6875, 0.9375},
|
||||
{0.9375, 0.0625}, };
|
||||
out_value[0] = pos[sample_index][0];
|
||||
out_value[1] = pos[sample_index][1];
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
float pos[][2] = { {0.5625, 0.5625},
|
||||
{0.4375, 0.3125},
|
||||
{0.3125, 0.625},
|
||||
{0.75, 0.4375},
|
||||
{0.1875, 0.375},
|
||||
{0.625, 0.8125},
|
||||
{0.8125, 0.6875},
|
||||
{0.6875, 0.1875},
|
||||
{0.375, 0.875},
|
||||
{0.5, 0.0625},
|
||||
{0.25, 0.125},
|
||||
{0.125, 0.75},
|
||||
{0.0, 0.5},
|
||||
{0.9375, 0.25},
|
||||
{0.875, 0.9375},
|
||||
{0.0625, 0.0}, };
|
||||
out_value[0] = pos[sample_index][0];
|
||||
out_value[1] = pos[sample_index][1];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
unreachable("unhandled sample count!");
|
||||
}
|
||||
u_default_get_sample_position(ctx, sample_count, sample_index, out_value);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user