void FOpenGLES2::ProcessQueryGLInt() { GLint MaxVertexAttribs; LOG_AND_GET_GL_INT(GL_MAX_VERTEX_ATTRIBS, 0, MaxVertexAttribs); bNeedsVertexAttribRemap = MaxVertexAttribs < 16; if (bNeedsVertexAttribRemap) { UE_LOG(LogRHI, Warning, TEXT("Device reports support for %d vertex attributes, UE4 requires 16. Rendering artifacts may occur."), MaxVertexAttribs ); } LOG_AND_GET_GL_INT(GL_MAX_VARYING_VECTORS, 0, MaxVaryingVectors); LOG_AND_GET_GL_INT(GL_MAX_VERTEX_UNIFORM_VECTORS, 0, MaxVertexUniformComponents); LOG_AND_GET_GL_INT(GL_MAX_FRAGMENT_UNIFORM_VECTORS, 0, MaxPixelUniformComponents); const GLint RequiredMaxVertexUniformComponents = 256; if (MaxVertexUniformComponents < RequiredMaxVertexUniformComponents) { UE_LOG(LogRHI,Warning, TEXT("Device reports support for %d vertex uniform vectors, UE4 requires %d. Rendering artifacts may occur, especially with skeletal meshes. Some drivers, e.g. iOS, report a smaller number than is actually supported."), MaxVertexUniformComponents, RequiredMaxVertexUniformComponents ); } MaxVertexUniformComponents = FMath::Max<GLint>(MaxVertexUniformComponents, RequiredMaxVertexUniformComponents); MaxGeometryUniformComponents = 0; MaxGeometryTextureImageUnits = 0; MaxHullTextureImageUnits = 0; MaxDomainTextureImageUnits = 0; }
void FOpenGLES31::ProcessQueryGLInt() { if(bES2Fallback) { LOG_AND_GET_GL_INT(GL_MAX_VARYING_VECTORS, 0, MaxVaryingVectors); LOG_AND_GET_GL_INT(GL_MAX_VERTEX_UNIFORM_VECTORS, 0, MaxVertexUniformComponents); LOG_AND_GET_GL_INT(GL_MAX_FRAGMENT_UNIFORM_VECTORS, 0, MaxPixelUniformComponents); MaxVaryingVectors *= 4; MaxVertexUniformComponents *= 4; MaxPixelUniformComponents *= 4; MaxGeometryUniformComponents = 0; MaxGeometryTextureImageUnits = 0; MaxHullTextureImageUnits = 0; MaxDomainTextureImageUnits = 0; } else { GET_GL_INT(GL_MAX_VARYING_VECTORS, 0, MaxVaryingVectors); GET_GL_INT(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 0, MaxVertexUniformComponents); GET_GL_INT(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 0, MaxPixelUniformComponents); GET_GL_INT(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT, 0, MaxGeometryUniformComponents); GET_GL_INT(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT, 0, MaxGeometryTextureImageUnits); GET_GL_INT(GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, 0, MaxComputeTextureImageUnits); GET_GL_INT(GL_MAX_COMPUTE_UNIFORM_COMPONENTS, 0, MaxComputeUniformComponents); if (bSupportsTessellation) { GET_GL_INT(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT, 0, MaxHullUniformComponents); GET_GL_INT(GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT, 0, MaxDomainUniformComponents); GET_GL_INT(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT, 0, MaxHullTextureImageUnits); GET_GL_INT(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT, 0, MaxDomainTextureImageUnits); } else { MaxHullUniformComponents = 0; MaxDomainUniformComponents = 0; MaxHullTextureImageUnits = 0; MaxDomainTextureImageUnits = 0; } } // No timestamps //LOG_AND_GET_GL_QUERY_INT(GL_TIMESTAMP, 0, TimestampQueryBits); }
void FOpenGL3::ProcessQueryGLInt() { #ifndef __clang__ #define LOG_AND_GET_GL_INT(IntEnum, Default, Dest) do { if (IntEnum) {glGetIntegerv(IntEnum, &Dest);} else {Dest = Default;} /*FPlatformMisc::LowLevelOutputDebugStringf(TEXT(" ") ## TEXT(#IntEnum) ## TEXT(": %d"), Dest);*/ } while(0) #else #define LOG_AND_GET_GL_INT(IntEnum, Default, Dest) do { if (IntEnum) {glGetIntegerv(IntEnum, &Dest);} else {Dest = Default;} /*FPlatformMisc::LowLevelOutputDebugStringf(TEXT(" " #IntEnum ": %d"), Dest);*/ } while(0) #endif LOG_AND_GET_GL_INT(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 0, MaxVertexUniformComponents); LOG_AND_GET_GL_INT(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 0, MaxPixelUniformComponents); LOG_AND_GET_GL_INT(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, 0, MaxGeometryUniformComponents); LOG_AND_GET_GL_INT(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, 0, MaxGeometryTextureImageUnits); LOG_AND_GET_GL_INT(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, 0, MaxHullTextureImageUnits); LOG_AND_GET_GL_INT(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, 0, MaxDomainTextureImageUnits); #ifndef __clang__ #define LOG_AND_GET_GL_QUERY_INT(IntEnum, Default, Dest) do { if (IntEnum) {glGetQueryiv(IntEnum, GL_QUERY_COUNTER_BITS, &Dest);} else {Dest = Default;} /*FPlatformMisc::LowLevelOutputDebugStringf(TEXT(" GL_QUERY_COUNTER_BITS: ") ## TEXT(#IntEnum) ## TEXT(": %d"), Dest);*/ } while(0) #else #define LOG_AND_GET_GL_QUERY_INT(IntEnum, Default, Dest) do { if (IntEnum) {glGetQueryiv(IntEnum, GL_QUERY_COUNTER_BITS, &Dest);} else {Dest = Default;} /*FPlatformMisc::LowLevelOutputDebugStringf(TEXT(" GL_QUERY_COUNTER_BITS: " #IntEnum ": %d"), Dest);*/ } while(0) #endif LOG_AND_GET_GL_QUERY_INT(GL_TIMESTAMP, 0, TimestampQueryBits); #undef LOG_AND_GET_GL_QUERY_INT #undef LOG_AND_GET_GL_INT }