2 * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
3 * Joakim Sindholt <opensource@zhasha.com>
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:
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
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. */
28 struct rX00_fragment_program_code r3xx_passthrough_fragment_shader
= {
29 .code
.r300
.alu
.length
= 1,
30 .code
.r300
.tex
.length
= 0,
32 .code
.r300
.config
= 0,
33 .code
.r300
.pixsize
= 0,
34 .code
.r300
.code_offset
= 0,
35 .code
.r300
.code_addr
[3] = R300_RGBA_OUT
,
37 .code
.r300
.alu
.inst
[0].rgb_inst
= R300_RGB_SWIZA(R300_ALU_ARGC_SRC0C_XYZ
) |
38 R300_RGB_SWIZB(R300_ALU_ARGC_SRC0C_XYZ
) |
39 R300_RGB_SWIZC(R300_ALU_ARGC_ZERO
) |
41 .code
.r300
.alu
.inst
[0].rgb_addr
= R300_RGB_ADDR0(0) | R300_RGB_ADDR1(0) |
42 R300_RGB_ADDR2(0) | R300_ALU_DSTC_OUTPUT_XYZ
,
43 .code
.r300
.alu
.inst
[0].alpha_inst
= R300_ALPHA_SWIZA(R300_ALU_ARGA_SRC0A
) |
44 R300_ALPHA_SWIZB(R300_ALU_ARGA_SRC0A
) |
45 R300_ALPHA_SWIZC(R300_ALU_ARGA_ZERO
) |
47 .code
.r300
.alu
.inst
[0].alpha_addr
= R300_ALPHA_ADDR0(0) |
48 R300_ALPHA_ADDR1(0) | R300_ALPHA_ADDR2(0) | R300_ALU_DSTA_OUTPUT
,
51 struct rX00_fragment_program_code r3xx_texture_fragment_shader
= {
52 .code
.r300
.alu
.length
= 1,
53 .code
.r300
.tex
.length
= 1,
55 .code
.r300
.config
= R300_PFS_CNTL_FIRST_NODE_HAS_TEX
,
56 .code
.r300
.pixsize
= 0,
57 .code
.r300
.code_offset
= 0,
58 .code
.r300
.code_addr
[3] = R300_RGBA_OUT
,
60 .code
.r300
.tex
.inst
[0] = R300_TEX_OP_LD
<< R300_TEX_INST_SHIFT
,
62 .code
.r300
.alu
.inst
[0].rgb_inst
= R300_RGB_SWIZA(R300_ALU_ARGC_SRC0C_XYZ
) |
63 R300_RGB_SWIZB(R300_ALU_ARGC_SRC0C_XYZ
) |
64 R300_RGB_SWIZC(R300_ALU_ARGC_ZERO
) |
66 .code
.r300
.alu
.inst
[0].rgb_addr
= R300_RGB_ADDR0(0) | R300_RGB_ADDR1(0) |
67 R300_RGB_ADDR2(0) | R300_ALU_DSTC_OUTPUT_XYZ
,
68 .code
.r300
.alu
.inst
[0].alpha_inst
= R300_ALPHA_SWIZA(R300_ALU_ARGA_SRC0A
) |
69 R300_ALPHA_SWIZB(R300_ALU_ARGA_SRC0A
) |
70 R300_ALPHA_SWIZC(R300_ALU_ARGA_ZERO
) |
72 .code
.r300
.alu
.inst
[0].alpha_addr
= R300_ALPHA_ADDR0(0) |
73 R300_ALPHA_ADDR1(0) | R300_ALPHA_ADDR2(0) | R300_ALU_DSTA_OUTPUT
,