Commit Graph

88 Commits

Author SHA1 Message Date
Brian Paul
c73245882c mesa: pass context parameter to gl_renderbuffer::Delete()
We sometimes need a rendering context when deleting renderbuffers.
Pass it explicitly instead of trying to grab a current context
(which might be NULL).  The next patch will make use of this.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:06 -07:00
Brian Paul
8472bb4508 mesa: fix-up and use _mesa_delete_renderbuffer()
_mesa_delete_renderbuffer() should free the mutex (though that may be a
no-op) and then free the renderbuffer object itself.  Subclasses of
gl_renderbuffer can use this function too.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-31 08:04:40 -06:00
Brian Paul
59a5b5a193 mesa: remove gl_renderbuffer::Wrapped
There's no such thing as renderbuffer wrappers anymore.
2012-01-24 14:12:27 -07:00
Brian Paul
f6a3979a04 mesa: move freeing of software renderbuffers into swrast 2012-01-24 14:12:25 -07:00
Brian Paul
f9874feef4 mesa: remove gl_renderbuffer::DataType 2012-01-24 14:12:24 -07:00
Brian Paul
0d2f0c8bb8 mesa: remove obsolete PutRow, etc assignments 2012-01-24 14:12:17 -07:00
Brian Paul
36ede89687 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:58:45 -07:00
Brian Paul
7a7b521ff2 mesa: remove gl_renderbuffer::PutRowRGB()
No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
fc41473b9f mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers.  The later wasn't used
anywhere!  Remove them and all implementations of those functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
eb3e1d8888 mesa: simplify _mesa_remove_renderbuffer() 2011-12-08 08:56:31 -07:00
Brian Paul
e4bb884dfb mesa: remove software-based renderbuffer code from core Mesa
We're now using the functions that live in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
14721dfe99 mesa: make some renderbuffer functions static
The functions to allocate software color, depth, accum, etc buffers aren't
called from anywhere else.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
0a3c895f34 mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88
To better reflect the component ordering and be consistent with other
format names.
2011-12-02 07:22:39 -07:00
Brian Paul
371b1648ab mesa: remove support for software alpha buffers
This was only used by the xlib driver to add an alpha channel to the
front/window color buffer.  This was no longer going to work well with
the move to direct mapping of renderbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
f4fb0be605 mesa: fix the selection of soft renderbuffer color formats
This fixes a regression from the recent glReadPixels changes found
with the piglit hiz tests.

Use either MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV for color
buffers depending on endian-ness.  Before, the gl_renderbuffer::Format
field was MESA_FORMAT_RGBA8888 but the data was really stored as
MESA_FORMAT_RGBA8888_REV when using a little endian machine.

Getting this right matters now that we can access renderbuffer data
without going through the span functions (namely glReadPixels() +
MapRenderbuffer()).
2011-11-07 14:25:48 -07:00
Brian Paul
0ef8c0ddc7 mesa: remove unneeded soft renderbuffer format-setting code
These vars will just get overwritten when we call _mesa_add_renderbuffer()
anyway.  We only need to set the InternalFormat field when we create the
software renderbuffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-07 14:25:48 -07:00
Yuanhan Liu
1f5bd65efa mesa: fix inital value for new renderbuffer
EXT_framebuffer_object bspec says:

    Get Value                          Type    Get Command 		Initial Value
    -------------------------------    ------  -----------      	-----------
    RENDERBUFFER_INTERNAL_FORMAT_EXT   Z+     GetRenderbufferParameterivEXT  RGBA

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:22:15 +08:00
Eric Anholt
76d1275474 Add MapRenderbuffer implementations for software drivers.
Mesa core's is generic for things like osmesa.

For swrast_dri.so, we have to do Y flipping.  The front-buffer path
isn't actually tested, though, because both before and after it fails
with a BadMatch in XGetImage.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Brian Paul
74142f1bf2 mesa: use inline function wrapper for _mesa_reference_renderbuffer() 2011-07-14 08:14:13 -06:00
Marek Olšák
1165280cbd mesa: initial ARB_depth_buffer_float support
Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there.
The spec says the type is n/a.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:16 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Brian Paul
fdb04c0384 mesa: work around failed assertion for GL_RGBA16_SNORM accum buffer
We use this format to represent the accum buffer.  No snorm texture
sampling or rendering takes place.

Fixes failed assertion with swrast and any app using the accum buffer
(and glxinfo).
2011-04-04 14:37:28 -06:00
Brian Paul
62c66b3430 mesa: plug in fallback function for ctx->Driver.ValidateFramebuffer()
The software renderer doesn't support GL_ALPHA, GL_LUMINANCE, etc
so we should report GL_FRAMEBUFFER_UNSUPPORTED during FBO validation.
2011-01-24 19:38:52 -07:00
Brian Paul
65da73c5f8 mesa: s/GLuint/gl_buffer_index/ 2011-01-03 14:01:41 -07:00
Brian Paul
fc70c05dbd mesa: fix aux/accum comment and error message mixups 2010-11-02 09:56:04 -06:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Nicolas Kaiser
9674929bce main: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Brian Paul
8ea614832d mesa: use GL_RGBA16_SNORM for accum buffer 2010-05-09 21:19:42 -06:00
Brian Paul
d148e25953 mesa: remove some color index code 2010-05-04 21:59:54 -06:00
Brian Paul
7f07ac80eb mesa: remove renderbuffer adaptor calls
Was only used for OSMesa but no longer needed.
2010-05-04 21:59:54 -06:00
Ian Romanick
3d0f608e13 mesa: Remove _mesa_add_color_index_renderbuffers
After all the recent color-index visual support removal,
_mesa_add_color_index_renderbuffers is no longer used anywhere.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-03 12:37:04 -08:00
Ian Romanick
22a96f3058 mesa: Remove checks of Visual.rgbMode
This must always be true now, so there is no reason to check it.  Ever.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-03 12:37:04 -08:00
Brian Paul
fe25476c04 mesa: fix _BaseFormat assignment in _mesa_soft_renderbuffer_storage()
The rb->InternalFormat field will be set by the caller if the allocation
succeeds.  Until then, this field's value can't be used.  Fixes a failed
assertion with FlightGear.
2010-02-26 09:03:34 -07:00
Brian Paul
a858bc393e mesa: added renderbuffer->_BaseFormat assertion 2010-02-25 20:11:54 -07:00
Kristian Høgsberg
32f2fd1c5d Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions 2010-02-19 12:03:01 -05:00
Brian Paul
6bf1ea897f mesa: replace _mesa_bzero() with memset() 2010-02-19 08:32:36 -07:00
Kenneth Graunke
26f8fad145 Remove _mesa_memset in favor of plain memset.
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19 09:18:57 -05:00
Kenneth Graunke
c7ac486261 Remove _mesa_memcpy in favor of plain memcpy.
This may break the SUNOS4 build, but it's no longer relevant.
2010-02-19 09:18:36 -05:00