diff options
author | Brian <brian@yutani.localnet.net> | 2007-03-12 17:29:50 -0600 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-03-12 17:29:50 -0600 |
commit | b3a22d0ed61afa9df4d3a02962884d49bc5760a4 (patch) | |
tree | 40de81f764da167493a4c96be78a57738cf4599f /src/mesa/shader/slang/library/slang_fragment_builtin.gc | |
parent | 8946d7f02938f20f3da46f6a8f7f1196afc271be (diff) |
Implement GL_ARB_texture_rectangle support
This includes the sampler2DRect and sampler2DRectShadow types and
the texture2DRect(), texture2DRectProj(), etc. built-in functions.
Diffstat (limited to 'src/mesa/shader/slang/library/slang_fragment_builtin.gc')
-rw-r--r-- | src/mesa/shader/slang/library/slang_fragment_builtin.gc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc index 40b1207ca8..9a7e17bdaf 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc +++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc @@ -68,6 +68,8 @@ vec4 texture1DProj(const sampler1D sampler, const vec4 coord, const float bias) } + + vec4 texture2D(const sampler2D sampler, const vec2 coord, const float bias) { vec4 coord4; @@ -95,6 +97,8 @@ vec4 texture2DProj(const sampler2D sampler, const vec4 coord, const float bias) } + + vec4 texture3D(const sampler3D sampler, const vec3 coord, const float bias) { vec4 coord4; @@ -113,6 +117,8 @@ vec4 texture3DProj(const sampler3D sampler, const vec4 coord, const float bias) } + + vec4 textureCube(const samplerCube sampler, const vec3 coord, const float bias) { vec4 coord4; @@ -122,6 +128,8 @@ vec4 textureCube(const samplerCube sampler, const vec3 coord, const float bias) } + + // For shadow textures, we use the regular tex instructions since they should // do the depth comparison step. @@ -142,6 +150,9 @@ vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float b __asm vec4_texb1d __retVal, sampler, pcoord; } + + + vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) { vec4 coord4; @@ -161,6 +172,38 @@ vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float b +//// GL_ARB_texture_rectangle: +vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) +{ + __asm vec4_tex_rect __retVal, sampler, coord; +} + +vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) +{ + // do projection here + vec4 pcoord; + pcoord.xy = coord.xy / coord.z; + __asm vec4_texp_rect __retVal, sampler, pcoord; +} + +vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) +{ + // do projection here + vec4 pcoord; + pcoord.xy = coord.xy / coord.w; + __asm vec4_texp_rect __retVal, sampler, pcoord; +} + +vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) +{ +// XXX to do +} + +vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) +{ +// XXX to do +} + // |