Home | History | Annotate | Download | only in r300
      1 /*
      2  * Copyright 2009 Corbin Simpson <MostAwesomeDude (at) gmail.com>
      3  * Copyright 2009 Marek Olk <maraeo (at) gmail.com>
      4  *
      5  * Permission is hereby granted, free of charge, to any person obtaining a
      6  * copy of this software and associated documentation files (the "Software"),
      7  * to deal in the Software without restriction, including without limitation
      8  * on the rights to use, copy, modify, merge, publish, distribute, sub
      9  * license, and/or sell copies of the Software, and to permit persons to whom
     10  * the Software is furnished to do so, subject to the following conditions:
     11  *
     12  * The above copyright notice and this permission notice (including the next
     13  * paragraph) shall be included in all copies or substantial portions of the
     14  * Software.
     15  *
     16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
     19  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
     20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     21  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     22  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
     23 
     24 #ifndef R300_VS_H
     25 #define R300_VS_H
     26 
     27 #include "pipe/p_state.h"
     28 #include "tgsi/tgsi_scan.h"
     29 #include "compiler/radeon_code.h"
     30 
     31 #include "r300_context.h"
     32 #include "r300_shader_semantics.h"
     33 
     34 struct r300_context;
     35 
     36 struct r300_vertex_shader {
     37     /* Parent class */
     38     struct pipe_shader_state state;
     39 
     40     struct tgsi_shader_info info;
     41     struct r300_shader_semantics outputs;
     42 
     43     /* Whether the shader was replaced by a dummy one due to a shader
     44      * compilation failure. */
     45     boolean dummy;
     46 
     47     /* Numbers of constants for each type. */
     48     unsigned externals_count;
     49     unsigned immediates_count;
     50 
     51     /* HWTCL-specific.  */
     52     /* Machine code (if translated) */
     53     struct r300_vertex_program_code code;
     54 
     55     /* SWTCL-specific. */
     56     void *draw_vs;
     57 };
     58 
     59 void r300_init_vs_outputs(struct r300_context *r300,
     60                           struct r300_vertex_shader *vs);
     61 
     62 void r300_translate_vertex_shader(struct r300_context *r300,
     63                                   struct r300_vertex_shader *vs);
     64 
     65 void r300_draw_init_vertex_shader(struct r300_context *r300,
     66                                   struct r300_vertex_shader *vs);
     67 
     68 #endif /* R300_VS_H */
     69