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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 640283003: Use NV_draw_buffers to implement EXT_draw_buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Added explanation of nv_draw_buffers flag to feature_info.cc Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info_unittest.cc ('k') | gpu/command_buffer/service/test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698