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

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

Issue 1783763002: [WebGL 2] primitive restart should be always enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cache max_value and max_value_primitive_restart_enabled for each range Created 4 years, 9 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 <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 6136 matching lines...) Expand 10 before | Expand all | Expand 10 after
6147 if (error == GL_NO_ERROR) { 6147 if (error == GL_NO_ERROR) {
6148 framebuffer->AttachRenderbuffer(attachment, renderbuffer); 6148 framebuffer->AttachRenderbuffer(attachment, renderbuffer);
6149 } 6149 }
6150 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { 6150 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) {
6151 framebuffer_state_.clear_state_dirty = true; 6151 framebuffer_state_.clear_state_dirty = true;
6152 } 6152 }
6153 OnFboChanged(); 6153 OnFboChanged();
6154 } 6154 }
6155 6155
6156 void GLES2DecoderImpl::DoDisable(GLenum cap) { 6156 void GLES2DecoderImpl::DoDisable(GLenum cap) {
6157 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
6158 // TODO(Yunchao): crbug.com/594021
6159 // On Desktop GL with versions lower than 4.3, we need to emulate
6160 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
6161 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
6162 return;
Ken Russell (switch to Gerrit) 2016/03/19 00:06:41 This short-circuit here and in DoEnable looks wron
6163 }
6164 buffer_manager()->SetPrimitiveRestartState(false);
6165 }
6157 if (SetCapabilityState(cap, false)) { 6166 if (SetCapabilityState(cap, false)) {
6158 glDisable(cap); 6167 glDisable(cap);
6159 } 6168 }
6160 } 6169 }
6161 6170
6162 void GLES2DecoderImpl::DoEnable(GLenum cap) { 6171 void GLES2DecoderImpl::DoEnable(GLenum cap) {
6172 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
6173 // TODO(Yunchao): crbug.com/594021
6174 // On Desktop GL with versions lower than 4.3, we need to emulate
6175 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
6176 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
6177 return;
6178 }
6179 buffer_manager()->SetPrimitiveRestartState(true);
6180 }
6163 if (SetCapabilityState(cap, true)) { 6181 if (SetCapabilityState(cap, true)) {
6164 glEnable(cap); 6182 glEnable(cap);
6165 } 6183 }
6166 } 6184 }
6167 6185
6168 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) { 6186 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) {
6169 state_.z_near = std::min(1.0f, std::max(0.0f, znear)); 6187 state_.z_near = std::min(1.0f, std::max(0.0f, znear));
6170 state_.z_far = std::min(1.0f, std::max(0.0f, zfar)); 6188 state_.z_far = std::min(1.0f, std::max(0.0f, zfar));
6171 glDepthRange(znear, zfar); 6189 glDepthRange(znear, zfar);
6172 } 6190 }
(...skipping 9955 matching lines...) Expand 10 before | Expand all | Expand 10 after
16128 } 16146 }
16129 16147
16130 // Include the auto-generated part of this file. We split this because it means 16148 // Include the auto-generated part of this file. We split this because it means
16131 // we can easily edit the non-auto generated parts right here in this file 16149 // we can easily edit the non-auto generated parts right here in this file
16132 // instead of having to edit some template or the code generator. 16150 // instead of having to edit some template or the code generator.
16133 #include "base/macros.h" 16151 #include "base/macros.h"
16134 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16152 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16135 16153
16136 } // namespace gles2 16154 } // namespace gles2
16137 } // namespace gpu 16155 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/buffer_manager.cc ('k') | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698