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

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

Issue 1674573002: UniformMatrix* supports transpose is true in ES3 semantic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused code and add more unittests Created 4 years, 10 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 7343 matching lines...) Expand 10 before | Expand all | Expand 10 after
7354 return; 7354 return;
7355 } 7355 }
7356 glUniform4uiv(real_location, count, value); 7356 glUniform4uiv(real_location, count, value);
7357 } 7357 }
7358 7358
7359 void GLES2DecoderImpl::DoUniformMatrix2fv( 7359 void GLES2DecoderImpl::DoUniformMatrix2fv(
7360 GLint fake_location, GLsizei count, GLboolean transpose, 7360 GLint fake_location, GLsizei count, GLboolean transpose,
7361 const GLfloat* value) { 7361 const GLfloat* value) {
7362 GLenum type = 0; 7362 GLenum type = 0;
7363 GLint real_location = -1; 7363 GLint real_location = -1;
7364 if (transpose && !unsafe_es3_apis_enabled()) {
7365 LOCAL_SET_GL_ERROR(
7366 GL_INVALID_VALUE, "glUniformMatrix2fv", "transpose not FALSE");
7367 return;
7368 }
7364 if (!PrepForSetUniformByLocation(fake_location, 7369 if (!PrepForSetUniformByLocation(fake_location,
7365 "glUniformMatrix2fv", 7370 "glUniformMatrix2fv",
7366 Program::kUniformMatrix2f, 7371 Program::kUniformMatrix2f,
7367 &real_location, 7372 &real_location,
7368 &type, 7373 &type,
7369 &count)) { 7374 &count)) {
7370 return; 7375 return;
7371 } 7376 }
7372 glUniformMatrix2fv(real_location, count, transpose, value); 7377 glUniformMatrix2fv(real_location, count, transpose, value);
7373 } 7378 }
7374 7379
7375 void GLES2DecoderImpl::DoUniformMatrix3fv( 7380 void GLES2DecoderImpl::DoUniformMatrix3fv(
7376 GLint fake_location, GLsizei count, GLboolean transpose, 7381 GLint fake_location, GLsizei count, GLboolean transpose,
7377 const GLfloat* value) { 7382 const GLfloat* value) {
7378 GLenum type = 0; 7383 GLenum type = 0;
7379 GLint real_location = -1; 7384 GLint real_location = -1;
7385 if (transpose && !unsafe_es3_apis_enabled()) {
7386 LOCAL_SET_GL_ERROR(
7387 GL_INVALID_VALUE, "glUniformMatrix3fv", "transpose not FALSE");
7388 return;
7389 }
7380 if (!PrepForSetUniformByLocation(fake_location, 7390 if (!PrepForSetUniformByLocation(fake_location,
7381 "glUniformMatrix3fv", 7391 "glUniformMatrix3fv",
7382 Program::kUniformMatrix3f, 7392 Program::kUniformMatrix3f,
7383 &real_location, 7393 &real_location,
7384 &type, 7394 &type,
7385 &count)) { 7395 &count)) {
7386 return; 7396 return;
7387 } 7397 }
7388 glUniformMatrix3fv(real_location, count, transpose, value); 7398 glUniformMatrix3fv(real_location, count, transpose, value);
7389 } 7399 }
7390 7400
7391 void GLES2DecoderImpl::DoUniformMatrix4fv( 7401 void GLES2DecoderImpl::DoUniformMatrix4fv(
7392 GLint fake_location, GLsizei count, GLboolean transpose, 7402 GLint fake_location, GLsizei count, GLboolean transpose,
7393 const GLfloat* value) { 7403 const GLfloat* value) {
7394 GLenum type = 0; 7404 GLenum type = 0;
7395 GLint real_location = -1; 7405 GLint real_location = -1;
7406 if (transpose && !unsafe_es3_apis_enabled()) {
7407 LOCAL_SET_GL_ERROR(
7408 GL_INVALID_VALUE, "glUniformMatrix4fv", "transpose not FALSE");
7409 return;
7410 }
7396 if (!PrepForSetUniformByLocation(fake_location, 7411 if (!PrepForSetUniformByLocation(fake_location,
7397 "glUniformMatrix4fv", 7412 "glUniformMatrix4fv",
7398 Program::kUniformMatrix4f, 7413 Program::kUniformMatrix4f,
7399 &real_location, 7414 &real_location,
7400 &type, 7415 &type,
7401 &count)) { 7416 &count)) {
7402 return; 7417 return;
7403 } 7418 }
7404 glUniformMatrix4fv(real_location, count, transpose, value); 7419 glUniformMatrix4fv(real_location, count, transpose, value);
7405 } 7420 }
(...skipping 8178 matching lines...) Expand 10 before | Expand all | Expand 10 after
15584 } 15599 }
15585 15600
15586 // Include the auto-generated part of this file. We split this because it means 15601 // Include the auto-generated part of this file. We split this because it means
15587 // we can easily edit the non-auto generated parts right here in this file 15602 // we can easily edit the non-auto generated parts right here in this file
15588 // instead of having to edit some template or the code generator. 15603 // instead of having to edit some template or the code generator.
15589 #include "base/macros.h" 15604 #include "base/macros.h"
15590 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 15605 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
15591 15606
15592 } // namespace gles2 15607 } // namespace gles2
15593 } // namespace gpu 15608 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_test_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698