Commit graph

48156 commits

Author SHA1 Message Date
Brian Paul
01cd9a7d92 vbo: remove unreachable _mesa_error() call
If mode is not GL_POINT/LINE/FILL we'll have already reported the
error earlier in the function and returned so we can never get here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:40 -07:00
Brian Paul
89efc1b839 mesa: move _mesa_error() call in compressedteximage()
We shouldn't call _mesa_error() if the target is a proxy texture.
Errors are handled later in the function.
Fixes a Coverity warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
9ec5050898 mesa: fix potential mem leak in generate_mipmap_compressed()
Fixes a coverity warning.

Reviewed-by: Vinson Lee <vlee@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
98ebe833fe glsl: return visit_stop in ir_validate::visit_enter() to silence warning 2011-12-02 07:22:39 -07:00
Brian Paul
06913497d6 mesa: fix some minor texstore comments
For the texsubimage commands, we're not mapping the whole image/region.
2011-12-02 07:22:39 -07:00
Brian Paul
b4aecc4e18 mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88
R is in the high byte, G in the low byte.
2011-12-02 07:22:39 -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
0be753a143 mesa: fix unpacking of RG88_REV texels
R should be in the high byte and G in the low byte for this format.
2011-12-02 07:22:39 -07:00
Kenneth Graunke
e304aa3600 i965: Make gen6_resolve_implied_move a no-op for MRF sources.
Attempting to move an MRF to a MRF is not only pointless, it will fail
because MRFs are read-only, resulting in garbage in your register.

If we already set up a MRF source, there's nothing to resolve anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-02 02:49:23 -08:00
Mathias Fröhlich
ce45aecfda mesa: Renumber the tnl attributes to match VERT_ATTRIB*.
Also renumber the tnl modules vertex attributes to match
the renumbered VERT_ATTRIB_* values.

This should fix

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

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Mathias Fröhlich
a4f345e0d2 mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges.
The BITSET64_{TEST,SET,CLEAR}_RANGE macros only work on ranges
wither in the lower 32 or in the upper 32 bits of the bitset.
This change extends these macros to work on arbitrary ranges
possibly crossing the bitset word boundary.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Stéphane Marchesin
52b75c6165 i915g: Implement GL_STREAM_* for textures by using untiled textures. 2011-12-01 18:12:56 -08:00
Stéphane Marchesin
d269ce0a39 i915g: Add unsupported PIPE_SHADER_CAP_OUTPUT_READ to silence warnings. 2011-12-01 18:09:18 -08:00
Chia-I Wu
912f7b6bfe docs: list GL_OES_compressed_ETC1_RGB8_texture in 7.12 release notes
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:47 +08:00
Chia-I Wu
cde6c91fd5 st/mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Have st/mesa recognize MESA_FORMAT_ETC1_RGB8 then we are good to advertise the
extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
5c31eb78e5 gallium: add PIPE_FORMAT_ETC1_RGB8
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
d4a38e86d4 mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa.  There is no
driver support yet.

Unlike desktop GL compressed texture formats, GLES compressed texture formats
usually can only be used with glCompressedTexImage2D.  All other gl*Tex*Image*
functions are updated to check for that.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
51f4d27254 mesa: add ETC1 decoding routines
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.  These routines
will be used in the following commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
4eae2b37a8 glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
35b506148e glapi: add GL_OES_compressed_ETC1_RGB8_texture for GLES
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:44 +08:00
Mathias Fröhlich
a4c952f36f swrast: Fix signed/unsigned problems with negative strides.
In swrast_map_renderbuffer negative strides lead to
render buffer map pointers that are off by 2^32.
Make sure that intermediate negative values are not
converted to an unsigned.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 21:44:57 +01:00
Vinson Lee
de93347d48 u_vbuf: Silence uninitialized variable warnings.
Fixes these GCC warnings.
u_vbuf.c: In function ‘u_vbuf_draw_begin’:
u_vbuf.c:839:20: warning: ‘max_index’ may be used uninitialized in this function [-Wuninitialized]
u_vbuf.c:838:20: warning: ‘min_index’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 11:41:14 -08:00
Alex Deucher
5df2d18f70 r600g: add some new pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-01 11:06:49 -05:00
Brian Paul
e10942c8e9 mesa: fix unpack_ARGB1555_REV()
We weren't doing the necessary byte swap.

v2: use same arithmetic as unpack_ARGB1555() to be consistent.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-12-01 08:07:34 -07:00
Brian Paul
478f0d228b mesa: fix indentation in attrib.c 2011-11-30 20:35:02 -07:00
Eric Anholt
51e5a266c1 i965/fs: Fix regression in fbo-alphatest-nocolor.
In the refactor for handling user-defined out params, we failed to set
up the new color output tracking when there was no color drawbuffer in
place but alpha testing was on.  Just always set up at least one when
handling gl_FragColor, since we won't make use of its value unless we
need to.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42806
2011-11-30 11:23:26 -08:00
Eric Anholt
a3b8c5ed5b i965/fs: Make register file enum 0 be the undefined register file.
In 6d874d0ee1, I checked whether a
register that had been stored was BAD_FILE (as opposed to a legitimate
GRF), but actually the unset register was ARF NULL because it had been
memset to 0.  Finding BAD_FILE for unset values in debugging was my
intention with that file, so make it the case more often by
rearranging the enum.  There was only one place we relied on the magic
enum register_file to hardware register file correspondance anyway.
2011-11-30 11:23:26 -08:00
Eric Anholt
c6abde211f i965: Don't perform the precompile on fragment shaders by default.
It is useful to have this option for shader-db, and it was also good
at the time where we were rejecting shaders due to various internal
limits we hadn't supported yet.  However, at this point the precompile
step takes extra time (since not all NOS is known at link time) and
spews misleading debug in the common case of debugging a real app.

This is left in place for VS, where we still have a couple of codegen
failure paths that result in link failure through precompile.  Those
need to be fixed.

shader-db can still get at the debug info it wants using
"shader_precompile=true" driconf option.  Long term, we can probably
build a good-enough app for shader-db to trigger real codegen.
2011-11-30 11:22:53 -08:00
Kai Wasserbäch
0a22fb6a5d gallium/failover: Remove the deprecated module.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-30 17:26:40 +00:00
Brian Paul
15245cbad4 st/mesa: fix indentation 2011-11-30 07:09:46 -07:00
Brian Paul
efcf5aa13f mesa: use _mesa_is_bufferobj() in update_array() 2011-11-30 06:57:38 -07:00
Brian Paul
529fa77529 mesa: use Elements() macro in program printing code 2011-11-30 06:57:37 -07:00
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