summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/build/html/context.html
blob: 21bab454806b6582701f9238da647527a8b527f5 (plain)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Context &mdash; Gallium v0.3 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.3',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Gallium v0.3 documentation" href="index.html" />
    <link rel="next" title="CSO" href="cso.html" />
    <link rel="prev" title="Screen" href="screen.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="cso.html" title="CSO"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="screen.html" title="Screen"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="context">
<h1>Context<a class="headerlink" href="#context" title="Permalink to this headline"></a></h1>
<p>The context object represents the purest, most directly accessible, abilities
of the device&#8217;s 3D rendering pipeline.</p>
<div class="section" id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline"></a></h2>
<div class="section" id="cso-state">
<h3>CSO State<a class="headerlink" href="#cso-state" title="Permalink to this headline"></a></h3>
<p>All CSO state is created, bound, and destroyed, with triplets of methods that
all follow a specific naming scheme. For example, <tt class="docutils literal"><span class="pre">create_blend_state</span></tt>,
<tt class="docutils literal"><span class="pre">bind_blend_state</span></tt>, and <tt class="docutils literal"><span class="pre">destroy_blend_state</span></tt>.</p>
<p>CSO objects handled by the context object:</p>
<ul class="simple">
<li><a class="reference external" href="cso/blend.html#blend"><em>Blend</em></a>: <tt class="docutils literal"><span class="pre">*_blend_state</span></tt></li>
<li><a class="reference external" href="cso/sampler.html#sampler"><em>Sampler</em></a>: These are special; they can be bound to either vertex or
fragment samplers, and they are bound in groups.
<tt class="docutils literal"><span class="pre">bind_fragment_sampler_states</span></tt>, <tt class="docutils literal"><span class="pre">bind_vertex_sampler_states</span></tt></li>
<li><a class="reference external" href="cso/rasterizer.html#rasterizer"><em>Rasterizer</em></a>: <tt class="docutils literal"><span class="pre">*_rasterizer_state</span></tt></li>
<li><a class="reference external" href="cso/dsa.html#depth-stencil-alpha"><em>Depth, Stencil, &amp; Alpha</em></a>: <tt class="docutils literal"><span class="pre">*_depth_stencil_alpha_state</span></tt></li>
<li><a class="reference external" href="cso/shader.html#shader"><em>Shader</em></a>: These have two sets of methods. <tt class="docutils literal"><span class="pre">*_fs_state</span></tt> is for
fragment shaders, and <tt class="docutils literal"><span class="pre">*_vs_state</span></tt> is for vertex shaders.</li>
</ul>
</div>
<div class="section" id="resource-binding-state">
<h3>Resource Binding State<a class="headerlink" href="#resource-binding-state" title="Permalink to this headline"></a></h3>
<p>This state describes how resources in various flavours (textures,
buffers, surfaces) are bound to the driver.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">set_constant_buffer</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_framebuffer_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_fragment_sampler_textures</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_sampler_textures</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_buffers</span></tt></li>
</ul>
</div>
<div class="section" id="non-cso-state">
<h3>Non-CSO State<a class="headerlink" href="#non-cso-state" title="Permalink to this headline"></a></h3>
<p>These pieces of state are too small, variable, and/or trivial to have CSO
objects. They all follow simple, one-method binding calls, e.g.
<tt class="docutils literal"><span class="pre">set_edgeflags</span></tt>.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">set_edgeflags</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_blend_color</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_clip_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_polygon_stipple</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_scissor_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_viewport_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_elements</span></tt></li>
</ul>
</div>
<div class="section" id="clearing">
<h3>Clearing<a class="headerlink" href="#clearing" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">clear</span></tt> initializes some or all of the surfaces currently bound to
the framebuffer to particular RGBA, depth, or stencil values.</p>
<p>Clear is one of the most difficult concepts to nail down to a single
interface and it seems likely that we will want to add additional
clear paths, for instance clearing surfaces not bound to the
framebuffer, or read-modify-write clears such as depth-only or
stencil-only clears of packed depth-stencil buffers.</p>
</div>
<div class="section" id="drawing">
<h3>Drawing<a class="headerlink" href="#drawing" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">draw_arrays</span></tt></p>
<p><tt class="docutils literal"><span class="pre">draw_elements</span></tt></p>
<p><tt class="docutils literal"><span class="pre">draw_range_elements</span></tt></p>
</div>
<div class="section" id="queries">
<h3>Queries<a class="headerlink" href="#queries" title="Permalink to this headline"></a></h3>
<p>Queries gather some statistic from the 3D pipeline over one or more
draws.  Queries may be nested, though no state tracker currently
exercises this.</p>
<p>Queries can be created with <tt class="docutils literal"><span class="pre">create_query</span></tt> and deleted with
<tt class="docutils literal"><span class="pre">destroy_query</span></tt>. To enable a query, use <tt class="docutils literal"><span class="pre">begin_query</span></tt>, and when finished,
use <tt class="docutils literal"><span class="pre">end_query</span></tt> to stop the query. Finally, <tt class="docutils literal"><span class="pre">get_query_result</span></tt> is used
to retrieve the results.</p>
</div>
<div class="section" id="flushing">
<h3>Flushing<a class="headerlink" href="#flushing" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">flush</span></tt></p>
</div>
<div class="section" id="resource-busy-queries">
<h3>Resource Busy Queries<a class="headerlink" href="#resource-busy-queries" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">is_texture_referenced</span></tt></p>
<p><tt class="docutils literal"><span class="pre">is_buffer_referenced</span></tt></p>
</div>
<div class="section" id="blitting">
<h3>Blitting<a class="headerlink" href="#blitting" title="Permalink to this headline"></a></h3>
<p>These methods emulate classic blitter controls. They are not guaranteed to be
available; if they are set to NULL, then they are not present.</p>
<p>These methods operate directly on <tt class="docutils literal"><span class="pre">pipe_surface</span></tt> objects, and stand
apart from any 3D state in the context.  Blitting functionality may be
moved to a separate abstraction at some point in the future.</p>
<p><tt class="docutils literal"><span class="pre">surface_fill</span></tt> performs a fill operation on a section of a surface.</p>
<p><tt class="docutils literal"><span class="pre">surface_copy</span></tt> blits a region of a surface to a region of another surface,
provided that both surfaces are the same format. The source and destination
may be the same surface, and overlapping blits are permitted.</p>
<p>The interfaces to these calls are likely to change to make it easier
for a driver to batch multiple blits with the same source and
destination.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">Context</a><ul>
<li><a class="reference external" href="#methods">Methods</a><ul>
<li><a class="reference external" href="#cso-state">CSO State</a></li>
<li><a class="reference external" href="#resource-binding-state">Resource Binding State</a></li>
<li><a class="reference external" href="#non-cso-state">Non-CSO State</a></li>
<li><a class="reference external" href="#clearing">Clearing</a></li>
<li><a class="reference external" href="#drawing">Drawing</a></li>
<li><a class="reference external" href="#queries">Queries</a></li>
<li><a class="reference external" href="#flushing">Flushing</a></li>
<li><a class="reference external" href="#resource-busy-queries">Resource Busy Queries</a></li>
<li><a class="reference external" href="#blitting">Blitting</a></li>
</ul>
</li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="screen.html"
                                  title="previous chapter">Screen</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="cso.html"
                                  title="next chapter">CSO</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/context.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="cso.html" title="CSO"
             >next</a> |</li>
        <li class="right" >
          <a href="screen.html" title="Screen"
             >previous</a> |</li>
        <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2009, VMWare, X.org, Nouveau.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
    </div>
  </body>
</html>