diff options
author | Robert Phillips <robertphillips@google.com> | 2018-01-24 14:52:02 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-24 14:52:11 +0000 |
commit | fe8da17f5333a0134a01b9fe4d7f67e3df949c61 (patch) | |
tree | bcffa405e17967214abcc9efcf75ede8d9cff689 /src/gpu/gl | |
parent | 3a08c65b9612dd845623f0e880fd68b3be75fceb (diff) |
Revert "Revert "converted vertex shaders to device coords""
This reverts commit 29b3434e48ca41672266ac40f5b9e8f8a0405cb5.
Reason for revert: The Chrome perf regression is suspect & the Nexus 5 is broken w/o this CL.
Original change's description:
> Revert "converted vertex shaders to device coords"
>
> This reverts commit e7e81c15c144b8133f696d0744ed9f7e8d06e936.
>
> Reason for revert: Chrome perf regressions
>
> Bug: skia:
> Change-Id: I17fadc97c4b8e80bfdccbf123554614a00c58473
> Reviewed-on: https://skia-review.googlesource.com/99040
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=csmartdalton@google.com,ethannicholas@google.com
Change-Id: Iff3c9fce65beeca16028ae59d4d08b1413b90530
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/99241
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLUniformHandler.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp index b3b4b9f6b5..39392f996b 100644 --- a/src/gpu/gl/GrGLUniformHandler.cpp +++ b/src/gpu/gl/GrGLUniformHandler.cpp @@ -10,10 +10,19 @@ #include "gl/GrGLCaps.h" #include "gl/GrGLGpu.h" #include "gl/builders/GrGLProgramBuilder.h" +#include "SkSLCompiler.h" #define GL_CALL(X) GR_GL_CALL(this->glGpu()->glInterface(), X) #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->glGpu()->glInterface(), R, X) +bool valid_name(const char* name) { + // disallow unknown names that start with "sk_" + if (!strncmp(name, GR_NO_MANGLE_PREFIX, strlen(GR_NO_MANGLE_PREFIX))) { + return !strcmp(name, SkSL::Compiler::RTADJUST_NAME); + } + return true; +} + GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray( uint32_t visibility, GrSLType type, @@ -23,6 +32,7 @@ GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray( int arrayCount, const char** outName) { SkASSERT(name && strlen(name)); + SkASSERT(valid_name(name)); SkASSERT(0 != visibility); SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeTemporarilyAcceptsPrecision(type)); @@ -36,7 +46,7 @@ GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray( // uniform view matrix, they should upload the view matrix in their setData along with regular // uniforms. char prefix = 'u'; - if ('u' == name[0]) { + if ('u' == name[0] || !strncmp(name, GR_NO_MANGLE_PREFIX, strlen(GR_NO_MANGLE_PREFIX))) { prefix = '\0'; } fProgramBuilder->nameVariable(uni.fVariable.accessName(), prefix, name, mangleName); |