changeset 1038 | 9b23f9a8aa31 |
parent 1037 | b102a563d9cb |
child 1041 | 200cde29af83 |
1037:b102a563d9cb | 1038:9b23f9a8aa31 |
---|---|
10 #define __MOJOSHADER_INTERNAL__ 1 |
10 #define __MOJOSHADER_INTERNAL__ 1 |
11 #include "mojoshader_internal.h" |
11 #include "mojoshader_internal.h" |
12 |
12 |
13 #include <math.h> |
13 #include <math.h> |
14 |
14 |
15 void run_preshader(const MOJOSHADER_preshader *preshader, float *regs) |
15 #if SUPPORT_PRESHADERS |
16 void MOJOSHADER_runPreshader(const MOJOSHADER_preshader *preshader, |
|
17 float *regs) |
|
16 { |
18 { |
17 // this is fairly straightforward, as there aren't any branching |
19 // this is fairly straightforward, as there aren't any branching |
18 // opcodes in the preshader instruction set (at the moment, at least). |
20 // opcodes in the preshader instruction set (at the moment, at least). |
19 const int scalarstart = (int) MOJOSHADER_PRESHADEROP_SCALAR_OPS; |
21 const int scalarstart = (int) MOJOSHADER_PRESHADEROP_SCALAR_OPS; |
20 |
22 |
160 assert(operand->type == MOJOSHADER_PRESHADEROPERAND_OUTPUT); |
162 assert(operand->type == MOJOSHADER_PRESHADEROPERAND_OUTPUT); |
161 for (i = 0; i < elems; i++) |
163 for (i = 0; i < elems; i++) |
162 regs[operand->index + i] = (float) dst[i]; |
164 regs[operand->index + i] = (float) dst[i]; |
163 } // else |
165 } // else |
164 } // for |
166 } // for |
165 } // run_preshader |
167 } // MOJOSHADER_runPreshader |
166 |
168 #endif |
167 |
169 |
168 static MOJOSHADER_effect MOJOSHADER_out_of_mem_effect = { |
170 static MOJOSHADER_effect MOJOSHADER_out_of_mem_effect = { |
169 1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
171 1, &MOJOSHADER_out_of_mem_error, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
170 }; |
172 }; |
171 |
173 |