From a189913fed877f1fa83073cb55eeb1a8ca66fefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Aug 2014 13:52:36 +0200 Subject: [PATCH] Platform: display also all new ES 3.1 limits in magnum-info. --- src/Magnum/Platform/magnum-info.cpp | 97 +++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 19 deletions(-) diff --git a/src/Magnum/Platform/magnum-info.cpp b/src/Magnum/Platform/magnum-info.cpp index bc7b0b7ef..52016ab2b 100644 --- a/src/Magnum/Platform/magnum-info.cpp +++ b/src/Magnum/Platform/magnum-info.cpp @@ -39,8 +39,10 @@ #include "Magnum/Extensions.h" #include "Magnum/Framebuffer.h" #include "Magnum/Mesh.h" -#ifndef MAGNUM_TARGET_GLES +#ifndef MAGNUM_TARGET_GLES2 #include "Magnum/MultisampleTexture.h" +#endif +#ifndef MAGNUM_TARGET_GLES #include "Magnum/RectangleTexture.h" #endif #include "Magnum/Renderbuffer.h" @@ -301,6 +303,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(Shader::maxTextureImageUnits(Shader::Type::TessellationControl)) _l(Shader::maxTextureImageUnits(Shader::Type::TessellationEvaluation)) _l(Shader::maxTextureImageUnits(Shader::Type::Geometry)) + #endif + #ifndef MAGNUM_TARGET_GLES2 _l(Shader::maxTextureImageUnits(Shader::Type::Compute)) #endif _l(Shader::maxTextureImageUnits(Shader::Type::Fragment)) @@ -310,18 +314,12 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(Shader::maxUniformComponents(Shader::Type::TessellationControl)) _l(Shader::maxUniformComponents(Shader::Type::TessellationEvaluation)) _l(Shader::maxUniformComponents(Shader::Type::Geometry)) + #endif + #ifndef MAGNUM_TARGET_GLES2 _l(Shader::maxUniformComponents(Shader::Type::Compute)) #endif _l(Shader::maxUniformComponents(Shader::Type::Fragment)) - #ifndef MAGNUM_TARGET_GLES - _l(AbstractShaderProgram::maxUniformLocations()) - #endif _l(AbstractShaderProgram::maxVertexAttributes()) - #ifndef MAGNUM_TARGET_GLES - _l(AbstractTexture::maxColorSamples()) - _l(AbstractTexture::maxDepthSamples()) - _l(AbstractTexture::maxIntegerSamples()) - #endif #ifndef MAGNUM_TARGET_GLES2 _l(AbstractTexture::maxLodBias()) #endif @@ -330,7 +328,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat #endif _lvec(Texture2D::maxSize()) #ifndef MAGNUM_TARGET_GLES2 - _lvec(Texture3D::maxSize()) + _lvec(Texture3D::maxSize()) /* Checked ES2 version below */ #endif #ifndef MAGNUM_TARGET_GLES @@ -339,14 +337,34 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(AbstractFramebuffer::maxDualSourceDrawBuffers()) } + #endif - if(c->isExtensionSupported()) { + #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES _h(ARB::compute_shader) + #endif _l(AbstractShaderProgram::maxComputeSharedMemorySize()) _l(AbstractShaderProgram::maxComputeWorkGroupInvocations()) } + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES + _h(ARB::explicit_uniform_location) + #endif + + _l(AbstractShaderProgram::maxUniformLocations()) + } + #endif + + #ifndef MAGNUM_TARGET_GLES if(c->isExtensionSupported()) { _h(ARB::geometry_shader4) @@ -354,57 +372,86 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(Shader::maxGeometryOutputComponents()) _l(Shader::maxGeometryTotalOutputComponents()) } + #endif - if(c->isExtensionSupported()) { + #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES _h(ARB::shader_atomic_counters) + #endif _l(Buffer::maxAtomicCounterBindings()) _l(Shader::maxAtomicCounterBuffers(Shader::Type::Vertex)) + #ifndef MAGNUM_TARGET_GLES _l(Shader::maxAtomicCounterBuffers(Shader::Type::TessellationControl)) _l(Shader::maxAtomicCounterBuffers(Shader::Type::TessellationEvaluation)) _l(Shader::maxAtomicCounterBuffers(Shader::Type::Geometry)) + #endif _l(Shader::maxAtomicCounterBuffers(Shader::Type::Compute)) _l(Shader::maxAtomicCounterBuffers(Shader::Type::Fragment)) _l(Shader::maxCombinedAtomicCounterBuffers()) _l(Shader::maxAtomicCounters(Shader::Type::Vertex)) + #ifndef MAGNUM_TARGET_GLES _l(Shader::maxAtomicCounters(Shader::Type::TessellationControl)) _l(Shader::maxAtomicCounters(Shader::Type::TessellationEvaluation)) _l(Shader::maxAtomicCounters(Shader::Type::Geometry)) + #endif _l(Shader::maxAtomicCounters(Shader::Type::Compute)) _l(Shader::maxAtomicCounters(Shader::Type::Fragment)) _l(Shader::maxCombinedAtomicCounters()) _l(AbstractShaderProgram::maxAtomicCounterBufferSize()) } - if(c->isExtensionSupported()) { + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES _h(ARB::shader_image_load_store) + #endif _l(Shader::maxImageUniforms(Shader::Type::Vertex)) + #ifndef MAGNUM_TARGET_GLES _l(Shader::maxImageUniforms(Shader::Type::TessellationControl)) _l(Shader::maxImageUniforms(Shader::Type::TessellationEvaluation)) _l(Shader::maxImageUniforms(Shader::Type::Geometry)) + #endif _l(Shader::maxImageUniforms(Shader::Type::Compute)) _l(Shader::maxImageUniforms(Shader::Type::Fragment)) _l(Shader::maxCombinedImageUniforms()) _l(AbstractShaderProgram::maxCombinedShaderOutputResources()) _l(AbstractShaderProgram::maxImageUnits()) + #ifndef MAGNUM_TARGET_GLES _l(AbstractShaderProgram::maxImageSamples()) + #endif } - if(c->isExtensionSupported()) { + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES _h(ARB::shader_storage_buffer_object) + #endif _l(Shader::maxShaderStorageBlocks(Shader::Type::Vertex)) + #ifndef MAGNUM_TARGET_GLES _l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationControl)) _l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationEvaluation)) _l(Shader::maxShaderStorageBlocks(Shader::Type::Geometry)) + #endif _l(Shader::maxShaderStorageBlocks(Shader::Type::Compute)) _l(Shader::maxShaderStorageBlocks(Shader::Type::Fragment)) _l(Shader::maxCombinedShaderStorageBlocks()) /* AbstractShaderProgram::maxCombinedShaderOutputResources() already in shader_image_load_store */ _l(AbstractShaderProgram::maxShaderStorageBlockSize()) } + #endif + #ifndef MAGNUM_TARGET_GLES if(c->isExtensionSupported()) { _h(ARB::tessellation_shader) @@ -428,14 +475,28 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(BufferTexture::offsetAlignment()) } + #endif - if(c->isExtensionSupported()) { + #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES + if(c->isExtensionSupported()) + #endif + { + #ifndef MAGNUM_TARGET_GLES _h(ARB::texture_multisample) + #endif + _l(AbstractTexture::maxColorSamples()) + _l(AbstractTexture::maxDepthSamples()) + _l(AbstractTexture::maxIntegerSamples()) _lvec(MultisampleTexture2D::maxSize()) + #ifndef MAGNUM_TARGET_GLES _lvec(MultisampleTexture2DArray::maxSize()) + #endif } + #endif + #ifndef MAGNUM_TARGET_GLES if(c->isExtensionSupported()) { _h(ARB::texture_rectangle) @@ -443,8 +504,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #endif - /** @todo Somehow sort the following into previous list for ES3 */ - #ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES if(c->isExtensionSupported()) @@ -459,8 +518,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(Shader::maxUniformBlocks(Shader::Type::TessellationControl)) _l(Shader::maxUniformBlocks(Shader::Type::TessellationEvaluation)) _l(Shader::maxUniformBlocks(Shader::Type::Geometry)) - _l(Shader::maxUniformBlocks(Shader::Type::Compute)) #endif + _l(Shader::maxUniformBlocks(Shader::Type::Compute)) _l(Shader::maxUniformBlocks(Shader::Type::Fragment)) _l(Shader::maxCombinedUniformBlocks()) _l(Shader::maxCombinedUniformComponents(Shader::Type::Vertex)) @@ -468,8 +527,8 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat _l(Shader::maxCombinedUniformComponents(Shader::Type::TessellationControl)) _l(Shader::maxCombinedUniformComponents(Shader::Type::TessellationEvaluation)) _l(Shader::maxCombinedUniformComponents(Shader::Type::Geometry)) - _l(Shader::maxCombinedUniformComponents(Shader::Type::Compute)) #endif + _l(Shader::maxCombinedUniformComponents(Shader::Type::Compute)) _l(Shader::maxCombinedUniformComponents(Shader::Type::Fragment)) _l(AbstractShaderProgram::maxUniformBlockSize()) }