gallium: remove pipe_surface::usage
[mesa.git] / src / gallium / drivers / r600 / r600_shader.h
1 /*
2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
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 boolean centroid;
36 unsigned lds_pos; /* for evergreen */
37 unsigned potential_back_facing_reg;
38 unsigned write_mask;
39 };
40
41 struct r600_shader {
42 unsigned processor_type;
43 struct r600_bytecode bc;
44 unsigned ninput;
45 unsigned noutput;
46 unsigned nlds;
47 struct r600_shader_io input[32];
48 struct r600_shader_io output[32];
49 boolean uses_kill;
50 boolean fs_write_all;
51 boolean two_side;
52 /* Number of color outputs in the TGSI shader,
53 * sometimes it could be higher than nr_cbufs (bug?).
54 * Also with writes_all property on eg+ it will be set to max CB number */
55 unsigned nr_ps_max_color_exports;
56 /* Real number of ps color exports compiled in the bytecode */
57 unsigned nr_ps_color_exports;
58 /* bit n is set if the shader writes gl_ClipDistance[n] */
59 unsigned clip_dist_write;
60 /* flag is set if the shader writes VS_OUT_MISC_VEC (e.g. for PSIZE) */
61 boolean vs_out_misc_write;
62 boolean vs_out_point_size;
63 boolean has_txq_cube_array_z_comp;
64 };
65
66 struct r600_shader_key {
67 unsigned color_two_side:1;
68 unsigned alpha_to_one:1;
69 unsigned nr_cbufs:4;
70 };
71
72 struct r600_pipe_shader {
73 struct r600_pipe_shader_selector *selector;
74 struct r600_pipe_shader *next_variant;
75 struct r600_shader shader;
76 struct r600_pipe_state rstate;
77 struct r600_resource *bo;
78 unsigned sprite_coord_enable;
79 unsigned flatshade;
80 unsigned pa_cl_vs_out_cntl;
81 unsigned nr_ps_color_outputs;
82 struct r600_shader_key key;
83 unsigned db_shader_control;
84 unsigned ps_depth_export;
85 };
86
87 #endif