summaryrefslogtreecommitdiff
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-05-16 15:34:22 -0700
committerIan Romanick <idr@us.ibm.com>2007-05-16 15:34:22 -0700
commitbb372f1c9bc08e8b0dca983cb4ba36b2f2f039fb (patch)
treeae0fe211215492e6e4ffec238e06ee15adca4a45 /src/mesa/main/fbobject.c
parent9ebffb86a699e49fd683ed9afbf6d5b2ac244ae0 (diff)
Initial implementation of MESA_texture_array
Shadow sampling from texture arrays is still not implemented. Everything else should be there, though.
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index eac2f78717..e3bada5ae8 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1179,9 +1179,16 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
texObj = _mesa_lookup_texture(ctx, texture);
if (texObj != NULL) {
- err = (texObj->Target == GL_TEXTURE_CUBE_MAP)
- ? !IS_CUBE_FACE(textarget)
- : (texObj->Target != textarget);
+ if (textarget == 0) {
+ err = (texObj->Target != GL_TEXTURE_3D) &&
+ (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) &&
+ (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT);
+ }
+ else {
+ err = (texObj->Target == GL_TEXTURE_CUBE_MAP)
+ ? !IS_CUBE_FACE(textarget)
+ : (texObj->Target != textarget);
+ }
}
if (err) {
@@ -1195,12 +1202,20 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target,
const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
if (zoffset < 0 || zoffset >= maxSize) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "glFramebufferTexture%sEXT(zoffset)",
- caller);
+ "glFramebufferTexture%sEXT(zoffset)", caller);
+ return;
+ }
+ }
+ else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) ||
+ (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
+ if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferTexture%sEXT(layer)", caller);
return;
}
}
+
if ((level < 0) ||
(level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
_mesa_error(ctx, GL_INVALID_VALUE,
@@ -1292,6 +1307,17 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
void GLAPIENTRY
+_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment,
+ GLuint texture, GLint level, GLint layer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ framebuffer_texture(ctx, "Layer", target, attachment, 0, texture,
+ level, layer);
+}
+
+
+void GLAPIENTRY
_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
GLenum renderbufferTarget,
GLuint renderbuffer)