File: gpu_shader_fp64.py

package info (click to toggle)
pyopengl 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,216 kB
  • sloc: python: 80,468; makefile: 4
file content (129 lines) | stat: -rw-r--r-- 5,223 bytes parent folder | download | duplicates (12)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
'''OpenGL extension ARB.gpu_shader_fp64

This module customises the behaviour of the 
OpenGL.raw.GL.ARB.gpu_shader_fp64 to provide a more 
Python-friendly API

Overview (from the spec)
	
	This extension allows GLSL shaders to use double-precision floating-point
	data types, including vectors and matrices of doubles.  Doubles may be
	used as inputs, outputs, and uniforms.  
	
	The shading language supports various arithmetic and comparison operators
	on double-precision scalar, vector, and matrix types, and provides a set
	of built-in functions including:
	
	  * square roots and inverse square roots;
	
	  * 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);
	
	  * absolute value, sign tests, various functions to round to an integer
	    value, modulus, minimum, maximum, clamping, blending two values, step
	    functions, and testing for infinity and NaN values;
	
	  * packing and unpacking doubles into a pair of 32-bit unsigned integers;
	
	  * matrix component-wise multiplication, and computation of outer
	    products, transposes, determinants, and inverses; and
	
	  * vector relational functions.
	
	Double-precision versions of angle, trigonometry, and exponential
	functions are not supported.
	
	Implicit conversions are supported from integer and single-precision
	floating-point values to doubles, and this extension uses the relaxed
	function overloading rules specified by the ARB_gpu_shader5 extension to
	resolve ambiguities.
	
	This extension provides API functions for specifying double-precision
	uniforms in the default uniform block, including functions similar to the
	uniform functions added by EXT_direct_state_access (if supported).
	
	This extension provides an "LF" suffix for specifying double-precision
	constants.  Floating-point constants without a suffix in GLSL are treated
	as single-precision values for backward compatibility with versions not
	supporting doubles; similar constants are treated as double-precision
	values in the "C" programming language.
	
	This extension does not support interpolation of double-precision values;
	doubles used as fragment shader inputs must be qualified as "flat".
	Additionally, this extension does not allow vertex attributes with 64-bit
	components.  That support is added separately by EXT_vertex_attrib_64bit.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.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_shader_fp64 import *
from OpenGL.raw.GL.ARB.gpu_shader_fp64 import _EXTENSION_NAME

def glInitGpuShaderFp64ARB():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )

# INPUT glUniform1dv.value size not checked against count
glUniform1dv=wrapper.wrapper(glUniform1dv).setInputArraySize(
    'value', None
)
# INPUT glUniform2dv.value size not checked against count
glUniform2dv=wrapper.wrapper(glUniform2dv).setInputArraySize(
    'value', None
)
# INPUT glUniform3dv.value size not checked against count
glUniform3dv=wrapper.wrapper(glUniform3dv).setInputArraySize(
    'value', None
)
# INPUT glUniform4dv.value size not checked against count
glUniform4dv=wrapper.wrapper(glUniform4dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix2dv.value size not checked against count
glUniformMatrix2dv=wrapper.wrapper(glUniformMatrix2dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix3dv.value size not checked against count
glUniformMatrix3dv=wrapper.wrapper(glUniformMatrix3dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix4dv.value size not checked against count
glUniformMatrix4dv=wrapper.wrapper(glUniformMatrix4dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix2x3dv.value size not checked against count
glUniformMatrix2x3dv=wrapper.wrapper(glUniformMatrix2x3dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix2x4dv.value size not checked against count
glUniformMatrix2x4dv=wrapper.wrapper(glUniformMatrix2x4dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix3x2dv.value size not checked against count
glUniformMatrix3x2dv=wrapper.wrapper(glUniformMatrix3x2dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix3x4dv.value size not checked against count
glUniformMatrix3x4dv=wrapper.wrapper(glUniformMatrix3x4dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix4x2dv.value size not checked against count
glUniformMatrix4x2dv=wrapper.wrapper(glUniformMatrix4x2dv).setInputArraySize(
    'value', None
)
# INPUT glUniformMatrix4x3dv.value size not checked against count
glUniformMatrix4x3dv=wrapper.wrapper(glUniformMatrix4x3dv).setInputArraySize(
    'value', None
)
glGetUniformdv=wrapper.wrapper(glGetUniformdv).setOutput(
    'params',size=_glgets._glget_size_mapping,pnameArg='location',orPassIn=True
)
### END AUTOGENERATED SECTION