aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/GLVertexAttributesBench.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-10-26 08:38:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-26 08:38:26 -0700
commitcb7ba1eafce89a2f90239a7be56050fa98a47b9f (patch)
treeeb332246d1e7ec586c5074c30b0714982f2879cf /bench/GLVertexAttributesBench.cpp
parent5c3ea4cd3921e8904d4f201bcdedfd5b8a726542 (diff)
Make appending default precision be controled by GLSL
Diffstat (limited to 'bench/GLVertexAttributesBench.cpp')
-rw-r--r--bench/GLVertexAttributesBench.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/bench/GLVertexAttributesBench.cpp b/bench/GLVertexAttributesBench.cpp
index 1051c31a9d..040ca18300 100644
--- a/bench/GLVertexAttributesBench.cpp
+++ b/bench/GLVertexAttributesBench.cpp
@@ -12,9 +12,9 @@
#if SK_SUPPORT_GPU
#include "GLBench.h"
#include "gl/GrGLContext.h"
-#include "gl/GrGLGLSL.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"
+#include "glsl/GrGLSL.h"
#include "glsl/GrGLSLCaps.h"
#include "glsl/GrGLSLShaderVar.h"
#include <stdio.h>
@@ -65,7 +65,8 @@ private:
GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t attribs,
uint32_t maxAttribs) {
- const char* version = ctx->caps()->glslCaps()->versionDeclString();
+ const GrGLSLCaps* glslCaps = ctx->caps()->glslCaps();
+ const char* version = glslCaps->versionDeclString();
// setup vertex shader
GrGLSLShaderVar aPosition("a_position", kVec4f_GrSLType, GrShaderVar::kAttribute_TypeModifier);
@@ -73,7 +74,7 @@ GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
SkTArray<GrGLSLShaderVar> oVars;
SkString vshaderTxt(version);
- aPosition.appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ aPosition.appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
for (uint32_t i = 0; i < attribs; i++) {
@@ -82,7 +83,7 @@ GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
aVars.push_back(GrGLSLShaderVar(aname.c_str(),
kVec4f_GrSLType,
GrShaderVar::kAttribute_TypeModifier));
- aVars.back().appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ aVars.back().appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
}
@@ -93,7 +94,7 @@ GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
oVars.push_back(GrGLSLShaderVar(oname.c_str(),
kVec4f_GrSLType,
GrShaderVar::kVaryingOut_TypeModifier));
- oVars.back().appendDecl(ctx->caps()->glslCaps(), &vshaderTxt);
+ oVars.back().appendDecl(glslCaps, &vshaderTxt);
vshaderTxt.append(";\n");
}
@@ -118,12 +119,11 @@ GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
// setup fragment shader
GrGLSLShaderVar oFragColor("o_FragColor", kVec4f_GrSLType, GrShaderVar::kOut_TypeModifier);
SkString fshaderTxt(version);
- GrGLAppendGLSLDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision, gl->fStandard,
- &fshaderTxt);
+ GrGLSLAppendDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision, *glslCaps, &fshaderTxt);
const char* fsOutName;
- if (ctx->caps()->glslCaps()->mustDeclareFragmentShaderOutput()) {
- oFragColor.appendDecl(ctx->caps()->glslCaps(), &fshaderTxt);
+ if (glslCaps->mustDeclareFragmentShaderOutput()) {
+ oFragColor.appendDecl(glslCaps, &fshaderTxt);
fshaderTxt.append(";\n");
fsOutName = oFragColor.c_str();
} else {
@@ -132,7 +132,7 @@ GrGLuint GLVertexAttributesBench::setupShader(const GrGLContext* ctx, uint32_t a
for (uint32_t i = 0; i < maxAttribs; i++) {
oVars[i].setTypeModifier(GrShaderVar::kVaryingIn_TypeModifier);
- oVars[i].appendDecl(ctx->caps()->glslCaps(), &fshaderTxt);
+ oVars[i].appendDecl(glslCaps, &fshaderTxt);
fshaderTxt.append(";\n");
}