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
|
'''OpenGL extension NV.shader_thread_group
This module customises the behaviour of the
OpenGL.raw.GL.NV.shader_thread_group to provide a more
Python-friendly API
Overview (from the spec)
Implementations of the OpenGL Shading Language may, but are not required
to, run multiple shader threads for a single stage as a SIMD thread group,
where individual execution threads are assigned to thread groups in an
undefined, implementation-dependent order. This extension provides a set
of new features to the OpenGL Shading Language to query thread states and
to share data between fragments within a 2x2 pixel quad.
More specifically the following functionalities were added:
* New uniform variables and tokens to query the number of threads in a
warp, the number of warps running on a SM and the number of SMs on the
GPU.
* New shader inputs to query the thread id, the warp id and the SM id.
* New shader inputs to query if a fragment shader thread is a helper
thread.
* New shader built-in functions to query the state of a Boolean condition
over all threads in a thread group.
* New shader built-in functions to query which threads are active within
a thread group.
* New fragment shader built-in functions to share data between fragments
within a 2x2 pixel quad.
Shaders using the new functionalities provided by this extension should
enable this functionality via the construct
#extension GL_NV_shader_thread_group : require (or enable)
This extension also specifies some modifications to the program assembly
language to support the thread state query and thread data sharing
functionalities.
Note that in this extension specification warp and thread group have the
same meaning. A warp is a group of threads that get executed in lockstep.
Each thread in a warp executes the same instruction of a program, but on
different data.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/shader_thread_group.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.NV.shader_thread_group import *
from OpenGL.raw.GL.NV.shader_thread_group import _EXTENSION_NAME
def glInitShaderThreadGroupNV():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION
|