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
17 #define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8
18 #define MAX_NUM_PASSES_ATI 2
19 #define MAX_NUM_FRAGMENT_REGISTERS_ATI 6
21 struct ati_fs_opcode_st
27 struct atifragshader_src_register
34 struct atifragshader_dst_register
41 #define ATI_FRAGMENT_SHADER_COLOR_OP 0
42 #define ATI_FRAGMENT_SHADER_ALPHA_OP 1
43 #define ATI_FRAGMENT_SHADER_PASS_OP 2
44 #define ATI_FRAGMENT_SHADER_SAMPLE_OP 3
46 /* two opcodes - one for color/one for alpha */
47 /* up to three source registers for most ops */
48 struct atifs_instruction
52 struct atifragshader_src_register SrcReg[2][3];
53 struct atifragshader_dst_register DstReg[2];
56 /* different from arithmetic shader instruction */
57 struct atifs_setupinst
65 extern struct ati_fragment_shader *
66 _mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id);
69 _mesa_delete_ati_fragment_shader(struct gl_context *ctx,
70 struct ati_fragment_shader *s);
73 extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range);
75 extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id);
77 extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id);
79 extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void);
81 extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void);
83 extern void GLAPIENTRY
84 _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle);
86 extern void GLAPIENTRY
87 _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle);
89 extern void GLAPIENTRY
90 _mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask,
91 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
94 extern void GLAPIENTRY
95 _mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask,
96 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
97 GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
100 extern void GLAPIENTRY
101 _mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask,
102 GLuint dstMod, GLuint arg1, GLuint arg1Rep,
103 GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
104 GLuint arg2Mod, GLuint arg3, GLuint arg3Rep,
107 extern void GLAPIENTRY
108 _mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
109 GLuint arg1Rep, GLuint arg1Mod);
111 extern void GLAPIENTRY
112 _mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
113 GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
114 GLuint arg2Rep, GLuint arg2Mod);
116 extern void GLAPIENTRY
117 _mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
118 GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
119 GLuint arg2Rep, GLuint arg2Mod, GLuint arg3,
120 GLuint arg3Rep, GLuint arg3Mod);
122 extern void GLAPIENTRY
123 _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value);
126 #endif /* ATIFRAGSHADER_H */