diff options
author | dcheng <dcheng@chromium.org> | 2016-02-06 15:08:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-06 15:08:55 -0800 |
commit | c4d196c9c87f226eb33b8091dc50053c45c4e752 (patch) | |
tree | d4850f4715af4c3d5364e311f95fe6524d9a682b /include | |
parent | 964eec67760196585954203ba625e440607f7e92 (diff) |
Revert of Improve GLSL integer support (patchset #1 id:1 of https://codereview.chromium.org/1669853002/ )
Reason for revert:
MSAN bots are unhappy with this change: https://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20ChromeOS%20MSan%20Tests/builds/7068
Original issue's description:
> Improve GLSL integer support
>
> - Adds shader types for uint.
> - Adds a cap for integer support.
> - Uses glVertexAttribIPointer for integer attribs.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1669853002
>
> Committed: https://skia.googlesource.com/skia/+/3a2caf8ecf38124f4ad21a0f6c4dabfcfa17911a
TBR=bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com,cdalton@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1674813004
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 2 | ||||
-rw-r--r-- | include/gpu/GrTypesPriv.h | 50 | ||||
-rw-r--r-- | include/gpu/gl/GrGLFunctions.h | 1 | ||||
-rw-r--r-- | include/gpu/gl/GrGLInterface.h | 1 |
4 files changed, 9 insertions, 45 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index fc682069ea..944fb1481c 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -62,7 +62,6 @@ public: bool pathRenderingSupport() const { return fPathRenderingSupport; } bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; } - bool integerSupport() const { return fIntegerSupport; } /** * Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSLType, etc in a @@ -110,7 +109,6 @@ protected: bool fPathRenderingSupport : 1; bool fDstReadInShaderSupport : 1; bool fDualSourceBlendingSupport : 1; - bool fIntegerSupport : 1; bool fShaderPrecisionVaries; PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h index 4026eb7874..bc107b5cf5 100644 --- a/include/gpu/GrTypesPriv.h +++ b/include/gpu/GrTypesPriv.h @@ -29,9 +29,8 @@ enum GrSLType { kSampler2DRect_GrSLType, kBool_GrSLType, kInt_GrSLType, - kUint_GrSLType, - kLast_GrSLType = kUint_GrSLType + kLast_GrSLType = kInt_GrSLType }; static const int kGrSLTypeCount = kLast_GrSLType + 1; @@ -68,7 +67,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 }; + static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1 }; return kCounts[type]; GR_STATIC_ASSERT(0 == kVoid_GrSLType); @@ -83,7 +82,6 @@ static inline int GrSLTypeVectorCount(GrSLType type) { GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); GR_STATIC_ASSERT(10 == kBool_GrSLType); GR_STATIC_ASSERT(11 == kInt_GrSLType); - GR_STATIC_ASSERT(12 == kUint_GrSLType); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount); } @@ -116,14 +114,13 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) { GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); GR_STATIC_ASSERT(10 == kBool_GrSLType); GR_STATIC_ASSERT(11 == kInt_GrSLType); - GR_STATIC_ASSERT(12 == kUint_GrSLType); - GR_STATIC_ASSERT(13 == kGrSLTypeCount); + GR_STATIC_ASSERT(12 == 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; GR_STATIC_ASSERT(0 == kVoid_GrSLType); GR_STATIC_ASSERT(1 == kFloat_GrSLType); @@ -137,8 +134,7 @@ static inline bool GrSLTypeIsIntType(GrSLType type) { GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); GR_STATIC_ASSERT(10 == kBool_GrSLType); GR_STATIC_ASSERT(11 == kInt_GrSLType); - GR_STATIC_ASSERT(12 == kUint_GrSLType); - GR_STATIC_ASSERT(13 == kGrSLTypeCount); + GR_STATIC_ASSERT(12 == kGrSLTypeCount); } /** Is the shading language type numeric (including vectors/matrices)? */ @@ -162,7 +158,6 @@ static inline size_t GrSLTypeSize(GrSLType type) { 0, // kSampler2DRect_GrSLType 0, // kBool_GrSLType 0, // kInt_GrSLType - 0, // kUint_GrSLType }; return kSizes[type]; @@ -178,8 +173,7 @@ static inline size_t GrSLTypeSize(GrSLType type) { GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); GR_STATIC_ASSERT(10 == kBool_GrSLType); GR_STATIC_ASSERT(11 == kInt_GrSLType); - GR_STATIC_ASSERT(12 == kUint_GrSLType); - GR_STATIC_ASSERT(13 == kGrSLTypeCount); + GR_STATIC_ASSERT(12 == kGrSLTypeCount); } static inline bool GrSLTypeIsSamplerType(GrSLType type) { @@ -208,9 +202,8 @@ enum GrVertexAttribType { kVec2s_GrVertexAttribType, // vector of 2 shorts, e.g. texture coordinates kInt_GrVertexAttribType, - kUint_GrVertexAttribType, - kLast_GrVertexAttribType = kUint_GrVertexAttribType + kLast_GrVertexAttribType = kInt_GrVertexAttribType }; static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; @@ -218,8 +211,7 @@ static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; * Returns the vector size of the type. */ static inline int GrVertexAttribTypeVectorCount(GrVertexAttribType type) { - SkASSERT(type >= 0 && type < kGrVertexAttribTypeCount); - static const int kCounts[] = { 1, 2, 3, 4, 1, 4, 2, 1, 1 }; + static const int kCounts[] = { 1, 2, 3, 4, 1, 4, 2, 1 }; return kCounts[type]; GR_STATIC_ASSERT(0 == kFloat_GrVertexAttribType); @@ -230,7 +222,6 @@ static inline int GrVertexAttribTypeVectorCount(GrVertexAttribType type) { GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType); GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType); GR_STATIC_ASSERT(7 == kInt_GrVertexAttribType); - GR_STATIC_ASSERT(8 == kUint_GrVertexAttribType); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrVertexAttribTypeCount); } @@ -246,8 +237,7 @@ static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) { 1*sizeof(char), // kUByte_GrVertexAttribType 4*sizeof(char), // kVec4ub_GrVertexAttribType 2*sizeof(int16_t), // kVec2s_GrVertexAttribType - sizeof(int32_t), // kInt_GrVertexAttribType - sizeof(uint32_t) // kUint_GrVertexAttribType + sizeof(int32_t) // kInt_GrVertexAttribType }; return kSizes[type]; @@ -259,30 +249,10 @@ static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) { GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType); GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType); GR_STATIC_ASSERT(7 == kInt_GrVertexAttribType); - GR_STATIC_ASSERT(8 == kUint_GrVertexAttribType); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrVertexAttribTypeCount); } /** - * Is the attrib type integral? - */ -static inline bool GrVertexAttribTypeIsIntType(GrVertexAttribType type) { - SkASSERT(type >= 0 && type < static_cast<GrVertexAttribType>(kGrVertexAttribTypeCount)); - return type >= kInt_GrVertexAttribType; - - GR_STATIC_ASSERT(0 == kFloat_GrVertexAttribType); - GR_STATIC_ASSERT(1 == kVec2f_GrVertexAttribType); - GR_STATIC_ASSERT(2 == kVec3f_GrVertexAttribType); - GR_STATIC_ASSERT(3 == kVec4f_GrVertexAttribType); - GR_STATIC_ASSERT(4 == kUByte_GrVertexAttribType); - GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType); - GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType); - GR_STATIC_ASSERT(7 == kInt_GrVertexAttribType); - GR_STATIC_ASSERT(8 == kUint_GrVertexAttribType); - GR_STATIC_ASSERT(9 == kGrVertexAttribTypeCount); -} - -/** * converts a GrVertexAttribType to a GrSLType */ static inline GrSLType GrVertexAttribTypeToSLType(GrVertexAttribType type) { @@ -303,8 +273,6 @@ static inline GrSLType GrVertexAttribTypeToSLType(GrVertexAttribType type) { return kVec4f_GrSLType; case kInt_GrVertexAttribType: return kInt_GrSLType; - case kUint_GrVertexAttribType: - return kUint_GrSLType; } } diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h index 3fd912f222..ad59ec0c00 100644 --- a/include/gpu/gl/GrGLFunctions.h +++ b/include/gpu/gl/GrGLFunctions.h @@ -176,7 +176,6 @@ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttrib2fvProc)(GrGLuint indx, c typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttrib3fvProc)(GrGLuint indx, const GrGLfloat* values); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttribDivisorProc)(GrGLuint index, GrGLuint divisor); -typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttribIPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* ptr); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr); typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index 5dd3b61e56..dd9a9fb386 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -332,7 +332,6 @@ public: GLPtr<GrGLVertexAttrib3fvProc> fVertexAttrib3fv; GLPtr<GrGLVertexAttrib4fvProc> fVertexAttrib4fv; GLPtr<GrGLVertexAttribDivisorProc> fVertexAttribDivisor; - GLPtr<GrGLVertexAttribIPointerProc> fVertexAttribIPointer; GLPtr<GrGLVertexAttribPointerProc> fVertexAttribPointer; GLPtr<GrGLViewportProc> fViewport; |