diff options
author | Brian <brian@yutani.localnet.net> | 2007-01-05 16:02:45 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-01-05 16:02:45 -0700 |
commit | 5cf7326132a37f11357b5cb31bcc9238fef5b54c (patch) | |
tree | 8d92595241072e8aebba501c68b544ef8b4e13eb /src/mesa/shader/slang/library/slang_common_builtin.gc | |
parent | b2ab693d68f2ba1358b9c3f8bab53b9ebfb586fe (diff) |
Checkpoint glsl compiler work: sampler uniforms now implemented, linked properly.
Diffstat (limited to 'src/mesa/shader/slang/library/slang_common_builtin.gc')
-rw-r--r-- | src/mesa/shader/slang/library/slang_common_builtin.gc | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 44e059f5a0..52f5b96d88 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1611,36 +1611,43 @@ bvec4 not (const bvec4 v) -// -// 8.7 Texture Lookup Functions -// +//// Texture Lookup Functions (for both fragment and vertex shaders) -vec4 texture1D (sampler1D sampler, float coord) { - vec4 texel; - __asm vec4_tex1d texel, sampler, coord, 0.0; - return texel; +vec4 texture1D(const sampler1D sampler, const float coord) +{ + __asm vec4_tex1d __retVal, coord; // XXX sampler } -vec4 texture1DProj (sampler1D sampler, vec2 coord) { - return texture1D (sampler, coord.s / coord.t); +vec4 texture1DProj(const sampler1D sampler, const vec2 coord) +{ + float pcoord = coord.s / coord.t; + __asm vec4_tex1d __retVal, pcoord; // XXX sampler } -vec4 texture1DProj (sampler1D sampler, vec4 coord) { - return texture1D (sampler, coord.s / coord.q); +vec4 texture1DProj(const sampler1D sampler, const vec4 coord) +{ + float pcoord = coord.s / coord.q; + __asm vec4_tex1d __retVal, pcoord; // XXX sampler } + vec4 texture2D(const sampler2D sampler, const vec2 coord) { - __asm vec4_tex2d __retVal, coord; // XXX sampler + __asm vec4_tex2d __retVal, sampler, coord; // XXX sampler } -vec4 texture2DProj (sampler2D sampler, vec3 coord) { - return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p)); -} +//vec4 texture2DProj(const sampler2D sampler, const vec3 coord) +//{ +// vec2 pcoord = coord.st / coord.p; +// __asm vec4_tex2d __retVal, pcoord; // XXX sampler +//} + +//vec4 texture2DProj(const sampler2D sampler, const vec4 coord) +//{ +// vec2 pcoord = coord.st / coord.q; +// __asm vec4_tex2d __retVal, pcoord; // XXX sampler +//} -vec4 texture2DProj (sampler2D sampler, vec4 coord) { - return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q)); -} vec4 texture3D (sampler3D sampler, vec3 coord) { vec4 texel; |