kMat22f_GrSLType,
kMat33f_GrSLType,
kMat44f_GrSLType,
- kSampler2D_GrSLType,
- kSamplerExternal_GrSLType,
- kSampler2DRect_GrSLType,
- kSamplerBuffer_GrSLType,
+ kTexture2DSampler_GrSLType,
+ kTextureExternalSampler_GrSLType,
+ kTexture2DRectSampler_GrSLType,
+ kTextureBufferSampler_GrSLType,
kBool_GrSLType,
kInt_GrSLType,
kUint_GrSLType,
+ kTexture2D_GrSLType,
+ kSampler_GrSLType,
- kLast_GrSLType = kUint_GrSLType
+ kLast_GrSLType = kSampler_GrSLType
};
static const int kGrSLTypeCount = kLast_GrSLType + 1;
*/
static inline int GrSLTypeVectorCount(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1 };
+ static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1 };
return kCounts[type];
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount);
}
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
- GR_STATIC_ASSERT(15 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+ GR_STATIC_ASSERT(17 == kGrSLTypeCount);
}
/** Is the shading language type integral (including vectors/matrices)? */
static inline bool GrSLTypeIsIntType(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return type >= kInt_GrSLType;
+ return type >= kInt_GrSLType && type <= kUint_GrSLType;
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
GR_STATIC_ASSERT(1 == kFloat_GrSLType);
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
- GR_STATIC_ASSERT(15 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+ GR_STATIC_ASSERT(17 == kGrSLTypeCount);
}
/** Is the shading language type numeric (including vectors/matrices)? */
2 * 2 * sizeof(float), // kMat22f_GrSLType
3 * 3 * sizeof(float), // kMat33f_GrSLType
4 * 4 * sizeof(float), // kMat44f_GrSLType
- 0, // kSampler2D_GrSLType
- 0, // kSamplerExternal_GrSLType
- 0, // kSampler2DRect_GrSLType
- 0, // kSamplerBuffer_GrSLType
+ 0, // kTexture2DSampler_GrSLType
+ 0, // kTextureExternalSampler_GrSLType
+ 0, // kTexture2DRectSampler_GrSLType
+ 0, // kTextureBufferSampler_GrSLType
0, // kBool_GrSLType
0, // kInt_GrSLType
0, // kUint_GrSLType
+ 0, // kTexture2D_GrSLType
+ 0, // kSampler_GrSLType
};
return kSizes[type];
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
- GR_STATIC_ASSERT(15 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
+ GR_STATIC_ASSERT(17 == kGrSLTypeCount);
}
-static inline bool GrSLTypeIs2DTextureType(GrSLType type) {
+static inline bool GrSLTypeIs2DCombinedSamplerType(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType;
+ return type >= kTexture2DSampler_GrSLType && type <= kTexture2DRectSampler_GrSLType;
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
}
-static inline bool GrSLTypeIsSamplerType(GrSLType type) {
+static inline bool GrSLTypeIsCombinedSamplerType(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return type >= kSampler2D_GrSLType && type <= kSamplerBuffer_GrSLType;
+ return type >= kTexture2DSampler_GrSLType && type <= kTextureBufferSampler_GrSLType;
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
}
static inline bool GrSLTypeAcceptsPrecision(GrSLType type) {
- return GrSLTypeIsNumeric(type) || GrSLTypeIsSamplerType(type);
+ return type != kVoid_GrSLType && type != kBool_GrSLType;
}
//////////////////////////////////////////////////////////////////////////////
kInt_GrVertexAttribType,
kUint_GrVertexAttribType,
-
+
kLast_GrVertexAttribType = kUint_GrVertexAttribType
};
static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
GrGLSLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType,
GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar uPosXform("u_posXform", kVec4f_GrSLType, GrShaderVar::kUniform_TypeModifier);
- GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUniform_TypeModifier);
+ GrGLSLShaderVar uTexture("u_texture", kTexture2DSampler_GrSLType,
+ GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier);
SkString vshaderTxt(version);
bool GrGLGpu::createCopyProgram(int progIdx) {
const GrGLSLCaps* glslCaps = this->glCaps().glslCaps();
- static const GrSLType kSamplerTypes[3] = { kSampler2D_GrSLType, kSamplerExternal_GrSLType,
- kSampler2DRect_GrSLType };
- if (kSamplerExternal_GrSLType == kSamplerTypes[progIdx] &&
+ static const GrSLType kSamplerTypes[3] = { kTexture2DSampler_GrSLType,
+ kTextureExternalSampler_GrSLType,
+ kTexture2DRectSampler_GrSLType };
+ if (kTextureExternalSampler_GrSLType == kSamplerTypes[progIdx] &&
!this->glCaps().glslCaps()->externalTextureSupport()) {
return false;
}
- if (kSampler2DRect_GrSLType == kSamplerTypes[progIdx] &&
+ if (kTexture2DRectSampler_GrSLType == kSamplerTypes[progIdx] &&
!this->glCaps().rectangleTextureSupport()) {
return false;
}
fshaderTxt.appendf("#extension %s : require\n", extension);
}
}
- if (kSamplerTypes[progIdx] == kSamplerExternal_GrSLType) {
+ if (kSamplerTypes[progIdx] == kTextureExternalSampler_GrSLType) {
fshaderTxt.appendf("#extension %s : require\n",
glslCaps->externalTextureExtensionString());
}
GrGLSLShaderVar aVertex("a_vertex", kVec2f_GrSLType, GrShaderVar::kAttribute_TypeModifier);
GrGLSLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType,
GrShaderVar::kUniform_TypeModifier);
- GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUniform_TypeModifier);
+ GrGLSLShaderVar uTexture("u_texture", kTexture2DSampler_GrSLType,
+ GrShaderVar::kUniform_TypeModifier);
// We need 1, 2, or 4 texture coordinates (depending on parity of each dimension):
GrGLSLShaderVar vTexCoords[] = {
GrGLSLShaderVar("v_texCoord0", kVec2f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier),
} else {
fsOutName = "gl_FragColor";
}
- const char* sampleFunction = GrGLSLTexture2DFunctionName(kVec2f_GrSLType, kSampler2D_GrSLType,
+ const char* sampleFunction = GrGLSLTexture2DFunctionName(kVec2f_GrSLType,
+ kTexture2DSampler_GrSLType,
this->glslGeneration());
fshaderTxt.append(
"// Mipmap Program FS\n"
static uint16_t sampler_key(GrSLType samplerType, GrPixelConfig config, GrShaderFlags visibility,
const GrGLSLCaps& caps) {
enum {
- kFirstSamplerType = kSampler2D_GrSLType,
- kLastSamplerType = kSamplerBuffer_GrSLType,
+ kFirstSamplerType = kTexture2DSampler_GrSLType,
+ kLastSamplerType = kTextureBufferSampler_GrSLType,
kSamplerTypeKeyBits = 4
};
GR_STATIC_ASSERT(kLastSamplerType - kFirstSamplerType < (1 << kSamplerTypeKeyBits));
}
for (; i < numSamplers; ++i) {
const GrBufferAccess& access = proc.bufferAccess(i - numTextures);
- k16[i] = sampler_key(kSamplerBuffer_GrSLType, access.texelConfig(), access.visibility(),
- caps);
+ k16[i] = sampler_key(kTextureBufferSampler_GrSLType, access.texelConfig(),
+ access.visibility(), caps);
}
// zero the last 16 bits if the number of samplers is odd.
if (numSamplers & 0x1) {
GrSLType type,
GrSLPrecision precision,
const char* name) : INHERITED(visibility, config) {
- SkASSERT(GrSLTypeIsSamplerType(type));
+ SkASSERT(GrSLTypeIsCombinedSamplerType(type));
fShaderVar.setType(type);
fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
fShaderVar.setPrecision(precision);
inline static GrSLType sampler_type(const GrGLTexture::IDDesc& idDesc, const GrGLGpu* gpu) {
if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
SkASSERT(gpu->glCaps().glslCaps()->externalTextureSupport());
- return kSamplerExternal_GrSLType;
+ return kTextureExternalSampler_GrSLType;
} else if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE) {
SkASSERT(gpu->glCaps().rectangleTextureSupport());
- return kSampler2DRect_GrSLType;
+ return kTexture2DRectSampler_GrSLType;
} else {
SkASSERT(idDesc.fInfo.fTarget == GR_GL_TEXTURE_2D);
- return kSampler2D_GrSLType;
+ return kTexture2DSampler_GrSLType;
}
}
*/
inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrSLType samplerType,
GrGLSLGeneration glslGen) {
- SkASSERT(GrSLTypeIs2DTextureType(samplerType));
+ SkASSERT(GrSLTypeIs2DCombinedSamplerType(samplerType));
SkASSERT(kVec2f_GrSLType == coordType || kVec3f_GrSLType == coordType);
// GL_TEXTURE_RECTANGLE_ARB is written against OpenGL 2.0/GLSL 1.10. At that time there were
// separate texture*() functions. In OpenGL 3.0/GLSL 1.30 the different texture*() functions
return (kVec2f_GrSLType == coordType) ? "texture" : "textureProj";
}
if (kVec2f_GrSLType == coordType) {
- return (samplerType == kSampler2DRect_GrSLType) ? "texture2DRect" : "texture2D";
+ return (samplerType == kTexture2DRectSampler_GrSLType) ? "texture2DRect" : "texture2D";
} else {
- return (samplerType == kSampler2DRect_GrSLType) ? "texture2DRectProj" : "texture2DProj";
+ return (samplerType == kTexture2DRectSampler_GrSLType) ? "texture2DRectProj"
+ : "texture2DProj";
}
}
return "mat3";
case kMat44f_GrSLType:
return "mat4";
- case kSampler2D_GrSLType:
+ case kTexture2DSampler_GrSLType:
return "sampler2D";
- case kSamplerExternal_GrSLType:
+ case kTextureExternalSampler_GrSLType:
return "samplerExternalOES";
- case kSampler2DRect_GrSLType:
+ case kTexture2DRectSampler_GrSLType:
return "sampler2DRect";
- case kSamplerBuffer_GrSLType:
+ case kTextureBufferSampler_GrSLType:
return "samplerBuffer";
case kBool_GrSLType:
return "bool";
return "int";
case kUint_GrSLType:
return "uint";
+ case kTexture2D_GrSLType:
+ return "texture2D";
+ case kSampler_GrSLType:
+ return "sampler";
default:
SkFAIL("Unknown shader var type.");
return ""; // suppress warning
for (int t = 0; t < numTextures; ++t) {
const GrTextureAccess& access = processor.textureAccess(t);
GrSLType samplerType = access.getTexture()->samplerType();
- if (kSamplerExternal_GrSLType == samplerType) {
+ if (kTextureExternalSampler_GrSLType == samplerType) {
const char* externalFeatureString = this->glslCaps()->externalTextureExtensionString();
// We shouldn't ever create a GrGLTexture that requires external sampler type
SkASSERT(externalFeatureString);
for (int b = 0; b < numBuffers; ++b) {
const GrBufferAccess& access = processor.bufferAccess(b);
name.printf("BufferSampler%d", b);
- this->emitSampler(kSamplerBuffer_GrSLType, access.texelConfig(), name.c_str(),
+ this->emitSampler(kTextureBufferSampler_GrSLType, access.texelConfig(), name.c_str(),
access.visibility(), outBufferSamplers);
texelBufferVisibility |= access.visibility();
}
// Returns the string to be used for the sampler in glsl 2D texture functions (texture,
// texture2D, etc.)
const char* getSamplerNameForTexture2D() const {
- SkASSERT(GrSLTypeIs2DTextureType(this->type()));
+ SkASSERT(GrSLTypeIs2DCombinedSamplerType(this->type()));
return this->onGetSamplerNameForTexture2D();
}
const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
const GrGLSLSampler& sampler = fProgramBuilder->getSampler(samplerHandle);
GrSLType samplerType = sampler.type();
- if (samplerType == kSampler2DRect_GrSLType) {
+ if (samplerType == kTexture2DRectSampler_GrSLType) {
if (varyingType == kVec2f_GrSLType) {
out->appendf("%s(%s, textureSize(%s) * %s)",
GrGLSLTexture2DFunctionName(varyingType, samplerType,
const char* coordExpr) const {
const GrGLSLSampler& sampler = fProgramBuilder->getSampler(samplerHandle);
SkASSERT(fProgramBuilder->glslCaps()->texelFetchSupport());
- SkASSERT(GrSLTypeIsSamplerType(sampler.type()));
+ SkASSERT(GrSLTypeIsCombinedSamplerType(sampler.type()));
out->appendf("texelFetch(%s, %s)", sampler.getSamplerNameForTexelFetch(), coordExpr);
GrSLPrecision precision,
const char* name,
const char** outName = nullptr) {
- SkASSERT(!GrSLTypeIsSamplerType(type));
+ SkASSERT(!GrSLTypeIsCombinedSamplerType(type));
return this->addUniformArray(visibility, type, precision, name, 0, outName);
}
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);
}
const char* name,
uint32_t binding,
uint32_t set) : INHERITED(visibility, config), fBinding(binding) {
- SkASSERT(GrSLTypeIsSamplerType(type));
+ SkASSERT(GrSLTypeIsCombinedSamplerType(type));
fShaderVar.setType(type);
fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
fShaderVar.setPrecision(precision);
const GrVkImageView* view)
: GrSurface(gpu, desc)
, GrVkImage(info, GrVkImage::kNot_Wrapped)
- , INHERITED(gpu, desc, kSampler2D_GrSLType, desc.fIsMipMapped)
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
this->registerWithCache(budgeted);
GrVkImage::Wrapped wrapped)
: GrSurface(gpu, desc)
, GrVkImage(info, wrapped)
- , INHERITED(gpu, desc, kSampler2D_GrSLType, desc.fIsMipMapped)
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
this->registerWithCacheWrapped();
GrVkImage::Wrapped wrapped)
: GrSurface(gpu, desc)
, GrVkImage(info, wrapped)
- , INHERITED(gpu, desc, kSampler2D_GrSLType, desc.fIsMipMapped)
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
}
0x0, // kBool_GrSLType
0x7, // kInt_GrSLType
0x7, // kUint_GrSLType
+ 0x0, // Texture2D_GrSLType, should never return this
+ 0x0, // Sampler_GrSLType, should never return this
};
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
GR_STATIC_ASSERT(1 == kFloat_GrSLType);
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAlignmentMask) == kGrSLTypeCount);
return kAlignmentMask[type];
}
8 * sizeof(float), // kMat22f_GrSLType. TODO: this will be 4 * szof(float) on std430.
12 * sizeof(float), // kMat33f_GrSLType
16 * sizeof(float), // kMat44f_GrSLType
- 0, // kSampler2D_GrSLType
- 0, // kSamplerExternal_GrSLType
- 0, // kSampler2DRect_GrSLType
- 0, // kSamplerBuffer_GrSLType
+ 0, // kTexture2DSampler_GrSLType
+ 0, // kTextureExternalSampler_GrSLType
+ 0, // kTexture2DRectSampler_GrSLType
+ 0, // kTextureBufferSampler_GrSLType
1, // kBool_GrSLType
4, // kInt_GrSLType
- 4 // kUint_GrSLType
+ 4, // kUint_GrSLType
+ 0, // kTexture2D_GrSLType
+ 0, // kSampler_GrSLType
};
return kSizes[type];
GR_STATIC_ASSERT(5 == kMat22f_GrSLType);
GR_STATIC_ASSERT(6 == kMat33f_GrSLType);
GR_STATIC_ASSERT(7 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(8 == kTexture2DSampler_GrSLType);
+ GR_STATIC_ASSERT(9 == kTextureExternalSampler_GrSLType);
+ GR_STATIC_ASSERT(10 == kTexture2DRectSampler_GrSLType);
+ GR_STATIC_ASSERT(11 == kTextureBufferSampler_GrSLType);
GR_STATIC_ASSERT(12 == kBool_GrSLType);
GR_STATIC_ASSERT(13 == kInt_GrSLType);
GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kTexture2D_GrSLType);
+ GR_STATIC_ASSERT(16 == kSampler_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrSLTypeCount);
}
for (int i = 0; i < fSamplers.count(); ++i) {
const GrVkGLSLSampler& sampler = fSamplers[i];
- SkASSERT(sampler.type() == kSampler2D_GrSLType);
+ SkASSERT(sampler.type() == kTexture2DSampler_GrSLType);
if (visibility == sampler.visibility()) {
sampler.fShaderVar.appendDecl(fProgramBuilder->glslCaps(), out);
out->append(";\n");