Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: gpu/command_buffer/common/capabilities.h

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/cmd_buffer_functions.txt ('k') | gpu/command_buffer/common/capabilities.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/capabilities.h
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h
index fff1ef854e39f07a74fbf0f2194b22ed2b2bfc31..224829c68b565c872fbcb23f3a21e4449aa94cbe 100644
--- a/gpu/command_buffer/common/capabilities.h
+++ b/gpu/command_buffer/common/capabilities.h
@@ -7,9 +7,75 @@
#include "gpu/gpu_export.h"
+// From gl2.h. We want to avoid including gl headers because client-side and
+// service-side headers conflict.
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_LOW_FLOAT 0x8DF0
+#define GL_MEDIUM_FLOAT 0x8DF1
+#define GL_HIGH_FLOAT 0x8DF2
+#define GL_LOW_INT 0x8DF3
+#define GL_MEDIUM_INT 0x8DF4
+#define GL_HIGH_INT 0x8DF5
+
namespace gpu {
struct GPU_EXPORT Capabilities {
+ struct ShaderPrecision {
+ ShaderPrecision() : min_range(0), max_range(0), precision(0) {}
+ int min_range;
+ int max_range;
+ int precision;
+ };
+
+ struct PerStagePrecisions {
+ PerStagePrecisions();
+
+ ShaderPrecision low_int;
+ ShaderPrecision medium_int;
+ ShaderPrecision high_int;
+ ShaderPrecision low_float;
+ ShaderPrecision medium_float;
+ ShaderPrecision high_float;
+ };
+
+ Capabilities();
+
+ template <typename T>
+ void VisitStagePrecisions(unsigned stage,
+ PerStagePrecisions* precisions,
+ const T& visitor) {
+ visitor(stage, GL_LOW_INT, &precisions->low_int);
+ visitor(stage, GL_MEDIUM_INT, &precisions->medium_int);
+ visitor(stage, GL_HIGH_INT, &precisions->high_int);
+ visitor(stage, GL_LOW_FLOAT, &precisions->low_float);
+ visitor(stage, GL_MEDIUM_FLOAT, &precisions->medium_float);
+ visitor(stage, GL_HIGH_FLOAT, &precisions->high_float);
+ }
+
+ template <typename T>
+ void VisitPrecisions(const T& visitor) {
+ VisitStagePrecisions(GL_VERTEX_SHADER, &vertex_shader_precisions, visitor);
+ VisitStagePrecisions(GL_FRAGMENT_SHADER, &fragment_shader_precisions,
+ visitor);
+ }
+
+ PerStagePrecisions vertex_shader_precisions;
+ PerStagePrecisions fragment_shader_precisions;
+ int max_combined_texture_image_units;
+ int max_cube_map_texture_size;
+ int max_fragment_uniform_vectors;
+ int max_renderbuffer_size;
+ int max_texture_image_units;
+ int max_texture_size;
+ int max_varying_vectors;
+ int max_vertex_attribs;
+ int max_vertex_texture_image_units;
+ int max_vertex_uniform_vectors;
+ int num_compressed_texture_formats;
+ int num_shader_binary_formats;
+ int bind_generates_resource_chromium;
+
bool post_sub_buffer;
bool egl_image_external;
bool texture_format_bgra8888;
@@ -25,8 +91,6 @@ struct GPU_EXPORT Capabilities {
bool future_sync_points;
bool blend_equation_advanced;
bool blend_equation_advanced_coherent;
-
- Capabilities();
};
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/cmd_buffer_functions.txt ('k') | gpu/command_buffer/common/capabilities.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698