Additional types may be added in the future.
*/
/* XXX is the pitch different for textures vs. drawables? */
- if (flags & PIPE_SURFACE_FLAG_TEXTURE) /* or PIPE_SURFACE_FLAG_RENDER? */
+ if (1/*flags & PIPE_SURFACE_FLAG_TEXTURE*/) /* or PIPE_SURFACE_FLAG_RENDER? */
return ((cpp * width + 63) & ~63) / cpp;
else
return ((cpp * width + 63) & ~63) / cpp;
/**
- * Query format support.
- * If we find texture and drawable support differs, add a selector
- * parameter or another function.
+ * Query format support for creating a texture, drawing surface, etc.
+ * \param format the format to test
+ * \param type one of PIPE_TEXTURE, PIPE_SURFACE, PIPE_SCREEN_SURFACE
*/
static boolean
i915_is_format_supported( struct pipe_context *pipe,
- enum pipe_format format )
+ enum pipe_format format, uint type )
{
-#if 0
- /* XXX: This is broken -- rewrite if still needed. */
- static const unsigned tex_supported[] = {
+ static const enum pipe_format tex_supported[] = {
PIPE_FORMAT_R8G8B8A8_UNORM,
PIPE_FORMAT_A8R8G8B8_UNORM,
PIPE_FORMAT_R5G6B5_UNORM,
PIPE_FORMAT_U_L8,
PIPE_FORMAT_U_A8,
PIPE_FORMAT_U_I8,
- PIPE_FORMAT_U_L8_A8,
+ PIPE_FORMAT_U_A8_L8,
PIPE_FORMAT_YCBCR,
PIPE_FORMAT_YCBCR_REV,
PIPE_FORMAT_S8Z24_UNORM,
+ PIPE_FORMAT_NONE /* list terminator */
};
-
-
- /* Actually a lot more than this - add later:
- */
- static const unsigned render_supported[] = {
+ static const enum pipe_format surface_supported[] = {
PIPE_FORMAT_A8R8G8B8_UNORM,
PIPE_FORMAT_R5G6B5_UNORM,
- };
-
- /*
- */
- static const unsigned z_stencil_supported[] = {
- PIPE_FORMAT_Z16_UNORM,
- PIPE_FORMAT_Z32_UNORM,
PIPE_FORMAT_S8Z24_UNORM,
+ PIPE_FORMAT_R16G16B16A16_SNORM,
+ PIPE_FORMAT_NONE /* list terminator */
+ };
+ static const enum pipe_format screen_surface_supported[] = {
+ PIPE_FORMAT_A8R8G8B8_UNORM,
+ PIPE_FORMAT_NONE /* list terminator */
};
+ const enum pipe_format *list;
+ uint i;
switch (type) {
- case PIPE_RENDER_FORMAT:
- *numFormats = Elements(render_supported);
- return render_supported;
-
- case PIPE_TEX_FORMAT:
- *numFormats = Elements(tex_supported);
- return render_supported;
-
- case PIPE_Z_STENCIL_FORMAT:
- *numFormats = Elements(render_supported);
- return render_supported;
-
+ case PIPE_TEXTURE:
+ list = tex_supported;
+ break;
+ case PIPE_SURFACE:
+ list = surface_supported;
+ break;
+ case PIPE_SCREEN_SURFACE:
+ list = screen_surface_supported;
+ break;
default:
- *numFormats = 0;
- return NULL;
+ assert(0);
}
-#else
- switch( format ) {
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_R5G6B5_UNORM:
- case PIPE_FORMAT_S8Z24_UNORM:
- return TRUE;
- default:
- return FALSE;
- };
-#endif
+
+ for (i = 0; list[i] != PIPE_FORMAT_NONE; i++) {
+ if (list[i] == format)
+ return TRUE;
+ }
+
+ return FALSE;
}
/*
* Queries
*/
+ /** type is one of PIPE_SURFACE, PIPE_TEXTURE, etc. */
boolean (*is_format_supported)( struct pipe_context *pipe,
- enum pipe_format format );
+ enum pipe_format format, uint type );
const char *(*get_name)( struct pipe_context *pipe );
#define PIPE_TEX_FACE_MAX 6
/**
- * Surface flags
+ * Surfaces, textures, etc. (others may be added)
*/
-#define PIPE_SURFACE_FLAG_TEXTURE 0x1
-#define PIPE_SURFACE_FLAG_RENDER 0x2
+#define PIPE_TEXTURE 1
+#define PIPE_SURFACE 2 /**< user-created surfaces */
+#define PIPE_SCREEN_SURFACE 3 /**< On-screen front/back colorbuffer */
/**
/**
- * Query format support.
- * If we find texture and drawable support differs, add a selector
- * parameter or another function.
+ * Query format support for creating a texture, drawing surface, etc.
+ * \param format the format to test
+ * \param type one of PIPE_TEXTURE, PIPE_SURFACE, PIPE_SCREEN_SURFACE
*/
static boolean
softpipe_is_format_supported( struct pipe_context *pipe,
- enum pipe_format format )
+ enum pipe_format format, uint type )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
- /* ask winsys if the format is supported */
- return softpipe->winsys->is_format_supported( softpipe->winsys, format );
+
+ switch (type) {
+ case PIPE_TEXTURE:
+ /* softpipe supports all texture formats */
+ return TRUE;
+ case PIPE_SURFACE:
+ /* softpipe supports all (off-screen) surface formats */
+ return TRUE;
+ case PIPE_SCREEN_SURFACE:
+ return softpipe->winsys->is_format_supported( softpipe->winsys, format );
+ default:
+ assert(0);
+ return FALSE;
+ }
}
*
**************************************************************************/
+/* This is the interface that softpipe requires any window system
+ * hosting it to implement. This is the only include file in softpipe
+ * which is public.
+ */
+
+
#ifndef SP_WINSYS_H
#define SP_WINSYS_H
-#include "pipe/p_compiler.h" // for boolean
+#include "pipe/p_compiler.h" /* for boolean */
-/* This is the interface that softpipe requires any window system
- * hosting it to implement. This is the only include file in softpipe
- * which is public.
- */
-
struct softpipe_winsys {
+ /** test if the given format is supported for front/back color bufs */
boolean (*is_format_supported)( struct softpipe_winsys *sws,
- uint format );
+ enum pipe_format format );
};
struct xmesa_softpipe_winsys
{
struct softpipe_winsys spws;
- uint pixelformat;
+ enum pipe_format pixelformat;
};
/**
+ * Called via softpipe_winsys->is_format_supported().
+ * This function is only called to test formats for front/back color surfaces.
* The winsys being queried will have been created at glXCreateContext
* time, with a pixel format corresponding to the context's visual.
- *
- * XXX we should pass a flag indicating if the format is going to be
- * use for a drawing surface vs. a texture. In the later case, we
- * can support any format.
*/
static boolean
xmesa_is_format_supported(struct softpipe_winsys *sws,
enum pipe_format format)
{
struct xmesa_softpipe_winsys *xmws = xmesa_softpipe_winsys(sws);
-
- if (format == xmws->pixelformat) {
- return TRUE;
- }
- else {
- /* non-color / window surface format */
- switch (format) {
- case PIPE_FORMAT_R16G16B16A16_SNORM:
- case PIPE_FORMAT_S8Z24_UNORM:
- case PIPE_FORMAT_U_S8:
- case PIPE_FORMAT_Z16_UNORM:
- case PIPE_FORMAT_Z32_UNORM:
- return TRUE;
- default:
- return FALSE;
- }
- }
+ return (format == xmws->pixelformat);
}
int row, col;
/* find a texture format we know */
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8 )) {
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8, PIPE_TEXTURE )) {
format = PIPE_FORMAT_U_I8;
internal_format = GL_INTENSITY8;
cpp = 1;
comp = 0;
}
- else if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM )) {
+ else if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_TEXTURE )) {
format = PIPE_FORMAT_A8R8G8B8_UNORM;
internal_format = GL_RGBA8;
cpp = 4;
{
struct pipe_context *pipe = ctx->st->pipe;
struct st_renderbuffer *strb = st_renderbuffer(rb);
+ uint type = strb->screenSurface ? PIPE_SCREEN_SURFACE : PIPE_SURFACE;
const enum pipe_format pipeFormat
- = st_choose_pipe_format(pipe, internalFormat, GL_NONE, GL_NONE);
+ = st_choose_pipe_format(pipe, internalFormat, GL_NONE, GL_NONE, type);
GLuint cpp;
- GLbitfield flags = PIPE_SURFACE_FLAG_RENDER; /* want to render to surface */
+ GLbitfield flags = 0x0; /* XXX needed? */
cpp = init_renderbuffer_bits(strb, pipeFormat);
+ assert(cpp);
if (strb->surface && strb->surface->format != pipeFormat) {
/* need to change surface types, free this surface */
/**
* Allocate a renderbuffer for a an on-screen window (not a user-created
* renderbuffer). The window system code determines the internal format.
+ * \param screenSurface indicates if the renderbuffer is a front/back color
+ * buffer that'll be displayed/copied to the screen
*/
struct gl_renderbuffer *
-st_new_renderbuffer_fb(GLenum intFormat)
+st_new_renderbuffer_fb(GLenum intFormat, GLboolean screenSurface)
{
struct st_renderbuffer *strb;
_mesa_init_renderbuffer(&strb->Base, 0);
strb->Base.ClassID = 0x4242; /* just a unique value */
strb->Base.InternalFormat = intFormat;
+ strb->screenSurface = screenSurface;
switch (intFormat) {
case GL_RGB5:
{
struct gl_renderbuffer Base;
struct pipe_surface *surface;
+ GLboolean screenSurface; /**< A front/back colorbuffer? */
};
extern struct gl_renderbuffer *
-st_new_renderbuffer_fb(GLenum intFormat);
+st_new_renderbuffer_fb(GLenum intFormat, GLboolean screen_surface);
extern void
* Find an RGBA format supported by the context/winsys.
*/
static GLuint
-default_rgba_format(
- struct pipe_context *pipe )
+default_rgba_format(struct pipe_context *pipe, uint type)
{
- static const uint colorFormats[] = {
+ static const enum pipe_format colorFormats[] = {
PIPE_FORMAT_R8G8B8A8_UNORM,
PIPE_FORMAT_A8R8G8B8_UNORM,
PIPE_FORMAT_B8G8R8A8_UNORM,
};
uint i;
for (i = 0; i < Elements(colorFormats); i++) {
- if (pipe->is_format_supported( pipe, colorFormats[i] )) {
+ if (pipe->is_format_supported( pipe, colorFormats[i], type )) {
return colorFormats[i];
}
}
* Search list of formats for first RGBA format with >8 bits/channel.
*/
static GLuint
-default_deep_rgba_format(
- struct pipe_context *pipe )
+default_deep_rgba_format(struct pipe_context *pipe, uint type)
{
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_R16G16B16A16_SNORM )) {
+ if (pipe->is_format_supported(pipe, PIPE_FORMAT_R16G16B16A16_SNORM, type)) {
return PIPE_FORMAT_R16G16B16A16_SNORM;
}
return PIPE_FORMAT_NONE;
* Find an Z format supported by the context/winsys.
*/
static GLuint
-default_depth_format(
- struct pipe_context *pipe )
+default_depth_format(struct pipe_context *pipe, uint type)
{
- static const uint zFormats[] = {
+ static const enum pipe_format zFormats[] = {
PIPE_FORMAT_Z16_UNORM,
PIPE_FORMAT_Z32_UNORM,
PIPE_FORMAT_S8Z24_UNORM,
};
uint i;
for (i = 0; i < Elements(zFormats); i++) {
- if (pipe->is_format_supported( pipe, zFormats[i] )) {
+ if (pipe->is_format_supported( pipe, zFormats[i], type )) {
return zFormats[i];
}
}
*/
GLuint
st_choose_pipe_format(struct pipe_context *pipe, GLint internalFormat,
- GLenum format, GLenum type)
+ GLenum format, GLenum type, uint surfType)
{
+ assert(surfType == PIPE_TEXTURE ||
+ surfType == PIPE_SURFACE ||
+ surfType == PIPE_SCREEN_SURFACE);
+
switch (internalFormat) {
case 4:
case GL_RGBA:
case GL_COMPRESSED_RGBA:
if (format == GL_BGRA) {
if (type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A8R8G8B8_UNORM, surfType ))
return PIPE_FORMAT_A8R8G8B8_UNORM;
}
else if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A4R4G4B4_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A4R4G4B4_UNORM, surfType ))
return PIPE_FORMAT_A4R4G4B4_UNORM;
}
else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
return PIPE_FORMAT_A1R5G5B5_UNORM;
}
}
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case 3:
case GL_RGB:
case GL_COMPRESSED_RGB:
if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_R5G6B5_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_R5G6B5_UNORM, surfType ))
return PIPE_FORMAT_R5G6B5_UNORM;
}
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_RGBA16:
- return default_deep_rgba_format( pipe );
+ return default_deep_rgba_format( pipe, surfType );
case GL_RGBA4:
case GL_RGBA2:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A4R4G4B4_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A4R4G4B4_UNORM, surfType ))
return PIPE_FORMAT_A4R4G4B4_UNORM;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_RGB5_A1:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
return PIPE_FORMAT_A1R5G5B5_UNORM;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_RGB5:
case GL_RGB4:
case GL_R3_G3_B2:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_A1R5G5B5_UNORM, surfType ))
return PIPE_FORMAT_A1R5G5B5_UNORM;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_ALPHA:
case GL_ALPHA4:
case GL_ALPHA12:
case GL_ALPHA16:
case GL_COMPRESSED_ALPHA:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8 ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8, surfType ))
return PIPE_FORMAT_U_A8;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case 1:
case GL_LUMINANCE:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
case GL_COMPRESSED_LUMINANCE:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8 ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8, surfType ))
return PIPE_FORMAT_U_A8;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case 2:
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
case GL_COMPRESSED_LUMINANCE_ALPHA:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8_L8 ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_A8_L8, surfType ))
return PIPE_FORMAT_U_A8_L8;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8 ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_I8, surfType ))
return PIPE_FORMAT_U_I8;
- return default_rgba_format( pipe );
+ return default_rgba_format( pipe, surfType );
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_YCBCR ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_YCBCR, surfType ))
return PIPE_FORMAT_YCBCR;
}
else {
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_YCBCR_REV ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_YCBCR_REV, surfType ))
return PIPE_FORMAT_YCBCR_REV;
}
return PIPE_FORMAT_NONE;
#endif
case GL_DEPTH_COMPONENT16:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z16_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z16_UNORM, surfType ))
return PIPE_FORMAT_Z16_UNORM;
/* fall-through */
case GL_DEPTH_COMPONENT24:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
return PIPE_FORMAT_S8Z24_UNORM;
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
return PIPE_FORMAT_Z24S8_UNORM;
/* fall-through */
case GL_DEPTH_COMPONENT32:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z32_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z32_UNORM, surfType ))
return PIPE_FORMAT_Z32_UNORM;
/* fall-through */
case GL_DEPTH_COMPONENT:
- return default_depth_format( pipe );
+ return default_depth_format( pipe, surfType );
case GL_STENCIL_INDEX:
case GL_STENCIL_INDEX1_EXT:
case GL_STENCIL_INDEX4_EXT:
case GL_STENCIL_INDEX8_EXT:
case GL_STENCIL_INDEX16_EXT:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_S8 ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_U_S8, surfType ))
return PIPE_FORMAT_U_S8;
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
return PIPE_FORMAT_S8Z24_UNORM;
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
return PIPE_FORMAT_Z24S8_UNORM;
return PIPE_FORMAT_NONE;
case GL_DEPTH_STENCIL_EXT:
case GL_DEPTH24_STENCIL8_EXT:
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_S8Z24_UNORM, surfType ))
return PIPE_FORMAT_S8Z24_UNORM;
- if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM ))
+ if (pipe->is_format_supported( pipe, PIPE_FORMAT_Z24S8_UNORM, surfType ))
return PIPE_FORMAT_Z24S8_UNORM;
return PIPE_FORMAT_NONE;
extern GLuint
st_choose_pipe_format(struct pipe_context *pipe, GLint internalFormat,
- GLenum format, GLenum type);
+ GLenum format, GLenum type, uint surfType);
extern const struct gl_texture_format *
/* fake frontbuffer */
/* XXX allocation should only happen in the unusual case
it's actually needed */
- struct gl_renderbuffer *rb = st_new_renderbuffer_fb(rgbFormat);
+ struct gl_renderbuffer *rb
+ = st_new_renderbuffer_fb(rgbFormat, GL_TRUE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_FRONT_LEFT, rb);
}
if (visual->doubleBufferMode) {
- struct gl_renderbuffer *rb = st_new_renderbuffer_fb(rgbFormat);
+ struct gl_renderbuffer *rb
+ = st_new_renderbuffer_fb(rgbFormat, GL_TRUE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_BACK_LEFT, rb);
}
if (visual->depthBits == 24 && visual->stencilBits == 8) {
/* combined depth/stencil buffer */
struct gl_renderbuffer *depthStencilRb
- = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT);
+ = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT, GL_FALSE);
/* note: bind RB to two attachment points */
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthStencilRb);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_STENCIL, depthStencilRb);
if (visual->depthBits == 32) {
/* 32-bit depth buffer */
struct gl_renderbuffer *depthRb
- = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT32);
+ = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT32, GL_FALSE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthRb);
}
else if (visual->depthBits == 24) {
/* 24-bit depth buffer, ignore stencil bits */
struct gl_renderbuffer *depthRb
- = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT);
+ = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT, GL_FALSE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthRb);
}
else if (visual->depthBits > 0) {
/* 16-bit depth buffer */
struct gl_renderbuffer *depthRb
- = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT16);
+ = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT16, GL_FALSE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthRb);
}
if (visual->stencilBits > 0) {
/* 8-bit stencil */
struct gl_renderbuffer *stencilRb
- = st_new_renderbuffer_fb(GL_STENCIL_INDEX8_EXT);
+ = st_new_renderbuffer_fb(GL_STENCIL_INDEX8_EXT, GL_FALSE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_STENCIL, stencilRb);
}
}
-#if 0
if (visual->accumRedBits > 0) {
/* 16-bit/channel accum */
struct gl_renderbuffer *accumRb
- = st_new_renderbuffer_fb(GL_RGBA16);
+ = st_new_renderbuffer_fb(GL_RGBA16, GL_FALSE);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_ACCUM, accumRb);
}
-#endif
-
- /* now add any/all software-based renderbuffers we may need */
- _mesa_add_soft_renderbuffers(&stfb->Base,
- GL_FALSE, /* never sw color */
- GL_FALSE, /* never sw depth */
- GL_FALSE, /* stencil */
- visual->accumRedBits > 0,
- GL_FALSE, /* never sw alpha */
- GL_FALSE /* never sw aux */ );
}
stfb->Base.Initialized = GL_TRUE;