diff options
author | Brian <[email protected]> | 2007-03-12 17:29:50 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-12 17:29:50 -0600 |
commit | b3a22d0ed61afa9df4d3a02962884d49bc5760a4 (patch) | |
tree | 40de81f764da167493a4c96be78a57738cf4599f /src/mesa/shader/slang/slang_codegen.c | |
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/slang_codegen.c')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index e972da459b6..e91e0446ad1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -69,6 +69,8 @@ is_sampler_type(const slang_fully_specified_type *t) case SLANG_SPEC_SAMPLERCUBE: case SLANG_SPEC_SAMPLER1DSHADOW: case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER2DRECT: + case SLANG_SPEC_SAMPLER2DRECTSHADOW: return GL_TRUE; default: return GL_FALSE; @@ -118,6 +120,8 @@ _slang_sizeof_type_specifier(const slang_type_specifier *spec) case SLANG_SPEC_SAMPLERCUBE: case SLANG_SPEC_SAMPLER1DSHADOW: case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER2DRECT: + case SLANG_SPEC_SAMPLER2DRECTSHADOW: return 1; /* special case */ case SLANG_SPEC_STRUCT: { @@ -196,6 +200,10 @@ sampler_to_texture_index(const slang_type_specifier_type type) return TEXTURE_1D_INDEX; /* XXX fix */ case SLANG_SPEC_SAMPLER2DSHADOW: return TEXTURE_2D_INDEX; /* XXX fix */ + case SLANG_SPEC_SAMPLER2DRECT: + return TEXTURE_RECT_INDEX; + case SLANG_SPEC_SAMPLER2DRECTSHADOW: + return TEXTURE_RECT_INDEX; /* XXX fix */ default: return -1; } @@ -357,6 +365,8 @@ static slang_asm_info AsmInfo[] = { { "vec4_texb3d", IR_TEXB, 1, 2 }, /* 3d w/ bias */ { "vec4_texp3d", IR_TEXP, 1, 2 }, /* 3d w/ projection */ { "vec4_texcube", IR_TEX, 1, 2 }, /* cubemap */ + { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ + { "vec4_texp_rect", IR_TEX, 1, 2 },/* rectangle w/ projection */ /* unary op */ { "int_to_float", IR_I_TO_F, 1, 1 }, |