aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgramDataManager.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-08-16 16:41:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-16 23:05:15 +0000
commit88d99c63878c2d3d340120f0321676f72afcb4f0 (patch)
tree5b957dbf2f78ef7a15aa3810f8922c915508683f /src/gpu/gl/GrGLProgramDataManager.cpp
parenta26d219a929f4e70f8597dfd57a53348c4bba905 (diff)
Switched highp float to highfloat and mediump float to half.
The ultimate goal is to end up with "float" and "half", but this intermediate step uses "highfloat" so that it is clear if I missed a "float" somewhere. Once this lands, a subsequent CL will switch all "highfloats" back to "floats". Bug: skia: Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca Reviewed-on: https://skia-review.googlesource.com/31000 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLProgramDataManager.cpp')
-rw-r--r--src/gpu/gl/GrGLProgramDataManager.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index 3414abac44..a8e3a6345f 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -73,7 +73,7 @@ void GrGLProgramDataManager::setImageStorages(const UniformInfoArray& images) co
void GrGLProgramDataManager::set1i(UniformHandle u, int32_t i) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kInt_GrSLType);
+ SkASSERT(uni.fType == kInt_GrSLType || uni.fType == kShort_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fLocation, i));
@@ -84,7 +84,7 @@ void GrGLProgramDataManager::set1iv(UniformHandle u,
int arrayCount,
const int v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kInt_GrSLType);
+ SkASSERT(uni.fType == kInt_GrSLType || uni.fType == kShort_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
if (kUnusedUniform != uni.fLocation) {
@@ -94,7 +94,7 @@ void GrGLProgramDataManager::set1iv(UniformHandle u,
void GrGLProgramDataManager::set1f(UniformHandle u, float v0) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kFloat_GrSLType);
+ SkASSERT(uni.fType == kHighFloat_GrSLType || uni.fType == kHalf_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform1f(uni.fLocation, v0));
@@ -105,7 +105,7 @@ void GrGLProgramDataManager::set1fv(UniformHandle u,
int arrayCount,
const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kFloat_GrSLType);
+ SkASSERT(uni.fType == kHighFloat_GrSLType || uni.fType == kHalf_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
// This assert fires in some instances of the two-pt gradient for its VSParams.
@@ -119,7 +119,7 @@ void GrGLProgramDataManager::set1fv(UniformHandle u,
void GrGLProgramDataManager::set2f(UniformHandle u, float v0, float v1) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec2f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat2_GrSLType || uni.fType == kHalf2_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform2f(uni.fLocation, v0, v1));
@@ -130,7 +130,7 @@ void GrGLProgramDataManager::set2fv(UniformHandle u,
int arrayCount,
const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec2f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat2_GrSLType || uni.fType == kHalf2_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
if (kUnusedUniform != uni.fLocation) {
@@ -140,7 +140,7 @@ void GrGLProgramDataManager::set2fv(UniformHandle u,
void GrGLProgramDataManager::set3f(UniformHandle u, float v0, float v1, float v2) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec3f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat3_GrSLType || uni.fType == kHalf3_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform3f(uni.fLocation, v0, v1, v2));
@@ -151,7 +151,7 @@ void GrGLProgramDataManager::set3fv(UniformHandle u,
int arrayCount,
const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec3f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat3_GrSLType || uni.fType == kHalf3_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
if (kUnusedUniform != uni.fLocation) {
@@ -165,7 +165,7 @@ void GrGLProgramDataManager::set4f(UniformHandle u,
float v2,
float v3) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec4f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat4_GrSLType || uni.fType == kHalf4_GrSLType);
SkASSERT(GrShaderVar::kNonArray == uni.fArrayCount);
if (kUnusedUniform != uni.fLocation) {
GR_GL_CALL(fGpu->glInterface(), Uniform4f(uni.fLocation, v0, v1, v2, v3));
@@ -176,7 +176,7 @@ void GrGLProgramDataManager::set4fv(UniformHandle u,
int arrayCount,
const float v[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kVec4f_GrSLType);
+ SkASSERT(uni.fType == kHighFloat4_GrSLType || uni.fType == kHalf4_GrSLType);
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
if (kUnusedUniform != uni.fLocation) {
@@ -214,7 +214,8 @@ template<int N> inline void GrGLProgramDataManager::setMatrices(UniformHandle u,
int arrayCount,
const float matrices[]) const {
const Uniform& uni = fUniforms[u.toIndex()];
- SkASSERT(uni.fType == kMat22f_GrSLType + (N - 2));
+ SkASSERT(uni.fType == kHighFloat2x2_GrSLType + (N - 2) ||
+ uni.fType == kHalf2x2_GrSLType + (N - 2));
SkASSERT(arrayCount > 0);
ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
if (kUnusedUniform != uni.fLocation) {
@@ -246,8 +247,10 @@ void GrGLProgramDataManager::setPathFragmentInputTransform(VaryingHandle u,
SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
const PathProcVarying& fragmentInput = fPathProcVaryings[u.toIndex()];
- SkASSERT((components == 2 && fragmentInput.fType == kVec2f_GrSLType) ||
- (components == 3 && fragmentInput.fType == kVec3f_GrSLType));
+ SkASSERT((components == 2 && (fragmentInput.fType == kHighFloat2_GrSLType ||
+ fragmentInput.fType == kHalf2_GrSLType)) ||
+ (components == 3 && (fragmentInput.fType == kHighFloat3_GrSLType ||
+ fragmentInput.fType == kHalf3_GrSLType)));
fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgramID,
fragmentInput.fLocation,