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

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: 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 6158 matching lines...) Expand 10 before | Expand all | Expand 10 after
6169 framebuffer->AttachRenderbuffer(attachment, renderbuffer); 6169 framebuffer->AttachRenderbuffer(attachment, renderbuffer);
6170 } 6170 }
6171 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { 6171 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) {
6172 framebuffer_state_.clear_state_dirty = true; 6172 framebuffer_state_.clear_state_dirty = true;
6173 } 6173 }
6174 OnFboChanged(); 6174 OnFboChanged();
6175 } 6175 }
6176 6176
6177 void GLES2DecoderImpl::DoDisable(GLenum cap) { 6177 void GLES2DecoderImpl::DoDisable(GLenum cap) {
6178 if (SetCapabilityState(cap, false)) { 6178 if (SetCapabilityState(cap, false)) {
6179 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
6180 // TODO(Yunchao): crbug.com/594021
6181 // On Desktop GL with versions lower than 4.3, we need to emulate
6182 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
6183 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
6184 return;
6185 }
6186 buffer_manager()->SetPrimitiveRestartState(false);
6187 }
6179 glDisable(cap); 6188 glDisable(cap);
6180 } 6189 }
6181 } 6190 }
6182 6191
6183 void GLES2DecoderImpl::DoEnable(GLenum cap) { 6192 void GLES2DecoderImpl::DoEnable(GLenum cap) {
6184 if (SetCapabilityState(cap, true)) { 6193 if (SetCapabilityState(cap, true)) {
6194 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) {
6195 // TODO(Yunchao): crbug.com/594021
6196 // On Desktop GL with versions lower than 4.3, we need to emulate
6197 // GL_PRIMITIVE_RESTART_FIXED_INDEX using glPrimitiveRestartIndex().
6198 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) {
6199 return;
6200 }
6201 buffer_manager()->SetPrimitiveRestartState(true);
6202 }
6185 glEnable(cap); 6203 glEnable(cap);
6186 } 6204 }
6187 } 6205 }
6188 6206
6189 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) { 6207 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) {
6190 state_.z_near = std::min(1.0f, std::max(0.0f, znear)); 6208 state_.z_near = std::min(1.0f, std::max(0.0f, znear));
6191 state_.z_far = std::min(1.0f, std::max(0.0f, zfar)); 6209 state_.z_far = std::min(1.0f, std::max(0.0f, zfar));
6192 glDepthRange(znear, zfar); 6210 glDepthRange(znear, zfar);
6193 } 6211 }
6194 6212
(...skipping 10057 matching lines...) Expand 10 before | Expand all | Expand 10 after
16252 } 16270 }
16253 16271
16254 // Include the auto-generated part of this file. We split this because it means 16272 // Include the auto-generated part of this file. We split this because it means
16255 // we can easily edit the non-auto generated parts right here in this file 16273 // we can easily edit the non-auto generated parts right here in this file
16256 // instead of having to edit some template or the code generator. 16274 // instead of having to edit some template or the code generator.
16257 #include "base/macros.h" 16275 #include "base/macros.h"
16258 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16276 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16259 16277
16260 } // namespace gles2 16278 } // namespace gles2
16261 } // namespace gpu 16279 } // 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