2 * Mesa 3-D graphics library ATI Fragment Shader
4 * Copyright (C) 2004 David Airlie All Rights Reserved.
8 #ifndef ATIFRAGSHADER_H
9 #define ATIFRAGSHADER_H
13 #include "mfeatures.h"
18 #define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8
19 #define MAX_NUM_PASSES_ATI 2
20 #define MAX_NUM_FRAGMENT_REGISTERS_ATI 6
22 struct ati_fs_opcode_st
28 struct atifragshader_src_register
35 struct atifragshader_dst_register
42 #define ATI_FRAGMENT_SHADER_COLOR_OP 0
43 #define ATI_FRAGMENT_SHADER_ALPHA_OP 1
44 #define ATI_FRAGMENT_SHADER_PASS_OP 2
45 #define ATI_FRAGMENT_SHADER_SAMPLE_OP 3
47 /* two opcodes - one for color/one for alpha */
48 /* up to three source registers for most ops */
49 struct atifs_instruction
53 struct atifragshader_src_register SrcReg[2][3];
54 struct atifragshader_dst_register DstReg[2];
57 /* different from arithmetic shader instruction */
58 struct atifs_setupinst
66 extern struct ati_fragment_shader *
67 _mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id);
70 _mesa_delete_ati_fragment_shader(struct gl_context *ctx,
71 struct ati_fragment_shader *s);
74 extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range);
76 extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id);
78 extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id);
80 extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void);
82 extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void);
84 extern void GLAPIENTRY
85 _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle);
87 extern void GLAPIENTRY
88 _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle);
90 extern void GLAPIENTRY
91 _mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask,
92 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
95 extern void GLAPIENTRY
96 _mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask,
97 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
98 GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
101 extern void GLAPIENTRY
102 _mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask,
103 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
104 GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
105 GLuint arg2Mod, GLuint arg3, GLuint arg3Rep,
108 extern void GLAPIENTRY
109 _mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
110 GLuint arg1Rep, GLuint arg1Mod);
112 extern void GLAPIENTRY
113 _mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
114 GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
115 GLuint arg2Rep, GLuint arg2Mod);
117 extern void GLAPIENTRY
118 _mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
119 GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
120 GLuint arg2Rep, GLuint arg2Mod, GLuint arg3,
121 GLuint arg3Rep, GLuint arg3Mod);
123 extern void GLAPIENTRY
124 _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value);
127 #endif /* ATIFRAGSHADER_H */