Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

context.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Context &mdash; Gallium v0.3 documentation</title>
  7. <link rel="stylesheet" href="_static/default.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '0.3',
  13. COLLAPSE_MODINDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/doctools.js"></script>
  20. <link rel="top" title="Gallium v0.3 documentation" href="index.html" />
  21. <link rel="next" title="CSO" href="cso.html" />
  22. <link rel="prev" title="Screen" href="screen.html" />
  23. </head>
  24. <body>
  25. <div class="related">
  26. <h3>Navigation</h3>
  27. <ul>
  28. <li class="right" style="margin-right: 10px">
  29. <a href="genindex.html" title="General Index"
  30. accesskey="I">index</a></li>
  31. <li class="right" >
  32. <a href="cso.html" title="CSO"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="screen.html" title="Screen"
  36. accesskey="P">previous</a> |</li>
  37. <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li>
  38. </ul>
  39. </div>
  40. <div class="document">
  41. <div class="documentwrapper">
  42. <div class="bodywrapper">
  43. <div class="body">
  44. <div class="section" id="context">
  45. <h1>Context<a class="headerlink" href="#context" title="Permalink to this headline">¶</a></h1>
  46. <p>The context object represents the purest, most directly accessible, abilities
  47. of the device&#8217;s 3D rendering pipeline.</p>
  48. <div class="section" id="methods">
  49. <h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h2>
  50. <div class="section" id="cso-state">
  51. <h3>CSO State<a class="headerlink" href="#cso-state" title="Permalink to this headline">¶</a></h3>
  52. <p>All CSO state is created, bound, and destroyed, with triplets of methods that
  53. all follow a specific naming scheme. For example, <tt class="docutils literal"><span class="pre">create_blend_state</span></tt>,
  54. <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>
  55. <p>CSO objects handled by the context object:</p>
  56. <ul class="simple">
  57. <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>
  58. <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
  59. fragment samplers, and they are bound in groups.
  60. <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>
  61. <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>
  62. <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>
  63. <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
  64. fragment shaders, and <tt class="docutils literal"><span class="pre">*_vs_state</span></tt> is for vertex shaders.</li>
  65. </ul>
  66. </div>
  67. <div class="section" id="resource-binding-state">
  68. <h3>Resource Binding State<a class="headerlink" href="#resource-binding-state" title="Permalink to this headline">¶</a></h3>
  69. <p>This state describes how resources in various flavours (textures,
  70. buffers, surfaces) are bound to the driver.</p>
  71. <ul class="simple">
  72. <li><tt class="docutils literal"><span class="pre">set_constant_buffer</span></tt></li>
  73. <li><tt class="docutils literal"><span class="pre">set_framebuffer_state</span></tt></li>
  74. <li><tt class="docutils literal"><span class="pre">set_fragment_sampler_textures</span></tt></li>
  75. <li><tt class="docutils literal"><span class="pre">set_vertex_sampler_textures</span></tt></li>
  76. <li><tt class="docutils literal"><span class="pre">set_vertex_buffers</span></tt></li>
  77. </ul>
  78. </div>
  79. <div class="section" id="non-cso-state">
  80. <h3>Non-CSO State<a class="headerlink" href="#non-cso-state" title="Permalink to this headline">¶</a></h3>
  81. <p>These pieces of state are too small, variable, and/or trivial to have CSO
  82. objects. They all follow simple, one-method binding calls, e.g.
  83. <tt class="docutils literal"><span class="pre">set_edgeflags</span></tt>.</p>
  84. <ul class="simple">
  85. <li><tt class="docutils literal"><span class="pre">set_edgeflags</span></tt></li>
  86. <li><tt class="docutils literal"><span class="pre">set_blend_color</span></tt></li>
  87. <li><tt class="docutils literal"><span class="pre">set_clip_state</span></tt></li>
  88. <li><tt class="docutils literal"><span class="pre">set_polygon_stipple</span></tt></li>
  89. <li><tt class="docutils literal"><span class="pre">set_scissor_state</span></tt></li>
  90. <li><tt class="docutils literal"><span class="pre">set_viewport_state</span></tt></li>
  91. <li><tt class="docutils literal"><span class="pre">set_vertex_elements</span></tt></li>
  92. </ul>
  93. </div>
  94. <div class="section" id="clearing">
  95. <h3>Clearing<a class="headerlink" href="#clearing" title="Permalink to this headline">¶</a></h3>
  96. <p><tt class="docutils literal"><span class="pre">clear</span></tt> initializes some or all of the surfaces currently bound to
  97. the framebuffer to particular RGBA, depth, or stencil values.</p>
  98. <p>Clear is one of the most difficult concepts to nail down to a single
  99. interface and it seems likely that we will want to add additional
  100. clear paths, for instance clearing surfaces not bound to the
  101. framebuffer, or read-modify-write clears such as depth-only or
  102. stencil-only clears of packed depth-stencil buffers.</p>
  103. </div>
  104. <div class="section" id="drawing">
  105. <h3>Drawing<a class="headerlink" href="#drawing" title="Permalink to this headline">¶</a></h3>
  106. <p><tt class="docutils literal"><span class="pre">draw_arrays</span></tt></p>
  107. <p><tt class="docutils literal"><span class="pre">draw_elements</span></tt></p>
  108. <p><tt class="docutils literal"><span class="pre">draw_range_elements</span></tt></p>
  109. </div>
  110. <div class="section" id="queries">
  111. <h3>Queries<a class="headerlink" href="#queries" title="Permalink to this headline">¶</a></h3>
  112. <p>Queries gather some statistic from the 3D pipeline over one or more
  113. draws. Queries may be nested, though no state tracker currently
  114. exercises this.</p>
  115. <p>Queries can be created with <tt class="docutils literal"><span class="pre">create_query</span></tt> and deleted with
  116. <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,
  117. 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
  118. to retrieve the results.</p>
  119. </div>
  120. <div class="section" id="flushing">
  121. <h3>Flushing<a class="headerlink" href="#flushing" title="Permalink to this headline">¶</a></h3>
  122. <p><tt class="docutils literal"><span class="pre">flush</span></tt></p>
  123. </div>
  124. <div class="section" id="resource-busy-queries">
  125. <h3>Resource Busy Queries<a class="headerlink" href="#resource-busy-queries" title="Permalink to this headline">¶</a></h3>
  126. <p><tt class="docutils literal"><span class="pre">is_texture_referenced</span></tt></p>
  127. <p><tt class="docutils literal"><span class="pre">is_buffer_referenced</span></tt></p>
  128. </div>
  129. <div class="section" id="blitting">
  130. <h3>Blitting<a class="headerlink" href="#blitting" title="Permalink to this headline">¶</a></h3>
  131. <p>These methods emulate classic blitter controls. They are not guaranteed to be
  132. available; if they are set to NULL, then they are not present.</p>
  133. <p>These methods operate directly on <tt class="docutils literal"><span class="pre">pipe_surface</span></tt> objects, and stand
  134. apart from any 3D state in the context. Blitting functionality may be
  135. moved to a separate abstraction at some point in the future.</p>
  136. <p><tt class="docutils literal"><span class="pre">surface_fill</span></tt> performs a fill operation on a section of a surface.</p>
  137. <p><tt class="docutils literal"><span class="pre">surface_copy</span></tt> blits a region of a surface to a region of another surface,
  138. provided that both surfaces are the same format. The source and destination
  139. may be the same surface, and overlapping blits are permitted.</p>
  140. <p>The interfaces to these calls are likely to change to make it easier
  141. for a driver to batch multiple blits with the same source and
  142. destination.</p>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="sphinxsidebar">
  150. <div class="sphinxsidebarwrapper">
  151. <h3><a href="index.html">Table Of Contents</a></h3>
  152. <ul>
  153. <li><a class="reference external" href="">Context</a><ul>
  154. <li><a class="reference external" href="#methods">Methods</a><ul>
  155. <li><a class="reference external" href="#cso-state">CSO State</a></li>
  156. <li><a class="reference external" href="#resource-binding-state">Resource Binding State</a></li>
  157. <li><a class="reference external" href="#non-cso-state">Non-CSO State</a></li>
  158. <li><a class="reference external" href="#clearing">Clearing</a></li>
  159. <li><a class="reference external" href="#drawing">Drawing</a></li>
  160. <li><a class="reference external" href="#queries">Queries</a></li>
  161. <li><a class="reference external" href="#flushing">Flushing</a></li>
  162. <li><a class="reference external" href="#resource-busy-queries">Resource Busy Queries</a></li>
  163. <li><a class="reference external" href="#blitting">Blitting</a></li>
  164. </ul>
  165. </li>
  166. </ul>
  167. </li>
  168. </ul>
  169. <h4>Previous topic</h4>
  170. <p class="topless"><a href="screen.html"
  171. title="previous chapter">Screen</a></p>
  172. <h4>Next topic</h4>
  173. <p class="topless"><a href="cso.html"
  174. title="next chapter">CSO</a></p>
  175. <h3>This Page</h3>
  176. <ul class="this-page-menu">
  177. <li><a href="_sources/context.txt"
  178. rel="nofollow">Show Source</a></li>
  179. </ul>
  180. <div id="searchbox" style="display: none">
  181. <h3>Quick search</h3>
  182. <form class="search" action="search.html" method="get">
  183. <input type="text" name="q" size="18" />
  184. <input type="submit" value="Go" />
  185. <input type="hidden" name="check_keywords" value="yes" />
  186. <input type="hidden" name="area" value="default" />
  187. </form>
  188. <p class="searchtip" style="font-size: 90%">
  189. Enter search terms or a module, class or function name.
  190. </p>
  191. </div>
  192. <script type="text/javascript">$('#searchbox').show(0);</script>
  193. </div>
  194. </div>
  195. <div class="clearer"></div>
  196. </div>
  197. <div class="related">
  198. <h3>Navigation</h3>
  199. <ul>
  200. <li class="right" style="margin-right: 10px">
  201. <a href="genindex.html" title="General Index"
  202. >index</a></li>
  203. <li class="right" >
  204. <a href="cso.html" title="CSO"
  205. >next</a> |</li>
  206. <li class="right" >
  207. <a href="screen.html" title="Screen"
  208. >previous</a> |</li>
  209. <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li>
  210. </ul>
  211. </div>
  212. <div class="footer">
  213. &copy; Copyright 2009, VMWare, X.org, Nouveau.
  214. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
  215. </div>
  216. </body>
  217. </html>