@@ -1111,45 +1111,6 @@ bool ValidDstBlendFunc(const Context *context, GLenum val)
1111
1111
1112
1112
return false ;
1113
1113
}
1114
-
1115
- void RecordBindTextureTypeError (Context *context, TextureType target)
1116
- {
1117
- ASSERT (!context->getStateCache ().isValidBindTextureType (target));
1118
-
1119
- switch (target)
1120
- {
1121
- case TextureType::Rectangle:
1122
- ASSERT (!context->getExtensions ().textureRectangle );
1123
- context->validationError (GL_INVALID_ENUM, kTextureRectangleNotSupported );
1124
- break ;
1125
-
1126
- case TextureType::_3D:
1127
- case TextureType::_2DArray:
1128
- ASSERT (context->getClientMajorVersion () < 3 );
1129
- context->validationError (GL_INVALID_ENUM, kES3Required );
1130
- break ;
1131
-
1132
- case TextureType::_2DMultisample:
1133
- ASSERT (context->getClientVersion () < Version (3 , 1 ) &&
1134
- !context->getExtensions ().textureMultisample );
1135
- context->validationError (GL_INVALID_ENUM, kMultisampleTextureExtensionOrES31Required );
1136
- break ;
1137
-
1138
- case TextureType::_2DMultisampleArray:
1139
- ASSERT (!context->getExtensions ().textureStorageMultisample2DArray );
1140
- context->validationError (GL_INVALID_ENUM, kMultisampleArrayExtensionRequired );
1141
- break ;
1142
-
1143
- case TextureType::External:
1144
- ASSERT (!context->getExtensions ().eglImageExternal &&
1145
- !context->getExtensions ().eglStreamConsumerExternal );
1146
- context->validationError (GL_INVALID_ENUM, kExternalTextureNotSupported );
1147
- break ;
1148
-
1149
- default :
1150
- context->validationError (GL_INVALID_ENUM, kInvalidTextureTarget );
1151
- }
1152
- }
1153
1114
} // anonymous namespace
1154
1115
1155
1116
bool ValidateES2TexImageParameters (Context *context,
@@ -3073,36 +3034,6 @@ bool ValidateFlushMappedBufferRangeEXT(Context *context,
3073
3034
return ValidateFlushMappedBufferRangeBase (context, target, offset, length);
3074
3035
}
3075
3036
3076
- bool ValidateBindTexture (Context *context, TextureType target, GLuint texture)
3077
- {
3078
- if (!context->getStateCache ().isValidBindTextureType (target))
3079
- {
3080
- RecordBindTextureTypeError (context, target);
3081
- return false ;
3082
- }
3083
-
3084
- if (texture == 0 )
3085
- {
3086
- return true ;
3087
- }
3088
-
3089
- Texture *textureObject = context->getTexture (texture);
3090
- if (textureObject && textureObject->getType () != target)
3091
- {
3092
- context->validationError (GL_INVALID_OPERATION, kTypeMismatch );
3093
- return false ;
3094
- }
3095
-
3096
- if (!context->getState ().isBindGeneratesResourceEnabled () &&
3097
- !context->isTextureGenerated (texture))
3098
- {
3099
- context->validationError (GL_INVALID_OPERATION, kObjectNotGenerated );
3100
- return false ;
3101
- }
3102
-
3103
- return true ;
3104
- }
3105
-
3106
3037
bool ValidateBindUniformLocationCHROMIUM (Context *context,
3107
3038
GLuint program,
3108
3039
GLint location,
@@ -6654,4 +6585,43 @@ bool ValidateProvokingVertexANGLE(Context *context, ProvokingVertex modePacked)
6654
6585
return true ;
6655
6586
}
6656
6587
6588
+ void RecordBindTextureTypeError (Context *context, TextureType target)
6589
+ {
6590
+ ASSERT (!context->getStateCache ().isValidBindTextureType (target));
6591
+
6592
+ switch (target)
6593
+ {
6594
+ case TextureType::Rectangle:
6595
+ ASSERT (!context->getExtensions ().textureRectangle );
6596
+ context->validationError (GL_INVALID_ENUM, kTextureRectangleNotSupported );
6597
+ break ;
6598
+
6599
+ case TextureType::_3D:
6600
+ case TextureType::_2DArray:
6601
+ ASSERT (context->getClientMajorVersion () < 3 );
6602
+ context->validationError (GL_INVALID_ENUM, kES3Required );
6603
+ break ;
6604
+
6605
+ case TextureType::_2DMultisample:
6606
+ ASSERT (context->getClientVersion () < Version (3 , 1 ) &&
6607
+ !context->getExtensions ().textureMultisample );
6608
+ context->validationError (GL_INVALID_ENUM, kMultisampleTextureExtensionOrES31Required );
6609
+ break ;
6610
+
6611
+ case TextureType::_2DMultisampleArray:
6612
+ ASSERT (!context->getExtensions ().textureStorageMultisample2DArray );
6613
+ context->validationError (GL_INVALID_ENUM, kMultisampleArrayExtensionRequired );
6614
+ break ;
6615
+
6616
+ case TextureType::External:
6617
+ ASSERT (!context->getExtensions ().eglImageExternal &&
6618
+ !context->getExtensions ().eglStreamConsumerExternal );
6619
+ context->validationError (GL_INVALID_ENUM, kExternalTextureNotSupported );
6620
+ break ;
6621
+
6622
+ default :
6623
+ context->validationError (GL_INVALID_ENUM, kInvalidTextureTarget );
6624
+ }
6625
+ }
6626
+
6657
6627
} // namespace gl
0 commit comments