Age | Commit message (Collapse) | Author |
|
|
|
There's really no need for two negation fields. This came from the
GL_NV_fragment_program extension. The new, unified Negate bitfield applies
after the absolute value step.
|
|
A shader program may consist of multiple shaders (source code units).
If we find there are unresolved functions after compiling the unit that
defines main(), we'll concatenate all the respective vertex or fragment
shaders then recompile.
This isn't foolproof but should work in most cases.
|
|
BTW, the debug pragma syntax is "#pragma debug(on)"
|
|
|
|
This fixes swizzled conditional expressions such "(b ? p : q).x"
|
|
This fixes the case of "infinitely" nested swizzles such as EXPR.wzyx.yxwz.xxyz
This doesn't appear in typical shaders but with function inlining and the
compiler's internal use of swizzles it can happen.
New glean glsl1 test case added for this.
|
|
Such TEX instructions will have the TexShadow flag set.
The gl_program::ShadowSamplers field is now set in the linker. We missed
that before.
|
|
This new issue was exposed by commit 6eabfc27f19a10dfc2663e99f9560966ba1ff697
|
|
|
|
This fixes a bug found with swizzled array indexes such as in "array[index.z]"
where "index" is an ivec4.
|
|
This info will be used in the linker for allocating generic vertex attribs.
|
|
|
|
|
|
Don't overload the Size field with the texture target, to avoid confusion.
|
|
|
|
On Windows snprintf is renamed as _snprintf.
(cherry picked from commit f8f9a1b620d31d1a59855fd502caed325d4a324f)
|
|
|
|
Now only the samplers that are actually used by texture() functions are
saved in the uniform variable list. Before, we could run out of samplers
if too many were declared while only some of them were actually used.
|
|
Fixes incorrect size information. See bug 19273.
|
|
This allows code such as "vec4 a = gl_LightSource[i].ambient;" to work.
When a built-in uniform array is indexed with a variable index we need to
"unroll" the whole array into the parameter list (aka constant buffer) because
we don't know which elements may be accessed at compile-time. In the case of
the gl_LightSource array of size [8], we emit 64 state references into the
parameter array (8 elements times 8 vec4s per gl_LightSourceParameters
struct).
Previously, we only allowed constant-indexed references to uniform arrays
(such as gl_LightSource[2].position) which resulted in a single state reference
being added to the parameter array, not 64. We still optimize this case.
Users should be aware that using "gl_LightSource[i].ambient" in their shaders
is a bit expensive since state validation will involve updating all 64
light source entries in the parameter list.
|
|
array.length() wasn't working.
Swizzle mask for accessing elements of float arrays was incorrect.
|
|
|
|
|
|
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.
|
|
|
|
The Swizzle and Size fields carry all the info we need now.
|
|
This is a step toward better array handling code. In particular, when more
than one operand of an instruction uses indirect addressing, we'll need some
temporary instructions and registers. By converting IR storage to instruction
operands all in one place (emit_instruction()) we can be smarter about this.
Also, somewhat better handling of dst register swizzle/writemask handling.
This results in tighter writemasks on some instructions which is good for
SOA execution.
And, cleaner instruction commenting with inst_comment().
Next: remove some more dead code and additional clean-ups...
|
|
emitted yet though)
|
|
Expressions like array[i] + array[j] didn't work properly before.
|
|
|
|
Includes:
1. Fixes failed asserting about bad swizzles in src reg emit.
2. Tracks uniform var usage.
3. Emit exp() in terms of EXP2 instruction.
|
|
|
|
|
|
Plus,
- fix some issues in casting function arguments to format param types.
- fix some vec/mat constructor bugs
- find/report more syntax/semantic errors
|
|
Plus begin some fixes for vec/matrix constructors.
|
|
In the following case:
for () {
if (cond)
break; // or continue;
else
something;
}
The "something" block didn't get emitted.
|
|
Also fix bug in comparing large structs/arrays.
|
|
Build on the heirarchal approach implemented for arrays/structs.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
Previously, the shader linker combined the uniforms used by the vertex and
fragment shaders into a combined set of uniforms. This made the implementation
of glUniform*() simple, but was rather inefficient otherwise. Now each shader
gets its own set of uniforms (no more modelview matrix showing up in the
fragment shader uniforms, for example).
cherry-picked by hand from gallium-0.1 branch
|
|
|