aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLUniformHandler.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-07-13 14:09:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-13 14:09:31 -0700
commit990dbc88796f656418bcc4c196df30ed9bef6345 (patch)
tree8ce14a655fd0e98363e5eb7a895ee79516012927 /src/gpu/glsl/GrGLSLUniformHandler.h
parente5de130788c8637d2f7df9ddb0241b78e04d5882 (diff)
Add Texture2D and Sampler GrSLTypes
These two new types are in support of Vulkan and the ability to send separate texture and sampler uniforms to the shader. They don't really fit well in the current system, since the current system ties together to idea of intended use and how to emit shader code into the same GrSLType enum. In vulkan, I want the GrGLSLSampler object to be used as a Sampler2D, but when appending its declaration it will emit a Texture2D and sampler object. Our query for GrSLTypeIsSamplerType refers more to the combination of texture and sampler and not just the sampler part. The GrSLTypeIs2DTextureType query is for is a a SamplerType that uses Texture2Ds. My new types don't really fit into either these categories as they are just half of the whole. In some refactoring down the road (possibly connected with SkSL), I suggest we split apart the concept of how we intend to use a GrGLSLSampler (Sampler2D, SamplerBuffer, etc.), from how we actually add it to the code (sampler, texture2D, sampler2D, etc.). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2143143002 Review-Url: https://codereview.chromium.org/2143143002
Diffstat (limited to 'src/gpu/glsl/GrGLSLUniformHandler.h')
-rw-r--r--src/gpu/glsl/GrGLSLUniformHandler.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/glsl/GrGLSLUniformHandler.h b/src/gpu/glsl/GrGLSLUniformHandler.h
index 56cac4a49f..d7b213869c 100644
--- a/src/gpu/glsl/GrGLSLUniformHandler.h
+++ b/src/gpu/glsl/GrGLSLUniformHandler.h
@@ -32,7 +32,7 @@ public:
GrSLPrecision precision,
const char* name,
const char** outName = nullptr) {
- SkASSERT(!GrSLTypeIsSamplerType(type));
+ SkASSERT(!GrSLTypeIsCombinedSamplerType(type));
return this->addUniformArray(visibility, type, precision, name, 0, outName);
}
@@ -42,7 +42,7 @@ public:
const char* name,
int arrayCount,
const char** outName = nullptr) {
- SkASSERT(!GrSLTypeIsSamplerType(type));
+ SkASSERT(!GrSLTypeIsCombinedSamplerType(type));
return this->internalAddUniformArray(visibility, type, precision, name, true, arrayCount,
outName);
}