2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
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:
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
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.
28 struct r600_shader_io
{
37 unsigned lds_pos
; /* for evergreen */
38 unsigned back_color_input
;
44 unsigned processor_type
;
45 struct r600_bytecode bc
;
49 struct r600_shader_io input
[40];
50 struct r600_shader_io output
[40];
54 /* Number of color outputs in the TGSI shader,
55 * sometimes it could be higher than nr_cbufs (bug?).
56 * Also with writes_all property on eg+ it will be set to max CB number */
57 unsigned nr_ps_max_color_exports
;
58 /* Real number of ps color exports compiled in the bytecode */
59 unsigned nr_ps_color_exports
;
60 /* bit n is set if the shader writes gl_ClipDistance[n] */
61 unsigned clip_dist_write
;
62 /* flag is set if the shader writes VS_OUT_MISC_VEC (e.g. for PSIZE) */
63 boolean vs_out_misc_write
;
64 boolean vs_out_point_size
;
66 boolean vs_out_viewport
;
67 boolean has_txq_cube_array_z_comp
;
68 boolean uses_tex_buffers
;
69 boolean gs_prim_id_input
;
71 /* geometry shader properties */
72 unsigned gs_input_prim
;
73 unsigned gs_output_prim
;
74 unsigned gs_max_out_vertices
;
75 /* size in bytes of a data item in the ring (single vertex data) */
76 unsigned ring_item_size
;
78 unsigned indirect_files
;
82 struct r600_shader_array
* arrays
;
85 struct r600_shader_key
{
86 unsigned color_two_side
:1;
87 unsigned alpha_to_one
:1;
92 struct r600_shader_array
{
98 struct r600_pipe_shader
{
99 struct r600_pipe_shader_selector
*selector
;
100 struct r600_pipe_shader
*next_variant
;
101 /* for GS - corresponding copy shader (installed as VS) */
102 struct r600_pipe_shader
*gs_copy_shader
;
103 struct r600_shader shader
;
104 struct r600_command_buffer command_buffer
; /* register writes */
105 struct r600_resource
*bo
;
106 unsigned sprite_coord_enable
;
108 unsigned pa_cl_vs_out_cntl
;
109 unsigned nr_ps_color_outputs
;
110 struct r600_shader_key key
;
111 unsigned db_shader_control
;
112 unsigned ps_depth_export
;