aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-12-16 11:56:26 -0800
committerEric Anholt <[email protected]>2014-02-11 16:00:12 -0800
commit4825af972a7e318f34ca20a32e8e1597f90ae90c (patch)
tree9e21722bdc865cd71aafed3825692368c583fe28 /src
parentf5a477ab76b6e0b268387699cd2253a43db0dfae (diff)
meta: Add rectangle textures to the shader-per-sampler-type table
Rectangle textures were not necessary for mipmap generation (because they cannot have mipmaps), but all of the future users of this common code will need to support rectangle textures. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/common/meta.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f07d30809a4..40e1f373532 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -233,6 +233,7 @@ struct sampler_table {
struct glsl_sampler sampler_1d;
struct glsl_sampler sampler_2d;
struct glsl_sampler sampler_3d;
+ struct glsl_sampler sampler_rect;
struct glsl_sampler sampler_cubemap;
struct glsl_sampler sampler_1d_array;
struct glsl_sampler sampler_2d_array;
@@ -3434,6 +3435,11 @@ setup_texture_sampler(GLenum target, struct sampler_table *table)
table->sampler_2d.func = "texture2D";
table->sampler_2d.texcoords = "texCoords.xy";
return &table->sampler_2d;
+ case GL_TEXTURE_RECTANGLE:
+ table->sampler_rect.type = "sampler2DRect";
+ table->sampler_rect.func = "texture2DRect";
+ table->sampler_rect.texcoords = "texCoords.xy";
+ return &table->sampler_rect;
case GL_TEXTURE_3D:
/* Code for mipmap generation with 3D textures is not used yet.
* It's a sw fallback.
@@ -3470,6 +3476,7 @@ sampler_table_cleanup(struct sampler_table *table)
_mesa_DeleteObjectARB(table->sampler_1d.shader_prog);
_mesa_DeleteObjectARB(table->sampler_2d.shader_prog);
_mesa_DeleteObjectARB(table->sampler_3d.shader_prog);
+ _mesa_DeleteObjectARB(table->sampler_rect.shader_prog);
_mesa_DeleteObjectARB(table->sampler_cubemap.shader_prog);
_mesa_DeleteObjectARB(table->sampler_1d_array.shader_prog);
_mesa_DeleteObjectARB(table->sampler_2d_array.shader_prog);
@@ -3477,6 +3484,7 @@ sampler_table_cleanup(struct sampler_table *table)
table->sampler_1d.shader_prog = 0;
table->sampler_2d.shader_prog = 0;
table->sampler_3d.shader_prog = 0;
+ table->sampler_rect.shader_prog = 0;
table->sampler_cubemap.shader_prog = 0;
table->sampler_1d_array.shader_prog = 0;
table->sampler_2d_array.shader_prog = 0;