Commit graph

41082 commits

Author SHA1 Message Date
Stéphane Marchesin
fc1fbb2dc1 i915g: Fix some whitespace problems. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
bfe507bcff i915g: Blend equation separate seems to work. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
ef1fa4467f i915g: Add ifdef'd out code to dump compiled shaders. 2011-09-21 18:01:40 -07:00
Stéphane Marchesin
9a15b1eb95 i915g: Fix bug in shader optimizer. 2011-09-21 18:01:39 -07:00
Stéphane Marchesin
ca8492c284 i915g: Remove stale function prototype. 2011-09-21 18:01:38 -07:00
Brian Paul
559a0cd1fc svga: call u_default_redefine_user_buffer() to fix failed assertion
This fixes a regression from a8cf4b6acf

The problem occured when two successive glDrawArrays calls accessed
subsequent elements in user-space arrays.  The user-space array
from the first call wasn't being grown to accomodate the second
draw call's elements.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-21 16:32:00 -06:00
Eric Anholt
a140c3e783 meta: Don't hang on to program refcounts after metaops are done.
Fixes piglit ARB_shader_objects/clear-with-deleted.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-21 10:17:54 -07:00
Eric Anholt
d4444b8e5b i965/vs: Return a dummy value when visiting ir_texture.
While the program won't successfully link in the end, this avoids
possible assertion failure in the driver during linking if
this->result isn't initialized with something already.
2011-09-21 09:46:39 -07:00
Eric Anholt
d158f6e73b i965/gen6+: When only BFC is written, use BFC as the color.
Fixes piglit vertex-program-two-side enabled back back2
2011-09-21 09:46:39 -07:00
Eric Anholt
447c488d77 i965/gen6+: Respect the VERTEX_PROGRAM_TWO_SIDE flag for shaders.
Fixes piglit:
vertex-program-two-side enabled front back front2 back2
vertex-program-two-side enabled front back
vertex-program-two-side enabled front2 back2
2011-09-21 09:46:39 -07:00
Eric Anholt
b68e3422ed mesa: Add a context flag indicating whether two-sided lighting should happen.
The 965 driver was ignoring the VERTEX_PROGRAM_TWO_SIDE flag and only
looking at fixed-function state.
2011-09-21 09:46:38 -07:00
Brian Paul
169f57255a util: remove stray debug code 2011-09-21 08:26:29 -06:00
Brian Paul
0e6646db32 mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()
We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was
done in Yuanhan Liu's original patch.

Take geometry shaders support into account too.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-21 08:22:07 -06:00
Brian Paul
51002968c9 gallivm: fix build with llvm 3.0svn
https://bugs.freedesktop.org/show_bug.cgi?id=41065
2011-09-21 07:24:03 -06:00
Brian Paul
4ef82cee6d tnl: include swrast/s_chan.h to fix sse build 2011-09-21 06:49:33 -06:00
Chia-I Wu
4a96a02de7 st/vega: fix drawing images with alpha channel
Checking if the paints are opaque in renderer_validate_blend() does not
work.  We could be drawing images.  Remove the check from
renderer_validate_blend() and take image drawing into consideration in
blend_use_shader().

The bug was introduced by 3f0a966807,
which affects the lookup demo.
2011-09-21 12:01:21 +08:00
Chia-I Wu
ceb6d34906 st/vega: fix vg_context_is_object_valid()
vg_context_is_object_valid() checks if a handle is valid by checking if
the handle is a valid key of the object hash table.  However, the keys
of the object hash table were object pointers.

Fix vg_context_add_object() to use the handles as the keys so that
vg_context_is_object_valid() works.  This bug was introduced by
99c67f27d3.
2011-09-21 12:01:03 +08:00
Brian Paul
bdddf1cc26 swrast: s/GLubyte/GLchan/ in a cast 2011-09-20 21:06:19 -06:00
Brian Paul
72648c25e6 llvmpipe: silence a pointer type warning 2011-09-20 20:33:45 -06:00
Brian Paul
de740d7b0a meta: use _mesa_set_enable() in more places
Avoids an extra context lookup.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
9e414865a6 meta: use _mesa_set_enable(), fix decompress_texture_image()
Use _mesa_set_enable() to avoid a redudant context lookup.
Need to disable the texture target in decompress_texture_image() so the
unit isn't still enabled after glGetTexImage() returns.  Arguably, the
meta restore code should do this, but it doesn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
20b92c9d1e st/mesa: specify source mipmap level in decompress_with_blit()
This, along with the previous patch, fixes glGetTexImage() of compressed
textures for level > 0.
2011-09-20 20:17:42 -06:00
Brian Paul
f63dbc600f gallium/util: observe sampler view's first_level in util_blit_pixels_tex()
This lets us blit from a non-zero source level.
2011-09-20 20:17:42 -06:00
Brian Paul
1e939f5374 meta: fix broken sRGB mipmap generation
If we're generating a mipmap for an sRGB texture we need to bypass
sRGB->linear conversion.  Otherwise the destination mipmap level
(drawn with a textured quad) will have the wrong colors.
If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode)
we need to use the software fallback for mipmap generation.

Note: This is a candidate for the 7.11 branch.
2011-09-20 20:17:42 -06:00
Brian Paul
4731a598f0 mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros
The 1-bit alpha channel was incorrectly encoded.  Previously, any non-zero
alpha value for the ubyte alpha value would set A=1.  Instead, use the
most significant bit of the ubyte alpha to determine the A bit.  This is
consistent with the other channels and other OpenGL implementations.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-09-20 20:17:42 -06:00
Brian Paul
4d53fb525d mesa: move last bits of GLchan stuff into swrast
This removes the last remnants of the GLchan datatype and associated
macros out of core Mesa and into swrast.
2011-09-20 20:17:42 -06:00
Brian Paul
ef275f907c mesa: remove CHAN_TYPE cruft from debug.c 2011-09-20 20:17:41 -06:00
Brian Paul
59e858f462 mesa: remove unused interp/stride chan macros 2011-09-20 20:17:41 -06:00
Brian Paul
460863ace9 mesa: remove unused UNCLAMPED_FLOAT_TO_RGB_CHAN() macro 2011-09-20 20:17:41 -06:00
Brian Paul
499f0685e8 radeon: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
8530d72c4e r200: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
d71c03836e mesa: remove unused <type>_TO_CHAN() macros 2011-09-20 20:17:41 -06:00
Brian Paul
e1d703bec5 mesa: convert _mesa_unpack_color_span_chan() to ubyte 2011-09-20 20:17:41 -06:00
Brian Paul
ae670b58d4 mesa: replace GLchan with GLubyte in texcompress_s3tc.c 2011-09-20 20:17:41 -06:00
Brian Paul
b4e6afbf77 mesa/gallium: remove GLchan from latc, rgtc code 2011-09-20 20:17:41 -06:00
Brian Paul
960694fd2d mesa: remove GLchan in texcompress_fxt1.c 2011-09-20 20:17:41 -06:00
Brian Paul
663f61a3e1 mesa: s/_mesa_make_temp_chan_image()/_mesa_make_temp_ubyte_image()
Another step toward eliminating the GLchan type.
2011-09-20 20:17:41 -06:00
Brian Paul
ece8d6f25c mesa: move _mesa_upscale_teximage2d() to texcompress_fxt1.c
Was used by no other code.
2011-09-20 20:17:41 -06:00
Brian Paul
529b9360f3 mesa: s/GLchan/GLubyte/ in mipmap generation code 2011-09-20 20:17:41 -06:00
Kenneth Graunke
dbae496083 make: Don't use builtin_stubs.cpp for standalone GLSL compiler.
builtin_stubs.cpp is only supposed to be used for builtin_compiler.  It
contains a stub version of _mesa_glsl_initialize_functions() that does
nothing.

libglsl.a already contains builtin_function.cpp, the generated file that
contains a version of _mesa_glsl_initialize_functions() that actually
initializes all the built-in functions.

By mistakenly linking to builtin_stubs, glsl_compiler and glsl_test are
unable to compile any shaders that use built-in functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-09-20 18:21:45 -07:00
Ian Romanick
011e946cb0 mesa: Don't expose compressed paletted formats via GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS
Fixes a bug introduced by commit faf5d65.  These formats should only
be exposed in OpenGL ES 1.x.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: Xun Fang <xunx.fang@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40860
2011-09-20 15:42:05 -07:00
Brian Paul
977e269c3e gallium: remove trailing comma to silence warning 2011-09-20 16:36:21 -06:00
Paul Berry
8b06b0d19d Gallium: Increase PIPE_MAX_CLIP_PLANES to 8.
Since Mesa is now capable of supporting up to 8 clipping planes
instead of 6, this patch updates Gallium internals to support 8
clipping planes as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
bc00370832 Gallium: remove unnecessary ifdef for MAX_CLIPPED_VERTICES.
draw_pipe_clip.c contained an ifdef to ensure that its local
definition of MAX_CLIPPED_VERTICES would not take effect if the global
MAX_CLIPPED_VERTICES (defined in src/mesa/main/config.h) was already
defined.  This was unnecessary because draw_pipe_clip.c doesn't
directly or indirectly include src/mesa/main/config.h.  Removed the
ifdef to reduce confusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
61b2d01101 Increase MAX_CLIP_PLANES to 8
This will allow drivers to increase ctx->Const.MaxClipPlanes to 8,
which is required for GLSL-1.30 compliance.

No driver behavior should be affected.  However, many data structures
use MAX_CLIP_PLANES as an array size, so these arrays will get
slightly larger.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:13 -07:00
Paul Berry
2dfa33a5e9 Hardcode the default value of ctx->Const.MaxClipPlanes to 6.
Previously this value was set to MAX_CLIP_PLANES, which is defined to
be 6.  But MAX_CLIP_PLANES needs to be increased to 8 to support
GLSL-1.30-compliant drivers.  This patch hard-codes the default value
of ctx->Const.MaxClipPlanes to 6, so that when MAX_CLIP_PLANES is
increased, it won't affect drivers that do not support 8 clip planes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:10 -07:00
Paul Berry
8be653164d i965: Remove bogus assertion on MAX_CLIP_PLANES.
This patch removes the assertion "MAX_CLIP_PLANES == 6" from the i965
driver.  This assertion is unnecessary; nothing in the driver requires
MAX_CLIP_PLANES to be 6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:07 -07:00
Paul Berry
27bdc76eb9 mesa: Update clipping code to use ctx->Const.MaxClipPlanes.
To support GLSL 1.30, we will need to increase MAX_CLIP_PLANES to 8.
To avoid breaking drivers that do not yet support 8 clip planes, this
patch modifies the Mesa core code that pertains to clipping to use
ctx->Const.MaxClipPlanes rather than MAX_CLIP_PLANES, since
ctx->Const.MaxClipPlanes will remain 6 for drivers that only support 6
clip planes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:03 -07:00
José Fonseca
c773de133a scons: Unbreak mingw build. 2011-09-20 20:50:48 +01:00
José Fonseca
f8aeb1c990 scons: MacOSX build fixes. 2011-09-20 20:41:57 +01:00