this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added assumption of limited NPOT support on GLES 2. Also skipped some feature detection for core features.

+38 -17
+38 -17
src/renderer_GL_common.inl
··· 260 260 261 261 // NPOT textures 262 262 #ifdef SDL_GPU_USE_OPENGL 263 - if(isExtensionSupported("GL_ARB_texture_non_power_of_two")) 263 + #if SDL_GPU_GL_MAJOR_VERSION >= 2 264 + // Core in GL 2+ 264 265 renderer->enabled_features |= GPU_FEATURE_NON_POWER_OF_TWO; 265 - else 266 - renderer->enabled_features &= ~GPU_FEATURE_NON_POWER_OF_TWO; 266 + #else 267 + if(isExtensionSupported("GL_ARB_texture_non_power_of_two")) 268 + renderer->enabled_features |= GPU_FEATURE_NON_POWER_OF_TWO; 269 + else 270 + renderer->enabled_features &= ~GPU_FEATURE_NON_POWER_OF_TWO; 271 + #endif 267 272 #elif defined(SDL_GPU_USE_GLES) 268 - if(isExtensionSupported("GL_OES_texture_npot") || isExtensionSupported("GL_IMG_texture_npot") 269 - || isExtensionSupported("GL_APPLE_texture_2D_limited_npot") || isExtensionSupported("GL_ARB_texture_non_power_of_two")) 273 + #if SDL_GPU_GLES_MAJOR_VERSION >= 3 274 + // Core in GLES 3+ 270 275 renderer->enabled_features |= GPU_FEATURE_NON_POWER_OF_TWO; 271 - else 272 - renderer->enabled_features &= ~GPU_FEATURE_NON_POWER_OF_TWO; 276 + #else 277 + if(isExtensionSupported("GL_OES_texture_npot") || isExtensionSupported("GL_IMG_texture_npot") 278 + || isExtensionSupported("GL_APPLE_texture_2D_limited_npot") || isExtensionSupported("GL_ARB_texture_non_power_of_two")) 279 + renderer->enabled_features |= GPU_FEATURE_NON_POWER_OF_TWO; 280 + else 281 + renderer->enabled_features &= ~GPU_FEATURE_NON_POWER_OF_TWO; 282 + 283 + #if SDL_GPU_GLES_MAJOR_VERSION >= 2 284 + // Assume limited NPOT support for GLES 2+ 285 + renderer->enabled_features |= GPU_FEATURE_NON_POWER_OF_TWO; 286 + #endif 287 + #endif 273 288 #endif 274 289 275 290 // FBO 276 291 #ifdef SDL_GPU_USE_OPENGL 277 - if(isExtensionSupported("GL_EXT_framebuffer_object")) 292 + #if SDL_GPU_GL_MAJOR_VERSION >= 3 293 + // Core in GL 3+ 278 294 renderer->enabled_features |= GPU_FEATURE_RENDER_TARGETS; 279 - else 280 - renderer->enabled_features &= ~GPU_FEATURE_RENDER_TARGETS; 295 + #else 296 + if(isExtensionSupported("GL_EXT_framebuffer_object")) 297 + renderer->enabled_features |= GPU_FEATURE_RENDER_TARGETS; 298 + else 299 + renderer->enabled_features &= ~GPU_FEATURE_RENDER_TARGETS; 300 + #endif 281 301 #elif defined(SDL_GPU_USE_GLES) 282 - #if SDL_GPU_GL_TIER < 3 302 + #if SDL_GPU_GLES_MAJOR_VERSION >= 2 303 + // Core in GLES 2+ 304 + renderer->enabled_features |= GPU_FEATURE_RENDER_TARGETS; 305 + #else 283 306 if(isExtensionSupported("GL_OES_framebuffer_object")) 284 307 renderer->enabled_features |= GPU_FEATURE_RENDER_TARGETS; 285 308 else 286 309 renderer->enabled_features &= ~GPU_FEATURE_RENDER_TARGETS; 287 - #else 288 - renderer->enabled_features |= GPU_FEATURE_RENDER_TARGETS; 289 310 #endif 290 311 #endif 291 312 ··· 294 315 renderer->enabled_features |= GPU_FEATURE_BLEND_EQUATIONS; 295 316 renderer->enabled_features |= GPU_FEATURE_BLEND_FUNC_SEPARATE; 296 317 297 - #if SDL_GPU_GL_MAJOR_VERSION > 1 318 + #if SDL_GPU_GL_MAJOR_VERSION >= 2 298 319 // Core in GL 2+ 299 320 renderer->enabled_features |= GPU_FEATURE_BLEND_EQUATIONS_SEPARATE; 300 321 #else ··· 306 327 307 328 #elif defined(SDL_GPU_USE_GLES) 308 329 309 - #if SDL_GPU_GLES_MAJOR_VERSION > 1 330 + #if SDL_GPU_GLES_MAJOR_VERSION >= 2 310 331 // Core in GLES 2+ 311 332 renderer->enabled_features |= GPU_FEATURE_BLEND_EQUATIONS; 312 333 renderer->enabled_features |= GPU_FEATURE_BLEND_FUNC_SEPARATE; ··· 331 352 332 353 // Wrap modes 333 354 #ifdef SDL_GPU_USE_OPENGL 334 - #if SDL_GPU_GL_MAJOR_VERSION > 1 355 + #if SDL_GPU_GL_MAJOR_VERSION >= 2 335 356 renderer->enabled_features |= GPU_FEATURE_WRAP_REPEAT_MIRRORED; 336 357 #else 337 358 if(isExtensionSupported("GL_ARB_texture_mirrored_repeat")) ··· 340 361 renderer->enabled_features &= ~GPU_FEATURE_WRAP_REPEAT_MIRRORED; 341 362 #endif 342 363 #elif defined(SDL_GPU_USE_GLES) 343 - #if SDL_GPU_GLES_MAJOR_VERSION > 1 364 + #if SDL_GPU_GLES_MAJOR_VERSION >= 2 344 365 renderer->enabled_features |= GPU_FEATURE_WRAP_REPEAT_MIRRORED; 345 366 #else 346 367 if(isExtensionSupported("GL_OES_texture_mirrored_repeat"))