aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLShaderBuilder.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-11-22 15:56:30 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-22 21:35:11 +0000
commitbe34882042048db096baca32ddf4a8b472529804 (patch)
tree2676dc4a9e6506f19728eddfe011ba4465f1c3ab /src/gpu/glsl/GrGLSLShaderBuilder.h
parent030cbd5f3cc60255b887fb88920fb655c8a2a9be (diff)
Initial OpenGL Image support.
This change along with recently landed changes is enough to make the new unit test work and not much else. imageLoad is support but not stores or any other image functions (atomics). Barriers in the shading language or the GL API are not yet hooked up. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4182 Change-Id: I5958b7c89e40ae5ee05f7bbaca3b3738162fe5ce Reviewed-on: https://skia-review.googlesource.com/4182 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/glsl/GrGLSLShaderBuilder.h')
-rw-r--r--src/gpu/glsl/GrGLSLShaderBuilder.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index b568369cca..983d50b926 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -25,7 +25,8 @@ public:
GrGLSLShaderBuilder(GrGLSLProgramBuilder* program);
virtual ~GrGLSLShaderBuilder() {}
- typedef GrGLSLUniformHandler::SamplerHandle SamplerHandle;
+ using SamplerHandle = GrGLSLUniformHandler::SamplerHandle;
+ using ImageStorageHandle = GrGLSLUniformHandler::ImageStorageHandle;
/** Appends a 2D texture sample with projection if necessary. coordType must either be Vec2f or
Vec3f. The latter is interpreted as projective texture coords. The vec length and swizzle
@@ -72,6 +73,11 @@ public:
/** Version of above that appends the result to the shader code instead.*/
void appendTexelFetch(SamplerHandle, const char* coordExpr);
+ /** Creates a string of shader code that performs an image load. */
+ void appendImageStorageLoad(SkString* out, ImageStorageHandle, const char* coordExpr);
+ /** Version of above that appends the result to the shader code instead. */
+ void appendImageStorageLoad(ImageStorageHandle, const char* coordExpr);
+
/**
* Adds a constant declaration to the top of the shader.
*/