Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1466 | 1466 |
| 1467 // Verifies that the currently bound multisample renderbuffer is valid | 1467 // Verifies that the currently bound multisample renderbuffer is valid |
| 1468 // Very slow! Only done on platforms with driver bugs that return invalid | 1468 // Very slow! Only done on platforms with driver bugs that return invalid |
| 1469 // buffers under memory pressure | 1469 // buffers under memory pressure |
| 1470 bool VerifyMultisampleRenderbufferIntegrity( | 1470 bool VerifyMultisampleRenderbufferIntegrity( |
| 1471 GLuint renderbuffer, GLenum format); | 1471 GLuint renderbuffer, GLenum format); |
| 1472 | 1472 |
| 1473 // Wrapper for glReleaseShaderCompiler. | 1473 // Wrapper for glReleaseShaderCompiler. |
| 1474 void DoReleaseShaderCompiler() { } | 1474 void DoReleaseShaderCompiler() { } |
| 1475 | 1475 |
| 1476 // Wrappers for glSamplerParameter*v functions. | |
| 1477 void DoSamplerParameterfv( | |
| 1478 GLuint sampler, GLenum pname, const GLfloat* params); | |
| 1479 void DoSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params); | |
| 1480 | |
| 1476 // Wrappers for glTexParameter functions. | 1481 // Wrappers for glTexParameter functions. |
| 1477 void DoTexParameterf(GLenum target, GLenum pname, GLfloat param); | 1482 void DoTexParameterf(GLenum target, GLenum pname, GLfloat param); |
| 1478 void DoTexParameteri(GLenum target, GLenum pname, GLint param); | 1483 void DoTexParameteri(GLenum target, GLenum pname, GLint param); |
| 1479 void DoTexParameterfv(GLenum target, GLenum pname, const GLfloat* params); | 1484 void DoTexParameterfv(GLenum target, GLenum pname, const GLfloat* params); |
| 1480 void DoTexParameteriv(GLenum target, GLenum pname, const GLint* params); | 1485 void DoTexParameteriv(GLenum target, GLenum pname, const GLint* params); |
| 1481 | 1486 |
| 1482 // Wrappers for glUniform1i and glUniform1iv as according to the GLES2 | 1487 // Wrappers for glUniform1i and glUniform1iv as according to the GLES2 |
| 1483 // spec only these 2 functions can be used to set sampler uniforms. | 1488 // spec only these 2 functions can be used to set sampler uniforms. |
| 1484 void DoUniform1i(GLint fake_location, GLint v0); | 1489 void DoUniform1i(GLint fake_location, GLint v0); |
| 1485 void DoUniform1iv(GLint fake_location, GLsizei count, const GLint* value); | 1490 void DoUniform1iv(GLint fake_location, GLsizei count, const GLint* value); |
| (...skipping 4365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5851 if (workarounds().clear_uniforms_before_first_program_use) | 5856 if (workarounds().clear_uniforms_before_first_program_use) |
| 5852 program_manager()->ClearUniforms(program); | 5857 program_manager()->ClearUniforms(program); |
| 5853 } | 5858 } |
| 5854 } | 5859 } |
| 5855 | 5860 |
| 5856 // LinkProgram can be very slow. Exit command processing to allow for | 5861 // LinkProgram can be very slow. Exit command processing to allow for |
| 5857 // context preemption and GPU watchdog checks. | 5862 // context preemption and GPU watchdog checks. |
| 5858 ExitCommandProcessingEarly(); | 5863 ExitCommandProcessingEarly(); |
| 5859 }; | 5864 }; |
| 5860 | 5865 |
| 5866 void GLES2DecoderImpl::DoSamplerParameterfv( | |
| 5867 GLuint sampler, GLenum pname, const GLfloat* params) { | |
|
piman
2015/01/09 07:10:57
These 2 methods need to be disabled if !unsafe_es3
Zhenyao Mo
2015/01/09 17:45:27
The check happens in Handle* function, which is th
| |
| 5868 DCHECK(params); | |
| 5869 glSamplerParameterf(sampler, pname, params[0]); | |
|
Zhenyao Mo
2014/12/10 01:59:12
This is use glSamplerParameterf to implement glSam
| |
| 5870 } | |
| 5871 | |
| 5872 void GLES2DecoderImpl::DoSamplerParameteriv( | |
| 5873 GLuint sampler, GLenum pname, const GLint* params) { | |
| 5874 DCHECK(params); | |
| 5875 glSamplerParameteri(sampler, pname, params[0]); | |
|
Zhenyao Mo
2014/12/10 01:59:12
This is use glSamplerParameteri to implement glSam
| |
| 5876 } | |
| 5877 | |
| 5861 void GLES2DecoderImpl::DoTexParameterf( | 5878 void GLES2DecoderImpl::DoTexParameterf( |
| 5862 GLenum target, GLenum pname, GLfloat param) { | 5879 GLenum target, GLenum pname, GLfloat param) { |
| 5863 TextureRef* texture = texture_manager()->GetTextureInfoForTarget( | 5880 TextureRef* texture = texture_manager()->GetTextureInfoForTarget( |
| 5864 &state_, target); | 5881 &state_, target); |
| 5865 if (!texture) { | 5882 if (!texture) { |
| 5866 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexParameterf", "unknown texture"); | 5883 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexParameterf", "unknown texture"); |
| 5867 return; | 5884 return; |
| 5868 } | 5885 } |
| 5869 | 5886 |
| 5870 texture_manager()->SetParameterf( | 5887 texture_manager()->SetParameterf( |
| (...skipping 5661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11532 } | 11549 } |
| 11533 } | 11550 } |
| 11534 | 11551 |
| 11535 // Include the auto-generated part of this file. We split this because it means | 11552 // Include the auto-generated part of this file. We split this because it means |
| 11536 // we can easily edit the non-auto generated parts right here in this file | 11553 // we can easily edit the non-auto generated parts right here in this file |
| 11537 // instead of having to edit some template or the code generator. | 11554 // instead of having to edit some template or the code generator. |
| 11538 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 11555 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 11539 | 11556 |
| 11540 } // namespace gles2 | 11557 } // namespace gles2 |
| 11541 } // namespace gpu | 11558 } // namespace gpu |
| OLD | NEW |