Fix crash in SpeechRecognizerImpl introduced in AudioParams refactor.
[chromium-blink-merge.git] / gpu / command_buffer / common / capabilities.h
blob532c2dfff14a0d0f39821d3ece8240cc8c3a53b8
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 <stdint.h>
10 #include "gpu/gpu_export.h"
12 // From gl2.h. We want to avoid including gl headers because client-side and
13 // service-side headers conflict.
14 #define GL_FRAGMENT_SHADER 0x8B30
15 #define GL_VERTEX_SHADER 0x8B31
16 #define GL_LOW_FLOAT 0x8DF0
17 #define GL_MEDIUM_FLOAT 0x8DF1
18 #define GL_HIGH_FLOAT 0x8DF2
19 #define GL_LOW_INT 0x8DF3
20 #define GL_MEDIUM_INT 0x8DF4
21 #define GL_HIGH_INT 0x8DF5
23 namespace gpu {
25 // NOTE: When adding members to this struct, also add corresponding
26 // entries in gpu/ipc/gpu_command_buffer_traits_multi.h.
28 struct GPU_EXPORT Capabilities {
29 struct ShaderPrecision {
30 ShaderPrecision() : min_range(0), max_range(0), precision(0) {}
31 int min_range;
32 int max_range;
33 int precision;
36 struct PerStagePrecisions {
37 PerStagePrecisions();
39 ShaderPrecision low_int;
40 ShaderPrecision medium_int;
41 ShaderPrecision high_int;
42 ShaderPrecision low_float;
43 ShaderPrecision medium_float;
44 ShaderPrecision high_float;
47 Capabilities();
49 template <typename T>
50 void VisitStagePrecisions(unsigned stage,
51 PerStagePrecisions* precisions,
52 const T& visitor) {
53 visitor(stage, GL_LOW_INT, &precisions->low_int);
54 visitor(stage, GL_MEDIUM_INT, &precisions->medium_int);
55 visitor(stage, GL_HIGH_INT, &precisions->high_int);
56 visitor(stage, GL_LOW_FLOAT, &precisions->low_float);
57 visitor(stage, GL_MEDIUM_FLOAT, &precisions->medium_float);
58 visitor(stage, GL_HIGH_FLOAT, &precisions->high_float);
61 template <typename T>
62 void VisitPrecisions(const T& visitor) {
63 VisitStagePrecisions(GL_VERTEX_SHADER, &vertex_shader_precisions, visitor);
64 VisitStagePrecisions(GL_FRAGMENT_SHADER, &fragment_shader_precisions,
65 visitor);
68 PerStagePrecisions vertex_shader_precisions;
69 PerStagePrecisions fragment_shader_precisions;
70 int max_combined_texture_image_units;
71 int max_cube_map_texture_size;
72 int max_fragment_uniform_vectors;
73 int max_renderbuffer_size;
74 int max_texture_image_units;
75 int max_texture_size;
76 int max_varying_vectors;
77 int max_vertex_attribs;
78 int max_vertex_texture_image_units;
79 int max_vertex_uniform_vectors;
80 int num_compressed_texture_formats;
81 int num_shader_binary_formats;
82 int bind_generates_resource_chromium;
84 int max_3d_texture_size;
85 int max_array_texture_layers;
86 int max_color_attachments;
87 int64_t max_combined_fragment_uniform_components;
88 int max_combined_uniform_blocks;
89 int64_t max_combined_vertex_uniform_components;
90 int max_copy_texture_chromium_size;
91 int max_draw_buffers;
92 int64_t max_element_index;
93 int max_elements_indices;
94 int max_elements_vertices;
95 int max_fragment_input_components;
96 int max_fragment_uniform_blocks;
97 int max_fragment_uniform_components;
98 int max_program_texel_offset;
99 int max_samples;
100 int64_t max_server_wait_timeout;
101 float max_texture_lod_bias;
102 int max_transform_feedback_interleaved_components;
103 int max_transform_feedback_separate_attribs;
104 int max_transform_feedback_separate_components;
105 int64_t max_uniform_block_size;
106 int max_uniform_buffer_bindings;
107 int max_varying_components;
108 int max_vertex_output_components;
109 int max_vertex_uniform_blocks;
110 int max_vertex_uniform_components;
111 int min_program_texel_offset;
112 int num_extensions;
113 int num_program_binary_formats;
114 int uniform_buffer_offset_alignment;
116 bool post_sub_buffer;
117 bool egl_image_external;
118 bool texture_format_astc;
119 bool texture_format_atc;
120 bool texture_format_bgra8888;
121 bool texture_format_dxt1;
122 bool texture_format_dxt5;
123 bool texture_format_etc1;
124 bool texture_format_etc1_npot;
125 bool texture_rectangle;
126 bool iosurface;
127 bool texture_usage;
128 bool texture_storage;
129 bool discard_framebuffer;
130 bool sync_query;
131 bool image;
132 bool future_sync_points;
133 bool blend_equation_advanced;
134 bool blend_equation_advanced_coherent;
135 bool texture_rg;
136 bool image_ycbcr_422;
137 bool render_buffer_format_bgra8888;
138 bool occlusion_query_boolean;
139 bool timer_queries;
140 bool surfaceless;
142 int major_version;
143 int minor_version;
146 } // namespace gpu
148 #endif // GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_