4 The context object represents the purest, most directly accessible, abilities
5 of the device's 3D rendering pipeline.
13 All CSO state is created, bound, and destroyed, with triplets of methods that
14 all follow a specific naming scheme. For example, ``create_blend_state``,
15 ``bind_blend_state``, and ``destroy_blend_state``.
17 CSO objects handled by the context object:
19 * :ref:`Blend`: ``*_blend_state``
20 * :ref:`Sampler`: These are special; they can be bound to either vertex or
21 fragment samplers, and they are bound in groups.
22 ``bind_fragment_sampler_states``, ``bind_vertex_sampler_states``
23 * :ref:`Rasterizer`: ``*_rasterizer_state``
24 * :ref:`Depth, Stencil, & Alpha`: ``*_depth_stencil_alpha_state``
25 * :ref:`Shader`: These have two sets of methods. ``*_fs_state`` is for
26 fragment shaders, and ``*_vs_state`` is for vertex shaders.
29 Resource Binding State
30 ^^^^^^^^^^^^^^^^^^^^^^
32 This state describes how resources in various flavours (textures,
33 buffers, surfaces) are bound to the driver.
36 * ``set_constant_buffer``
37 * ``set_framebuffer_state``
38 * ``set_fragment_sampler_textures``
39 * ``set_vertex_sampler_textures``
40 * ``set_vertex_buffers``
46 These pieces of state are too small, variable, and/or trivial to have CSO
47 objects. They all follow simple, one-method binding calls, e.g.
53 * ``set_polygon_stipple``
54 * ``set_scissor_state``
55 * ``set_viewport_state``
56 * ``set_vertex_elements``
62 ``clear`` initializes some or all of the surfaces currently bound to
63 the framebuffer to particular RGBA, depth, or stencil values.
65 Clear is one of the most difficult concepts to nail down to a single
66 interface and it seems likely that we will want to add additional
67 clear paths, for instance clearing surfaces not bound to the
68 framebuffer, or read-modify-write clears such as depth-only or
69 stencil-only clears of packed depth-stencil buffers.
79 ``draw_range_elements``
85 Queries gather some statistic from the 3D pipeline over one or more
86 draws. Queries may be nested, though no state tracker currently
89 Queries can be created with ``create_query`` and deleted with
90 ``destroy_query``. To enable a query, use ``begin_query``, and when finished,
91 use ``end_query`` to stop the query. Finally, ``get_query_result`` is used
92 to retrieve the results.
100 Resource Busy Queries
101 ^^^^^^^^^^^^^^^^^^^^^
103 ``is_texture_referenced``
105 ``is_buffer_referenced``
112 These methods emulate classic blitter controls. They are not guaranteed to be
113 available; if they are set to NULL, then they are not present.
115 These methods operate directly on ``pipe_surface`` objects, and stand
116 apart from any 3D state in the context. Blitting functionality may be
117 moved to a separate abstraction at some point in the future.
119 ``surface_fill`` performs a fill operation on a section of a surface.
121 ``surface_copy`` blits a region of a surface to a region of another surface,
122 provided that both surfaces are the same format. The source and destination
123 may be the same surface, and overlapping blits are permitted.
125 The interfaces to these calls are likely to change to make it easier
126 for a driver to batch multiple blits with the same source and