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

Unified Diff: include/gpu/GrTypesPriv.h

Issue 1785873003: Implement GL support for buffer textures (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glTexBuffer
Patch Set: rebase Created 4 years, 9 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 | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypesPriv.h
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index a2facfa6cfc0f2c65d95fda4c96646323e68a202..9fea39626c23a7cf0c735457128045ee65144b97 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -27,6 +27,7 @@ enum GrSLType {
kSampler2D_GrSLType,
kSamplerExternal_GrSLType,
kSampler2DRect_GrSLType,
+ kSamplerBuffer_GrSLType,
kBool_GrSLType,
kInt_GrSLType,
kUint_GrSLType,
@@ -76,7 +77,7 @@ static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 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 };
+ static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1 };
return kCounts[type];
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
@@ -90,9 +91,10 @@ static inline int GrSLTypeVectorCount(GrSLType type) {
GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kBool_GrSLType);
- GR_STATIC_ASSERT(12 == kInt_GrSLType);
- GR_STATIC_ASSERT(13 == kUint_GrSLType);
+ GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(12 == kBool_GrSLType);
+ GR_STATIC_ASSERT(13 == kInt_GrSLType);
+ GR_STATIC_ASSERT(14 == kUint_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount);
}
@@ -124,10 +126,11 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) {
GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kBool_GrSLType);
- GR_STATIC_ASSERT(12 == kInt_GrSLType);
- GR_STATIC_ASSERT(13 == kUint_GrSLType);
- GR_STATIC_ASSERT(14 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(12 == kBool_GrSLType);
+ GR_STATIC_ASSERT(13 == kInt_GrSLType);
+ GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kGrSLTypeCount);
}
/** Is the shading language type integral (including vectors/matrices)? */
@@ -146,10 +149,11 @@ static inline bool GrSLTypeIsIntType(GrSLType type) {
GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kBool_GrSLType);
- GR_STATIC_ASSERT(12 == kInt_GrSLType);
- GR_STATIC_ASSERT(13 == kUint_GrSLType);
- GR_STATIC_ASSERT(14 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(12 == kBool_GrSLType);
+ GR_STATIC_ASSERT(13 == kInt_GrSLType);
+ GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kGrSLTypeCount);
}
/** Is the shading language type numeric (including vectors/matrices)? */
@@ -172,6 +176,7 @@ static inline size_t GrSLTypeSize(GrSLType type) {
0, // kSampler2D_GrSLType
0, // kSamplerExternal_GrSLType
0, // kSampler2DRect_GrSLType
+ 0, // kSamplerBuffer_GrSLType
0, // kBool_GrSLType
0, // kInt_GrSLType
0, // kUint_GrSLType
@@ -189,19 +194,21 @@ static inline size_t GrSLTypeSize(GrSLType type) {
GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(11 == kBool_GrSLType);
- GR_STATIC_ASSERT(12 == kInt_GrSLType);
- GR_STATIC_ASSERT(13 == kUint_GrSLType);
- GR_STATIC_ASSERT(14 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(11 == kSamplerBuffer_GrSLType);
+ GR_STATIC_ASSERT(12 == kBool_GrSLType);
+ GR_STATIC_ASSERT(13 == kInt_GrSLType);
+ GR_STATIC_ASSERT(14 == kUint_GrSLType);
+ GR_STATIC_ASSERT(15 == kGrSLTypeCount);
}
static inline bool GrSLTypeIsSamplerType(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType;
+ return type >= kSampler2D_GrSLType && type <= kSamplerBuffer_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);
}
static inline bool GrSLTypeAcceptsPrecision(GrSLType type) {
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698