xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/r300/r300_vs.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2009 Corbin Simpson <[email protected]>
3  * Copyright 2009 Marek Olšák <[email protected]>
4  * SPDX-License-Identifier: MIT
5  */
6 
7 #ifndef R300_VS_H
8 #define R300_VS_H
9 
10 #include "pipe/p_state.h"
11 #include "tgsi/tgsi_scan.h"
12 #include "compiler/radeon_code.h"
13 
14 #include "r300_context.h"
15 #include "r300_shader_semantics.h"
16 
17 struct r300_context;
18 
19 struct r300_vertex_shader_code {
20     /* Parent class */
21 
22     struct tgsi_shader_info info;
23     struct r300_shader_semantics outputs;
24 
25     /* Whether the shader was replaced by a dummy one due to a shader
26      * compilation failure. */
27     bool dummy;
28 
29     bool wpos;
30 
31     /* Numbers of constants for each type. */
32     unsigned externals_count;
33     unsigned immediates_count;
34 
35     /* HWTCL-specific.  */
36     /* Machine code (if translated) */
37     struct r300_vertex_program_code code;
38 
39     struct r300_vertex_shader_code *next;
40 };
41 
42 struct r300_vertex_shader {
43     /* Parent class */
44     struct pipe_shader_state state;
45 
46     /* Currently-bound vertex shader. */
47     struct r300_vertex_shader_code *shader;
48 
49     /* List of the same shaders compiled with different states. */
50     struct r300_vertex_shader_code *first;
51 
52     /* SWTCL-specific. */
53     void *draw_vs;
54 };
55 
56 struct nir_shader;
57 
58 void r300_init_vs_outputs(struct r300_context *r300,
59                           struct r300_vertex_shader *vs);
60 
61 void r300_translate_vertex_shader(struct r300_context *r300,
62                                   struct r300_vertex_shader *vs);
63 
64 void r300_draw_init_vertex_shader(struct r300_context *r300,
65                                   struct r300_vertex_shader *vs);
66 
67 #endif /* R300_VS_H */
68