Age | Commit message (Collapse) | Author |
|
|
|
Used to log a shader to a file. Includes shader source code, the info log
and generated GPU instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Don't overload the Size field with the texture target, to avoid confusion.
|
|
Previously MaxTextureUnits was used to validate both texture image
units and texture coordinate units in fragment programs. Instead, use
MaxTextureCoordUnits for texture coordinate units and
MaxTextureImageUnits for texture image units.
Fixes bugzilla #19468.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
|
|
|
|
|
|
|
|
|
|
Two forms are supported:
Pragmas are silently ignored at this time.
|
|
6333005f7aea3e5d1d86a5c47b3fa2a1ed2f3ff0)
|
|
Fixes regression in progs/demos/convolution.c due to loop unrolling.
This also allows the following to be compiled correctly:
for (int i = 0; i < n; i++) {
int i;
...
}
This fix is a bit of a hack, however. The better fix would be to change
the slang_shader.syn grammar. Will revisit that...
|
|
|
|
1-component structs such as "struct foo { float x; }" could get placed at
any position within a register. This caused some trouble computing the
field offset which assumed all struct objects were placed at R.x.
It would be unusual to hit this case in normal shaders.
|
|
|
|
These functions need to return the final computed value.
Now expressions such as a = (b += c) work properly.
Also, no need to use __asm intrinsics in these functions. The resulting
code is the same when using ordinary arithmetic operators and is more legible.
|
|
|
|
|
|
Now the #extension directives can be handled properly.
|
|
|
|
gl_FragData[]
|
|
On Windows snprintf is renamed as _snprintf.
(cherry picked from commit f8f9a1b620d31d1a59855fd502caed325d4a324f)
|
|
|
|
|
|
|
|
Add a "max complexity" heuristic to allow unrolling long loops with small
bodies and short loops with large bodies.
The loop unroll limits may need further tweaking...
|
|
Loops such as this will be unrolled:
for (i = 0; i < 4; ++i) {
body;
}
where 'body' isn't too large.
This also helps to fix the issue reported in bug #19190. The problem there
is indexing vector types with a variable index. For example:
vec4 v;
v[2] = 1.0; // equivalent to v.z = 1.0
v[i] = 2.0; // variable index into vector!!
Since the for-i loop can be unrolled, we can avoid the problems associated
with variable indexing into a vector (at least in this case).
|
|
(cherry picked from commit 3740a06e28f4cd09e2a3dce2da60320aa9304df1)
|
|
This fixes cases such as:
vec4 v4;
vec2 v2;
v4.xz.yx = v2;
The last line now correctly compiles into MOV TEMP[1].xz, TEMP[0].yyxw;
Helps to fix the Humus Domino demo. See bug 19189.
|
|
|
|
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.
|
|
|
|
The max texture coord units is still 8. All the fixed-function paths are
still limited to 8 too. But GLSL shaders can use more samplers now.
Note that some texcoord-related data structures are declared to be 16
elements in size rather than 8. This just simplifies the code in a few
places; the extra elements aren't accessible to the user.
These changes haven't been extensively tested yet, but sanity checking has
been done.
It should be possible to increase the max image units/samplers to 32 without
doing anything special. Beyond that we'll need longer bitfields in a few
places.
|
|
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.
|
|
|
|
|
|
It looks like the LOG2 macro only has 8 or 9 bits of precission, but
the ARB_vertex_program spec says "accurate to at least 10 bits".
|
|
|
|
|
|
array.length() wasn't working.
Swizzle mask for accessing elements of float arrays was incorrect.
|
|
The noise functions were not glsl-specific.
Also, ran indent on the code to clean it up.
|