GL_ARB_sparse_texture is not supported

I have this code that checks if it is supported GL_ARB_sparse_texture:

GLint ExtensionCount = 0;
    glGetIntegerv(GL_NUM_EXTENSIONS, &ExtensionCount);
    for (GLint i = 0; i < ExtensionCount; ++i)
        if (std::string((char const*)glGetStringi(GL_EXTENSIONS, i)) == std::string("GL_ARB_sparse_texture")){
            std::cout << "supported" << std::endl;
        }

It prints that it is supported. The problem is that my shader says this is not the case:

#version 450 core
#extension GL_ARB_sparse_texture : require

Exit: enter image description here

I have a GTX 660Ti with 350.12 drivers on Windows 8.1.

What am I doing wrong?

+2
source share
1 answer

As pointed out in a comment by genpfault, in the shader with the directive #extensionyou need to enable only extensions that add functions to the GLSL language manually. Since it GL_ARB_sparse_texturedoes not add GLSL functions, you do not need to explicitly include it in your shaders - just check the support with glGetIntegerv.

GLSL (, ARB_shader_subroutine), .

+1

Source: https://habr.com/ru/post/1626781/


All Articles