st_cb_clear.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void st_init_clear (struct st_context *st)
void st_destroy_clear (struct st_context *st)
void st_flush_clear (struct st_context *st)
void st_init_clear_functions (struct dd_function_table *functions)


Function Documentation

void st_destroy_clear ( struct st_context st  ) 

Definition at line 96 of file st_cb_clear.c.

References st_context::clear, st_context::cso_context, cso_delete_fragment_shader(), cso_delete_vertex_shader(), st_context::frag_shader, st_context::fs, st_context::pipe, pipe_buffer_reference(), pipe_context::screen, pipe_shader_state::tokens, util_free_shader(), st_context::vbuf, st_context::vert_shader, and st_context::vs.

00097 {
00098    struct pipe_context *pipe = st->pipe;
00099 
00100    if (st->clear.vert_shader.tokens) {
00101       util_free_shader(&st->clear.vert_shader);
00102       st->clear.vert_shader.tokens = NULL;
00103    }
00104 
00105    if (st->clear.frag_shader.tokens) {
00106       util_free_shader(&st->clear.frag_shader);
00107       st->clear.frag_shader.tokens = NULL;
00108    }
00109 
00110    if (st->clear.fs) {
00111       cso_delete_fragment_shader(st->cso_context, st->clear.fs);
00112       st->clear.fs = NULL;
00113    }
00114    if (st->clear.vs) {
00115       cso_delete_vertex_shader(st->cso_context, st->clear.vs);
00116       st->clear.vs = NULL;
00117    }
00118    if (st->clear.vbuf) {
00119       pipe_buffer_reference(pipe->screen, &st->clear.vbuf, NULL);
00120       st->clear.vbuf = NULL;
00121    }
00122 }

void st_flush_clear ( struct st_context st  ) 

Definition at line 526 of file st_cb_clear.c.

References st_context::clear, st_context::pipe, pipe_buffer_reference(), pipe_context::screen, st_context::vbuf, and st_context::vbuf_slot.

00527 {
00528    /* Release vertex buffer to avoid synchronous rendering if we were
00529     * to map it in the next frame.
00530     */
00531    pipe_buffer_reference(st->pipe->screen, &st->clear.vbuf, NULL);
00532    st->clear.vbuf_slot = 0;
00533 }

void st_init_clear ( struct st_context st  ) 

Definition at line 59 of file st_cb_clear.c.

References pipe_rasterizer_state::bypass_clipping, st_context::clear, st_context::frag_shader, st_context::fs, pipe_rasterizer_state::gl_rasterization_rules, st_context::pipe, st_context::raster, pipe_viewport_state::scale, semantic_names, TGSI_SEMANTIC_COLOR, TGSI_SEMANTIC_POSITION, pipe_viewport_state::translate, util_make_fragment_passthrough_shader(), util_make_vertex_passthrough_shader(), st_context::vert_shader, st_context::viewport, and st_context::vs.

00060 {
00061    struct pipe_context *pipe = st->pipe;
00062 
00063    /* rasterizer state: bypass clipping */
00064    memset(&st->clear.raster, 0, sizeof(st->clear.raster));
00065    st->clear.raster.gl_rasterization_rules = 1;
00066    st->clear.raster.bypass_clipping = 1;
00067 
00068    /* viewport state: identity since we're drawing in window coords */
00069    st->clear.viewport.scale[0] = 1.0;
00070    st->clear.viewport.scale[1] = 1.0;
00071    st->clear.viewport.scale[2] = 1.0;
00072    st->clear.viewport.scale[3] = 1.0;
00073    st->clear.viewport.translate[0] = 0.0;
00074    st->clear.viewport.translate[1] = 0.0;
00075    st->clear.viewport.translate[2] = 0.0;
00076    st->clear.viewport.translate[3] = 0.0;
00077 
00078    /* fragment shader state: color pass-through program */
00079    st->clear.fs =
00080       util_make_fragment_passthrough_shader(pipe, &st->clear.frag_shader);
00081 
00082    /* vertex shader state: color/position pass-through */
00083    {
00084       const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
00085                                       TGSI_SEMANTIC_COLOR };
00086       const uint semantic_indexes[] = { 0, 0 };
00087       st->clear.vs = util_make_vertex_passthrough_shader(pipe, 2,
00088                                                          semantic_names,
00089                                                          semantic_indexes,
00090                                                          &st->clear.vert_shader);
00091    }
00092 }

void st_init_clear_functions ( struct dd_function_table *  functions  ) 

Definition at line 599 of file st_cb_clear.c.

References st_clear().

00600 {
00601    functions->Clear = st_clear;
00602 }


Generated on Tue Sep 29 06:25:52 2009 for Gallium3D by  doxygen 1.5.4