1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
'''OpenGL extension ARB.gpu_shader5
This module customises the behaviour of the
OpenGL.raw.GL.ARB.gpu_shader5 to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a set of new features to the OpenGL Shading
Language and related APIs to support capabilities of new GPUs, extending
the capabilities of version 1.50 of the OpenGL Shading Language. Shaders
using the new functionality provided by this extension should enable this
functionality via the construct
#extension GL_ARB_gpu_shader5 : require (or enable)
This extension provides a variety of new features for all shader types,
including:
* support for indexing into arrays of samplers using non-constant
indices, as long as the index doesn't diverge if multiple shader
invocations are run in lockstep;
* extending the uniform block capability of OpenGL 3.1 and 3.2 to allow
shaders to index into an array of uniform blocks;
* support for implicitly converting signed integer types to unsigned
types, as well as more general implicit conversion and function
overloading infrastructure to support new data types introduced by
other extensions;
* a "precise" qualifier allowing computations to be carried out exactly
as specified in the shader source to avoid optimization-induced
invariance issues (which might cause cracking in tessellation);
* new built-in functions supporting:
* fused floating-point multiply-add operations;
* splitting a floating-point number into a significand and exponent
(frexp), or building a floating-point number from a significand and
exponent (ldexp);
* integer bitfield manipulation, including functions to find the
position of the most or least significant set bit, count the number
of one bits, and bitfield insertion, extraction, and reversal;
* packing and unpacking vectors of small fixed-point data types into a
larger scalar; and
* convert floating-point values to or from their integer bit
encodings;
* extending the textureGather() built-in functions provided by
ARB_texture_gather:
* allowing shaders to select any single component of a multi-component
texture to produce the gathered 2x2 footprint;
* allowing shaders to perform a per-sample depth comparison when
gathering the 2x2 footprint using for shadow sampler types;
* allowing shaders to use arbitrary offsets computed at run-time to
select a 2x2 footprint to gather from; and
* allowing shaders to use separate independent offsets for each of the
four texels returned, instead of requiring a fixed 2x2 footprint.
This extension also provides some new capabilities for individual
shader types, including:
* support for instanced geometry shaders, where a geometry shader may be
run multiple times for each primitive, including a built-in
gl_InvocationID to identify the invocation number;
* support for emitting vertices in a geometry program where each vertex
emitted may be directed independently at a specified vertex stream (as
provided by ARB_transform_feedback3), and where each shader output is
associated with a stream;
* support for reading a mask of covered samples in a fragment shader;
and
* support for interpolating a fragment shader input at a programmable
offset relative to the pixel center, a programmable sample number, or
at the centroid.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/gpu_shader5.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.ARB.gpu_shader5 import *
from OpenGL.raw.GL.ARB.gpu_shader5 import _EXTENSION_NAME
def glInitGpuShader5ARB():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION
|