mesa.git
12 years agoglapi: Add texture swizzle enums
Ian Romanick [Fri, 25 May 2012 18:34:42 +0000 (11:34 -0700)]
glapi: Add texture swizzle enums

These are from OpenGL 3.3, ARB_texture_swizzle, and
EXT_texture_swizzle (with different names).  I only added them to 3.3
because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglapi: Add a couple missing 3.0 enums
Ian Romanick [Fri, 25 May 2012 18:34:16 +0000 (11:34 -0700)]
glapi: Add a couple missing 3.0 enums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglapi: Add missing _NV extension on COMBINE4
Ian Romanick [Fri, 25 May 2012 18:33:39 +0000 (11:33 -0700)]
glapi: Add missing _NV extension on COMBINE4

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglapi: Add missing enums for GL_EXT_vertex_array
Ian Romanick [Fri, 25 May 2012 18:18:21 +0000 (11:18 -0700)]
glapi: Add missing enums for GL_EXT_vertex_array

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglapi: Add missing enums for GL_EXT_compiled_vertex_array
Ian Romanick [Fri, 25 May 2012 18:13:42 +0000 (11:13 -0700)]
glapi: Add missing enums for GL_EXT_compiled_vertex_array

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglx/tests: Add unit tests for generated code in indirect_init.c
Ian Romanick [Thu, 24 May 2012 17:21:03 +0000 (10:21 -0700)]
glx/tests: Add unit tests for generated code in indirect_init.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglx/tests: Add unit tests for generated code in indirect_size.c
Ian Romanick [Thu, 24 May 2012 16:08:56 +0000 (09:08 -0700)]
glx/tests: Add unit tests for generated code in indirect_size.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglx/tests: Rename test as glx-test
Ian Romanick [Tue, 29 May 2012 22:20:21 +0000 (15:20 -0700)]
glx/tests: Rename test as glx-test

This matches the existing test in src/glsl/tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglx: Move tests from tests/glx to src/glx/tests
Ian Romanick [Wed, 23 May 2012 22:23:22 +0000 (15:23 -0700)]
glx: Move tests from tests/glx to src/glx/tests

This matches the organization of other unit tests in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoutil: add some comments, fix indentation
Brian Paul [Tue, 12 Jun 2012 23:27:56 +0000 (17:27 -0600)]
util: add some comments, fix indentation

12 years agoglsl: Transform dot product by a basis vector into a swizzle
Matt Turner [Tue, 5 Jun 2012 01:59:34 +0000 (21:59 -0400)]
glsl: Transform dot product by a basis vector into a swizzle

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add is_basis function
Matt Turner [Mon, 4 Jun 2012 20:26:32 +0000 (16:26 -0400)]
glsl: Add is_basis function

Determines whether it's a basis vector, i.e., a vector with one element
equal to 1 and all other elements equal to 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Check for zero vectors in ir_binop_dot
Matt Turner [Mon, 4 Jun 2012 20:17:12 +0000 (16:17 -0400)]
glsl: Check for zero vectors in ir_binop_dot

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: move variable declaration out of loop to fix MSVC build
Brian Paul [Tue, 12 Jun 2012 22:31:33 +0000 (16:31 -0600)]
mesa: move variable declaration out of loop to fix MSVC build

12 years agomesa: Fix bool-int mismatch
Stéphane Marchesin [Tue, 12 Jun 2012 22:11:21 +0000 (15:11 -0700)]
mesa: Fix bool-int mismatch

Also include stdbool for windows.

12 years agomesa: Fix hash table leak
Antoine Labour [Fri, 25 May 2012 01:17:50 +0000 (18:17 -0700)]
mesa: Fix hash table leak

When a value was replaced, the new key was strdup'd and leaked.
To fix this, we modify the hash table implementation to return
whether the value was replaced and free() the (now useless)
duplicate string.

12 years agomesa: Free uniforms correclty.
Antoine Labour [Fri, 25 May 2012 01:15:44 +0000 (18:15 -0700)]
mesa: Free uniforms correclty.

This is an array of uniforms, not a single one.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agometa: Cleanup the resources we allocate.
Antoine Labour [Fri, 25 May 2012 01:08:27 +0000 (18:08 -0700)]
meta: Cleanup the resources we allocate.

When we have multiple shared contexts, and one of them is
long-running, this will lead to never freeing those resources
since they are shared. Instead, free them right away on context
destruction since we know the other context isn't using them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agoglx: Handle a null reply in QueryVersion.
Stéphane Marchesin [Fri, 25 May 2012 00:58:53 +0000 (17:58 -0700)]
glx: Handle a null reply in QueryVersion.

Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agoradeonsi: Don't always re-compile shaders after they're bound.
Michel Dänzer [Tue, 12 Jun 2012 18:18:24 +0000 (20:18 +0200)]
radeonsi: Don't always re-compile shaders after they're bound.

12 years agost/xorg: Fix crash on startup.
Dave Airlie [Fri, 8 Jun 2012 16:10:18 +0000 (18:10 +0200)]
st/xorg: Fix crash on startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: Use linear instead of constant interpolation for now.
Michel Dänzer [Fri, 8 Jun 2012 15:15:21 +0000 (17:15 +0200)]
radeonsi: Use linear instead of constant interpolation for now.

Constant interpolation still hangs the GPU for some reason.

12 years agoradeonsi: Handle SUB_f32.
Thomas Stellard [Thu, 7 Jun 2012 17:33:24 +0000 (19:33 +0200)]
radeonsi: Handle SUB_f32.

Signed-off-by: Thomas Stellard <tom.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1.
Michel Dänzer [Thu, 7 Jun 2012 17:30:47 +0000 (19:30 +0200)]
radeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1.

12 years agomesa: Build git_sha1.h before computing dependencies.
Eric Anholt [Tue, 12 Jun 2012 01:46:51 +0000 (18:46 -0700)]
mesa: Build git_sha1.h before computing dependencies.

Otherwise, version.c doesn't get a dependency on it in a clean build,
and then it doesn't necessarily get generated before version.c is
compiled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50976
Reviewed-by: Jakob Bornecrantz jakob@vmware.com
12 years agodocs: whitespaces cleanup
Andreas Boll [Tue, 12 Jun 2012 07:05:49 +0000 (09:05 +0200)]
docs: whitespaces cleanup

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: remove some superfluous <p> tags
Andreas Boll [Tue, 12 Jun 2012 07:05:46 +0000 (09:05 +0200)]
docs: remove some superfluous <p> tags

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: remove unused table styles
Andreas Boll [Tue, 12 Jun 2012 07:05:42 +0000 (09:05 +0200)]
docs: remove unused table styles

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: remove unused anchor links
Andreas Boll [Tue, 12 Jun 2012 07:05:39 +0000 (09:05 +0200)]
docs: remove unused anchor links

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: prefer lowercase html tags
Andreas Boll [Tue, 12 Jun 2012 07:05:36 +0000 (09:05 +0200)]
docs: prefer lowercase html tags

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: use id instead of <a name>
Andreas Boll [Tue, 12 Jun 2012 07:05:33 +0000 (09:05 +0200)]
docs: use id instead of <a name>

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs/subset-A.html: fix markup
Andreas Boll [Tue, 12 Jun 2012 07:05:30 +0000 (09:05 +0200)]
docs/subset-A.html: fix markup

fixes tidy warnings:

line 11 column 1 - Warning: <center> isn't allowed in <h1> elements
line 10 column 1 - Info: <h1> previously mentioned
line 11 column 34 - Warning: discarding unexpected </center>
line 14 column 1 - Warning: <center> isn't allowed in <h2> elements
line 13 column 1 - Info: <h2> previously mentioned
line 13 column 1 - Warning: missing </h2> before <h3>
line 18 column 1 - Warning: discarding unexpected </center>
line 19 column 1 - Warning: discarding unexpected </h2>

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs/news.html: use proper markup
Andreas Boll [Tue, 12 Jun 2012 07:05:26 +0000 (09:05 +0200)]
docs/news.html: use proper markup

fixes tidy warnings:

line 1227 column 9 - Warning: missing <li>
line 1228 column 17 - Warning: missing <li>
line 1235 column 25 - Warning: missing <li>
line 1259 column 17 - Warning: missing <li>
line 1267 column 9 - Warning: missing <li>
line 1359 column 9 - Warning: missing <li>
line 1361 column 55 - Warning: discarding unexpected </i>
line 1354 column 1 - Warning: trimming empty <p>

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: fix html end/start tags
Andreas Boll [Tue, 12 Jun 2012 07:05:22 +0000 (09:05 +0200)]
docs: fix html end/start tags

for more well-formed html

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: escape special html chars
Andreas Boll [Tue, 12 Jun 2012 07:05:15 +0000 (09:05 +0200)]
docs: escape special html chars

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodocs: consolidate html header and footer
Andreas Boll [Tue, 12 Jun 2012 07:05:03 +0000 (09:05 +0200)]
docs: consolidate html header and footer

add doctype
add character encoding
add missing <head> tag
unify html header and footer

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Unbind GL_TEXTURE_BUFFER on DeleteBuffers.
Kenneth Graunke [Sun, 10 Jun 2012 04:44:58 +0000 (21:44 -0700)]
mesa: Unbind GL_TEXTURE_BUFFER on DeleteBuffers.

Fixes oglconform's tbo/basic.buffer.delete test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Make glPrimitiveRestartIndex execute immediately in display lists.
Kenneth Graunke [Sun, 10 Jun 2012 01:06:17 +0000 (18:06 -0700)]
mesa: Make glPrimitiveRestartIndex execute immediately in display lists.

From the GL_NV_primitive_restart spec:
"PrimitiveRestartIndexNV is not compiled into display lists, but is
 executed immediately."

Prior to this patch, calls to glPrimitiveRestartIndex would hit the noop
dispatch stub.

+2 oglconforms.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Check for a negative "size" parameter in glCopyBufferSubData().
Kenneth Graunke [Sat, 9 Jun 2012 05:12:23 +0000 (22:12 -0700)]
mesa: Check for a negative "size" parameter in glCopyBufferSubData().

From the GL_ARB_copy_buffer spec:
"An INVALID_VALUE error is generated if any of readoffset, writeoffset,
 or size are negative [...]"

Fixes oglconform's copybuffer/negative.CNNegativeValues test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoautomake: Add AM_PROG_AR before LT_INIT to silence a lot of warnings.
Kenneth Graunke [Thu, 31 May 2012 04:54:21 +0000 (21:54 -0700)]
automake: Add AM_PROG_AR before LT_INIT to silence a lot of warnings.

The warnings appear to occur with newer automake (probably 1.12).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoscons: Fix scons build.
José Fonseca [Mon, 11 Jun 2012 18:38:07 +0000 (19:38 +0100)]
scons: Fix scons build.

12 years agoconfigure.ac: Add --with-(gl|glu|osmesa)-lib-name options
Brad King [Tue, 5 Jun 2012 17:59:58 +0000 (13:59 -0400)]
configure.ac: Add --with-(gl|glu|osmesa)-lib-name options

These allow one to mangle the library names, without also mangling the
symbol names, to make them distinct from other GL libraries on the
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Put a bunch of optimization visitors under anonymous namespaces.
Eric Anholt [Tue, 29 May 2012 23:18:37 +0000 (16:18 -0700)]
glsl: Put a bunch of optimization visitors under anonymous namespaces.

Because these classes are used entirely from their own source files
and not from separate DSOs, the linker gets to produce massively less
code.  This cuts about 13k of text in the libdricore case.  In the
non-libdricore case, the additional linkage information allows the
compiler to inline some code, so libglsl.a size actually increases by
about 300 bytes.

For a dricore build, improves shader_runner runtime on
glsl-fs-copy-propagation-texcoords-1 by 0.21% +/- 0.03% (n=353574,
outliers removed).  No statistically significant difference with n=322
on glslparsertest on a yofrankie shader intended to test compiler
performance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Merge the dricore libglsl build into libdricore.
Eric Anholt [Tue, 29 May 2012 21:55:40 +0000 (14:55 -0700)]
automake: Merge the dricore libglsl build into libdricore.

Now we have just one library of "all of Mesa core" instead of both
libdricore and libglsl that drivers link against.

I did this change in a sort of nonrecursive make fashion: the
generated files are still produced in the non-automake build, like the
rest of dricore, but the GLSL files are stuffed into libdricore
without building a convenience library in src/glsl (even though we
could now).  This would make a bit more sense if glsl was just another
dir under src/mesa, because right now I had to contort the prefix
variable name to look another ../ level up.

12 years agoautomake: Add a prefix variable for libglsl sources.
Eric Anholt [Tue, 29 May 2012 21:45:10 +0000 (14:45 -0700)]
automake: Add a prefix variable for libglsl sources.

See e86c40a84d241b954594f5ae7df9b9c3fc797a4e for reasoning.  In the
process I did s/:=/=/ to shut up automake about nonportable make syntax.

12 years agoautomake: Convert src/Makefile to automake.
Eric Anholt [Tue, 15 May 2012 17:21:31 +0000 (10:21 -0700)]
automake: Convert src/Makefile to automake.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Move top-level makefile to automake.
Eric Anholt [Tue, 15 May 2012 01:38:54 +0000 (18:38 -0700)]
automake: Move top-level makefile to automake.

This is part of a series to fix our build issues in the automake case
by hooking up the automatic Makefile regeneration support.  The
extract_git_sha1 is moved into src/mesa/Makefile so that we get
correct dependency generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Globally add stub automake targets to the old Makefiles.
Eric Anholt [Tue, 15 May 2012 17:32:43 +0000 (10:32 -0700)]
automake: Globally add stub automake targets to the old Makefiles.

I tried to update all the old Makefiles that included the default
config to be sure they had a default target if they didn't previously
have one, since this new all target will always point at it.  Almost
everything had one.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Move the version information right into configure.ac.
Eric Anholt [Tue, 15 May 2012 01:43:15 +0000 (18:43 -0700)]
mesa: Move the version information right into configure.ac.

Nothing else called version.mk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoautomake: Remove the old static configs system.
Eric Anholt [Tue, 15 May 2012 01:26:30 +0000 (18:26 -0700)]
automake: Remove the old static configs system.

With the incremental automake conversion, we'd broken those that
included glx or egl.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoandroid: fix the build
Tapani Pälli [Thu, 7 Jun 2012 11:11:31 +0000 (14:11 +0300)]
android: fix the build

Some more of the files are now autogenerated, this caused build breakage,
patch adds generation of these missing files. Patch also changes existing
make so that the files are created to be part of the local source
(not intermediate directory, this causes several problems).

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
12 years agoi915g: Fix depth/stencil glClear
Michael Karcher [Sat, 9 Jun 2012 23:49:30 +0000 (01:49 +0200)]
i915g: Fix depth/stencil glClear

This patch fixes a copy/paste error and masking of depth/stencil (stencil
is in the top 8 bits), and makes glean/readPixSanity happy.

Both the stencil and the depth buffer piglit test also pass if
glClear(DEPTH | STENCIL) is executed instead of
glClear(DEPTH)/glClear(STENCIL).

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agomesa: Fix "glCopyBuffserSubData" typos in error messages and comments.
Kenneth Graunke [Sat, 9 Jun 2012 05:03:50 +0000 (22:03 -0700)]
mesa: Fix "glCopyBuffserSubData" typos in error messages and comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Clean up warnings about deleting classes without virtual destructors.
Eric Anholt [Mon, 14 May 2012 23:48:47 +0000 (16:48 -0700)]
glsl: Clean up warnings about deleting classes without virtual destructors.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: fix deref_hash memory leak in constant_expression_value
Marcin Slusarz [Tue, 5 Jun 2012 19:10:33 +0000 (21:10 +0200)]
glsl: fix deref_hash memory leak in constant_expression_value

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglcpp: .gitignore cleanup
Andreas Boll [Fri, 8 Jun 2012 17:55:51 +0000 (19:55 +0200)]
glcpp: .gitignore cleanup

*.o, *.lo and *~ are already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: .gitignore cleanup
Andreas Boll [Fri, 8 Jun 2012 17:55:50 +0000 (19:55 +0200)]
glapi: .gitignore cleanup

remove archaic .cvsignore
*.pyo is already in toplevel .gitignore
*.pyc is already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogallivm: Fix calculating rho for 3d textures for the single-quad case
Roland Scheidegger [Thu, 24 May 2012 19:05:13 +0000 (21:05 +0200)]
gallivm: Fix calculating rho for 3d textures for the single-quad case

Discovered by accident, this looks like a very old typo bug.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agoi965: Add forgotten bitcast operations in brw_fs_channel_expressions.
Kenneth Graunke [Thu, 7 Jun 2012 18:20:18 +0000 (11:20 -0700)]
i965: Add forgotten bitcast operations in brw_fs_channel_expressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: allow all buffer formats provided src and dst match.
Paul Berry [Wed, 6 Jun 2012 18:17:32 +0000 (11:17 -0700)]
i965/blorp: allow all buffer formats provided src and dst match.

Previously, blits using the "blorp" mechanism only worked for 8-bit
RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers.
This was not enough, because the blorp mechanism must be used for
blitting whenever MSAA is in use.  This patch allows all formats to be
used, provided the source and destination formats match.

So far I have confirmed that the following formats work properly with
MSAA:
- GL_RGB
- GL_RGBA
- GL_ALPHA
- GL_ALPHA4
- GL_ALPHA8
- GL_R3_G3_B2
- GL_RGB4
- GL_RGB5
- GL_RGB8
- GL_RGB10
- GL_RGB12
- GL_RGB16
- GL_RGBA2
- GL_RGBA4
- GL_RGB5_A1
- GL_RGBA8
- GL_RGB10_A2
- GL_RGBA12
- GL_RGBA16

Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on
Sandy Bridge and Ivy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: Implement logic for additional buffer formats.
Paul Berry [Wed, 6 Jun 2012 18:05:02 +0000 (11:05 -0700)]
i965/blorp: Implement logic for additional buffer formats.

Previously the blorp engine only supported RGBA8 color buffers and
24-bit depth buffers.  This patch adds support for any color buffer
format that is supported as a render target, and for 16-bit and 32-bit
depth buffers.

This required threading the brw_context struct through into
brw_blorp_surface_info::set() so that it can consult the
brw->render_target_format array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.
Paul Berry [Wed, 6 Jun 2012 17:59:56 +0000 (10:59 -0700)]
i965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.

Even though brw_blorp_surface_info is derived from brw_blorp_mip_info,
this function doesn't need to be virtual, because it is never accessed
through a base class pointer.  Making the function non-virtual will
allow it to take additional parameters in the brw_blorp_surface_info
case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/blorp: Refactor surface format determination.
Paul Berry [Wed, 6 Jun 2012 17:34:12 +0000 (10:34 -0700)]
i965/blorp: Refactor surface format determination.

This patch moves the responsibility for deciding on the format of the
source and destination surfaces from the
gen{6,7}_blorp_emit_surface_state() functions to
brw_blorp_surface_info::set(), which is shared between Gen6 and Gen7.
This will make it possible to add support for more surface formats
without code duplication.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Enable the GL_ARB_shader_bit_encode extension.
Kenneth Graunke [Thu, 7 Jun 2012 07:11:28 +0000 (00:11 -0700)]
i965: Enable the GL_ARB_shader_bit_encode extension.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agost/mesa: Finally activate the ARB_shader_bit_encoding extension.
Olivier Galibert [Tue, 8 May 2012 18:40:37 +0000 (20:40 +0200)]
st/mesa: Finally activate the ARB_shader_bit_encoding extension.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in the software renderers.
Olivier Galibert [Tue, 8 May 2012 18:40:36 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in the software renderers.

TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene).  Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_constant_expression.
Olivier Galibert [Tue, 8 May 2012 18:40:35 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_constant_expression.

A "test_out = floatBitsToUint(-1.0);" fired through the GLSL compiler
gives a correct "(assign (x) (var_ref test_out)
(constant uint (3212836864)))"

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_validate.
Olivier Galibert [Tue, 8 May 2012 18:40:34 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_validate.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Bitwise conversion operator support in ir_expression.
Olivier Galibert [Tue, 8 May 2012 18:40:33 +0000 (20:40 +0200)]
glsl: Bitwise conversion operator support in ir_expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: New unary opcodes for ARB_shader_bit_encoding support.
Olivier Galibert [Tue, 8 May 2012 18:40:32 +0000 (20:40 +0200)]
glsl: New unary opcodes for ARB_shader_bit_encoding support.

The opcodes are bitcast_f2u, bitcast_f2i, bitcast_i2f and bitcast_u2f.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Scaffolding for ARB_shader_bit_encoding.
Olivier Galibert [Mon, 30 Apr 2012 11:19:01 +0000 (13:19 +0200)]
glsl: Scaffolding for ARB_shader_bit_encoding.

That adds support for activating the extension.  It doesn't actually
*do* anything yet, of course.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.
Kenneth Graunke [Wed, 6 Jun 2012 06:51:04 +0000 (23:51 -0700)]
mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.

From the issues section of the GL_ARB_texture_compression_rgtc extension:

15) What should glGetTexLevelParameter return for
    GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1
    formats?  What should glGetTexLevelParameter return for
    GL_TEXTURE_BLUE_SIZE for the RGTC2 formats?

    RESOLVED:  Zero bits.

    These formats always return 0.0 for these respective components
    and have no bits devoted to these components.

    Returning 8 bits for red size of RGTC1 and the red and green
    sizes of RGTC2 makes sense because that's the maximum potential
    precision for the uncompressed texels.

Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats
and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats.  BLUE should be 0.

Fixes oglconform/rgtc/advanced.texture_fetch.tex_param.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: Hook up loop_variable_state destructor to plug a memory leak.
Kenneth Graunke [Tue, 5 Jun 2012 22:58:41 +0000 (15:58 -0700)]
glsl: Hook up loop_variable_state destructor to plug a memory leak.

While ~loop_state() is already freeing the loop_variable_state objects
via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor
was never getting called, so the hash table inside loop_variable_state
was never getting destroyed.

Fixes a memory leak in any shader with loops.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoradeon/llvm: Emulate RECIP_UINT instruction on Cayman
Tom Stellard [Wed, 6 Jun 2012 17:24:48 +0000 (13:24 -0400)]
radeon/llvm: Emulate RECIP_UINT instruction on Cayman

12 years agoradeon/llvm: Remove some duplicate code in the R600 CodeEmitter
Tom Stellard [Wed, 6 Jun 2012 15:40:34 +0000 (11:40 -0400)]
radeon/llvm: Remove some duplicate code in the R600 CodeEmitter

12 years agoradeon/llvm: Fix MULLO* instructions on Cayman
Tom Stellard [Wed, 6 Jun 2012 15:35:48 +0000 (11:35 -0400)]
radeon/llvm: Fix MULLO* instructions on Cayman

On Cayman, the MULLO* instructions must fill all slots in an
instruction group.

12 years agor600g: Compute support for Cayman
Tom Stellard [Tue, 5 Jun 2012 17:11:11 +0000 (13:11 -0400)]
r600g: Compute support for Cayman

12 years agoxorg: port to new compat API.
Dave Airlie [Wed, 6 Jun 2012 14:20:24 +0000 (15:20 +0100)]
xorg: port to new compat API.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: consolidate internal glCompressedTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCompressedTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glCompressedTexImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCompressedTexImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glCopyTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glCopyTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glTexSubImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glTexSubImage1/2/3D code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: consolidate internal glTexImage1/2/3D code
Brian Paul [Tue, 5 Jun 2012 22:32:23 +0000 (16:32 -0600)]
mesa: consolidate internal glTexImage1/2/3D code

The functions for handling 1D, 2D and 3D texture images were nearly
identical.  This folds them all together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agotranslate_test: add support for half floats
Brian Paul [Tue, 5 Jun 2012 15:03:45 +0000 (09:03 -0600)]
translate_test: add support for half floats

Fixes assertion reported in
https://bugs.freedesktop.org/show_bug.cgi?id=44519
but there's still failing cases.

12 years agodocs: remove documentation of old Makefile system
Brian Paul [Fri, 1 Jun 2012 15:19:36 +0000 (09:19 -0600)]
docs: remove documentation of old Makefile system

It's going away in the near future.

12 years agoradeon/llvm: Remove obselete hooks for the ConvertToISA pass
Tom Stellard [Wed, 6 Jun 2012 00:10:31 +0000 (20:10 -0400)]
radeon/llvm: Remove obselete hooks for the ConvertToISA pass

We can't remove this pass yet, because we need it to convert AMDIL
registers in BRANCH* instructions, but we don't need it for
instruction conversion any more.

12 years agoradeon/llvm: Remove AMDIL MOVE* instructions
Tom Stellard [Wed, 6 Jun 2012 00:48:41 +0000 (20:48 -0400)]
radeon/llvm: Remove AMDIL MOVE* instructions

12 years agoradeon/llvm: Add isMov() to AMDILInstrInfo
Tom Stellard [Sat, 2 Jun 2012 13:51:04 +0000 (09:51 -0400)]
radeon/llvm: Add isMov() to AMDILInstrInfo

This enables the CFGStructurizer to work without the AMDIL::MOV*
instructions.

12 years agoradeon/llvm: Remove deadcode from the AMDILISelLowering class
Tom Stellard [Sat, 2 Jun 2012 13:51:04 +0000 (09:51 -0400)]
radeon/llvm: Remove deadcode from the AMDILISelLowering class

12 years agoradeon/llvm: Don't lower RETURN to S_ENDPGM on SI
Tom Stellard [Sat, 2 Jun 2012 11:57:54 +0000 (07:57 -0400)]
radeon/llvm: Don't lower RETURN to S_ENDPGM on SI

Instead create an S_ENDPGM instruction in the CodeEmitter and emit
it after all the other instructions.

12 years agoradeon/llvm: Remove AMDIL VCREATE* instructions
Tom Stellard [Sat, 2 Jun 2012 11:09:16 +0000 (07:09 -0400)]
radeon/llvm: Remove AMDIL VCREATE* instructions

This obsoletes the AMDGPULowerInstruction pass.

12 years agoradeon/llvm: Remove AMDIL LOADCONST* instructions
Tom Stellard [Sat, 2 Jun 2012 10:16:18 +0000 (06:16 -0400)]
radeon/llvm: Remove AMDIL LOADCONST* instructions

This obsoletes the R600LowerInstruction and SIPropagateImmReads passes.

12 years agonouveau: fix scratch buffer leak
Marcin Slusarz [Tue, 5 Jun 2012 21:26:05 +0000 (23:26 +0200)]
nouveau: fix scratch buffer leak

...and create common function for destroying nouveau_context

12 years agonv50: fix nv50_stream_output_state leak
Marcin Slusarz [Tue, 5 Jun 2012 18:26:54 +0000 (20:26 +0200)]
nv50: fix nv50_stream_output_state leak

12 years agonv50: fix symbol table memory leak
Marcin Slusarz [Tue, 5 Jun 2012 18:18:33 +0000 (20:18 +0200)]
nv50: fix symbol table memory leak

12 years agoi965/fs: Fix user-defined FS outputs with less than four components.
Kenneth Graunke [Fri, 1 Jun 2012 20:16:58 +0000 (13:16 -0700)]
i965/fs: Fix user-defined FS outputs with less than four components.

OpenGL allows you to declare user-defined fragment shader outputs with
less than four components:

    out ivec2 color;

This makes sense if you're rendering to an RG format render target.

Previously, we assumed that all color outputs had four components (like
the built-in gl_FragColor/gl_FragData variables).  This caused us to
call emit_color_write for invalid indices, incrementing the output
virtual GRF's reg_offset beyond the size of the register.

This caused cascading failures: split_virtual_grfs would allocate new
size-1 registers based on the virtual GRF size, but then proceed to
rewrite the out-of-bounds accesses assuming that it had allocated enough
new (contiguously numbered) registers.  This resulted in instructions
that accessed size-1 GRFs which register numbers beyond
virtual_grf_next (i.e. registers that were never allocated).

Finally, this manifested as live variable analysis and instruction
scheduling accessing their temporary array with an out of bounds index
(as they're all sized based on virtual_grf_next), and the program would
segfault.

It looks like the hardware's Render Target Write message requires you to
send four components, even for RT formats such as RG or RGB.  This patch
continues to use all four MRFs, but doesn't bother to fill any data for
the last few, which should be unused.

+2 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965/vs: Fix texelFetchOffset() on pre-Gen7.
Kenneth Graunke [Mon, 4 Jun 2012 21:12:15 +0000 (14:12 -0700)]
i965/vs: Fix texelFetchOffset() on pre-Gen7.

Commit 4650aea7a536ddce120576fadb91845076e8e37a fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

NOTE: This and 4650aea7a536ddce are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/fs: Fix texelFetchOffset() on pre-Gen7.
Kenneth Graunke [Mon, 4 Jun 2012 21:07:13 +0000 (14:07 -0700)]
i965/fs: Fix texelFetchOffset() on pre-Gen7.

Commit f41ecade7b458c02d504158b522acb2231585040 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

NOTE: This and f41ecade7b458 are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agometa: Fix GL_RENDERBUFFER binding in decompress_texture_image().
Kenneth Graunke [Mon, 4 Jun 2012 18:40:23 +0000 (11:40 -0700)]
meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().

This isn't saved/restored by _mesa_meta_begin, so we need to do it
manually (like we do for the read/draw framebuffers).  Additionally,
we neglected to re-bind before the glRenderbufferStorage call.

+13 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Unbind ARB_transform_feedback2 binding points on Delete too.
Kenneth Graunke [Mon, 4 Jun 2012 07:51:34 +0000 (00:51 -0700)]
mesa: Unbind ARB_transform_feedback2 binding points on Delete too.

DeleteBuffer needs to unbind from these binding points as well, based on
the same rationale as the previous patch.

+51 oglconforms (together with the last patch).

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>