Class ARBES31Compatibility


  • public class ARBES31Compatibility
    extends java.lang.Object
    Native bindings to the ARB_ES3_1_compatibility extension.

    This extension adds support for features of OpenGL ES 3.1 that are missing from OpenGL 4.4. Enabling these features will ease the process of porting applications from OpenGL ES 3.1 to OpenGL. Enabling these features will ease the process of porting applications from OpenGL ES 3.1 to OpenGL.

    In particular this adds the following features:

    • a new MemoryBarrierByRegion API which is potentially more efficient for specific localized memory access patterns.
    • increases the minimum required size of SSBOs to 2^27 (128 MB).
    • support for GLSL ES version 310.
    • a new GLSL built-in function, imageAtomicExchange, which performs atomic exchanges on r32f floating point images.
    • a new GLSL built-in fragment shader input, gl_HelperInvocation, that identifies whether the current fragment shader input is a helper invocation. Fragment shader code can use this variable to skip performing operations that are useless or potentially dangerous for helper invocations.
    • a new GLSL built-in constant for the maximum supported samples: gl_MaxSamples.
    • a number of new GLSL built-in constants mirroring the API limits for image uniforms: gl_Max * ImageUniforms, gl_MaxCombinedShaderOutputResources.
    • new GLSL built-in functions which extend mix() to select between int, uint, and bool components.
    • add the "coherent" qualifier to all memory variables taken by the GLSL built-in atomic* and imageAtomic* functions.

    Requires OpenGL 4.4, ARB_ES2_compatibility, ARB_ES3_compatibility. Promoted to core in OpenGL 4.5.

    • Method Detail

      • glMemoryBarrierByRegion

        public static void glMemoryBarrierByRegion​(int barriers)
        Behaves like MemoryBarrier, with two differences:

        First, it narrows the region under consideration so that only reads/writes of prior fragment shaders that are invoked for a smaller region of the framebuffer will be completed/reflected prior to subsequent reads/write of following fragment shaders. The size of the region is implementation dependent and may be as small as one framebuffer pixel.

        Second, it only applies to memory transactions that may be read by or written by a fragment shader.

        When barriers is ALL_BARRIER_BITS, shader memory accesses will be synchronized relative to all these barrier bits, but not to other barrier bits specific to MemoryBarrier. This implies that reads/writes for scatter/gather-like algorithms may or may not be completed/reflected after a MemoryBarrierByRegion command. However, for uses such as deferred shading, where a linked list of visible surfaces with the head at a framebuffer address may be constructed, and the entirety of the list is only dependent on previous executions at that framebuffer address, MemoryBarrierByRegion may be significantly more efficient than MemoryBarrier.

        Parameters:
        barriers - the barriers to insert. One or more of:
        ATOMIC_COUNTER_BARRIER_BITFRAMEBUFFER_BARRIER_BITSHADER_IMAGE_ACCESS_BARRIER_BIT
        SHADER_STORAGE_BARRIER_BITTEXTURE_FETCH_BARRIER_BITUNIFORM_BARRIER_BIT