Commit Graph

47974 Commits

Author SHA1 Message Date
Brian Paul c67d9cfd9d mesa: fix signed/unsigned comparison warning 2011-11-30 06:57:37 -07:00
Brian Paul c3a57841a3 mesa: fix MESA_FORMAT_RG88 format match test
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-30 06:57:37 -07:00
Brian Paul 76374e60cd mesa: fix printf format warning in _mesa_fprint_program_parameters() 2011-11-30 06:57:37 -07:00
Brian Paul 1ad5a1a246 tnl: s/INLINE/inline/ 2011-11-30 06:57:37 -07:00
Brian Paul 22ad02b3ff mesa: regenerated dispatch.h (s/INLINE/inline/) 2011-11-30 06:57:37 -07:00
Brian Paul 919c835835 glapi: s/INLINE/inline/ for dispatch.h file 2011-11-30 06:57:36 -07:00
Brian Paul ea472ffe67 swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entries
When new MESA_FORMAT_x enums are added we need to add a new entry in
the table of texture fetch functions.  In the past this has been
missed if swrast isn't actually tested.  Using a static assertion
should help with that.
2011-11-30 06:57:36 -07:00
Brian Paul 15be8b4bf0 mesa: add STATIC_ASSERT() macro for compile-time assertions
This can be used to check that tables have the right number of entries,
etc. at compile-time.  This will hopefully catch things that are missed
if particular drivers aren't tested, for example.

v2: Simplify the macro to omit the extra line number info (the compiler
already indicates the line number).  And wrap the macro for readability.
2011-11-30 06:57:36 -07:00
Brian Paul 25c8a112ab mesa: access pixels as GLushort in unpack_SL8()
Per the format comments and the texstore code, use a GLushort to access the
pixel.  The code was OK as-is on little endian machines.
2011-11-30 06:57:36 -07:00
Eric Anholt 2134d2f35b mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().
There was only one consumer of this API, meta.c, which was intending
to ask "is this format just stencil index (and nothing else)?".
Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
formats, it would just try to draw the stencil parts.  Nothing good
came of this.

This function looks rather silly at this point, but I'm leaving it in
place to be the obvious parallel API to _mesa_is_depth_format().  Note
that if you want the old behavior, you should use it as
(_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
commonly done for depth-related tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt ed945b0bc7 mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.
Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny
-- there's a float depth channel, and a stencil channel that doesn't
have a particular GLenum associated with its type, so what's the
correct response?

Because there is no query for stencil, just make this format's
datatype be that of the depth channel.  It fixes the depth query (and
thus a failure in piglit gl-3.0-required-sized-formats), and none of
the other consumers of the _mesa_get_format_datatype() API care.

v2: Add a comment for why the DataType is this way for this format.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt d2235b0f46 i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.
We were already doing it through the shader (layered underneath
GL_EXT_texture_swizzle) in the shadow compare case.  This avoids
having per-format logic for switching out the surface format dependent
on the depth mode.

v2: Also do the swizzling for DEPTH_STENCIL.  oops.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt f98bfb5d68 i965: Fix EXT_texture_swizzle with a writemask in the FFFS/FP backend.
I tripped over this bug in the next commit, relying on our
EXT_texture_swizzle to do some shadow sampler-related swizzling.  If a
writemask was masking out a channel of the destination that was a live
channel of the texture swizzle, it would read undefined values.

Fixes piglit ARB_fragment_program_shadow/masked.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt d84a180417 i965: Base HW depth format setup based on MESA_FORMAT, not bpp.
This will make handling new formats (like actually exposing Z32F)
easier and more reliable.

v2: Remove the check for hiz buffer -- the MESA_FORMAT should really
    be giving us the value we want even for hiz.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Kai Wasserbäch ccd4d4367f gallium/cell: Remove the driver.
Complicates Gallium3D development and doesn't seem to have active users.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 20:26:53 +00:00
Eric Anholt 09e67706e9 i965: Don't depth test the fake depthbuffer when one isn't present.
For the non-separate-stencil-only case, we've been using a NULL
surface for depth, so we didn't have to care.  However, to support
separate stencil with no depthbuffer, we have to make the depth
surface non-NULL or the stencil test always fails thanks to separate
stencil inheriting the surface type of depth.

Fixes hiz-depth-stencil-test-d0-s8.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 11:18:23 -08:00
Ian Romanick e6c314f7d2 mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES
Page 77 (page 91 of the PDF) says about glGetActiveAttrib:

    "The returned attribute name can be the name of a generic
    attribute or a conventional attribute (which begin with the prefix
    "gl_", see the OpenGL Shading Language specification for a
    complete list)."

Page 261 (page 275 of the PDF) says about glGetProgramiv:

    "If pname is ACTIVE_ATTRIBUTES, the number of active attributes in
    program is returned."

It doesn't say anything about built-in vs. user-defined attributes.
From the language around glGetActiveAttrib and the lack of an
exclusion of built-in attributes, which exists other places (e.g.,
around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES
should include the active attribute count.  It should also be included
in the values returned by glGetActiveAttrib.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Yi Sun <yi.sun@intel.com>
2011-11-29 11:14:28 -08:00
Chad Versace 03bbcd447c swrast: Fix some static analysis warnings
To each switch statement in s_texfilter.c, add a break statement to the
default case.

Eliminates the Eclipse static analysis warning: No break at the end of
this case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 10:36:15 -08:00
José Fonseca 10b07665be Remove windows kernel support code.
Not actively used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:56 +00:00
José Fonseca 57f8e26ca8 gallium/auxiliary: Remove os_stream.
XP kernel mode was the only subsystem lacking stdio FILES.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:30 +00:00
Kai Wasserbäch 23a8a7fe8c docs: Removed i965 entry in the source tree listing.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:50 +00:00
Kai Wasserbäch 5383c9c7be docs: Added item to release notes for 7.12.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:48 +00:00
José Fonseca c8db5a3d53 st/vega: Fix warnings about dllimport attributes on windows. 2011-11-29 15:55:40 +00:00
Kai Wasserbäch 2c27f204f1 i965g: Delete this driver.
Never completed, and no plans to do so.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 15:44:09 +00:00
Chia-I Wu 76ba431b97 mesa: distinct gl_client_array arrays are gone
Fix build errors since 762c9766c9.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
2011-11-29 17:13:01 +08:00
Mathias Fröhlich 762c9766c9 mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.
Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:37:19 +01:00
Mathias Fröhlich dca6a28a14 mesa: Make gl_program::InputsRead 64 bits.
Make gl_program::InputsRead a 64 bits bitfield.
Adapt the intel and radeon driver to handle a 64 bits
InputsRead value.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich f364ac1da1 mesa: Make gl_array_object::_Enabled 64 bits.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich ed42c25807 vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich 104b81def4 mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*
Consolidate the two distinct set of flags to use VERT_BIT_*.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich b57101302d mesa: Introduce more symbolic VERT_{ATTRIB,BIT}* defines.
Introduce a set of defines for VERT_ATTRIB_* and VERT_BIT_*
that will be used in the followup patches.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Yuanhan Liu a0a5bd4bb3 mesa: move ElementArrayBufferObj to gl_array_object
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

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-29 09:48:50 +08:00
Brian Paul 4ff212aac3 mesa: update comments for _mesa_format_matches_format_and_type(), 80-column wrapping 2011-11-28 18:10:30 -07:00
Brian Paul 0cbdead62e mesa: add component comments for sRGB formats 2011-11-28 18:10:30 -07:00
Brian Paul ae70caf7eb mesa: update texstore comments for R/G textures 2011-11-28 18:10:30 -07:00
Brian Paul 50b91aa305 mesa: fix comments for RG formats
The position of the red and green bits was misstated in the comments.
Arguably, the names of these formats should be changed to "GR" to reflect
the component ordering and to be consistent with other formats.
2011-11-28 18:10:30 -07:00
Brian Paul 6856472689 st/mesa: don't try to allocate zero-sized renderbuffers
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047
and https://bugs.freedesktop.org/show_bug.cgi?id=43048

Note: This is a candidate for the 7.11 branch.

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 18:10:30 -07:00
Daniel Vetter 8f15c31338 gallium/i965g: hide that utterly broken driver better
And warn loudly in case people want to use it. Too many tester report
gpu hangs on irc and we rootcause this ...

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-28 23:54:47 +01:00
Brian Paul e32ada1b26 swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINT
As with the other integer-valued formats, use NULL until we support
integer textures.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 15:40:11 -07:00
Brian Paul 5c84e961e3 mesa: remove unused gl_texture_object::DriverData field 2011-11-28 10:07:19 -07:00
Brian Paul c5012c1d56 mesa: handle MapTextureImage() failures in mipmap generation code
And handle potential malloc failures too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul e984085299 mesa: handle MapTextureImage() failures in glGetTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul 1ad88fb42d mesa: handle MapTextureImage() failures in glTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul e68994494b mesa: fix frag shader generation for alpha test with no color buffers
If alpha test is enabled and there's no color buffers we still need the
fragment shader to emit a color.

v2: add _NEW_COLOR flag in _mesa_update_state_locked()

Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net> (i965)
2011-11-28 08:13:04 -07:00
Brian Paul 56b870e441 mesa: check for null ptr in _mesa_is_bufferobj()
This simplifies a few callers.  And it adds a bit of robustness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-11-28 08:07:32 -07:00
Brian Paul 37bf720da4 mesa: move _mesa_base_format_has_channel() into image.c
This is where other format-related functions live.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:32 -07:00
Brian Paul d45c9b239f mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queries
Use the _mesa_base_format_has_channel() helper as we do for the
other texture format component queries.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:26 -07:00
Brian Paul f0b6e9a729 mesa: use _mesa_base_format_has_channel() in fbobject.c queries
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:09 -07:00
Brian Paul 858d1f0b1c mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()
The source array elements are 8-bytes (float + uint) so we need
to multiply the src index by 2 to get the right array stride.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-28 08:04:48 -07:00
Dave Airlie ee47e19738 mesa/docs: add ARB_texture_rgb10_a2ui to relnotes/gl3.txt
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00