X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Frenderbuffer.c;h=38be8266e05c5bd6df0fa3e83e3f7525bbb0af84;hb=9b70c33e735ff060ddad7d0b501d19c670f41618;hp=a900de169e5aa2ba595cb45b362df1c7dfacf767;hpb=9bc1c92a0b809c6b60d5e4a2c8909f5f98528919;p=mesa.git diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index a900de169e5..38be8266e05 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -49,10 +49,6 @@ #include "rbadaptors.h" -#include "pipe/softpipe/sp_z_surface.h" -#include "pipe/p_state.h" -#include "pipe/p_defines.h" - /* 32-bit color index format. Not a public format. */ #define COLOR_INDEX32 0x424243 @@ -1095,8 +1091,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_ushort; rb->PutMonoValues = put_mono_values_ushort; rb->DepthBits = 8 * sizeof(GLushort); - rb->surface - = (struct pipe_surface *) softpipe_new_z_surface(PIPE_FORMAT_U_Z16); pixelSize = sizeof(GLushort); break; case GL_DEPTH_COMPONENT24: @@ -1119,8 +1113,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->_ActualFormat = GL_DEPTH_COMPONENT32; rb->DepthBits = 32; } - rb->surface - = (struct pipe_surface *) softpipe_new_z_surface(PIPE_FORMAT_U_Z32); pixelSize = sizeof(GLuint); break; case GL_DEPTH_STENCIL_EXT: @@ -1138,8 +1130,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoValues = put_mono_values_uint; rb->DepthBits = 24; rb->StencilBits = 8; - rb->surface - = (struct pipe_surface *) softpipe_new_z_surface(PIPE_FORMAT_Z24_S8); pixelSize = sizeof(GLuint); break; case GL_COLOR_INDEX8_EXT: @@ -1203,27 +1193,14 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, /* free old buffer storage */ if (rb->Data) { - if (rb->surface) { - /* pipe surface */ - } - else { - /* legacy renderbuffer */ - _mesa_free(rb->Data); - } + _mesa_free(rb->Data); rb->Data = NULL; } if (width > 0 && height > 0) { /* allocate new buffer storage */ - if (rb->surface) { - /* pipe surface */ - rb->surface->resize(rb->surface, width, height); - rb->Data = rb->surface->buffer.ptr; - } - else { - /* legacy renderbuffer */ - rb->Data = _mesa_malloc(width * height * pixelSize); - } + rb->Data = malloc(width * height * pixelSize); + if (rb->Data == NULL) { rb->Width = 0; rb->Height = 0; @@ -1511,11 +1488,16 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->InternalFormat = GL_NONE; rb->_ActualFormat = GL_NONE; rb->_BaseFormat = GL_NONE; - rb->DataType = GL_NONE; + + rb->ComponentType = GL_UNSIGNED_NORMALIZED; /* ARB_fbo */ + rb->ColorEncoding = GL_LINEAR; /* ARB_fbo */ + rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0; rb->IndexBits = 0; rb->DepthBits = 0; rb->StencilBits = 0; + + rb->DataType = GL_NONE; rb->Data = NULL; /* Point back to ourself so that we don't have to check for Wrapped==NULL