*/
-#include "main/imports.h"
+
#include "main/context.h"
#include "main/fbobject.h"
#include "main/framebuffer.h"
#include "st_util.h"
#include "st_manager.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
#include "util/u_inlines.h"
#include "util/u_surface.h"
case PIPE_FORMAT_R8G8B8X8_UNORM:
case PIPE_FORMAT_B8G8R8X8_UNORM:
case PIPE_FORMAT_X8R8G8B8_UNORM:
+ case PIPE_FORMAT_R8G8B8_UNORM:
strb->Base.InternalFormat = GL_RGB8;
break;
case PIPE_FORMAT_R8G8B8A8_SRGB:
case PIPE_FORMAT_R16G16B16A16_UNORM:
strb->Base.InternalFormat = GL_RGBA16;
break;
+ case PIPE_FORMAT_R16G16B16_UNORM:
+ strb->Base.InternalFormat = GL_RGB16;
+ break;
case PIPE_FORMAT_R8_UNORM:
strb->Base.InternalFormat = GL_R8;
break;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
strb->Base.InternalFormat = GL_RGBA32F;
break;
+ case PIPE_FORMAT_R32G32B32X32_FLOAT:
+ case PIPE_FORMAT_R32G32B32_FLOAT:
+ strb->Base.InternalFormat = GL_RGB32F;
+ break;
case PIPE_FORMAT_R16G16B16A16_FLOAT:
strb->Base.InternalFormat = GL_RGBA16F;
break;
+ case PIPE_FORMAT_R16G16B16X16_FLOAT:
+ strb->Base.InternalFormat = GL_RGB16F;
+ break;
default:
_mesa_problem(NULL,
"Unexpected format %s in st_new_renderbuffer_fb",
* to determine if the rb is sRGB-capable.
*/
boolean enable_srgb = st->ctx->Color.sRGBEnabled &&
- _mesa_get_format_color_encoding(strb->Base.Format) == GL_SRGB;
+ _mesa_is_format_srgb(strb->Base.Format);
enum pipe_format format = resource->format;
if (strb->is_rtt) {
/* If the encoding is sRGB and sRGB rendering cannot be enabled,
* check for linear format support instead.
* Later when we create a surface, we change the format to a linear one. */
- if (!ctx->Extensions.EXT_sRGB &&
- _mesa_get_format_color_encoding(texFormat) == GL_SRGB) {
+ if (!ctx->Extensions.EXT_sRGB && _mesa_is_format_srgb(texFormat)) {
const mesa_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
format = st_mesa_format_to_pipe_format(st_context(ctx), linearFormat);
}
struct st_context *st = st_context(ctx);
struct pipe_resource *prsc;
- if (!att->Renderbuffer)
+ if (!att->Renderbuffer || !att->Complete)
return;
prsc = st_renderbuffer(att->Renderbuffer)->surface->texture;
struct st_context *st = st_context(ctx);
struct st_renderbuffer *strb = st_renderbuffer(rb);
struct pipe_context *pipe = st->pipe;
- const GLboolean invert = rb->Name == 0;
+ const GLboolean invert = flip_y;
GLuint y2;
GLubyte *map;
- /* driver does not support GL_FRAMEBUFFER_FLIP_Y_MESA */
- assert((rb->Name == 0) == flip_y);
-
if (strb->software) {
/* software-allocated renderbuffer (probably an accum buffer) */
if (strb->data) {