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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.h

Issue 367643004: Implement NVPR on GLES (Closed) Base URL: https://skia.googlesource.com/skia.git@02-path-program-fragment
Patch Set: rebse Created 6 years, 4 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 | « src/gpu/gl/GrGpuGL_program.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.h
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 09f7eba511ce8c6877ecc7de0b2a2daecc34d864..d1af63fc4ee3fa5369274480fee71bf7232bed81 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -40,6 +40,7 @@ public:
};
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
+ typedef GrGLProgramDataManager::VaryingHandle VaryingHandle;
// Handles for program uniforms (other than per-effect uniforms)
struct BuiltinUniformHandles {
@@ -69,6 +70,13 @@ public:
// name strings. Otherwise, we'd have to hand out copies.
typedef GrTAllocator<UniformInfo> UniformInfoArray;
+ struct SeparableVaryingInfo {
+ GrGLShaderVar fVariable;
+ GrGLint fLocation;
+ };
+
+ typedef GrTAllocator<SeparableVaryingInfo> SeparableVaryingInfoArray;
+
/** Generates a shader program.
*
* The program implements what is specified in the stages given as input.
@@ -91,6 +99,9 @@ public:
bool hasVertexShader() const { SkASSERT(fProgramID); return !fFragOnly; }
int getTexCoordSetCount() const { SkASSERT(fProgramID); return fTexCoordSetCnt; }
const UniformInfoArray& getUniformInfos() const { return fUniforms; }
+ const SeparableVaryingInfoArray& getSeparableVaryingInfos() const {
+ return fSeparableVaryingInfos;
+ }
virtual ~GrGLProgramBuilder() {}
@@ -126,13 +137,12 @@ public:
const GrGLContextInfo& ctxInfo() const;
GrGLFragmentShaderBuilder* getFragmentShaderBuilder() { return &fFS; }
+ GrGpuGL* gpu() const { return fGpu; }
protected:
typedef GrTAllocator<GrGLShaderVar> VarArray;
GrGLProgramBuilder(GrGpuGL*, const GrGLProgramDesc&);
- GrGpuGL* gpu() const { return fGpu; }
-
const GrGLProgramDesc& desc() const { return fDesc; }
// Helper for emitEffects().
@@ -162,6 +172,7 @@ protected:
int fTexCoordSetCnt;
GrGLuint fProgramID;
GrGLFragmentShaderBuilder fFS;
+ SeparableVaryingInfoArray fSeparableVaryingInfos;
private:
class CodeStage : SkNoncopyable {
public:
@@ -271,6 +282,17 @@ public:
const char** vsOutName = NULL,
const char** fsInName = NULL);
+ /** Add a separable varying input variable to the current program.
+ * A separable varying (fragment shader input) is a varying that can be used also when vertex
+ * shaders are not used. With a vertex shader, the operation is same as with other
+ * varyings. Without a vertex shader, such as with NV_path_rendering, GL APIs are used to
+ * populate the variable. The APIs can refer to the variable through the returned handle.
+ */
+ VaryingHandle addSeparableVarying(GrSLType type,
+ const char* name,
+ const char** vsOutName,
+ const char** fsInName);
+
joshua.litt 2014/08/25 17:00:05 Since this only requires a fragment shader, does i
Chris Dalton 2014/08/25 18:04:50 It actually does require a vertex shader. Not for
GrGLVertexShaderBuilder* getVertexShaderBuilder() { return &fVS; }
private:
« no previous file with comments | « src/gpu/gl/GrGpuGL_program.cpp ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698