[virglrenderer-devel] [PATCH 1/2] vrend: Support caps struct v2
Stéphane Marchesin
marcheu at chromium.org
Sat Feb 10 01:20:54 UTC 2018
This new struct allows us to report accurate max point size
and line width.
Signed-off-by: Stéphane Marchesin <marcheu at chromium.org>
---
src/virgl_hw.h | 29 +++++++++++++++++++++++++++++
src/vrend_renderer.c | 19 ++++++++++++++++++-
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index 8c6f523..ca043a3 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -257,9 +257,38 @@ struct virgl_caps_v1 {
uint32_t max_texture_gather_components;
};
+struct virgl_caps_v2 {
+ uint32_t max_version;
+ struct virgl_supported_format_mask sampler;
+ struct virgl_supported_format_mask render;
+ struct virgl_supported_format_mask depthstencil;
+ struct virgl_supported_format_mask vertexbuffer;
+ struct virgl_caps_bool_set1 bset;
+ uint32_t glsl_level;
+ uint32_t max_texture_array_layers;
+ uint32_t max_streamout_buffers;
+ uint32_t max_dual_source_render_targets;
+ uint32_t max_render_targets;
+ uint32_t max_samples;
+ uint32_t prim_mask;
+ uint32_t max_tbo_size;
+ uint32_t max_uniform_blocks;
+ uint32_t max_viewports;
+ uint32_t max_texture_gather_components;
+ float min_aliased_point_size;
+ float max_aliased_point_size;
+ float min_smooth_point_size;
+ float max_smooth_point_size;
+ float min_aliased_line_width;
+ float max_aliased_line_width;
+ float min_smooth_line_width;
+ float max_smooth_line_width;
+};
+
union virgl_caps {
uint32_t max_version;
struct virgl_caps_v1 v1;
+ struct virgl_caps_v2 v2;
};
enum virgl_errors {
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index ec37fc8..6ef6cff 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -6208,6 +6208,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
{
int i;
GLint max;
+ GLfloat range[2];
int gl_ver = epoxy_gl_version();
if (!caps)
@@ -6220,7 +6221,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
return;
}
- caps->max_version = 1;
+ caps->max_version = 2;
caps->v1.bset.occlusion_query = 1;
if (gl_ver >= 30) {
@@ -6381,6 +6382,22 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
}
}
}
+
+ glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, range);
+ caps->v2.min_aliased_point_size = range[0];
+ caps->v2.max_aliased_point_size = range[1];
+
+ glGetFloatv(GL_SMOOTH_POINT_SIZE_RANGE, range);
+ caps->v2.min_smooth_point_size = range[0];
+ caps->v2.max_smooth_point_size = range[1];
+
+ glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, range);
+ caps->v2.min_aliased_line_width = range[0];
+ caps->v2.max_aliased_line_width = range[1];
+
+ glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, range);
+ caps->v2.min_smooth_line_width = range[0];
+ caps->v2.max_smooth_line_width = range[1];
}
GLint64 vrend_renderer_get_timestamp(void)
--
2.16.0.rc1.238.g530d649a79-goog
More information about the virglrenderer-devel
mailing list