diff options
author | Brian <brian@yutani.localnet.net> | 2007-01-08 15:58:14 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-01-08 15:58:14 -0700 |
commit | 42153d7858686cfd88e919c0889a56d3a13a603e (patch) | |
tree | 3fe760df42a2f1eb963866b6bbb86dc98525fd37 /src/mesa/shader/slang/library/slang_common_builtin.gc | |
parent | 483ca39bca3c4a125e725e4711abde3f86a84b9e (diff) |
Implement projective texture sampling, 3D textures. Disable some debug output.
Diffstat (limited to 'src/mesa/shader/slang/library/slang_common_builtin.gc')
-rw-r--r-- | src/mesa/shader/slang/library/slang_common_builtin.gc | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 52f5b96d88..184a92ce34 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1633,38 +1633,42 @@ vec4 texture1DProj(const sampler1D sampler, const vec4 coord) vec4 texture2D(const sampler2D sampler, const vec2 coord) { - __asm vec4_tex2d __retVal, sampler, coord; // XXX sampler + __asm vec4_tex2d __retVal, sampler, coord; } -//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 vec3 coord) +{ + // new coord with .z moved to .w + vec4 coord4; + coord4.xy = coord.xy; + coord4.w = coord.z; + __asm vec4_texp2d __retVal, sampler, coord4; +} -//vec4 texture2DProj(const sampler2D sampler, const vec4 coord) -//{ -// vec2 pcoord = coord.st / coord.q; -// __asm vec4_tex2d __retVal, pcoord; // XXX sampler -//} +vec4 texture2DProj(const sampler2D sampler, const vec4 coord) +{ + __asm vec4_texp2d __retVal, coord; +} -vec4 texture3D (sampler3D sampler, vec3 coord) { - vec4 texel; - __asm vec4_tex3d texel, sampler, coord, 0.0; - return texel; +vec4 texture3D(const sampler3D sampler, const vec3 coord) +{ + __asm vec4_tex3d __retVal, sampler, coord; } -vec4 texture3DProj (sampler3D sampler, vec4 coord) { - return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q)); +vec4 texture3DProj(const sampler3D sampler, const vec4 coord) +{ + __asm vec4_texp3d __retVal, sampler, coord; } -vec4 textureCube (samplerCube sampler, vec3 coord) { - vec4 texel; - __asm vec4_texcube texel, sampler, coord, 0.0; - return texel; + +vec4 textureCube(const samplerCube sampler, const vec3 coord) +{ + __asm vec4_texcube __retVal, sampler, coord; } + + vec4 shadow1D (sampler1DShadow sampler, vec3 coord) { vec4 texel; __asm vec4_shad1d texel, sampler, coord, 0.0; |