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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 2774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2785 resources.FragmentPrecisionHigh = | 2785 resources.FragmentPrecisionHigh = |
2786 PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision); | 2786 PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision); |
2787 | 2787 |
2788 if (force_webgl_glsl_validation_) { | 2788 if (force_webgl_glsl_validation_) { |
2789 resources.OES_standard_derivatives = derivatives_explicitly_enabled_; | 2789 resources.OES_standard_derivatives = derivatives_explicitly_enabled_; |
2790 resources.EXT_frag_depth = frag_depth_explicitly_enabled_; | 2790 resources.EXT_frag_depth = frag_depth_explicitly_enabled_; |
2791 resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_; | 2791 resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_; |
2792 if (!draw_buffers_explicitly_enabled_) | 2792 if (!draw_buffers_explicitly_enabled_) |
2793 resources.MaxDrawBuffers = 1; | 2793 resources.MaxDrawBuffers = 1; |
2794 resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_; | 2794 resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_; |
| 2795 resources.NV_draw_buffers = |
| 2796 draw_buffers_explicitly_enabled_ && features().nv_draw_buffers; |
2795 } else { | 2797 } else { |
2796 resources.OES_standard_derivatives = | 2798 resources.OES_standard_derivatives = |
2797 features().oes_standard_derivatives ? 1 : 0; | 2799 features().oes_standard_derivatives ? 1 : 0; |
2798 resources.ARB_texture_rectangle = | 2800 resources.ARB_texture_rectangle = |
2799 features().arb_texture_rectangle ? 1 : 0; | 2801 features().arb_texture_rectangle ? 1 : 0; |
2800 resources.OES_EGL_image_external = | 2802 resources.OES_EGL_image_external = |
2801 features().oes_egl_image_external ? 1 : 0; | 2803 features().oes_egl_image_external ? 1 : 0; |
2802 resources.EXT_draw_buffers = | 2804 resources.EXT_draw_buffers = |
2803 features().ext_draw_buffers ? 1 : 0; | 2805 features().ext_draw_buffers ? 1 : 0; |
2804 resources.EXT_frag_depth = | 2806 resources.EXT_frag_depth = |
2805 features().ext_frag_depth ? 1 : 0; | 2807 features().ext_frag_depth ? 1 : 0; |
2806 resources.EXT_shader_texture_lod = | 2808 resources.EXT_shader_texture_lod = |
2807 features().ext_shader_texture_lod ? 1 : 0; | 2809 features().ext_shader_texture_lod ? 1 : 0; |
| 2810 resources.NV_draw_buffers = |
| 2811 features().nv_draw_buffers ? 1 : 0; |
2808 } | 2812 } |
2809 | 2813 |
2810 ShShaderSpec shader_spec = force_webgl_glsl_validation_ ? SH_WEBGL_SPEC | 2814 ShShaderSpec shader_spec = force_webgl_glsl_validation_ ? SH_WEBGL_SPEC |
2811 : SH_GLES2_SPEC; | 2815 : SH_GLES2_SPEC; |
2812 if (shader_spec == SH_WEBGL_SPEC && features().enable_shader_name_hashing) | 2816 if (shader_spec == SH_WEBGL_SPEC && features().enable_shader_name_hashing) |
2813 resources.HashFunction = &CityHash64; | 2817 resources.HashFunction = &CityHash64; |
2814 else | 2818 else |
2815 resources.HashFunction = NULL; | 2819 resources.HashFunction = NULL; |
2816 ShaderTranslatorInterface::GlslImplementationType implementation_type = | 2820 ShaderTranslatorInterface::GlslImplementationType implementation_type = |
2817 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ? | 2821 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2 ? |
(...skipping 8326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11144 } | 11148 } |
11145 } | 11149 } |
11146 | 11150 |
11147 // Include the auto-generated part of this file. We split this because it means | 11151 // Include the auto-generated part of this file. We split this because it means |
11148 // we can easily edit the non-auto generated parts right here in this file | 11152 // we can easily edit the non-auto generated parts right here in this file |
11149 // instead of having to edit some template or the code generator. | 11153 // instead of having to edit some template or the code generator. |
11150 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11154 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
11151 | 11155 |
11152 } // namespace gles2 | 11156 } // namespace gles2 |
11153 } // namespace gpu | 11157 } // namespace gpu |
OLD | NEW |