GL_OES_shader_io_blocks

Supported Hardware

Series6, Series6XE, Series6XT

Valid APIs

OpenGL ES 3.0, 3.1

Description

This extension extends the functionality of interface blocks to support input and output interfaces in the OpenGL ES Shading Language.

Input and output interface blocks are used for forming the interfaces between vertex, tessellation control, tessellation evaluation, geometry and fragment shaders. This accommodates passing arrays between stages, which otherwise would require multi-dimensional array support for tessellation control outputs and for tessellation control, tessellation evaluation, and geometry shader inputs.

This extension provides support for application defined interface blocks which are used for passing application-specific information between shader stages.

This extension moves the built-in "per-vertex" in/out variables to a new built-in gl_PerVertex block. This is necessary for tessellation and geometry shaders which require separate instance for each vertex, but it can also be useful for vertex shaders.

Finally, this extension allows the redeclaration of the gl_PerVertex block in order to reduce the set of variables that must be passed between shaders.

Registry Link

https://www.khronos.org/registry/gles/extensions/OES/OES_shader_io_blocks.txt

Example

// Vertex Shader 
#extension GL_EXT_shader_io_blocks : require 
layout(location = 0) out SurfaceData 
{ 
	highp vec3 normal; 
	highp vec3 tangent; 
} surfaceData; 
// Fragment Shader 
#extension GL_EXT_shader_io_blocks : require 
layout(location = 0) in SurfaceData 
{ 
	highp vec3 normal; 
	highp vec3 tangent; 
} surfaceData;