File: command_list.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (66 lines) | stat: -rw-r--r-- 2,680 bytes parent folder | download | duplicates (2)
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.command_list

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

Overview (from the spec)
	
	This extension adds a few new features designed to provide very low 
	overhead batching and replay of rendering commands and state changes:
	
	- A state object, which stores a pre-validated representation of the
	  the state of (almost) the entire pipeline.
	
	- A more flexible and extensible MultiDrawIndirect (MDI) type of mechanism, using
	  a token-based command stream, allowing to setup binding state and emit draw calls.
	
	- A set of functions to execute a list of the token-based command streams with state object
	  changes interleaved with the streams.
	
	- Command lists enabling compilation and reuse of sequences of command
	  streams and state object changes.
	
	Because state objects reflect the state of the entire pipeline, it is 
	expected that they can be pre-validated and executed efficiently. It is 
	also expected that when state objects are combined into a command list,
	the command list can diff consecutive state objects to produce a reduced/
	optimized set of state changes specific to that transition.
	
	The token-based command stream can also be stored in regular buffer objects
	and therefore be modified by the server itself. This allows more 
	complex work creation than the original MDI approach, which was limited
	to emitting draw calls only.

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

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

# INPUT glCreateStatesNV.states size not checked against n
glCreateStatesNV=wrapper.wrapper(glCreateStatesNV).setInputArraySize(
    'states', None
)
# INPUT glDeleteStatesNV.states size not checked against n
glDeleteStatesNV=wrapper.wrapper(glDeleteStatesNV).setInputArraySize(
    'states', None
)
# INPUT glCreateCommandListsNV.lists size not checked against n
glCreateCommandListsNV=wrapper.wrapper(glCreateCommandListsNV).setInputArraySize(
    'lists', None
)
# INPUT glDeleteCommandListsNV.lists size not checked against n
glDeleteCommandListsNV=wrapper.wrapper(glDeleteCommandListsNV).setInputArraySize(
    'lists', None
)
### END AUTOGENERATED SECTION