Commit graph

46533 commits

Author SHA1 Message Date
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
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
Bryan Cain
6da8c21124 glsl_to_tgsi: implement ir_binop_all_equal and ir_binop_any_nequal for native integers 2011-09-20 14:39:30 -05:00
Eric Anholt
c662764f4f i965/vs: Add support for compute-to-MRF.
Removes 1.8% of the instructions from 97% of the vertex shaders in
shader-db.
2011-09-20 11:28:56 -07:00
Eric Anholt
0502db1eab i965/vs: Do VUE writes using the MRF file instead of hardware register.
We'll only do compute-to-MRF on accesses to this file.
2011-09-20 11:28:56 -07:00
Eric Anholt
65d46c96c2 i965/vs: Handle destinations in the MRF file.
We've been referencing MRFs through the HW_REG file so far, but that
makes it harder to handle compute-to-MRF and similar optimizations.
2011-09-20 11:28:56 -07:00
Eric Anholt
160848d8ef i965/vs: Add a function for how many MRFs get written as part of a SEND.
This will be used for compute-to-mrf, which needs to know when MRFs
get overwritten.
2011-09-20 11:28:56 -07:00
Eric Anholt
63bc443f8a i965/vs: Remove dead fields of src_reg.
These were copy and pasted from the FS, and are never used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
f0c04e6c22 i965/vs: Add support for simple algebraic optimizations.
We generate silly code for array access, and it's easier to generally
support the cleanup than to specifically avoid the bad code in each
place we might generate it.

Removes 4.6% of instructions from 41.6% of shaders in shader-db,
particularly savage2/hon and unigine.

v2: Fixes by Ken: Make is_zero/one member functions, and fix a
    progress flag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
7288d010e0 i965: Fix polygon stipple offset state flagging.
_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
4c9b09d3c2 i965: Add missing _NEW_POLYGON flag to polygon stipple upload.
Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
c310c35a75 i965: Fix compiler warnings. 2011-09-20 10:20:06 -07:00
Yuanhan Liu
a11b4c1e7a mesa: fix error handling for glMaterial*
Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

Trigger GL_INVALID_VALUE error if the GL_SHININESS value is out side
[0, ctx->Constant.MaxShiniess].

v2: fix the max shininess value.

v3: suggested by Brian, move the face check into glMaterialfv function
    to reduce code duplicate. Also, refactor the error message.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-20 08:05:34 -06:00
Chia-I Wu
a5f8d37be1 st/egl: add support for null platform
The backend calls null_sw_create() to create sw_winsys.  And that is
pretty much it...
2011-09-20 17:44:20 +08:00
Chia-I Wu
5eca41665b egl: add null platform
The null platform has no window or pixmap surface (but pbuffer surface).
And the only valid display is EGL_DEFAULT_DISPLAY.  It is useful for
offscreen rendering.  It works everywhere becase no window system is
required.
2011-09-20 17:44:15 +08:00
Dave Airlie
fb4ceb9638 configs: remove rest of APP_LIB_DEPS lines
pointed out by GArik_ on #radeon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-20 08:25:25 +01:00
Kenneth Graunke
47b556fbca i965/fs: Implement texelFetch() on Gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Kenneth Graunke
0edf5d63d6 i965/fs: Implement texelFetch() on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00