glBindProgramARB dispatches to glBindProgramNV (remove _mesa_BindProgramARB).
[mesa.git] / src / mesa / main / nvvertprog.h
1 /* $Id: nvvertprog.h,v 1.2 2003/04/07 14:57:27 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 5.1
6 *
7 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 /* Private vertex program types and constants only used by files
29 * related to vertex programs.
30 */
31
32 #ifndef NVVERTPROG_H
33 #define NVVERTPROG_H
34
35
36 #define VP_NUM_INPUT_REGS MAX_NV_VERTEX_PROGRAM_INPUTS
37 #define VP_NUM_OUTPUT_REGS MAX_NV_VERTEX_PROGRAM_OUTPUTS
38 #define VP_NUM_TEMP_REGS MAX_NV_VERTEX_PROGRAM_TEMPS
39 #define VP_NUM_PROG_REGS MAX_NV_VERTEX_PROGRAM_PARAMS
40
41 /* Location of register groups within the whole register file */
42 #define VP_INPUT_REG_START 0
43 #define VP_INPUT_REG_END (VP_INPUT_REG_START + VP_NUM_INPUT_REGS - 1)
44 #define VP_OUTPUT_REG_START (VP_INPUT_REG_END + 1)
45 #define VP_OUTPUT_REG_END (VP_OUTPUT_REG_START + VP_NUM_OUTPUT_REGS - 1)
46 #define VP_TEMP_REG_START (VP_OUTPUT_REG_END + 1)
47 #define VP_TEMP_REG_END (VP_TEMP_REG_START + VP_NUM_TEMP_REGS - 1)
48 #define VP_PROG_REG_START (VP_TEMP_REG_END + 1)
49 #define VP_PROG_REG_END (VP_PROG_REG_START + VP_NUM_PROG_REGS - 1)
50
51
52 /* Vertex program opcodes */
53 enum vp_opcode
54 {
55 VP_OPCODE_MOV,
56 VP_OPCODE_LIT,
57 VP_OPCODE_RCP,
58 VP_OPCODE_RSQ,
59 VP_OPCODE_EXP,
60 VP_OPCODE_LOG,
61 VP_OPCODE_MUL,
62 VP_OPCODE_ADD,
63 VP_OPCODE_DP3,
64 VP_OPCODE_DP4,
65 VP_OPCODE_DST,
66 VP_OPCODE_MIN,
67 VP_OPCODE_MAX,
68 VP_OPCODE_SLT,
69 VP_OPCODE_SGE,
70 VP_OPCODE_MAD,
71 VP_OPCODE_ARL,
72 VP_OPCODE_DPH,
73 VP_OPCODE_RCC,
74 VP_OPCODE_SUB,
75 VP_OPCODE_ABS,
76 VP_OPCODE_END
77 };
78
79
80 /* Instruction source register */
81 struct vp_src_register
82 {
83 GLint Register; /* or the offset from the address register */
84 GLuint Swizzle[4];
85 GLboolean Negate;
86 GLboolean RelAddr;
87 };
88
89
90 /* Instruction destination register */
91 struct vp_dst_register
92 {
93 GLint Register;
94 GLboolean WriteMask[4];
95 };
96
97
98 /* Vertex program instruction */
99 struct vp_instruction
100 {
101 enum vp_opcode Opcode;
102 struct vp_src_register SrcReg[3];
103 struct vp_dst_register DstReg;
104 };
105
106
107 #endif /* VERTPROG_H */