Age | Commit message (Collapse) | Author |
|
We now express arrays in terms of indirect addressing. For example:
dst = a[i];
becomes:
MOV dst, TEMP[1 + TEMP[2].y];
At instruction-emit time indirect addressing is converted into ARL/
ADDR-relative form:
ARL ADDR.x, TEMP[2].y;
MOV dst, TEMP[1 + ADDR.x];
This fixes a number of array-related issues. Arrays of arrays and complex
array/struct nesting works now.
There may be some regressions, but more work is coming.
(cherry picked from commit ae0ff8097b85d3537a7be1674d55a44a9bd6018e)
|
|
The Swizzle and Size fields carry all the info we need now.
(cherry picked from commit 80d6379722a1249ce13db79a898d340644936f67)
|
|
Simplify the code for allocating storage for intermediate results. Use fewer
temps in some cases.
Also, use new asm vec4_move intrinsic instead of regular assigments in various
constructors. For example:
float f;
vec3 v;
v.xyz = f;
is not legal GLSL, so do this instead:
__asm vec4_move v.xyz, f; // note: f will auto-expand into f.xxxx
Plus, fix assorted bugs in structure comparison.
|
|
Some of the headers in src/mesa/main have pretty common names which
easily conflict with third-party code, e.g. config.h
|
|
The slang_ir_storage type now has a pointer to parent storage to represent
storage of an array element within an array, or a field within a struct.
This fixes some problems related to addressing of fields/elements in non-
trivial cases. More work to follow.
|
|
|
|
|
|
|
|
|
|
Also, found/fixed a code generation regression: the emit_swizzle() function
was always returning NULL. This caused emit_move() to miss its chance at peephole
optimization.
|
|
|
|
|
|
|
|
IR_LOOP now has two children: the body code, and the tail code.
Tail code is the "i++" part of a for-loop, or the expression at the end
of a "do {} while(expr);" loop.
"continue" translates into: "execute tail code; CONT;"
Also, the test for infinite do/while loops was incorrect.
|
|
Previously, comparing vec2, vec3, vec4 was broken.
Added IR_EQUAL, IR_NOTEQUAL nodes/operators to compute boolean
equality/inequality vs. IR_SEQUAL/IR_SNEQUAL which work component-wise.
Use IR_EQUAL/IR_NOTEQUAL for the == and != operators.
To compute vec4 equality, use SNE, DP4, SEQ instruction sequence.
|
|
struct == and != operators not finished yet. Struct assignment works though.
|
|
Using IR_SGE and IR_SGT with transposed args doesn't work since the __asm
calls don't do argument matching by name, but by position.
This fixes the broken lessThan() and lessThanEqual() functions.
|
|
|
|
|
|
This eliminates the NOP instructions that had been used as placeholders for
branch targets.
Also, fix "return" statement bug.
|
|
Also, start moving high vs. low-level instruction selection into slang_emit.c
|
|
|
|
|
|
IF/ELSE/ENDIF and BEGIN_LOOP/END_LOOP/BREAK instructions seem to work.
Disabled by default though until better tested.
Implemented IR_NOT, but needs optimization.
|
|
New high-level flow-control instructions, both at IR level and GPU instructions
for looping and subroutines.
|
|
vec2 v; v.x = v.y = 1.0; // chained assignment
vec4 v; v.zx = vec2(a,b); // swizzled writemask
|
|
instruction saturate-write option. Not finished yet.
|
|
|
|
|
|
|
|
|
|
we can either jump on zero, or non-zero predicate.
|
|
|
|
p and q works correctly.
|
|
|
|
emit time, not codegen time.
|
|
and expression temporarires. Much better register utilization now.
Lots of other fixes.
The OpenGL GLSL "orange book" brick shader demo works now.
|
|
|
|
|
|
properly.
|
|
|
|
|
|
|
|
|
|
|
|
instructions.
|