Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4358 | Serge | 1 | /* |
2 | * Copyright 2010 Jerome Glisse |
||
3 | * |
||
4 | * Permission is hereby granted, free of charge, to any person obtaining a |
||
5 | * copy of this software and associated documentation files (the "Software"), |
||
6 | * to deal in the Software without restriction, including without limitation |
||
7 | * on the rights to use, copy, modify, merge, publish, distribute, sub |
||
8 | * license, and/or sell copies of the Software, and to permit persons to whom |
||
9 | * the Software is furnished to do so, subject to the following conditions: |
||
10 | * |
||
11 | * The above copyright notice and this permission notice (including the next |
||
12 | * paragraph) shall be included in all copies or substantial portions of the |
||
13 | * Software. |
||
14 | * |
||
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
18 | * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, |
||
19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
||
20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
||
21 | * USE OR OTHER DEALINGS IN THE SOFTWARE. |
||
22 | */ |
||
23 | #ifndef R600_SHADER_H |
||
24 | #define R600_SHADER_H |
||
25 | |||
26 | #include "r600_asm.h" |
||
27 | |||
28 | struct r600_shader_io { |
||
29 | unsigned name; |
||
30 | unsigned gpr; |
||
31 | unsigned done; |
||
32 | int sid; |
||
33 | int spi_sid; |
||
34 | unsigned interpolate; |
||
35 | unsigned ij_index; |
||
36 | boolean centroid; |
||
37 | unsigned lds_pos; /* for evergreen */ |
||
38 | unsigned back_color_input; |
||
39 | unsigned write_mask; |
||
40 | }; |
||
41 | |||
42 | struct r600_shader { |
||
43 | unsigned processor_type; |
||
44 | struct r600_bytecode bc; |
||
45 | unsigned ninput; |
||
46 | unsigned noutput; |
||
47 | unsigned nlds; |
||
48 | struct r600_shader_io input[40]; |
||
49 | struct r600_shader_io output[40]; |
||
50 | boolean uses_kill; |
||
51 | boolean fs_write_all; |
||
52 | boolean two_side; |
||
53 | /* Number of color outputs in the TGSI shader, |
||
54 | * sometimes it could be higher than nr_cbufs (bug?). |
||
55 | * Also with writes_all property on eg+ it will be set to max CB number */ |
||
56 | unsigned nr_ps_max_color_exports; |
||
57 | /* Real number of ps color exports compiled in the bytecode */ |
||
58 | unsigned nr_ps_color_exports; |
||
59 | /* bit n is set if the shader writes gl_ClipDistance[n] */ |
||
60 | unsigned clip_dist_write; |
||
61 | /* flag is set if the shader writes VS_OUT_MISC_VEC (e.g. for PSIZE) */ |
||
62 | boolean vs_out_misc_write; |
||
63 | boolean vs_out_point_size; |
||
64 | boolean has_txq_cube_array_z_comp; |
||
65 | boolean uses_tex_buffers; |
||
66 | |||
67 | unsigned indirect_files; |
||
68 | unsigned max_arrays; |
||
69 | unsigned num_arrays; |
||
70 | struct r600_shader_array * arrays; |
||
71 | }; |
||
72 | |||
73 | struct r600_shader_key { |
||
74 | unsigned color_two_side:1; |
||
75 | unsigned alpha_to_one:1; |
||
76 | unsigned nr_cbufs:4; |
||
77 | }; |
||
78 | |||
79 | struct r600_shader_array { |
||
80 | unsigned gpr_start; |
||
81 | unsigned gpr_count; |
||
82 | unsigned comp_mask; |
||
83 | }; |
||
84 | |||
85 | struct r600_pipe_shader { |
||
86 | struct r600_pipe_shader_selector *selector; |
||
87 | struct r600_pipe_shader *next_variant; |
||
88 | struct r600_shader shader; |
||
89 | struct r600_command_buffer command_buffer; /* register writes */ |
||
90 | struct r600_resource *bo; |
||
91 | unsigned sprite_coord_enable; |
||
92 | unsigned flatshade; |
||
93 | unsigned pa_cl_vs_out_cntl; |
||
94 | unsigned nr_ps_color_outputs; |
||
95 | struct r600_shader_key key; |
||
96 | unsigned db_shader_control; |
||
97 | unsigned ps_depth_export; |
||
98 | }; |
||
99 | |||
100 | #endif |