st/mesa: fix texture array dimensions
[mesa.git] / src / mesa / state_tracker / st_cb_fbo.c
index cd718a31a145925712be1163d0d29352a448efb3..52464707eaea0ea3008bb123ac8a6ffccac04bad 100644 (file)
@@ -38,6 +38,7 @@
 #include "main/fbobject.h"
 #include "main/framebuffer.h"
 #include "main/macros.h"
+#include "main/mfeatures.h"
 #include "main/renderbuffer.h"
 
 #include "pipe/p_context.h"
@@ -61,7 +62,8 @@
  * during window resize.
  */
 static GLboolean
-st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+st_renderbuffer_alloc_storage(struct gl_context * ctx,
+                              struct gl_renderbuffer *rb,
                               GLenum internalFormat,
                               GLuint width, GLuint height)
 {
@@ -75,7 +77,8 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *r
    if (strb->format != PIPE_FORMAT_NONE)
       format = strb->format;
    else
-      format = st_choose_renderbuffer_format(screen, internalFormat, rb->NumSamples);
+      format = st_choose_renderbuffer_format(screen, internalFormat,
+                                             rb->NumSamples);
       
    /* init renderbuffer fields */
    strb->Base.Width  = width;
@@ -387,7 +390,7 @@ st_render_texture(struct gl_context *ctx,
 
    /* new surface for rendering into the texture */
    memset(&surf_tmpl, 0, sizeof(surf_tmpl));
-   surf_tmpl.format = strb->texture->format;
+   surf_tmpl.format = util_format_linear(strb->texture->format);
    surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
    surf_tmpl.u.tex.level = strb->rtt_level;
    surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice;