OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/shader_translator.h" | 5 #include "gpu/command_buffer/service/shader_translator.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 g_translator_initializer.Get(); | 116 g_translator_initializer.Get(); |
117 | 117 |
118 ShShaderOutput shader_output = | 118 ShShaderOutput shader_output = |
119 (glsl_implementation_type == kGlslES ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT); | 119 (glsl_implementation_type == kGlslES ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT); |
120 | 120 |
121 { | 121 { |
122 TRACE_EVENT0("gpu", "ShConstructCompiler"); | 122 TRACE_EVENT0("gpu", "ShConstructCompiler"); |
123 compiler_ = ShConstructCompiler( | 123 compiler_ = ShConstructCompiler( |
124 shader_type, shader_spec, shader_output, resources); | 124 shader_type, shader_spec, shader_output, resources); |
125 } | 125 } |
126 compiler_options_ = *resources; | |
127 implementation_is_glsl_es_ = (glsl_implementation_type == kGlslES); | 126 implementation_is_glsl_es_ = (glsl_implementation_type == kGlslES); |
128 driver_bug_workarounds_ = driver_bug_workarounds; | 127 driver_bug_workarounds_ = driver_bug_workarounds; |
129 return compiler_ != NULL; | 128 return compiler_ != NULL; |
130 } | 129 } |
131 | 130 |
132 int ShaderTranslator::GetCompileOptions() const { | 131 int ShaderTranslator::GetCompileOptions() const { |
133 int compile_options = | 132 int compile_options = |
134 SH_OBJECT_CODE | SH_VARIABLES | SH_ENFORCE_PACKING_RESTRICTIONS | | 133 SH_OBJECT_CODE | SH_VARIABLES | SH_ENFORCE_PACKING_RESTRICTIONS | |
135 SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | | 134 SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | |
136 SH_CLAMP_INDIRECT_ARRAY_BOUNDS; | 135 SH_CLAMP_INDIRECT_ARRAY_BOUNDS; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 destruction_observers_, | 204 destruction_observers_, |
206 OnDestruct(this)); | 205 OnDestruct(this)); |
207 | 206 |
208 if (compiler_ != NULL) | 207 if (compiler_ != NULL) |
209 ShDestruct(compiler_); | 208 ShDestruct(compiler_); |
210 } | 209 } |
211 | 210 |
212 } // namespace gles2 | 211 } // namespace gles2 |
213 } // namespace gpu | 212 } // namespace gpu |
214 | 213 |
OLD | NEW |