drawable->is_pixmap = dri2_check_if_pixmap(buffers, count);
for (i = 0; i < count; i++) {
+ enum pipe_format format = 0;
int index = 0;
switch (buffers[i].attachment) {
case __DRI_BUFFER_FRONT_LEFT:
+ continue;
case __DRI_BUFFER_FAKE_FRONT_LEFT:
index = ST_SURFACE_FRONT_LEFT;
- drawable->color_format = buffers[i].flags;
+ format = drawable->color_format;
break;
case __DRI_BUFFER_BACK_LEFT:
index = ST_SURFACE_BACK_LEFT;
- drawable->color_format = buffers[i].flags;
+ format = drawable->color_format;
break;
case __DRI_BUFFER_DEPTH:
index = ST_SURFACE_DEPTH;
- drawable->depth_format = buffers[i].flags;
+ format = drawable->depth_format;
break;
case __DRI_BUFFER_STENCIL:
index = ST_SURFACE_DEPTH;
- drawable->stencil_format = buffers[i].flags;
+ format = drawable->stencil_format;
break;
case __DRI_BUFFER_ACCUM:
default:
surface = dri_surface_from_handle(api,
screen,
buffers[i].name,
- buffers[i].flags,
+ format,
dri_drawable->w,
dri_drawable->h, buffers[i].pitch);
st_get_framebuffer_surface(drawable->stfb, ST_SURFACE_FRONT_LEFT, &ps);
st_bind_texture_surface(ps, target == GL_TEXTURE_2D ? ST_TEXTURE_2D :
- ST_TEXTURE_RECT, 0, drawable->color_format);
+ ST_TEXTURE_RECT, 0,
+ format == GLX_TEXTURE_FORMAT_RGBA_EXT ?
+ PIPE_FORMAT_R8G8B8A8_UNORM : PIPE_FORMAT_R8G8B8X8_UNORM);
}
void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,