Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created April 26, 2015 07:56
Show Gist options
  • Save aras-p/ad38ab253e3e7038fe49 to your computer and use it in GitHub Desktop.
Save aras-p/ad38ab253e3e7038fe49 to your computer and use it in GitHub Desktop.
Part of runtime flags that kick in different things on our GL implementaton
int maxAASamplesConst; // gles2 img/apple/ext extensions all use different constants (facepalm)
int halfConst; // gles2 and gles3 have different constants for half float type
int texSRGBAConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGBA texture type
int texSRGBConst; // gles2 (without 'internal format' ext) and gles3 have different constants for SRGB RGB texture type
int etcFormatConst; // gles2/gles3 have different standard etc formats
bool isPvrGpu;
bool isMaliGpu;
bool isAdrenoGpu;
bool isTegraGpu;
bool isIntelGpu;
bool isAMDGpu;
bool hasSlowAlphaTest; // alpha test might be slow because it kills coarse z cull
bool useDiscardToAvoidRestore; // if discard/invalidate are preferred to avoid restore (usually means clear is fullscreen quad)
bool useClearToAvoidRestore; // if clear is preferred to avoid restore
bool hasPolygonOffsetBug; // Need to increase polygon offset by a large factor
bool favorUniformBuffer; // If false, will avoid using uniform buffers
bool requireDrawBufferNone;
bool enforceFullFormat;
// old gles2 adreno drivers fails to re-patch vfetch instructions
// if shader stays the same, but vertex layout has been changed
// will result in forced program change on draw call
bool buggyVFetchPatching;
// if we should force highp as default precision
// on Tegra there is a bug that sometimes results in samplers not being reported (workaround)
// on Adreno (N4 at least) there is a bug that sometimes results in program link crash (workaround)
bool useHighpDefaultFSPrec;
// older imgtec android shader compiler have borken GL_EXT_shader_texture_lod
// it insists on textureCubeLod instead of textureCubeLodEXT and textureCubeGradARB instead of textureCubeGradEXT
// they told us it was fixed in reference driver and backported to driver ver 1.10@2570425
// on the other hand we better off not trusting driver string, so we recheck the case on all pvr androids
bool buggyTexCubeLodGrad;
//doesn't like to have the same buffer bound to the same binding point with both BindBuffer and BindBufferBase (below)
bool buggyBindBuffer;
// on some adrenos (gles2) there is a bug in texture upload code, which usually hits font rendering
// it seems there is some optimization inside a driver when you have several uploads one after another
// and it is totally buggy
// as a workaround we just call glFinish before the first texture upload of a frame
bool buggyTextureUploadSynchronization;
// In some implementations glColorMask(0, 0, 0, 0) does not work in all situations.
// E.g. on PowerVR SGX 540 when 'discard' is used in the shader.
bool buggyDisableColorWrite;
// Adreno 3xx's crash if they see a const float array in shader that's actually used. Silently fail to compile those shaders.
bool buggyShaderConstArray;
// BlackBerry adreno needs an extra call of this
bool requirePrepareFramebuffer;
bool buggyTextureBothColorAndDepth; // Can't have render target where both color & depth will be sampled as textures
bool buggyShadowMapBilinearSampling; // Never use hardware bilinear PCF on shadow maps due to bugs
bool buggyDepthBlitWithSRGBEnabled; // depth blit with FRAMEBUFFER_SRGB enabled is buggy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment