~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/shader/slang/slang_execute.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Mesa 3-D graphics library
3
 
 * Version:  6.5
 
3
 * Version:  6.5.2
4
4
 *
5
5
 * Copyright (C) 2005-2006  Brian Paul   All Rights Reserved.
6
6
 *
22
22
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 */
24
24
 
25
 
#if !defined SLANG_EXECUTE_H
 
25
#ifndef SLANG_EXECUTE_H
26
26
#define SLANG_EXECUTE_H
27
27
 
28
28
#include "slang_assemble.h"
31
31
extern "C" {
32
32
#endif
33
33
 
 
34
 
 
35
/**
 
36
 * A memory location
 
37
 */
34
38
typedef union slang_machine_slot_
35
39
{
36
 
        GLfloat _float;
37
 
        GLuint _addr;
 
40
   GLfloat _float;
 
41
   GLuint _addr;
38
42
} slang_machine_slot;
39
43
 
40
44
#define SLANG_MACHINE_GLOBAL_SIZE 3072
41
45
#define SLANG_MACHINE_STACK_SIZE 1024
42
46
#define SLANG_MACHINE_MEMORY_SIZE (SLANG_MACHINE_GLOBAL_SIZE + SLANG_MACHINE_STACK_SIZE)
43
47
 
 
48
 
44
49
#if defined(USE_X86_ASM) || defined(SLANG_X86)
 
50
/**
 
51
 * Extra machine state for x86 execution.
 
52
 */
45
53
typedef struct
46
54
{
47
 
        GLvoid (* compiled_func) (struct slang_machine_ *);
48
 
        GLuint esp_restore;
49
 
        GLshort fpucntl_rnd_neg;
50
 
        GLshort fpucntl_restore;
 
55
   GLvoid(*compiled_func) (struct slang_machine_ *);
 
56
   GLuint esp_restore;
 
57
   GLshort fpucntl_rnd_neg;
 
58
   GLshort fpucntl_restore;
51
59
} slang_machine_x86;
52
60
#endif
53
61
 
 
62
 
 
63
/**
 
64
 * Runtime shader machine state.
 
65
 */
54
66
typedef struct slang_machine_
55
67
{
56
 
        GLuint ip;                                      /* instruction pointer, for flow control */
57
 
        GLuint sp;                                      /* stack pointer, for stack access */
58
 
        GLuint bp;                                      /* base pointer, for local variable access */
59
 
        GLuint kill;                            /* discard the fragment */
60
 
        GLuint exit;                            /* terminate the shader */
61
 
        slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
62
 
   struct slang_info_log_ *infolog;                /* printMESA() support */
 
68
   GLuint ip;               /**< instruction pointer, for flow control */
 
69
   GLuint sp;               /**< stack pointer, for stack access */
 
70
   GLuint bp;               /**< base pointer, for local variable access */
 
71
   GLboolean kill;          /**< discard the fragment? */
 
72
   GLboolean exit;          /**< terminate the shader */
 
73
   /** Machine memory */
 
74
   slang_machine_slot mem[SLANG_MACHINE_MEMORY_SIZE];
 
75
   struct slang_info_log_ *infolog;     /**< printMESA() support */
63
76
#if defined(USE_X86_ASM) || defined(SLANG_X86)
64
 
        slang_machine_x86 x86;
 
77
   slang_machine_x86 x86;
65
78
#endif
66
79
} slang_machine;
67
80
 
68
 
GLvoid slang_machine_ctr (slang_machine *);
69
 
GLvoid slang_machine_dtr (slang_machine *);
70
 
 
71
 
void slang_machine_init (slang_machine *);
72
 
 
73
 
int _slang_execute2 (const slang_assembly_file *, slang_machine *);
 
81
 
 
82
extern GLvoid
 
83
slang_machine_ctr(slang_machine *);
 
84
 
 
85
extern GLvoid
 
86
slang_machine_dtr(slang_machine *);
 
87
 
 
88
extern void
 
89
slang_machine_init(slang_machine *);
 
90
 
 
91
extern GLboolean
 
92
_slang_execute2(const slang_assembly_file *, slang_machine *);
 
93
 
74
94
 
75
95
#if defined(USE_X86_ASM) || defined(SLANG_X86)
76
 
GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
 
96
extern GLboolean
 
97
_slang_x86_codegen(slang_machine *, slang_assembly_file *, GLuint);
77
98
#endif
78
99
 
 
100
 
79
101
#ifdef __cplusplus
80
102
}
81
103
#endif
82
104
 
83
105
#endif
84