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

Side by Side Diff: src/gpu/gl/builders/GrGLShaderStringBuilder.cpp

Issue 2437063002: re-re-land of skslc now automatically turns on derivatives support (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLShaderStringBuilder.h" 8 #include "GrGLShaderStringBuilder.h"
9 #include "gl/GrGLGpu.h" 9 #include "gl/GrGLGpu.h"
10 #include "gl/GrGLSLPrettyPrint.h" 10 #include "gl/GrGLSLPrettyPrint.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 result.fVersion = 310; 78 result.fVersion = 310;
79 break; 79 break;
80 case k320es_GrGLSLGeneration: 80 case k320es_GrGLSLGeneration:
81 SkASSERT(kGLES_GrGLStandard == standard); 81 SkASSERT(kGLES_GrGLStandard == standard);
82 result.fVersion = 320; 82 result.fVersion = 320;
83 break; 83 break;
84 } 84 }
85 result.fIsCoreProfile = caps->isCoreProfile(); 85 result.fIsCoreProfile = caps->isCoreProfile();
86 result.fUsesPrecisionModifiers = glslCaps->usesPrecisionModifiers(); 86 result.fUsesPrecisionModifiers = glslCaps->usesPrecisionModifiers();
87 result.fMustDeclareFragmentShaderOutput = glslCaps->mustDeclareFragmentShade rOutput(); 87 result.fMustDeclareFragmentShaderOutput = glslCaps->mustDeclareFragmentShade rOutput();
88 result.fShaderDerivativeSupport = glslCaps->shaderDerivativeSupport();
89 if (result.fShaderDerivativeSupport && glslCaps->shaderDerivativeExtensionSt ring()) {
90 result.fShaderDerivativeExtensionString = glslCaps->shaderDerivativeExte nsionString();
91 }
88 result.fCanUseMinAndAbsTogether = glslCaps->canUseMinAndAbsTogether(); 92 result.fCanUseMinAndAbsTogether = glslCaps->canUseMinAndAbsTogether();
89 result.fMustForceNegatedAtanParamToFloat = glslCaps->mustForceNegatedAtanPar amToFloat(); 93 result.fMustForceNegatedAtanParamToFloat = glslCaps->mustForceNegatedAtanPar amToFloat();
90 return result; 94 return result;
91 } 95 }
92 96
93 static void dump_string(std::string s) { 97 static void dump_string(std::string s) {
94 // on Android, SkDebugf only displays the first 1K characters of output, whi ch results in 98 // on Android, SkDebugf only displays the first 1K characters of output, whi ch results in
95 // incomplete shader source code. Print each line individually to avoid this problem. 99 // incomplete shader source code. Print each line individually to avoid this problem.
96 size_t index = 0; 100 size_t index = 0;
97 for (;;) { 101 for (;;) {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 217
214 static void print_shader_source(const char** strings, int* lengths, int count) { 218 static void print_shader_source(const char** strings, int* lengths, int count) {
215 const SkString& pretty = GrGLSLPrettyPrint::PrettyPrintGLSL(strings, lengths , count, true); 219 const SkString& pretty = GrGLSLPrettyPrint::PrettyPrintGLSL(strings, lengths , count, true);
216 SkTArray<SkString> lines; 220 SkTArray<SkString> lines;
217 SkStrSplit(pretty.c_str(), "\n", &lines); 221 SkStrSplit(pretty.c_str(), "\n", &lines);
218 for (const SkString& line : lines) { 222 for (const SkString& line : lines) {
219 // Print the shader one line at the time so it doesn't get truncated by the adb log. 223 // Print the shader one line at the time so it doesn't get truncated by the adb log.
220 SkDebugf("%s\n", line.c_str()); 224 SkDebugf("%s\n", line.c_str());
221 } 225 }
222 } 226 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/glsl/GrGLSLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698