1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_
6 #define GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_
8 #include "gpu/gpu_export.h"
10 // From gl2.h. We want to avoid including gl headers because client-side and
11 // service-side headers conflict.
12 #define GL_FRAGMENT_SHADER 0x8B30
13 #define GL_VERTEX_SHADER 0x8B31
14 #define GL_LOW_FLOAT 0x8DF0
15 #define GL_MEDIUM_FLOAT 0x8DF1
16 #define GL_HIGH_FLOAT 0x8DF2
17 #define GL_LOW_INT 0x8DF3
18 #define GL_MEDIUM_INT 0x8DF4
19 #define GL_HIGH_INT 0x8DF5
23 struct GPU_EXPORT Capabilities
{
24 struct ShaderPrecision
{
25 ShaderPrecision() : min_range(0), max_range(0), precision(0) {}
31 struct PerStagePrecisions
{
34 ShaderPrecision low_int
;
35 ShaderPrecision medium_int
;
36 ShaderPrecision high_int
;
37 ShaderPrecision low_float
;
38 ShaderPrecision medium_float
;
39 ShaderPrecision high_float
;
45 void VisitStagePrecisions(unsigned stage
,
46 PerStagePrecisions
* precisions
,
48 visitor(stage
, GL_LOW_INT
, &precisions
->low_int
);
49 visitor(stage
, GL_MEDIUM_INT
, &precisions
->medium_int
);
50 visitor(stage
, GL_HIGH_INT
, &precisions
->high_int
);
51 visitor(stage
, GL_LOW_FLOAT
, &precisions
->low_float
);
52 visitor(stage
, GL_MEDIUM_FLOAT
, &precisions
->medium_float
);
53 visitor(stage
, GL_HIGH_FLOAT
, &precisions
->high_float
);
57 void VisitPrecisions(const T
& visitor
) {
58 VisitStagePrecisions(GL_VERTEX_SHADER
, &vertex_shader_precisions
, visitor
);
59 VisitStagePrecisions(GL_FRAGMENT_SHADER
, &fragment_shader_precisions
,
63 PerStagePrecisions vertex_shader_precisions
;
64 PerStagePrecisions fragment_shader_precisions
;
65 int max_combined_texture_image_units
;
66 int max_cube_map_texture_size
;
67 int max_fragment_uniform_vectors
;
68 int max_renderbuffer_size
;
69 int max_texture_image_units
;
71 int max_varying_vectors
;
72 int max_vertex_attribs
;
73 int max_vertex_texture_image_units
;
74 int max_vertex_uniform_vectors
;
75 int num_compressed_texture_formats
;
76 int num_shader_binary_formats
;
77 int bind_generates_resource_chromium
;
78 int max_transform_feedback_separate_attribs
;
79 int max_uniform_buffer_bindings
;
80 int uniform_buffer_offset_alignment
;
83 bool egl_image_external
;
84 bool texture_format_atc
;
85 bool texture_format_bgra8888
;
86 bool texture_format_dxt1
;
87 bool texture_format_dxt5
;
88 bool texture_format_etc1
;
89 bool texture_format_etc1_npot
;
90 bool texture_rectangle
;
94 bool discard_framebuffer
;
97 bool future_sync_points
;
98 bool blend_equation_advanced
;
99 bool blend_equation_advanced_coherent
;
105 #endif // GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_