Commit graph

48156 commits

Author SHA1 Message Date
Brian Paul
ff6cf60cb8 gallium/util: add util_format_is_srgb() helper 2011-09-22 08:26:36 -06:00
Keith Whitwell
553930424d util: add u_bit_scan helper 2011-09-22 08:26:36 -06:00
José Fonseca
ffb1996f61 util: Allow to make the depth/stencil format queries without repeatedly looking up the format description.
All functions here should take struct util_format_description * IMO, to
incentive efficient code.
2011-09-22 08:26:36 -06:00
Keith Whitwell
c40c1599bb util: single call to util_format_description in fill_rect 2011-09-22 08:26:35 -06:00
José Fonseca
f2a2ba9c6c util: Handle conversion between depth stencil formats. 2011-09-22 08:26:35 -06:00
Stéphane Marchesin
51f641291d i915g: Add an optimization to get rid of useless movs, in particular at the end of some shaders. 2011-09-21 18:01:43 -07:00
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
b152a239b1 GLES2/gl2ext: upgrade to gl2ext.h version 15049 2011-09-20 15:54:52 -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