summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2018-07-13 14:46:31 +0200
committerGert Wollny <[email protected]>2018-07-16 12:51:39 +0200
commit78887e99e3fdc1933c9fd185e38d4e61d05672a4 (patch)
treef53e29f7d3483fbfe03e9948fe9e1e460e880662 /src/gallium
parent4d0d9118756325ea83d254515d4c7a410df96f0e (diff)
mesa/virgl: Fix off-by-one and copy-paste error in multisample position evaluation
Converting from a switch statement that would not allow intermediate sample counts to use an if-else chain went a bit wrong, so that in some cases the range that should be inclusive was exclusive and the line for 16 samples was copies wrongly. v2: elaborate commit message. Fixes: 91f48cdfe5c817158c533a8f67c60e9aabbe4479 virgl: Add support for glGetMultisample Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> (v1)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index d985bf906fb..f5e3832d99f 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -943,11 +943,11 @@ static void virgl_get_sample_position(struct pipe_context *ctx,
return;
} else if (sample_count == 2) {
bits = vs->caps.caps.v2.msaa_sample_positions[0] >> (8 * index);
- } else if (sample_count < 4) {
+ } else if (sample_count <= 4) {
bits = vs->caps.caps.v2.msaa_sample_positions[1] >> (8 * index);
- } else if (sample_count < 8) {
+ } else if (sample_count <= 8) {
bits = vs->caps.caps.v2.msaa_sample_positions[2 + (index >> 2)] >> (8 * (index & 3));
- } else if (sample_count < 8) {
+ } else if (sample_count <= 16) {
bits = vs->caps.caps.v2.msaa_sample_positions[4 + (index >> 2)] >> (8 * (index & 3));
}
out_value[0] = ((bits >> 4) & 0xf) / 16.0f;