34
38
typedef union slang_machine_slot_
38
42
} slang_machine_slot;
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)
44
49
#if defined(USE_X86_ASM) || defined(SLANG_X86)
51
* Extra machine state for x86 execution.
47
GLvoid (* compiled_func) (struct slang_machine_ *);
49
GLshort fpucntl_rnd_neg;
50
GLshort fpucntl_restore;
55
GLvoid(*compiled_func) (struct slang_machine_ *);
57
GLshort fpucntl_rnd_neg;
58
GLshort fpucntl_restore;
51
59
} slang_machine_x86;
64
* Runtime shader machine state.
54
66
typedef struct slang_machine_
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 */
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;
68
GLvoid slang_machine_ctr (slang_machine *);
69
GLvoid slang_machine_dtr (slang_machine *);
71
void slang_machine_init (slang_machine *);
73
int _slang_execute2 (const slang_assembly_file *, slang_machine *);
83
slang_machine_ctr(slang_machine *);
86
slang_machine_dtr(slang_machine *);
89
slang_machine_init(slang_machine *);
92
_slang_execute2(const slang_assembly_file *, slang_machine *);
75
95
#if defined(USE_X86_ASM) || defined(SLANG_X86)
76
GLboolean _slang_x86_codegen (slang_machine *, slang_assembly_file *, GLuint);
97
_slang_x86_codegen(slang_machine *, slang_assembly_file *, GLuint);
79
101
#ifdef __cplusplus