| 1 |
/* |
| 2 |
* Mesa 3-D graphics library ATI Fragment Shader |
| 3 |
* |
| 4 |
* Copyright (C) 2004 David Airlie All Rights Reserved. |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef ATIFRAGSHADER_H |
| 9 |
#define ATIFRAGSHADER_H |
| 10 |
|
| 11 |
#define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8 |
| 12 |
#define MAX_NUM_PASSES_ATI 2 |
| 13 |
#define MAX_NUM_FRAGMENT_REGISTERS_ATI 6 |
| 14 |
|
| 15 |
struct ati_fs_opcode_st |
| 16 |
{ |
| 17 |
GLenum opcode; |
| 18 |
GLint num_src_args; |
| 19 |
}; |
| 20 |
|
| 21 |
extern struct ati_fs_opcode_st ati_fs_opcodes[]; |
| 22 |
|
| 23 |
struct atifragshader_src_register |
| 24 |
{ |
| 25 |
GLuint Index; |
| 26 |
GLuint argRep; |
| 27 |
GLuint argMod; |
| 28 |
}; |
| 29 |
|
| 30 |
struct atifragshader_dst_register |
| 31 |
{ |
| 32 |
GLuint Index; |
| 33 |
GLuint dstMod; |
| 34 |
GLuint dstMask; |
| 35 |
GLuint Swizzle; |
| 36 |
}; |
| 37 |
|
| 38 |
#define ATI_FRAGMENT_SHADER_COLOR_OP 0 |
| 39 |
#define ATI_FRAGMENT_SHADER_ALPHA_OP 1 |
| 40 |
#define ATI_FRAGMENT_SHADER_PASS_OP 2 |
| 41 |
#define ATI_FRAGMENT_SHADER_SAMPLE_OP 3 |
| 42 |
|
| 43 |
/* two opcodes - one for color/one for alpha - also pass/sample */ |
| 44 |
/* up to three source registers for most ops */ |
| 45 |
struct atifs_instruction |
| 46 |
{ |
| 47 |
GLenum Opcode[2]; |
| 48 |
GLuint ArgCount[2]; |
| 49 |
struct atifragshader_src_register SrcReg[2][3]; |
| 50 |
struct atifragshader_dst_register DstReg[2]; |
| 51 |
}; |
| 52 |
|
| 53 |
extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range); |
| 54 |
|
| 55 |
extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id); |
| 56 |
|
| 57 |
extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id); |
| 58 |
|
| 59 |
extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void); |
| 60 |
|
| 61 |
extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void); |
| 62 |
|
| 63 |
extern void GLAPIENTRY |
| 64 |
_mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle); |
| 65 |
|
| 66 |
extern void GLAPIENTRY |
| 67 |
_mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle); |
| 68 |
|
| 69 |
extern void GLAPIENTRY |
| 70 |
_mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, |
| 71 |
GLuint dstMod, GLuint arg1, GLuint arg1Rep, |
| 72 |
GLuint arg1Mod); |
| 73 |
|
| 74 |
extern void GLAPIENTRY |
| 75 |
_mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, |
| 76 |
GLuint dstMod, GLuint arg1, GLuint arg1Rep, |
| 77 |
GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, |
| 78 |
GLuint arg2Mod); |
| 79 |
|
| 80 |
extern void GLAPIENTRY |
| 81 |
_mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, |
| 82 |
GLuint dstMod, GLuint arg1, GLuint arg1Rep, |
| 83 |
GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, |
| 84 |
GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, |
| 85 |
GLuint arg3Mod); |
| 86 |
|
| 87 |
extern void GLAPIENTRY |
| 88 |
_mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, |
| 89 |
GLuint arg1Rep, GLuint arg1Mod); |
| 90 |
|
| 91 |
extern void GLAPIENTRY |
| 92 |
_mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, |
| 93 |
GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, |
| 94 |
GLuint arg2Rep, GLuint arg2Mod); |
| 95 |
|
| 96 |
extern void GLAPIENTRY |
| 97 |
_mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, |
| 98 |
GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, |
| 99 |
GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, |
| 100 |
GLuint arg3Rep, GLuint arg3Mod); |
| 101 |
|
| 102 |
extern void GLAPIENTRY |
| 103 |
_mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value); |
| 104 |
|
| 105 |
#endif |