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

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

Issue 2278823002: Fix getInternalformativ on GL 4.1 or lower. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16311 matching lines...) Expand 10 before | Expand all | Expand 10 after
16322 } 16322 }
16323 if (!validators_->internal_format_parameter.IsValid(pname)) { 16323 if (!validators_->internal_format_parameter.IsValid(pname)) {
16324 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetInternalformativ", pname, "pname"); 16324 LOCAL_SET_GL_ERROR_INVALID_ENUM("glGetInternalformativ", pname, "pname");
16325 return error::kNoError; 16325 return error::kNoError;
16326 } 16326 }
16327 16327
16328 typedef cmds::GetInternalformativ::Result Result; 16328 typedef cmds::GetInternalformativ::Result Result;
16329 GLsizei num_values = 0; 16329 GLsizei num_values = 0;
16330 std::vector<GLint> samples; 16330 std::vector<GLint> samples;
16331 if (gl_version_info().IsLowerThanGL(4, 2)) { 16331 if (gl_version_info().IsLowerThanGL(4, 2)) {
16332 if (!GLES2Util::IsIntegerFormat(format) && 16332 if (!GLES2Util::IsIntegerFormat(format)) {
16333 !GLES2Util::IsFloatFormat(format)) { 16333 // No multisampling for integer formats.
16334 // No multisampling for integer formats and float formats.
16335 GLint max_samples = renderbuffer_manager()->max_samples(); 16334 GLint max_samples = renderbuffer_manager()->max_samples();
16336 while (max_samples > 0) { 16335 while (max_samples > 0) {
16337 samples.push_back(max_samples); 16336 samples.push_back(max_samples);
16338 max_samples = max_samples >> 1; 16337 --max_samples;
16339 } 16338 }
16340 } 16339 }
16341 switch (pname) { 16340 switch (pname) {
16342 case GL_NUM_SAMPLE_COUNTS: 16341 case GL_NUM_SAMPLE_COUNTS:
16343 num_values = 1; 16342 num_values = 1;
16344 break; 16343 break;
16345 case GL_SAMPLES: 16344 case GL_SAMPLES:
16346 num_values = static_cast<GLsizei>(samples.size()); 16345 num_values = static_cast<GLsizei>(samples.size());
16347 break; 16346 break;
16348 default: 16347 default:
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
17694 } 17693 }
17695 17694
17696 // Include the auto-generated part of this file. We split this because it means 17695 // Include the auto-generated part of this file. We split this because it means
17697 // we can easily edit the non-auto generated parts right here in this file 17696 // we can easily edit the non-auto generated parts right here in this file
17698 // instead of having to edit some template or the code generator. 17697 // instead of having to edit some template or the code generator.
17699 #include "base/macros.h" 17698 #include "base/macros.h"
17700 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17699 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17701 17700
17702 } // namespace gles2 17701 } // namespace gles2
17703 } // namespace gpu 17702 } // namespace gpu
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698