[Mesa-dev] [PATCH v2 1/2] virgl: rename msaa_sample_positions -> sample_locations

Erik Faye-Lund erik.faye-lund at collabora.com
Fri Jul 27 07:18:36 UTC 2018


This matches what this field is called in virglrenderer's copy of
this.

While we're at it, fixup the indentation.

This reduces the diff between the two different versions of
virgl_hw.h, and should make it easier to upgrade the file in
the future.
---
 src/gallium/drivers/virgl/virgl_context.c | 8 ++++----
 src/gallium/drivers/virgl/virgl_hw.h      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 74b232fe6c..832bd05efc 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -996,13 +996,13 @@ static void virgl_get_sample_position(struct pipe_context *ctx,
       out_value[0] = out_value[1] = 0.5f;
       return;
    } else if (sample_count == 2) {
-      bits = vs->caps.caps.v2.msaa_sample_positions[0] >> (8 * index);
+      bits = vs->caps.caps.v2.sample_locations[0] >> (8 * index);
    } else if (sample_count <= 4) {
-      bits = vs->caps.caps.v2.msaa_sample_positions[1] >> (8 * index);
+      bits = vs->caps.caps.v2.sample_locations[1] >> (8 * index);
    } else if (sample_count <= 8) {
-      bits = vs->caps.caps.v2.msaa_sample_positions[2 + (index >> 2)] >> (8 * (index & 3));
+      bits = vs->caps.caps.v2.sample_locations[2 + (index >> 2)] >> (8 * (index & 3));
    } else if (sample_count <= 16) {
-      bits = vs->caps.caps.v2.msaa_sample_positions[4 + (index >> 2)] >> (8 * (index & 3));
+      bits = vs->caps.caps.v2.sample_locations[4 + (index >> 2)] >> (8 * (index & 3));
    }
    out_value[0] = ((bits >> 4) & 0xf) / 16.0f;
    out_value[1] = (bits & 0xf) / 16.0f;
diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h
index 4469515dd1..059888b13b 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -303,7 +303,7 @@ struct virgl_caps_v2 {
         uint32_t uniform_buffer_offset_alignment;
         uint32_t shader_buffer_offset_alignment;
         uint32_t capability_bits;
-        uint32_t msaa_sample_positions[8];
+        uint32_t sample_locations[8];
         uint32_t max_vertex_attrib_stride;
         uint32_t max_shader_buffer_frag_compute;
         uint32_t max_shader_buffer_other_stages;
-- 
2.18.0



More information about the mesa-dev mailing list