Commit Graph

241 Commits

Author SHA1 Message Date
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Fabian Bieler
c7339d42c6 mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared.

At least with the gallium state tracker this can actually occur if st_render_texture fails.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 07:51:01 -06:00
Brian Paul
db0f9e701d mesa: added _mesa_get_attachment_teximage() helpers 2011-04-05 07:51:01 -06:00
Marek Olšák
0be369975f mesa: initial EXT_texture_snorm support
The component ordering of some formats has been been reversed to match
Gallium types.
2011-03-29 12:04:55 +02:00
Vinson Lee
4f94e0b76a mesa: Add missing parentheses in glBlitFramebufferEXT error strings. 2011-03-28 20:32:01 -07:00
Marek Olšák
a674ef7814 mesa: return after invalidating renderbuffer 2011-03-07 23:33:36 +01:00
Marek Olšák
df818d572e mesa: invalidate framebuffer if internal format of renderbuffer is changed
RenderTexture doesn't have to be called in invalidate_rb, I guess.
2011-03-07 23:27:35 +01:00
Brian Paul
c6991433ef mesa: consolidate framebuffer target lookup code 2011-02-28 18:24:25 -07:00
Brian Paul
ca1b551562 mesa: s/mesaFormat/attFormat/ 2011-02-28 18:23:23 -07:00
Brian Paul
6364d75008 mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebuffer 2011-02-18 10:34:25 -07:00
Dave Airlie
88ffa9ce5b mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)
This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new
constant to say that the driver can support sRGB enabled FBOs since enabling
the extension doesn't mean the driver can actually support sRGB.

Also adds the suggested state flush in the core code suggested by Brian.

fix the ARB_fbo color encoding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-05 17:06:30 +10:00
Brian Paul
b3cfcdf923 mesa: fix typo, wrap long line 2011-01-28 20:25:26 -07:00
Brian Paul
d30156525f mesa: add red, red/green formats in _mesa_base_fbo_format() 2011-01-24 19:38:52 -07: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
976ea9d76b mesa: new cases in _mesa_base_fbo_format()
The set of internalFormat parameters accepted by glRenderBufferStorage
depends on the EXT vs. ARB version of framebuffer_object.  The later
added support for GL_ALPHA, GL_LUMINANCE, etc. formats.  Note that
these formats might be legal but might not be supported.  That should
be checked with glCheckFramebufferStatus().
2011-01-24 19:38:52 -07:00
Brian Paul
f41bbc7c44 Revert "mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages."
This reverts commit 65c41d55a0.

There really are quite a few differences in the set of internal
formats allowed by glTexImage and glRenderbufferStorage.
2011-01-24 19:38:52 -07:00
Marek Olšák
81ae8c6313 mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Eric Anholt
65c41d55a0 mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages.
The comment of "this is just like teximages except for..." is a pretty
good clue that we're handling this wrong.  By just using the teximage
code, we catch a bunch of cases we'd missed, like GL_RED and GL_RG.
2011-01-14 13:57:15 -08:00
Dave Airlie
7f652fc523 srgb: fix fbo base format picking.
Pointed out by Brian.
2011-01-14 14:58:47 +10:00
Dave Airlie
8c8e26d66a mesa/fbo: prevent assert trigger on i965 with piglit fbo-srgb test. 2011-01-13 15:17:34 +10:00
Brian Paul
dd973cd9e8 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:14:18 -07:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -08:00
Eric Anholt
5f13c39484 mesa: Also report the number of renderbuffer alpha bits for GL_LUMINANCE_ALPHA.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
f45aea0ec9 mesa: Also report renderbuffer red/green size for GL_RED and GL_RG.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
059cca92a8 mesa: Use the common logic for "is this baseformat a color format?"
When figuring out whether a renderbuffer should be used to set the
visual bits of an FBO, we were missing important baseformats like
GL_RED, GL_RG, and GL_LUMINANCE.
2011-01-03 13:28:24 -08:00
Eric Anholt
beac6ee62a mesa: Allow color renderbuffers besides just RGB and RGBA.
We did so already for textures to do ARB_fbo's
GL_ALPHA/GL_LUMINANCE/etc. support and for ARB_texture_rg's GL_RED and
GL_RG, but this path was missed.
2011-01-03 13:22:38 -08:00
Brian Paul
ecb7cc3319 mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.
2010-12-06 17:10:05 -07:00
Brian Paul
6d13ec7dc0 mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).

See http://bugs.freedesktop.org/show_bug.cgi?id=31947

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:32:29 -07:00
Brian Paul
20cf1851d8 mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.

See http://bugs.freedesktop.org/show_bug.cgi?id=30993

Note that piglit fbo-getframebufferattachmentparameter-01 still does
not pass.  But Mesa behaves the same as the NVIDIA driver in this case.
Perhaps the test is incorrect.

NOTE: This is a candidate for the 7.9 branch.
2010-12-03 08:24:51 -07:00
Brian Paul
412b960883 mesa: rename function to _mesa_is_format_integer_color()
Be a bit more clear about its operation.
2010-10-26 20:30:42 -06:00
Marek Olšák
6e61853590 mesa: allow FBO attachments of formats LUMINANCE, LUMINANCE_ALPHA, and INTENSITY
As per the GL_ARB_framebuffer_object specification.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-10-24 23:14:01 +02:00
Brian Paul
c7d18374dd mesa: compute _IntegerColor field in _mesa_test_framebuffer_completeness() 2010-10-23 10:19:30 -06:00
Brian Paul
e67f6ee96e mesa: simplify fbo format checking code 2010-10-23 10:19:29 -06:00
Brian Paul
f9288540ec mesa: 80-column wrapping 2010-10-23 10:19:29 -06:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Ian Romanick
421f4d8dc1 ARB_texture_rg: Allow RED and RG textures as FBO color buffer attachments 2010-10-01 15:49:13 -07:00
Kristian Høgsberg
144356f992 mesa: Don't reuse DummyFramebuffer as the incomplete framebuffer
Binding framebuffer 0 on a context that doesn't have a winsys drawable
will try to bind the incomplete framebuffer.  That fails when that's
also the dummy framebuffer.
2010-09-09 17:08:12 -04:00
Eric Anholt
50a3349bee mesa: Set the base format of GL_ALPHA FBOs and teach swrast about it.
Fixes assertion failures in fbo-alpha with a debug build of Mesa.
Bug #29781.
2010-09-07 14:34:23 -07:00
Vinson Lee
c5dde53f4e mesa: Fix printf-like warnings. 2010-09-02 16:03:32 -07:00
Vladimir Vukicevic
0731701236 mesa: initialize dummy framebuffer and renderbuffer mutexes
See fd.o bug 29909.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-01 08:54:23 -06:00
Kristian Høgsberg
9456e22c7a intel: Implement EGL_KHR_surfaceless extension 2010-07-28 23:07:09 -04:00
Zack Rusin
da7bd6a90e mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the
stuff.
linking, gl_VerticesIn and multidimensional inputs are left.
2010-06-28 22:53:21 -04:00
Brian Paul
61ec205816 mesa: fix attachment error checking for glGetFramebufferAttachmentParameteriv()
This is a follow-on to commit 80dfec3e53.

The valid attachments for glGetFramebufferAttachmentParameteriv() depends
on whether we're querying the default FBO or a user-created FBO.
2010-06-22 21:55:51 -06:00
Kristian Høgsberg
80dfec3e53 mesa: Allow querying the system FBO in GetFramebufferAttachmentParameteriv
If the default framebuffer is bound to <target>, then
        <attachment> must be one of FRONT_LEFT, FRONT_RIGHT, BACK_LEFT,
        BACK_RIGHT, AUXi, DEPTH_BUFFER, or STENCIL_BUFFER, identifying a
        color buffer, the depth buffer, or the stencil buffer, and
        <pname> may be FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE or
        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.

as well as these <pname> values

        FRAMEBUFFER_ATTACHMENT_RED_SIZE,
        FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
        FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,
        FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
        FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
        FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
        FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, or
        FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING.

https://bugs.freedesktop.org/show_bug.cgi?id=28551
2010-06-15 13:28:38 -04:00
Eric Anholt
262cdbd957 mesa: Allow GL_ALPHA FBOs with ARB_framebuffer_object.
Drivers still reject them today, but cairo would like to use these.
2010-06-10 00:22:01 -07:00
Brian Paul
23c5b21c16 mesa: whitespace and 80 column wrapping 2010-06-02 15:34:49 -06:00
Brian Paul
a504f2387e mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially
non-existant) current attachment.

Fixes segfault w/ fbotexture -ds2.

NOTE: this will be applied to the 7.8 branch too.
2010-05-27 13:11:08 -06:00
Kristian Høgsberg
e88cef3c9d mesa: Reenable check for GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
The check was disabled when FEATURE_OES_framebuffer_object was enabled,
since that used to mean we weren't implementing regular OpenGL semantics.
Now that we can compile in support for multiple APIs, change the #ifdef to
compile the check in when FEATURE_GL is enabled and enable the check for
contexts that implement OpenGL at runtime.
2010-05-24 16:56:56 -04:00
Brian Paul
8ea614832d mesa: use GL_RGBA16_SNORM for accum buffer 2010-05-09 21:19:42 -06:00