gallium/util: fix cpu detection on ppc
[mesa.git] / src / gallium / drivers / r300 / r3xx_fs.c
1 /*
2 * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
3 * Joakim Sindholt <opensource@zhasha.com>
4 *
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:
11 *
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
14 * Software.
15 *
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. */
23
24 #include "r3xx_fs.h"
25
26 #include "r300_reg.h"
27
28 struct rX00_fragment_program_code r3xx_passthrough_fragment_shader = {
29 .code.r300.alu.length = 1,
30 .code.r300.tex.length = 0,
31
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,
36
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) |
40 R300_ALU_OUTC_CMP,
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) |
46 R300_ALU_OUTA_CMP,
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,
49 };
50
51 struct rX00_fragment_program_code r3xx_texture_fragment_shader = {
52 .code.r300.alu.length = 1,
53 .code.r300.tex.length = 1,
54
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,
59
60 .code.r300.tex.inst[0] = R300_TEX_OP_LD << R300_TEX_INST_SHIFT,
61
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) |
65 R300_ALU_OUTC_CMP,
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) |
71 R300_ALU_OUTA_CMP,
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,
74 };