aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/builders
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-10-22 07:08:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-22 07:08:37 -0700
commit899ba37db336c20a06bce65d952e0664596a26ef (patch)
treecdb633ab7b5ea307e1785c976b998ecc6965922c /src/gpu/gl/builders
parent5eaaad29dd4fd903a2dde36473c4643bd069c753 (diff)
Revert of Add version string and force highp NDS transfrom to GLSLCaps (patchset #3 id:40001 of https://codereview.chromium.org/1417993004/ )
Reason for revert: breaking bots Original issue's description: > Add version string and force highp NDS transfrom to GLSLCaps > > This also include the use of any() in the shaders. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/cef4bce8e260b49bf3417eadbac806cf7d39cdc8 TBR=bsalomon@google.com,jvanverth@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1420033002
Diffstat (limited to 'src/gpu/gl/builders')
-rw-r--r--src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp14
-rw-r--r--src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index d31482a4bb..4a5814de51 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -192,14 +192,14 @@ const char* GrGLFragmentShaderBuilder::fragmentPosition() {
const char* GrGLFragmentShaderBuilder::dstColor() {
fHasReadDstColor = true;
- const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
- if (glslCaps->fbFetchSupport()) {
+ GrGLGpu* gpu = fProgramBuilder->gpu();
+ if (gpu->glCaps().glslCaps()->fbFetchSupport()) {
this->addFeature(1 << (GrGLFragmentShaderBuilder::kLastGLSLPrivateFeature + 1),
- glslCaps->fbFetchExtensionString());
+ gpu->glCaps().glslCaps()->fbFetchExtensionString());
// Some versions of this extension string require declaring custom color output on ES 3.0+
- const char* fbFetchColorName = glslCaps->fbFetchColorName();
- if (glslCaps->fbFetchNeedsCustomOutput()) {
+ const char* fbFetchColorName = gpu->glCaps().glslCaps()->fbFetchColorName();
+ if (gpu->glCaps().glslCaps()->fbFetchNeedsCustomOutput()) {
this->enableCustomOutput();
fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOut_TypeModifier);
fbFetchColorName = declared_color_output_name();
@@ -213,7 +213,7 @@ const char* GrGLFragmentShaderBuilder::dstColor() {
void GrGLFragmentShaderBuilder::enableAdvancedBlendEquationIfNeeded(GrBlendEquation equation) {
SkASSERT(GrBlendEquationIsAdvanced(equation));
- const GrGLSLCaps& caps = *fProgramBuilder->glslCaps();
+ const GrGLSLCaps& caps = *fProgramBuilder->gpu()->glCaps().glslCaps();
if (!caps.mustEnableAdvBlendEqs()) {
return;
}
@@ -268,7 +268,7 @@ const char* GrGLFragmentShaderBuilder::getSecondaryColorOutputName() const {
bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId,
SkTDArray<GrGLuint>* shaderIds) {
GrGLGpu* gpu = fProgramBuilder->gpu();
- this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString();
+ this->versionDecl() = GrGLGetGLSLVersionDecl(gpu->ctxInfo());
GrGLAppendGLSLDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision,
gpu->glStandard(),
&this->precisionQualifier());
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index c1a7dee56a..de0bb03aa3 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -39,7 +39,7 @@ void GrGLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posV
SkASSERT(!fRtAdjustName);
GrSLPrecision precision = kDefault_GrSLPrecision;
- if (fProgramBuilder->glslCaps()->forceHighPrecisionNDSTransform()) {
+ if (fProgramBuilder->ctxInfo().vendor() == kARM_GrGLVendor) {
precision = kHigh_GrSLPrecision;
}
@@ -89,7 +89,7 @@ void GrGLVertexBuilder::bindVertexAttributes(GrGLuint programID) {
bool
GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shaderIds) {
- this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString();
+ this->versionDecl() = GrGLGetGLSLVersionDecl(fProgramBuilder->ctxInfo());
this->compileAndAppendLayoutQualifiers();
fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &this->uniforms());
this->appendDecls(fInputs, &this->inputs());