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

Unified Diff: bench/GLVertexAttributesBench.cpp

Issue 1403373012: Make appending default precision be controled by GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/GLVec4ScalarBench.cpp ('k') | src/gpu/gl/GrGLGLSL.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GLVertexAttributesBench.cpp
diff --git a/bench/GLVertexAttributesBench.cpp b/bench/GLVertexAttributesBench.cpp
index 1051c31a9d8edeb409cb94101bfd06c9a38cc7ba..040ca183004a1fce15fe094d5ebf6f793777a12b 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");
}
« no previous file with comments | « bench/GLVec4ScalarBench.cpp ('k') | src/gpu/gl/GrGLGLSL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698