• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "glheader.h"
12 
13 
14 struct gl_context;
15 
16 #define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8
17 #define MAX_NUM_PASSES_ATI                2
18 #define MAX_NUM_FRAGMENT_REGISTERS_ATI    6
19 #define MAX_NUM_FRAGMENT_CONSTANTS_ATI    8
20 
21 struct ati_fs_opcode_st
22 {
23    GLenum opcode;
24    GLint num_src_args;
25 };
26 
27 struct atifragshader_src_register
28 {
29    GLuint Index;
30    GLuint argRep;
31    GLuint argMod;
32 };
33 
34 struct atifragshader_dst_register
35 {
36    GLuint Index;
37    GLuint dstMod;
38    GLuint dstMask;
39 };
40 
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
45 
46 /* two opcodes - one for color/one for alpha */
47 /* up to three source registers for most ops */
48 struct atifs_instruction
49 {
50    GLenum Opcode[2];
51    GLuint ArgCount[2];
52    struct atifragshader_src_register SrcReg[2][3];
53    struct atifragshader_dst_register DstReg[2];
54 };
55 
56 /* different from arithmetic shader instruction */
57 struct atifs_setupinst
58 {
59    GLenum Opcode;
60    GLuint src;
61    GLenum swizzle;
62 };
63 
64 
65 extern struct ati_fragment_shader *
66 _mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id);
67 
68 extern void
69 _mesa_delete_ati_fragment_shader(struct gl_context *ctx,
70                                  struct ati_fragment_shader *s);
71 
72 #endif /* ATIFRAGSHADER_H */
73