Compare commits

...

3931 Commits

Author SHA1 Message Date
Ian Romanick
2d85170eb7 docs: Add 9.0.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-16 13:52:15 -08:00
Andreas Boll
d4540c5f3d build: add missing files to tarballs target
fixes errors ./configure and make was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 8a9f0fdeab)
2012-11-14 23:20:31 +01:00
Andreas Boll
fcb9f25989 build: add missing Makefile.in files to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit bc08f26485)
2012-11-14 23:20:30 +01:00
Andreas Boll
d0533029ce build: add config.sub and config.guess to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit a0a90ea920)
2012-11-14 23:20:30 +01:00
Andreas Boll
4510df5464 mesa: use .cherry-ignore in the get-pick-list.sh script
NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit ca8988673b)
2012-11-14 23:19:25 +01:00
Andreas Boll
bf1fb345af mesa: add initial .cherry-ignore file for the 9.0 branch
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-14 23:18:21 +01:00
Jonas Ådahl
2332bc26d4 wayland: Destroy frame callback when destroying surface
If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit a3b6b2d305)
2012-11-08 10:49:06 -08:00
Fredrik Höglund
d26890688f egl_dri2/x11: Fix eglPostSubBufferNV()
This got broken in commit 0a523a8820.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
(cherry picked from commit f42518962a)
2012-11-08 10:49:01 -08:00
Ian Romanick
c4f392aafb mesa: Bump version to 9.0.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-08 10:47:44 -08:00
Ian Romanick
129d9d5078 docs: Add 9.0.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-08 10:45:13 -08:00
Kenneth Graunke
895a5873d1 glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b45a68eebf)
2012-11-02 11:31:11 -07:00
Ian Romanick
4b507f809c glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
(cherry picked from commit 7b0f912e70)
2012-11-02 11:31:11 -07:00
Matt Turner
94cc306e41 ralloc: Annotate printf functions with PRINTFLIKE(...)
This is a squash of the following two commits:

    ralloc: Annotate printf functions with PRINTFLIKE(...)

    Catches problems such as (in the gles3 branch)

    glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
    glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
    	'long long int', but argument 4 has type 'int' [-Wformat]

    As a side-effect, remove ralloc.c's likely/unlikely macros and just use
    the ones from main/compiler.h.

    NOTE: This is a candidate for the release branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 41b14d1251)

and

    src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS

    When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
    are not used. AM_CPPFLAGS should be used for includes anyway.

    Fixes a build problem since 41b14d125:

    CC       ralloc_test-ralloc.o
    In file included from ../../../src/glsl/ralloc.c:42:0:
    ../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

    Acked-by: Paul Berry <stereotype441@gmail.com>
    (cherry picked from commit 67f1e7bf5f)
2012-11-02 11:30:26 -07:00
Matt Turner
4be397e164 build: Ship install-sh in the tarball
Fixes the problem where configure from the tarball would report missing
files:

$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in bin

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit ec57fbbc72)
2012-11-02 11:10:04 -07:00
Matt Turner
6a3c578dcd Re-add HAVE_PTHREADS preprocessor macro
Broken in commit 814345f54b.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 9a51edfb5a)
2012-11-02 11:10:01 -07:00
Adam Jackson
8d00f077c9 glx: Add GLXBadProfileARB to the error string list
Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit a30d14635d)
2012-11-02 11:08:53 -07:00
Owen W. Taylor
8aab8a50d3 glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()
Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 1d0c621121)
2012-11-02 11:08:38 -07:00
Matt Turner
cf7634d966 egl: Return EGL_BAD_MATCH for invalid profile attributes
Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 587d5db11d)
2012-11-02 11:08:06 -07:00
Kristian Høgsberg
2a81037439 wayland: Drop support for ill-defined, unused wl_egl_pixmap
It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
2012-10-31 14:08:18 -04:00
Kristian Høgsberg
b565197c5c wayland: Remove 0.85 compatibility #ifdefs 2012-10-31 14:08:18 -04:00
Kristian Høgsberg
a5776ac0b8 egl/wayland: Update to Wayland 0.99 API
The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
2012-10-31 14:08:18 -04:00
Kristian Høgsberg
79d9471efd gbm: Use the kms dumb ioctls for cursor instead of libkms
We need to create bos suitable for cursor usage that we can map and
write data into.  The kms dumb ioctls is all we need for this, so drop
the dependency on libkms.
2012-10-31 14:08:18 -04:00
Kristian Høgsberg
0a72dbd350 gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-10-31 14:08:18 -04:00
Ian Romanick
5fe5aa8e55 i965: Fix regression in depth texture rendering on pre-SNB
This was introduced by commit 24db6d6 (cherry-picked from a683012).  The
original patch fixed potential GPU hangs on SNB, and it caused some
rendering regressions there.  The benefits outweigh the costs.

However, the work-around is not necessary for pre-SNB chipsets.
Applying the work-around there gives rendering regressions with no
benefit.  This patch disables the work-around on pre-SNB chipsets.

Without the original patch, the piglit test
depthstencil-render-miplevels would reliably hang an SNB GPU.  On ILK
this test would not hang, and it does not hang with this patch.

NOTE: This is a candidate for the 8.0 and 9.0 branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2012-10-24 11:35:07 -07:00
Michel Dänzer
8e01950625 st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit eee1ff423c)
2012-10-24 18:14:09 +02:00
Andreas Boll
95c47f07a1 mesa: add get-pick-list.sh script into bin/
This is a squash of:

    mesa: add get-pick-list.sh script into bin/

    NOTE: This is a candidate for the stable branches.
    (cherry picked from commit 2d95db660e)

This is the 2nd commit message:

    mesa: simplify get-pick-list.sh script

    and add a description for the script

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit fa27a0db43)

This is the 3rd commit message:

    mesa: optimize get-pick-list.sh script

    cuts down the while loop iterations from 4600 to 380 commits at the
    moment

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit b2991526ed)

This is the 4th commit message:

    mesa: grep for commits with cherry picked in commit message only once

    and save them temporary in already_picked

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 135ec3a1db)

This is the 5th commit message:

    mesa: fix indentation in get-pick-list.sh script

    NOTE: This is a candidate for the stable branches.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 3e3ff4cd73)
2012-10-23 19:32:33 +02:00
Marcin Slusarz
77b1d2e09c nouveau: use pre-calculated stride for resource_get_handle
Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 93eba26935)
2012-10-21 22:05:40 +02:00
Michel Dänzer
8f772b34b0 st/mesa: Fix source miptree level for copying data to finalized miptree.
Fixes WebGL texture mips conformance test, no piglit regressions.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit c2e37b1d2e)
2012-10-19 18:57:30 +02:00
Quentin Glidic
3913cd19b8 intel: Add missing #include <time.h>
Commit 006c1a3c65 introduced a call to
clock_gettime, but failed to include <time.h>, breaking the build in
some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 7cb8764ca3)
2012-10-10 11:30:52 -07:00
Imre Deak
d56ee24335 glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS
This got broken by:
22b7ddc7f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension
section

Fix it by appending the _EXT suffix to the enum in the test too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:56:42 +03:00
Imre Deak
8dc79ae7d7 mesa: glGet: fix parameter lookup for apps using multiple APIs
The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:41:05 +03:00
Imre Deak
22b7ddc7f0 glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section
This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:58 +03:00
Tomeu Vizoso
dc74c9d0f4 mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs
instead of just for GL and ES1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:55 +03:00
Imre Deak
b4419477fb mesa: glGet: fix API check for EGL_image_external enums
These enums are valid only in ES1 and ES2. So far they were marked valid
incorrectly, depending on the previous API mask in the enum list.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:51 +03:00
Imre Deak
dee121b885 mesa: glGet: fix indentation of print_table_stats
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:48 +03:00
Imre Deak
0c3c77ba17 mesa: glGet: fix indentation of find_value
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:46 +03:00
Imre Deak
0f5d87c3dd mesa: glGet: fix indentation of _mesa_init_get_hash
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:40:15 +03:00
Andreas Boll
8e73273cb9 docs: add news item for 9.0 release
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-09 17:26:45 +02:00
Brian Paul
e75051d196 mesa: fix error check for zero-sized compressed subtexture
For glCompressedTexSubImage, width or height = 0 is legal.
Fixes a failure in piglit's s3tc-errors test.

This is for the 9.0 and 8.0 branches.  Already fixed on master.
2012-10-09 07:47:43 -06:00
Brian Paul
32faf7ab0d mesa: don't call TexImage driver hooks for zero-sized images
This simply avoids some failed assertions but there's no reason to
call the driver hooks for storing a tex image if its size is zero.

Note: This is a candidate for the stable branches.
(cherry picked from commit 91d8409649)
2012-10-09 07:47:43 -06:00
Ian Romanick
161aababc6 docs: Add 9.0 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-08 15:07:10 -07:00
Ian Romanick
e5fdeef1e0 mesa: Bump version number to 9.0 (final)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-08 14:58:35 -07:00
Tom Stellard
a8d0652c04 configure.ac: Don't link gallium drivers with libdricore
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit d68e337c60)
2012-10-08 10:27:40 -07:00
Anuj Phogat
ad4b3b93de _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
This is a squash for the following 7 commits.  The first introduces the
functionality, and the remaining six fix various bugs.

Patch 1:
    _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

    glsl path of _mesa_meta_GenerateMipmap() function would require different fragment
    shaders depending on the texture target. This patch adds the code to generate
    appropriate fragment shader programs at run time.
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

    V2: Removed the code for integer textures as ARB is planning to
        disallow automatic mipmap generation for integer textures.
        Now using ralloc_asprintf in setup_glsl_generate_mipmap().

    NOTE: This is a candidate for stable branches.

    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 299acac849)

Patch 2:
    _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130

    glsl version of _mesa_meta_GenerateMipmap() would require separate
    shaders for glsl 120 and 130.

    V2: Removed the code for integer textures as ARB is planning to
        disallow automatic mipmap generation for integer textures.

    NOTE: This is a candidate for stable branches.

    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 15bf3103b4)

Patch 3:
    meta: Add on demand compilation of per target shader programs

    A call to glGenerateMipmap() follows the generation of a relevant
    shader program in setup_glsl_generate_mipmap().

    To support all texture targets and to avoid compiling shaders
    everytime, per target shader programs are compiled on demand
    and saved for the next call.

    Fixes float-texture(mipmap.manual):
    See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296

    NOTE: This is a candidate for stable branches.

    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit eb1d87fb94)

Patch 4:
    meta: make mem_ctx non-global.

    I can't see any external users, and this is a global symbol,

    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 36639ec6e9)

Patch 5:
    meta: Remove unsafe global mem_ctx pointer

    NOTE: This is a candidate for the 9.0 branch.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    (cherry picked from commit ab097dde0c)

Patch 6:
    meta: Rearrange shader creation in setup_glsl_generate_mipmap

    The diff looks weird, but this moves the code from the first 'if
    (ctx->Const.GLSLVersion < 130)' block down into the second block.  It
    also moves some variable decalarations closer to their use.

    NOTE: This is a candidate for the 9.0 branch.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    (cherry picked from commit 3308c079bd)

Patch 7:
    meta: Don't use GLSL 1.30 shader on OpenGL ES 2

    Fixes GLES2 CoverageGL conformance test.

    NOTE: This is a candidate for the 9.0 branch.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    (cherry picked from commit 0242381f06)
2012-10-07 20:38:14 -07:00
Marek Olšák
7851d398de r600g: fix possible issue with stencil mipmap rendering
Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 9dfca930d7)
2012-10-06 05:40:09 +02:00
Brian Paul
19a15cd5ba mesa: remove bogus compressed texture size checks
A compressed texture image size doesn't have to be a multiple of the
compressed block size (only sub-images do).  Fixes issues when building
compressed mipmaps because we often wind up with non-block-size images
for the higher mipmap levels.

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

Note: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Sven Arvidsson <sa@whiz.se>
(cherry picked from commit df4a88ac43)
2012-10-05 15:55:47 -07:00
Anuj Phogat
c566267f5c intel/i965: Disable SampleAlphaToOne if dual source blending enabled
From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ea0d088727)
2012-10-05 15:55:47 -07:00
Kenneth Graunke
8491e03b2b mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.
The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
active, at least one stage is using fixed function.

On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
tests, as well as missing textures in Xonotic.  These were all
regressions since commit fb4a34e60e.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7fa0f10cd8)
2012-10-05 15:55:47 -07:00
Paul Berry
78c9adb17e mesa: don't enable glVertexPointer() when using API_OPENGLES2.
This function is only present in GLES1 and in the OpenGL compatibility
profile.

Fixes the following "make check" failure:

    [----------] 1 test from DispatchSanity_test
    [ RUN      ] DispatchSanity_test.GLES2
    Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
    compression/decompression unavailable
    dispatch_sanity.cpp:122: Failure
    Value of: table[i]
       Actual: 0x4de54e
    Expected: (_glapi_proc) _mesa_generic_nop
    Which is: 0x41af72
    i = 321
    [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
    [----------] 1 test from DispatchSanity_test (4 ms total)

NOTE: This is a candidate for stable release branches.

Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 8f0b81bf7d)
2012-10-05 15:55:47 -07:00
Robert Bragg
e1cb50b15d SwapBuffersRegionNOK: invert rectangles on y axis
The EGL_NOK_swap_region2 spec states that the rectangles are specified
with a bottom-left origin within a surface coordinate space also with a
bottom left origin, so this patch ensures the rectangles are flipped
before passing them on to dri2_copy_region.

Fixes piglit's egl-nok-swap-region test.

Tested-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0a523a8820)
2012-10-05 15:03:56 -07:00
Matt Turner
c8fda5f44a build: Set PTHREAD_LIBS for pkgconfig files if empty
(cherry picked from dd4fde8f67)
2012-10-05 17:30:11 +02:00
Tom Stellard
542f6feda9 radeon/llvm: Remove R600InstrInfo.td from TD_FILES
Fixes build bug introduced by
cebbdd4ac2
(cherry picked from commit 2baaa5c7eb)
2012-10-05 15:45:43 +02:00
Tom Stellard
71b5503164 radeon/llvm: Cleanup makefile
Hopefully, this will fix all the parallel make problems people have
been having.
(cherry picked from commit cebbdd4ac2)
2012-10-04 10:10:37 -04:00
Eric Anholt
b2048c5e90 i965: Use visibility cflags on the driver code.
(cherry picked from commit 837f06b42f)

The only symbols that need to be public (those in intel_screen.c that the
loader looks for) are already marked public.  Saves 100k of compiled driver
size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-03 15:24:19 -07:00
Matt Turner
ddb9ecca3b build: Don't build libdricore if not building classic drivers
(cherry picked from commit 523c015246)
2012-10-03 15:24:18 -07:00
Matt Turner
76732c9ca5 build: Add visibility CFLAGS to OSMesa
(cherry picked from commit 24ded89876)
2012-10-03 15:24:18 -07:00
Matt Turner
c8669c7ba7 build: Link OSMesa with glapi, libdl, libstdc++
(cherry picked from commit 1762ec28db)

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=399813
          https://bugs.freedesktop.org/show_bug.cgi?id=53179
2012-10-03 15:24:11 -07:00
Matt Turner
f9a8673a7a build: Set visibility CFLAGS in dri/swrast
(cherry picked from commit 4cfff7211c)
2012-10-03 14:00:52 -07:00
Matt Turner
f88046a1f0 build: Set visibility CFLAGS in dri/r200
(cherry picked from commit 3628402707)
2012-10-03 14:00:46 -07:00
Matt Turner
8ebcf34d87 build: Set visibility CFLAGS in dri/radeon
(cherry picked from commit 55d45efdd8)
2012-10-03 14:00:40 -07:00
Matt Turner
3b794e4a56 build: Set visibility CFLAGS in dri/nouveau
(cherry picked from commit 340637d54d)
2012-10-03 14:00:32 -07:00
Matt Turner
0470fa395f build: Set visibility CFLAGS in dri/i915
(cherry picked from commit 381d120b8a)
2012-10-03 14:00:26 -07:00
Matt Turner
6512610f9a build: Set visibility CFLAGS in dri/common
(cherry picked from commit d2872b5612)
2012-10-03 14:00:14 -07:00
Matt Turner
03cfc8d660 build: Build src/glsl with visibility CFLAGS
(cherry picked from commit 8746f641bb)
2012-10-03 13:59:52 -07:00
Matt Turner
a1f1add42d build: Turn on visibility CFLAGS for core mesa
(cherry picked from commit 710a90ccaf)
2012-10-03 13:59:43 -07:00
Matt Turner
a2f28ceea2 build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition
(cherry picked from commit 814345f54b)

Conflicts:

	src/mapi/glapi/gen/gl_x86-64_asm.py
	src/mapi/glapi/gen/gl_x86_asm.py
2012-10-03 13:59:08 -07:00
Matt Turner
421dda800d build: Use PTHREAD_LIBS and PTHREAD_CFLAGS
(cherry picked from commit b6651ae6ad)

Conflicts:

	src/mesa/main/tests/Makefile.am
2012-10-03 13:56:24 -07:00
Matt Turner
89e76252ca dri drivers: Link dricommon before dynamic libraries
I think libtool should be handling this for us, but the build fails for
Jordan because libdricommon (a static library, which uses expat) appears
before -lexpat on the linker command.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 31ab61cac1)

Conflicts:

	src/mesa/drivers/dri/i965/Makefile.am
2012-10-03 13:46:03 -07:00
Oliver McFadden
f2b4f588f5 Revert "i965: Implement guardband clipping on Ivybridge."
This reverts commit 610910a66d.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55523
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-03 13:32:32 +03:00
Oliver McFadden
dbe13c105f Revert "i965: Implement guardband clipping on Sandybridge."
This reverts commit 85cd30406f.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55523
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-03 13:32:21 +03:00
Matt Turner
9fc4a39dbf build: Remove autoconf check for signbit
rebase failure in 7da12426f7.
(cherry picked from commit 159ca32fec)
2012-10-02 22:52:42 -07:00
Brian Paul
604cd6b966 mesa: fix glCompressedTexSubImage assertion/segfault
If the destination texture image doesn't exist we'd hit an assertion
(or crash in a release build).  The piglit/s3tc-errors test hits this.
This has already been fixed in master by the error checking code
consolidation.

Note: This is a candidate for the 8.0 branch.
2012-10-01 08:24:36 -06:00
Brian Paul
e642d61d13 scons: add new -p (prefix) options for yacc
These were recently added to the Makefiles.
(cherry picked from commit e78ebbc5f9)
2012-09-30 11:43:58 -07:00
Marek Olšák
d9197f9037 r600g: fix EXP on Cayman
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 96f50d0cf7)
2012-09-30 05:31:49 +02:00
Marek Olšák
fc62ee7e0d r600g: fix RSQ of negative value on Cayman
NOTE: This is a candidate for the stable branches.
(cherry picked from commit fd5c538464)
2012-09-30 05:31:42 +02:00
Marek Olšák
50ba62e231 r600g: fix instance divisor on Cayman
Not sure if this is the best way to fix it.

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 836325bf7e)
2012-09-30 05:31:35 +02:00
Kenneth Graunke
549129838c meta: Use float for temporary images, not (un)signed normalized.
In commit 091eb15b69, Jordan changed get_temp_image_type() to use
_mesa_get_format_datatype() instead of returning GL_FLOAT.  That has
several possible return values: GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
GL_SIGNED_NORMALIZED, and GL_UNSIGNED_NORMALIZED.

We do want to use GL_INT/GL_UNSIGNED_INT for integer formats.  However,
we want to continue using GL_FLOAT for the normalized fixed-point types.
There isn't any code in pack.c to handle GL_(UN)SIGNED_NORMALIZED.

Fixes oglconform's fboarb advanced.blit.copypix, which was regressed by
commit 091eb15b69.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3767b25bd3)
2012-09-28 15:56:11 -07:00
Eric Anholt
0586a94929 i965: Remove broken non-interleaved-to-interleaved upload code.
This failed when all the uploads to occur were uniform-type vertex data (like
glColor4f being active across a DrawArrays), because it would upload 1 element
instead of 1 element per vertex.  There was no citation for how this code
helped any particular application, and it breaks ETQW, so just remove it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47170
NOTE: This is a candidate for the 9.0 and 8.0 branches.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0334e8dc25)
2012-09-28 15:55:28 -07:00
Kenneth Graunke
fdabc7d9f6 meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and
GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops
that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL
errors.  One such operation is _mesa_meta_Clear().

On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead.

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comment.
v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 679c93ff89)
2012-09-28 15:54:18 -07:00
Matt Turner
cb84fe5e10 build: Link libglapi with pthreads
NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=839060
          https://bugs.gentoo.org/show_bug.cgi?id=435152
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 9ed00075d8)
2012-09-28 15:48:30 -07:00
Matt Turner
cc18cc282f build: Use AX_PTHREAD to detect pthreads
NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 7da12426f7)
2012-09-28 15:48:25 -07:00
Brian Paul
5ef472dd83 mesa: fix incorrect error for glCompressedSubTexImage
If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1f586684d6)
2012-09-28 15:47:57 -07:00
Ian Romanick
7c60a95a0e i915: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
(cherry picked from commit de958de71b)
2012-09-28 15:41:34 -07:00
Ian Romanick
8aaef12a59 i965: Don't free the intel_context structure when intelCreateContext fails.
This squashes two commits from master:

    i965: Don't free the intel_context structure when intelCreateContext fails.

    intelDestroyContext will eventually be called, and it will clean things
    up.  The call to brwInitVtbl is moved earlier so that
    intelDestroyContext can call the device-specific destructor.  This also
    makes the code look more like the i915 code.

    NOTE: This is a candidate for the 9.0 branch.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
    (cherry picked from commit 87f26214d6)

And:

    i965: brwInitVtbl needs to know the chipset generation

    Fixes major regressions since de958de.

    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit e87c63f288)

The second commit message should have read 'since 87f2621', of course.
2012-09-28 15:40:20 -07:00
Ian Romanick
a87b0110b9 intel: Don't call intelDestroyContext if there is no context to destroy
Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit 22897c7497)
2012-09-28 15:07:02 -07:00
Ian Romanick
5174eed793 dri_util: Use calloc to allocate __DRIcontext
The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit f93cb0bebb)
2012-09-28 15:06:58 -07:00
Kenneth Graunke
8c1c18769e i965/blorp: Add support for blits between SRGB and linear formats (fixed).
This is a squash of 2 commits from master.
The first commit is:

i965/blorp: Add support for blits between SRGB and linear formats.

Fixes colorspace issues in L4D2 when multisampling is enabled (the
scene was far too dark, but the flashlight area was way too bright).

The nVidia and AMD binary drivers both allow this kind of blit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e2249e8c4d)

The second commit is:

i965/blorp: Fix sRGB MSAA resolves.

Commit e2249e8c4d (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB).  This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer.  This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 124b214f09)
2012-09-28 11:20:40 -07:00
Paul Berry
849a3d243d i965: Don't spill "smeared" registers.
Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ab5ce2789f)
2012-09-28 11:20:40 -07:00
Paul Berry
36bc0fe4f2 i965/blorp: Increase Y alignment for multisampled stencil blits.
This patch is a band-aid fix for a bug in commit 5fd67fa (i965/blorp:
Reduce alignment restrictions for stencil blits), which causes
multisampled stencil blits to work incorrectly on Sandy Bridge.

When blitting to or from a normal stencil buffer, we have to use a
coordinate transformation that swizzles coordinates to account for the
fact that stencil buffers use W tiling, but the most similar tiling
format available for textures and render targets is Y tiling.  The
differences between W and Y tiling cause pixels to be scrambled within
a block of size 8x4 (width x height) as measured relative to a W tile,
or 16x2 as measured relative to a Y tile.  So in order to make sure
that pixels at the edges of the blit aren't lost, we need to align the
rendering rectangle (and the buffer sizes) to multiples of the 8x4
block size.  This alignment happens in the brw_blorp_blit_params
constructor, whereas the determination of how to swizzle the
coordinates happens during code generation, in the
brw_blorp_blit_program class.

When blitting to or from a multisampled stencil buffer, the coordinate
swizzling is more complex, because it has to account for the
interleaving pattern of samples, which uses 4x4 blocks for 4x MSAA and
8x4 blocks for 8x MSAA.  The end result is that if multisampling is in
use, the 16x2 block size (relative so a Y tile) needs to be expanded
to 16x4, and the corresponding size relative to a W tile expands to
8x8.

The problem doesn't affect Ivy Bridge severely enough to crop up in
Piglit tests because on Ivy Bridge we have to disable multisampling
when blitting *to* a multisampled stencil buffer (the blorp compiler
generates code to compensate for the fact that multisampling is
disabled).  However I suspect a bug is still present because we don't
disable multisampling when blitting *from* a multisampled stencil
buffer.

This patch fixes the problem by doubling the vertical alignment
requirement when blitting to or from a multisampled stencil buffer,
and multisampling has not been disabled.

In the long run I would like to rework the brw_blorp_blit_params
constructor--it's difficult to follow and has had several subtle bugs
like this one.  However this band-aid fix should be suitable for
cherry-picking to release branches.

Fixes Piglit tests "unaligned-blit {2,4} stencil {msaa,upsample}" on
Sandy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a33ce665a5)
2012-09-28 11:20:39 -07:00
Paul Berry
76c1c34c4a i965/blorp: Fix offsets and width/height for stencil blits.
Fixes piglit test "framebuffer-blit-levels draw stencil".

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a5d4f7cb2)
2012-09-28 11:20:39 -07:00
Paul Berry
21e9850d53 i965/blorp: Reduce alignment restrictions for stencil blits.
Previously, we aligned all stencil blit operations to multiples of the
size of a tile, since stencil buffers use W-tiling, and blorp has to
approximate this by configuring the 3D pipeline for Y-tiling and
swizzling coordinates.

However, this was unnecessarily conservative; it turns out that the
differences between W-tiling and Y-tiling are confined to 32-byte
sub-tiles within the 4k tiling pattern; the layout of these 32-byte
sub-tiles within the larger 4k tile is the same (8 sub-tiles across by
16 sub-tiles down, in column-major order).  Therefore we only need to
align stencil blit operations to multiples of the sub-tile size.

Note: although the performance improvement of this change is probably
quite small, the fact that W-tiling and Y-tiling formats only differ
within 32-byte sub-tiles will be essential in a future patch to ensure
that stencil blits work correctly between parts of the miptree other
than level/layer 0.  Making this change provides handy documentation
(and validation) of this fact.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5fd67fac14)
2012-09-28 11:20:39 -07:00
Paul Berry
62bc4af0e1 i965/blorp: don't reduce stencil alignment restrictions when multisampling.
When blitting to a stencil buffer, we need to align the rectangle we
send down the rendering pipeline, to account for the fact that the
stencil buffer uses a W-tiled layout, but we are configuring its
surface state as Y-tiled.

Previously, when the stencil buffer was multisampled, we assumed that
we could reduce the amount of alignment that was necessary, since each
pixel occupies a block of 2x2 or 4x2 samples in the stencil buffer.
That would have been correct if the coordinates we were adjusting were
measured in pixels.  However, the conversion from pixel coordinates to
coordinates within the interleaved buffer has already been done;
therefore the full alignment restriction applies.

Note: the reason this mistake wasn't previously uncovered by piglit
tests is because it is being masked by another mistake: the blorp
engine is using overly conservative alignment restrictions when doing
stencil blits.  The overly conservative alignment restrictions will be
removed in the patch that follows.  Doing this fix now will prevent
the subsequent patch from introducing regressions.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a75063d5f)
2012-09-28 11:20:39 -07:00
Paul Berry
68da5dfc2c intel: Add map_stencil_as_y_tiled to intel_region_get_aligned_offset.
This patch modifies intel_region_get_aligned_offset() to make the
appropriate calculation when the blorp engine sets up a W-tiled
stencil buffer using a Y-tiled SURFACE_STATE.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b760c9913d)
2012-09-28 11:20:39 -07:00
Paul Berry
96fd94ba94 intel: Add map_stencil_as_y_tiled to intel_region_get_tile_masks.
When the blorp engine is performing a blit from one stencil buffer to
another, it sets up the surface state for these buffers as Y-tiled, so
it needs to be able to force intel_region_get_tile_masks() to return
the appropriate masks for a Y-tiled region.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 50dec7fc2d)
2012-09-28 11:20:39 -07:00
Paul Berry
239e9bef92 i965/blorp: Account for offsets when emitting SURFACE_STATE.
Fixes piglit tests "framebuffer-blit-levels {read,draw} depth".

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f04f219906)
2012-09-28 11:20:39 -07:00
Paul Berry
e87174cf4b i965/blorp: Thread level and layer through brw_blorp_blit_miptrees().
Previously, when performing a blit using the blorp engine, we failed
to account for the level and layer of the source and destination.  As
a result, all blits would occur between miplevel 0 and layer 0 of the
corresponding textures, regardless of which level/layer was bound to
the framebuffer.

This patch passes the correct level and layer through
brw_blorp_miptrees() into the brw_blorp_blit_params data structure.

Further patches in the series will adapt
gen{6,7}_blorp_emit_surface_state to make use of these parameters.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3123f06215)
2012-09-28 11:20:39 -07:00
Paul Berry
127dc6d136 i965/blorp: store x and y offsets in brw_blorp_mip_info.
Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and
dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface
offset is required).  This is a bug, since the user might try to blit
to and from levels/layers other than 0.

To fix this bug, it will not be sufficient to have
gen6_{6,7}_blorp_emit_surface_state look up the surface offset at the
time they set up the surface state, since these offsets will need to
be tweaked when blitting stencil buffers (due to the fact that stencil
buffer blits have to swizzle between W and Y tiling formats).

So, to pave the way for the bug fix, this patch causes the x and y
offsets to be computed during blit setup and stored in
brw_blorp_mip_info.

As a result of this change, brw_blorp_mip_info doesn't need to store
the level and layer anymore.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c130ce7b2b)
2012-09-28 11:20:38 -07:00
Paul Berry
602e9a0f37 i965/blorp: store surface width/height in brw_blorp_mip_info.
Previously, gen{6,7}_blorp_emit_surface_state would look up the width
and height of the surface at the time they set up the surface state,
and then tweak it if necessary (it's necessary when a W-tiled surface
is being mapped as Y-tiled).  With this patch, we look up the width
and height when setting up the blit, and store them in
brw_blorp_mip_info.  This allows us to do the necessary tweak in the
brw_blorp_blit_params constructor (where it makes more sense).  It
also reduces the need to keep track of level and layer in
brw_blorp_mip_info, so that a future patch can eliminate them
entirely.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 09b0fa8499)
2012-09-28 11:20:38 -07:00
Paul Berry
5c66640ac7 i965/blorp: Change gl_renderbuffer* params to intel_renderbuffer*.
This makes it more convenient for blorp functions to get access to
Intel-specific data inside the renderbuffer objects.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit e14b1288ef)
2012-09-28 11:20:38 -07:00
Paul Berry
cb9765ca94 i965/blorp: Clarify why width/height must be adjusted for Gen6 IMS surfaces.
Also add a clarifying comment for why the width/height doesn't need
adjustment for Gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 32c7b2769c)
2012-09-28 11:20:38 -07:00
Paul Berry
5db1deab51 i965/gen6+: Adjust stencil buffer size after computing miptree layout.
Since Gen6+ stencil buffers use W-tiling (a tiling arrangement which
drm and the kernel are not aware of) we need to round up the width and
height of a stencil buffer to multiples of the W-tile size (64x64)
before allocating a stencil buffer.  Previously, we rounded up the
size of the base miplevel, and then computed the miptree layout based
on the rounded up size.  This was incorrect, because it meant that the
total size of the miptree would not be properly W-tile aligned, and
therefore we would not always allocate enough pages.

(Note: even though the GL API doesn't allow creation of mipmapped
stencil textures, it does allow mipmapping of a combined depth/stencil
texture, and on Gen6+, a combined depth/stencil texture is internally
implemented as a pair of separate depth and stencil buffers.)

For example, on Sandy Bridge, when allocating a mipmapped stencil
texture of size 128x128, we would first round up to the nearest
multiple of 64x64 (causing no change to the size), and then compute
the miptree layout (whose size worked out to 128x196).  Then we would
request an allocation of 128*196 bytes (6.125 pages), causing 7 pages
to be allocated to the texture.  However, the texture needs 8 pages,
since each W-tile occupies a page, and it takes 2 W-tiles to cover a
width of 128 and 4 W-tiles to cover a height of 196.

This patch changes the order of operations so that the miptree layout
is computed first and then the total size of the miptree is rounded up
to be W-tile aligned.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit bde833c9d0)
2012-09-28 11:20:38 -07:00
Ian Romanick
4cdbf27fac mesa: Don't set uniform dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 6c01a0e770)
2012-09-28 10:56:46 -07:00
Ian Romanick
0fb12a40e4 mesa: Don't set shaderapi dispatch pointers for many things in ES2 or core
v2: Allow GL_ARB_shader_objects functions in core profile because we
still expose the extension string there.  Don't allow
glBindFragDataLocation in GLES3 because it's not part of that API.
Based (mostly) on review comments from Eric Anholt.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit be66cf950e)
2012-09-28 10:55:30 -07:00
Ian Romanick
f16031513f mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit aa0f588e2d)
2012-09-28 10:52:05 -07:00
Ian Romanick
0dc989ea5b mesa: Don't set loopback dispatch pointers for most things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a13c07f752)
2012-09-28 10:50:16 -07:00
Ian Romanick
c01f896062 mesa: Pass GL context to _mesa_create_save_table
This isn't used by this patch, but it will be necessary for several
follow-on patches.  Separating this out will make it easier to reorder
patches later.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3ef9e43865)
2012-09-28 10:36:55 -07:00
Ian Romanick
b56c93dfff mesa: Don't set dispatch pointer for glTexStorage in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ee77061277)
2012-09-28 10:35:02 -07:00
Ian Romanick
90ec1db9f4 mesa: Don't set dispatch pointer for glGetProgramivARB in ES2
This function is not the same as glGetProgramiv.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7f7268d385)
2012-09-28 10:27:36 -07:00
Ian Romanick
dd0dd9aa52 mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a83b01371e)
2012-09-28 10:22:24 -07:00
Ian Romanick
7dc8dc0f7c mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1c0a44aaf5)
2012-09-28 10:19:55 -07:00
Ian Romanick
961567d0fe mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2a3a68e4c7)
2012-09-28 10:19:19 -07:00
Ian Romanick
de4e222794 mesa: Don't set dispatch pointer for glGetBufferSubData in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 11927bfc4a)
2012-09-28 10:17:20 -07:00
Ian Romanick
f57bc97c7a mesa: Don't set dispatch pointer for glGetDoublev in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 850412b8ab)
2012-09-28 10:16:38 -07:00
Ian Romanick
bb16b471d2 mesa: Don't set dispatch pointer for glPointSize in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit aa129b0833)
2012-09-28 10:14:53 -07:00
Ian Romanick
d87c319390 gles2: Alias glReadBufferNV with desktop glReadBuffer
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 23ff634c9c)
2012-09-28 10:11:56 -07:00
Ian Romanick
cf81335712 mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT
This was already (correctly) supported for glGetSamplerParameter paths.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ae3023e967)
2012-09-28 09:56:09 -07:00
Chris Forbes
8d06574d2b mesa: fix dropped && in glGetStringi()
This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d30a7d2eb4)
2012-09-28 09:56:04 -07:00
Brian Paul
4eecc8d007 upgrade glext.h to version 85
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 68060cfb2b)
2012-09-28 09:51:20 -07:00
Matt Turner
b1ce5749b9 targets/xorg-i915: Rename driver to i915_drv.so.
modesetting_drv.so is undescriptive and collides with
xf86-video-modesetting.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-09-25 12:05:20 -07:00
Kenneth Graunke
82a08e2f46 mesa: Ignore SRGB when determining compatible resolve formats.
MSAA resolves and other blit-like operations ignore SRGB state anyway,
so we should be able to safely allow resolves between compatible
SRGB/linear formats like SRGBA8 and RGBA8888.

This matches the behavior of the nVidia and AMD binary drivers.

Fixes completely black rendering when using multisampling in L4D2.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c96828ecb4)
2012-09-25 07:21:40 -07:00
Kenneth Graunke
3dd84a58bb mesa: Don't override S3TC internalFormat if data is pre-compressed.
Commit 42723d88d intended to override an S3TC internalFormat to a
generic compressed format when the application requested online
compression of uncompressed data.  Unfortunately, it also broke
pre-compressed textures when libtxc_dxtn isn't installed but the
extensions are forced on.

Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which
calls _mesa_choose_texture_format(), hitting this override code.  If we
have actual S3TC source data, we can't treat it as any other format, and
need to avoid the override.

Since glCompressedTexImage2D() passes in a format of GL_NONE (which is
illegal for glTexImage), we can use that to detect the pre-compressed
case and avoid the overrides.

Fixes a regression since 42723d88d3.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 328961d955)
2012-09-25 07:17:33 -07:00
Kenneth Graunke
0231c54ebb meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and GL_TEXTURE_GEN_*
don't exist in ES 1 contexts, so any meta ops that used _mesa_meta_begin
with MESA_META_TEXTURE would trigger GL errors.  One such operation is
_mesa_meta_Clear().

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comments.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Cc: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-25 07:17:09 -07:00
Jonas Maebe
2fe673fec3 darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 5fdf1f784b)
2012-09-24 16:06:37 -07:00
Vadim Girlin
f6a66a33f7 winsys/radeon: fix relocs caching
Don't cache pointers to elements of reallocatable array.
In some circumstances it caused false cache hits resulting in incorrect
command stream and gpu lockup.

Note: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 9aa8bac98b)
2012-09-24 03:05:39 +02:00
Marek Olšák
38d1191f41 draw: fix non-indexed draw calls if there's an index buffer
pipe_draw_info::indexed determines if it should be indexed and not
the presence of an index buffer.

This fixes crashes in r300g.

NOTE: This is a candidate for the stable branches.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2988fa940e)
2012-09-22 14:22:15 +02:00
Marek Olšák
a940c74bc3 r600g: set QUANT_MODE on Cayman too
This fixes piglit/fbo-blit-stretched.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bfe489c76b)
2012-09-22 01:19:51 +02:00
Marek Olšák
c3454d95af r600g: do not require MSAA renderbuffer support if not asked for
to allow stencil-only sampler-only formats (like X24S8)

NOTE: This is a candidate for the stable branches.
(cherry picked from commit df5e2c058f)
2012-09-22 01:19:33 +02:00
Marek Olšák
27e056ff15 gallium/u_blitter: fix stencil-only blits
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 61706915a3)
2012-09-22 01:19:23 +02:00
Marek Olšák
e81717e9e7 r300g: fix colormask with non-BGRA formats
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 1e51d368eb)
2012-09-22 01:19:13 +02:00
Marek Olšák
86735d78e6 r600g: don't use a staging resource for large transfers
It kills performance if the resource is linear.
(cherry picked from commit e386972f5b)
2012-09-22 01:18:57 +02:00
Andreas Boll
890b405232 docs: fix some issues in relnotes
improve markup
fix link to relnotes-9.0
add missing relnotes links
(cherry picked from commit 6fb8aeb2c5)
2012-09-19 12:24:13 +02:00
Andreas Boll
1e314197dd docs/devinfo: fix typo
(cherry picked from commit abb1c847ac)
2012-09-19 12:24:13 +02:00
Matt Turner
437c40eee4 build: Don't list glproto and dri2proto in pkg-config file
No files provided by glproto or dri2proto are needed for building
something with Mesa.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=342393
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-09-18 14:10:11 -07:00
Dave Airlie
7cfd42cefe mesa/glsl: rename preprocess to glcpp_preprocess
This symbol with dricore escapes into the namespace, its too generic,
we should prefix it with something just to be nice.

Should be applied to stable + 9.0

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 88b0790b1a)
2012-09-15 08:27:51 +10:00
Dave Airlie
8f7990c5f2 glcpp: fix abuse of yylex
So glcpp tried to workaround yylex its own way, but failed,
do it properly.

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 53d46bc787)
2012-09-15 08:27:51 +10:00
Dave Airlie
a834381506 mesa: use a prefix for the program lex
This avoids us making a global yylex symbol which will interfere will
all sorts of apps.

with libdricore which can't do symbol visibility currently we pollute
the namespace with this.

This is a candidate for 9.0 & stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit cc943c8470)
2012-09-15 08:27:51 +10:00
Mike Frysinger
fafaf56479 mklib: clean up abi flags for x86 targets
The current code is duplicated in two places and relies on `uname` to
detect the flags.  This is no good for cross-compiling, and the current
logic uses -m64 for the x32 ABI which breaks things.

Unify the code in one place, avoid `uname` completely, and add support
for the new x32 ABI.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-09-14 15:26:27 -07:00
Alex Deucher
f94b6d706f r600g: reduce quant mode on evergreen+
Seems to have an affect on the allowable range of
values.  Set evergreen+ to 1/256 to match 6xx/7xx.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b33d7eaa5e)
2012-09-14 09:26:59 -04:00
Kenneth Graunke
a5a86652f1 i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL
which has an extra indirection.  If a fragment program only uses one
texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single
bit, which would make us only upload a single surface/sampler state
entry.  However, it needs to be the second entry.

Using _mesa_fls() instead of _mesa_bitcount() solves this.  For ARB
programs, this makes num_samplers the ID of the highest texture unit
used.  Since GLSL uses consecutive integers assigned by the linker,
_mesa_fls() should give the same result as _mesa_bitcount()..

Fixes a regression since 85e8e9e000,
which caused GPU hangs in ETQW (and probably others), as well as
breaking piglit test fp-fragment-position.

v2: Add a comment, as suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: meng <mengmeng.meng@intel.com>
(cherry picked from commit 28f4be9eb9)
2012-09-14 02:03:00 -07:00
Kenneth Graunke
66e8f863d3 mesa: Add a _mesa_fls() function to find the last bit set in a word.
ffs() finds the least significant bit set; _mesa_fls() finds the /most/
significant bit.

v2: Make it an inline function in imports.h, per Brian's suggestion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0fc163408e)
2012-09-14 02:02:53 -07:00
Vadim Girlin
c586fce4fb r600g: adjust QUANT_MODE for higher precision
Use 1/256 for R6xx/7xx, 1/4096 for evergreen, instead of default 1/16.

Helps to pass some piglit tests (fbo, multisample).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f44bda17f5)
2012-09-12 11:57:36 +02:00
Vadim Girlin
405d47bbe7 mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
From ARB_sync spec:

    If the value of <timeout> is zero, then ClientWaitSync does not
    block, but simply tests the current state of <sync>. TIMEOUT_EXPIRED
    will be returned in this case if <sync> is not signaled, even though
    no actual wait was performed.

Fixes random fails of the arb_sync-timeout-zero piglit test on r600g.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b05a1fc156)
2012-09-12 11:57:36 +02:00
Brian Paul
04f902b472 mesa: fix proxy texture error handling in glTexStorage()
This is basically a follow-on to 1f5b1f9846.
Basically, generate GL errors for ordinary invalid parameters for proxy
targets the same as for non-proxy targets.  Only texture size and OOM
errors should be handled specially for proxies.

Note: This is a candidate for the stable branches.
(cherry picked from commit 35c75f6777)
2012-09-12 10:22:04 +02:00
Brian Paul
f9bb66b1ce mesa: make _mesa_get_proxy_target() non-static
Needed for the next patch.

Note: This is a candidate for the stable branches.
(cherry picked from commit d17440dcaa)
2012-09-12 10:22:04 +02:00
Brian Paul
10b9a02952 mesa: do internal format error checking for glTexStorage()
Turns out we weren't doing any format checking before.  Now check
the internal format and, in particular, make sure that unsized internal
formats aren't accepted.

Note: This is a candidate for the stable branches.
(cherry picked from commit 2e4fc54977)
2012-09-12 10:22:04 +02:00
Paul Berry
1f4d074f75 mesa/msaa: Allow X and Y flips in multisampled blits.
From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":

    If SAMPLE_BUFFERS for either the read framebuffer or draw
    framebuffer is greater than zero, no copy is performed and an
    INVALID_OPERATION error is generated if the dimensions of the
    source and destination rectangles provided to BlitFramebuffer are
    not identical, or if the formats of the read and draw framebuffers
    are not identical.

It is not clear from the spec whether "dimensions" should mean both
sign and magnitude, or just magnitude.

Previously, Mesa interpreted "dimensions" as meaning both sign and
magnitude, so any multisampled blit that attempted to flip the image
in the X and/or Y direction would fail.

However, Y flips are likely to be commonplace in OpenGL applications
that have been ported from DirectX applications, as a result of the
fact that DirectX and OpenGL differ in their orientation of the Y
axis.  Furthermore, at least one commercial driver (nVidia) permits Y
filps, and L4D2 relies on them being permitted.  So it seems prudent
for Mesa to permit them.

This patch changes Mesa to allow both X and Y flips, since there is no
language in the spec to indicate that X and Y flips should be treated
differently.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 5d5f0f3491)
2012-09-12 10:22:04 +02:00
Kenneth Graunke
42ef3f68c9 glsl: Generate compile errors for explicit blend indices < 0 or > 1.
According to the GLSL 4.30 specification, this is a compile time error.
Earlier specifications don't specify a behavior, but since 0 and 1 are
the only valid indices for dual source blending, it makes sense to
generate the error.

Fixes (the fixed version of) piglit's layout-12.frag.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 354f2cb5c7)
2012-09-12 10:22:03 +02:00
Eric Anholt
e2b4f9aac3 i965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.
This fixes the blue zombies bug in l4d2.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 39aca5076f)
2012-09-12 10:22:03 +02:00
Brian Paul
8b8416676e glapi/glx: rename 'table' variable to 'disp_table'
This fixes an issue where the local 'table' variable was hiding the
function parameter name in glGetColorTable(..., void *table).

This should be OK as long as there's never a GL entrypoint that uses
'disp_table' as a parameter name.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 043f66204b)
2012-09-12 10:22:03 +02:00
Brian Paul
6e9baa85a9 mesa: fix per-level max texture size error checking
This is a long-standing omission in Mesa's texture image size checking.
We need to take the mipmap level into consideration when checking if the
width, height and depth are too large.

Fixes the new piglit max-texture-size-level test.
Thanks to Stéphane Marchesin for finding this problem.

Note: This is a candidate for the stable branches.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 771e7b6d88)
2012-09-12 10:22:03 +02:00
Brian Paul
3f6ce3454f st/mesa: s/CALLOC/calloc/ to fix allocation bug
The CALLOC() macro only takes one argument so this was being treated
as a comma expression.  Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
(cherry picked from commit 43ed822a50)
2012-09-12 10:22:03 +02:00
Johannes Obermayr
7f011e2075 Set OSMESA_VERSION=8.
VERSION_NUMBER is not required anymore. So it will be removed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 10a96f4a4d)
2012-09-07 15:29:48 -04:00
Jerome Glisse
41d14eaf19 r600g: fix num of dwords needed for alphatest_state atom
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-06 15:23:51 -04:00
Chad Versace
13b8eb6452 mesa: Don't advertise GLES extensions in GL contexts
glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.

Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit f29a4b0157)
2012-09-06 11:49:11 -07:00
Tapani Pälli
c7775e842b android: do not expose single buffered eglconfigs
On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type.  This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit d58ca43b80)
2012-09-04 19:24:14 -07:00
Tapani Pälli
2a69de60bf android: fix liblog API changes
android logging macros changed their name in JellyBean.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 29d394b9ba)
2012-09-04 19:24:14 -07:00
Tapani Pälli
8cffec495c xmlconfig: use __progname when building for Android
__progname symbol and strrchr are available with bionic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 4d02b018f4)
2012-09-04 19:24:14 -07:00
Ian Romanick
284fe97515 meta: Don't save and restore fog state when there is no fog state
I wonder if the better solution is to have _mesa_meta_GenerateMipmap not
use MESA_META_ALL for the GLSL path.  Even on compatibility profiles
there is no reason to save and restore fog on this path.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54295
(cherry picked from commit 51b069e7aa)
2012-09-03 10:38:48 -07:00
Kenneth Graunke
6886da783a i965/fs: Don't use brw->fragment_program in calculate_urb_setup().
Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled.  Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b
on pre-Sandybridge hardware.  The actual bug was created in commit
7b1fbc6889.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 4d9abd96cc)
2012-08-31 23:00:25 -07:00
Matt Turner
b982fa8e8f build: Remove left over echo from GLU removal 2012-08-31 15:13:23 -07:00
Matt Turner
d240dcee6d Remove libGLU
It's been moved to its own repository, found at
	http://cgit.freedesktop.org/mesa/glu/

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-31 15:08:40 -07:00
Jakob Bornecrantz
0097809879 dri: Rework planar image interface
As discussed with Kristian on #wayland. Pushes the decision of components into
the dri driver giving it greater freedom to allow t to implement YUV samplers
in hardware, and which mode to use.

This interface will also allow drivers like SVGA to implement YUV surfaces
without the need to sub-allocate and instead send 3 seperate buffers for each
channel, currently not implemented.

I have tested these changes on Gallium Svga. Scott tested them on both intel
and Gallium Radeon. Kristan and Pekka tested them on intel.

v2: Fix typo in dri2_from_planar.
v3: Merge in intel changes.

(cherry picked from commit 6a7dea93fa)

Tested-by: Scott Moreau <oreaus@gmail.com>
Tested-by: Pekka Paalanen <ppaalanen@gmail.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-31 19:53:45 +02:00
Marek Olšák
ef557eacff winsys/radeon: disable virtual memory on Cayman
It hangs.
2012-08-31 18:02:35 +02:00
Vinson Lee
de92b7adca scons: Remove leftover print statement.
Remove print statement left over from commit
c57fb034b1.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit f3bb6bd9b3)
2012-08-31 08:30:54 -07:00
Andreas Boll
3ffd5dfbce docs: update relnotes-9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:39 -06:00
Andreas Boll
03785fe360 mesa: also bump version in Makefile.am and configure.ac to 9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:36 -06:00
Vinson Lee
7b676fd738 scons: Add default libraries to Solaris build.
Fixes SCons build on Solaris.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54293
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 08:24:59 -06:00
Ian Romanick
2d2f1fd164 docs: Add some missing features to 9.0 release notes and GL3.txt
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:29 -07:00
Ian Romanick
0791484c42 mesa: Bump version to 9.0
Now that OpenGL 3.1 is supported by at least one driver, follow
tradition and bump the major version number.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:28 -07:00
Marek Olšák
0e470533ad r600g: enable transform feedback on Cayman
There doesn't seem to be anything wrong with it.
2012-08-31 01:19:03 +02:00
Marek Olšák
64db3cc6ad r600g: implement MSAA for Cayman
Everything works except for blitting MSAA colorbuffers, which isn't
so trivial on Cayman. It's a rarely-used feature anyway.
2012-08-31 01:19:03 +02:00
Anuj Phogat
f8a8f069ee i965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_state
This is required to get the program recompiled when SampleAlphaToCoverage
is enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 11:10:50 -07:00
Marek Olšák
c2e9dd0276 r600g: enable MSAA on r6xx by default
DRM 2.22.0 is required though. Also require the new DRM for r700, as
there are some important fixes for that generation too.
2012-08-30 19:43:56 +02:00
Marek Olšák
2f6eb3afb7 r600g: disable MSAA depth decompression on r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
78354011f9 r600g: implement color resolve for r600
The blend state is different and the resolve single-sample buffer must have
FMASK and CMASK enabled. I decided to have one CMASK and one FMASK
per context instead of per resource.

There are new FMASK and CMASK allocation helpers and a new buffer_create
helper for that.
2012-08-30 19:43:56 +02:00
Marek Olšák
863e2c85b9 r600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
187d7fb2fe r600g: implement draw_rectangle callback
The color resolve on r6xx needs PT_RECTLIST. Using conventional primitive
types (triangles and quads) produces an ugly line between two diagonally
opposite corners. I guess a rectangular point sprite would work too.
2012-08-30 19:43:55 +02:00
Marek Olšák
8698a3b85d r600g: implement MSAA for r700
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
edf22a5c6d r600g: change programming of CB_SHADER_MASK on r600-r700
This one actually makes more sense and gives the expected value
for MSAA resolve.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
1ff5f08823 configure.ac: require libdrm_radeon 2.6.39 for MSAA 2012-08-30 19:43:55 +02:00
Brian Paul
055093e33f meta: remove call to _meta_in_progress(), fix multisample enable/disable
This partially reverts d638da23d2.

With gallium the meta code is not always built so the call to
_meta_in_progress() was unresolved.  Simply special-case the
GL_MULTISAMPLE case in the meta code.  There might be other special
cases in the future given all the differences between legacy GL,
core GL, GLES, etc.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234
and https://bugs.freedesktop.org/show_bug.cgi?id=54239

v2 (Paul Berry <stereotype441@gmail.com>): keep _meta_in_progress
function, since it's needed by the i965 driver, but don't call it from
core mesa.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-30 08:28:19 -07:00
Brian Paul
aad7ccd261 meta: add parenthesis to silence compiler warnings
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 09:26:51 -06:00
Tapani Pälli
9121460f13 scons : add HAVE_DLOPEN to build environment
fixes dlopen issue caused by 57c57df7b4

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-08-30 12:02:03 +01:00
Christian König
f1fd94f355 radeonsi: fix stupid bug added in commit 07838603b9
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-30 10:23:32 +02:00
Eric Anholt
8393360659 i965/fs: Remove a dead member from live variables analysis.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 20:46:51 -07:00
Kenneth Graunke
6928bea7ca i965/fs: Initialize output_components[] by filling it with zeros.
Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output.  However, that broke for
smaller output types (float, vec2, or vec3).  To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.

Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.

Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).

Fixes a regression since 2f18698220.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2012-08-29 15:10:57 -07:00
Ian Romanick
42723d88d3 mesa: Do something sensible when on-line compression is requested but not possible
It is possible to force S3TC extensions to be enabled.  This is
generally done to support applications that will only supply
pre-compressed textures.  This accounts for the vast majority of
applications.

However, there is still the possibility of an application asking for
on-line compression.  In that case, generate a warning and substitute a
generic compressed format.  The driver will either pick an uncompressed
format or a compressed format that Mesa can handle on-line (e.g., FXT1).

This should only cause problems for applications that request on-line
compression and read the compressed texture back.  This is likely an
infinitesimal subset of an already infinitesimal subset.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:38 -07:00
Ian Romanick
0e0d664461 i965: Allow creation of OpenGL 3.1 contexts
v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not
defined.  Based on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:38 -07:00
Ian Romanick
2a33a99737 i965: Advertise GLSL 1.40 and TexBOs in core contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:38 -07:00
Ian Romanick
91473485fc intel: Clean up bits of cruft in intelCreateContext
This and the previous three commits should probably be squashed together...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
bf8644e64d i965: Set context flags
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ca2b1fcb30 mesa/dri: Allow creation of forward-compatible contexts
This is done by changing the API to API_OPENGL_CORE.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
36ceabfb74 mesa/es: Enable GL_OES_vertex_array_object
Functionally the same as GL_ARB_vertex_array_object.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
35cf6aeb8c mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers
This is a purely software extension.  The drivers don't need to do any
work to support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
d1cf5c77b7 meta: Don't use deprecated keyword in 1.30 shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ae88281b7b mesa: Disallow alpha, luminance, and LA textures in core context
Also disallow the 1, 2, 3, and 4 formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
04d6ffa06d mesa: Disallow more deprecated functions in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
91107b4ccf mesa: Require names from Gen in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
843b876ba3 mesa: Allow NULL vertex pointer without a VBO
There is text in the OpenGL 3.x specs to explicitly allow this case.
Weird.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
792214e8d4 mesa: Disallow VertexAttribPointer without a VAO in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
29512df635 mesa: Disallow wide lines in forward compatible context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
7e1cab09a1 mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context
Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list
of deprecated functionality):

    "Separate polygon draw mode - PolygonMode face values of FRONT and
    BACK; polygons are always drawn in the same mode, no matter which
    face is being rasterized."

Also modify meta to not use FRONT or BACK in a core context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Paul Berry
d638da23d2 meta: Don't stray outside the confines of the API specified in the context
Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
8e7b6a69e9 mesa: Don't allow display lists or evaluators in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
2bcf555490 mesa: Don't allow GL_EXTENSIONS query in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
c85a9a9996 mesa: Non-sprite points are deprecated
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Eric Anholt
7d8d1c7819 mesa: Fix VAO deletion on GL 3.1 core.
We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop.  Just call the function we mean instead of
indirecting through the dispatch.
2012-08-29 15:09:36 -07:00
Eric Anholt
8a4d560796 mesa: Enable a bunch of missing getters on 3.1 core.
NOTE: maybe I enabled too many?
2012-08-29 15:09:36 -07:00
Eric Anholt
bb4a39ec95 mesa: Expose texture buffer objects when the context is GL 3.1 core.
v2: Use API_OPENGL_CORE.

v3: Only require desktop GL.  If a driver can't support TexBOs in a non-core
context, it should not enable them.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:36 -07:00
Ian Romanick
1b86a91c64 mesa: Allow PACK / UNPACK queries for ES2
These are part of the GL_EXT_unpack_subimage extension and ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
a010215463 mesa: Kill ES2 wrapper functions
v2: Fix completely broken condition around ClearColorIiEXT and
ClearColorIuiEXT.

v3: Add special VertexAttrib handling for ES2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
fc2219e448 mesa: glGetVertexAttribPointerv is part of core profile and ES2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
917f68071b mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
f778174ea1 mesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN
The comment in the code even says this is the right thing to do.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
25ffb86893 mesa: Require that drivers supporting point sprites support point parameters
All drivers in Mesa do.  This allows a lot of extension checking code to be
gutted from the function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:35 -07:00
Ian Romanick
33e01d93ca mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8a263b6efd mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d2b03f6e99 mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
f329adfa49 mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
0fa4ed05cf mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
fb4f2d3425 mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8df3f9bd5f mesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper
Fixes a bug that glGetMaterial[fx]v in ES1 contexts would (try to) allow
queries of GL_AMBIENT_AND_DIFFUSE.  This enum can only be used in glMaterial,
not in the get.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
9555d7bdc1 mesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d6c8913bc6 mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
10e7db1ccf mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
b7c7e5e45a mesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
4114dee99e mesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
08be1d288f mesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper
Also handle glDisable, glIsEnabled, glEnableClientState, and
glDisableClientState.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
bca2cece02 mesa/es: Validate glHint target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
2c87030a00 mesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow glGetVertexAttribfv(0, GL_CURRENT_VERTEX_ATTRIB_ARB, param) in
OpenGL 3.1, just like OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
c13f36ce4e mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
6a9b8f897a mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
72e076cb17 mesa: Refactor _mesa_valid_prim_mode to use a switch-statement
This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
01497a3560 mesa/es: Validate blend function enums in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

v3: Allow GL_SRC_ALPHA_SATURATE as a destination factor in GLES3.  Based
on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
e58c19a204 mesa/es: Validate glClear mask in Mesa code rather than the ES wrapper 2012-08-29 15:09:34 -07:00
Ian Romanick
f0c99d0a6a mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric
Anholt.

v4: Arg.  Reject unsized RED and RG enums on GLES.  More feedback from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
ae86ebfcc9 mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:34 -07:00
Ian Romanick
0cdaa471ec mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the
attachment type is GL_NONE on GLES3.  Other cleanups.  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
5b44a77428 mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking.

v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
7f991d26ad mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Tom Stellard
2809ae3d44 radeon/llvm: Fix encoding of FP immediates on SI 2012-08-29 15:52:10 -04:00
Tom Stellard
05113fd266 radeon/llvm: Create a register class for the M0 register
The Common Subexpression Elimination pass will not operate on
instructions with physical register defs, so we end up with
several redundant copies to M0 when using interpolation.

Adding a register class that only contains the M0 register allows
use to use a virtual register to represent M0, and makes it possible
for the Common Subexpression Elimination pass to remove the extra
copies.
2012-08-29 15:52:10 -04:00
Tom Stellard
733c28a0d9 radeon/llvm: Set the neverHasSideEffects bit on more instructions
This flag makes these instructions candidates for the dead code
elimination and common subexpression elimination.
2012-08-29 15:52:10 -04:00
Tom Stellard
cf4ac69928 radeon/llvm: Declare the interpolation intrinsics as ReadOnly
This signals to the Dead Code Elimination pass that it is safe to
remove these instructions when they are dead.
2012-08-29 15:52:10 -04:00
Tom Stellard
73a2c4b9db radeon/llvm: Mark M0 as a def when lowering interpolation instructions 2012-08-29 15:52:10 -04:00
Anuj Phogat
0fc11a24c8 meta: Add GLSL variant of _mesa_meta_GenerateMipmap() function
This reduces the overhead of using the fixed function internally
in the driver.

V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap()
    functions to avoid code duplication.
    Use glsl version when ARB_{vertex, fragmet}_shader are present.
    Remove redundant code.

V3: Remove redundant border related code leaving the assertion.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-29 11:43:52 -07:00
Brian Paul
c824804c6f glsl: s/class/struct/ for ast_type_qualifier
To silence an MSVC compiler warning about class vs. struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 12:08:46 -06:00
Brian Paul
ec6478fd32 mesa: convert a few more macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
cf41d7c63a mesa: remove COPY_4V_CAST() macro
Only used in one place, and not really needed.
2012-08-29 08:20:58 -06:00
Brian Paul
fd9afb87d8 mesa: convert a bunch of math macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
454e23776d tnl: use INTERP_4F() instead of four INTERP_F() calls 2012-08-29 08:20:58 -06:00
Brian Paul
ba6f47132d swrast: fix wrong assignments in _swrast_add_spec_terms_line() 2012-08-29 08:20:58 -06:00
Brian Paul
1aee8803f8 mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
2012-08-29 08:20:57 -06:00
Martin Pieuchot
c4c4d4ad1e mesa: Define CPU_TO_LE32 to work on OpenBSD
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-29 08:05:17 -06:00
Brian Paul
4aede0018a docs: remove mention of old driver maintenance
People who need old drivers can use older versions of Mesa.
2012-08-28 13:09:02 -06:00
Andreas Boll
6eaccbfeeb docs/utilities: add/update some useful utilities
the progs/util directory is now in mesa demos
replace glean with piglit
add ApiTrace

markup: replace the unordered list <ul> with a definition list <dl>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-28 13:08:56 -06:00
Eric Anholt
67e9ae8563 i965: Disable the swrast context setup on GL 3.1 core.
I've reviewed the code, and the swrast callsites remaining are all in
drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't
be hit.  A piglit run with the context setup disabled on legacy GL and GLES2
showed regressions only in the copypixels and drawpixels tests.

If the context type is forced, this reduces the shader_runner maximum heap
size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
993c52d0be i965: Replace general sw fallback support with a manual check for rendermode.
There were no other cases that set it any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
b0d23b66cf intel: Move RenderMode fallback func to i915 driver.
The Fallback field of the context struct doesn't work that way on i965, and
it's the only caller of FALLBACK() in the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
628dfe9511 i965: Drop the old sw fallback for position array being disabled.
This code has been in the driver since the first commit.  I think it was
trying to stop rendering from happening with a disabled position array.  Core
mesa has since had changes to deal with disabled position arrays correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
5e3c093ff8 i965: Drop support for forcing drawing through sw fallbacks.
It turns out it hasn't worked since at least 8.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
bfae8650ec i965: Move depth resolve for span fallbacks to a simpler place.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
707f242c4b i965: Drop manual hiz resolves in span rendering.
swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the
depth resolve.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Michel Dänzer
70f9dbe298 radeon/llvm: Handle TGSI KIL opcode for SI.
Fixes piglit fp-kil and glBitmap() with radeonsi.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:27:23 +02:00
Michel Dänzer
16e42a5dd0 radeon/llvm: Basic support for SI EXEC register.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:26:50 +02:00
Michel Dänzer
6ca64393c9 radeonsi: Don't write to the PA_SC_RASTER_CONFIG register.
It should be initialized by the kernel as necessary.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-28 20:24:52 +02:00
Marek Olšák
999b7f6665 r600g: fix relative addressing on RS780 and RS880
They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 18:27:03 +02:00
Andreas Boll
3e20605c16 docs/helpwanted: add radeonsi todo list
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:36:07 +02:00
Andreas Boll
17f09b664b configure.ac: add radeonsi to --with-gallium-drivers help string
the help string is used by ./configure --help

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:35:36 +02:00
José Fonseca
bc8509b43b llvmpipe: Bump the maximum texture size (in pixels).
But cap the size in bytes, to avoid depleting the whole system memory,
with humongus textures.

Tested with max-texture-size piglit test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-28 15:18:43 +01:00
Vadim Girlin
6463eb013f u_vbuf: avoid unnecessary update of the vertex elements
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-28 18:01:13 +04:00
Matt Turner
971750e1cd egl: fix invalid flag detection for EGL_KHR_create_context
We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-27 15:11:11 -07:00
Kenneth Graunke
77d675926a i965: Make VS programs obey the shader_precompile driconf option.
Now that it's on by default, we may as well make it obey the flag,
for consistency's sake if nothing else.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
9ef710575b i965: Reenable the fragment shader precompile.
Precompiling the shader at link time often allows us to avoid compiling
it at the first use.  This moves the expensive compilation and
optimization process to game or level load time, rather than at draw
time, where we really can't avoid any cycles and don't want to risk
stalling the GPU.

The downside is that we have to guess the non-orthagonal state the
program will have set when it draws with the shader.  Previously, we
guessed wrong for nearly every shader, so it wasn't useful.  With the
recent SamplerUnits rework and this series, we've either eliminated
state or made smarter guesses, and usually get it right now.

In the L4D2 time demo, I now have 39 fragment shader recompiles and no
vertex shader recompiles.  Before this series and the SamplerUnits
rework, I had 206 fragment shader recompiles and 192 vertex shader
recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
88b3850c27 i965: Set swizzle fields in the VS precompile program key.
This fixes a regression since 76d1301e8e:
I began setting SWIZZLE_XYZW for unused sampler units in the actual
program keys, since this matched the FS precompile behavior.  However,
the VS precompile was expecting zero, so that commit made essentially
every vertex shader (even those not using texturing) mismatch and need
to be recompiled.

Setting them in the VS precompile key solves the issue.  It also is an
improvement over our old behavior: previously we guessed that vertex
shaders didn't use any textures at all.  Now we actually look to see if
the VS had any sampler uniforms and guess based on that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
c20cb8d1f6 i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.
Eric added support for WM key debugging.  This adds it for the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
85b24b0751 i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.
Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
textures.  There are no Y, Z, or W components.

DEPTH_TEXTURE_MODE has three options:
- GL_LUMINANCE: <X, X, X, 1>
- GL_INTENSITY: <X, X, X, X>
- GL_ALPHA:     <0, 0, 0, X>

The default value is GL_LUMINANCE, and most applications don't seem to
alter DEPTH_TEXTURE_MODE.  Make that our precompile guess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
f3d0daf7ea i965: Index sampler program key data by linker-assigned index.
Now that most things are based on the linker-assigned index, it makes
sense to convert the arrays in the VS/WM program key as well.  It seems
silly to leave them indexed by texture unit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
ab17762c70 i965: Only set proj_attrib_mask for fixed function.
brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.

However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key.  Turning it off for
shaders should allow the precompile to work and not lose much.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
6cc14c2493 i965: Don't set stats_wm in the WM program key on Gen6+.
It's only needed for Gen4/5 IZ lookup workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
b6b1fc1261 i965: Don't set vp_outputs_written in the WM program key on Gen6+.
It's only used by on pre-Sandybridge hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Kenneth Graunke
87cdefed40 i965: Double the size of the state cache.
We probably want to do something more sophisticated here, but this at
least makes it through L4D2 without dumping the program cache.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Julien Cristau
ac889b2410 glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly
We were stomping on the caller's buffer by ignoring their alignment
requests and other pixel store modes.  This patch makes the USE_XCB path match
the older one more closely.

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

Signed-off-by: Julien Cristau <julien.cristau@logilab.fr>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
f308c80490 gallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
a971476cc7 st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)
Fixes many failing cases in piglit copyteximage test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Chad Versace
88edbdf9f0 i965: Move hiz resolve to after renderbuffer resizing (v2)
Do all pre-draw hiz resolves *after* the renderbuffers are resized by
intel_prepare_render. Otherwise, we may resolve buffers that are
immediately discarded afterwards.

Fixes the assertion failure below when resizing windows in KDE and under
some unknown circumstance in Chrome OS:
    intel_resolve_map.c:46: intel_resolve_map_set: Assertion
    `(*tail)->need == need' failed.

Also, remove the comment that "resolves must occur [...] before setting up
any hardware state". That was true when resolves were implemented with
meta-ops, but no longer with blorp.

v2:
  - Keep brw_predraw_resolve_buffers in its current position, which is
    before any brw_context bits are modified. Instead, move the call to
    intel_prepare_render.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:48:28 -07:00
Chad Versace
a2a7e640a4 i965: Remove redundant null check
intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no
need for the caller to do so.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:47:09 -07:00
Marek Olšák
7f0fcf17c3 r300g: implement TRUNC correctly
This fixes some integer division tests.
2012-08-27 14:35:18 +02:00
Michel Dänzer
f402acdbe2 radeonsi: Use FP16 shader export format when necessary / possible.
Fixes piglit fbo-blending-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:56 +02:00
Michel Dänzer
26c7139d2c radeonsi: Refactor initialization of shader export intrinsic arguments.
In preparation for extending this code, which would make it rather unwieldy in
its current place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:49 +02:00
Michel Dänzer
d1e40b3d40 radeonsi: Maintain cache of pixel shader variants according to contxt state.
Mostly inspired by r600g commit 4acf71f01e
('r600g: cache shader variants instead of rebuilding v3').

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:41 +02:00
Michel Dänzer
84fdda280f radeonsi: Drop extraneous semicolons from pm4 state macro definitions.
Could cause build failures if trying to use the macros in certain constructs.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:50:38 +02:00
Marek Olšák
a3d9d7ec79 r600g: implement compression for MSAA colorbuffers for evergreen
This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
48edfe0505 r600g: cleanup names around depth decompression
for consistency with the upcoming color decompression naming

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
3ac54ac2c8 r600g: fix evergreen 8x MSAA sample positions
The original samples positions took samples outside of the pixel boundary,
leading to dark pixels on the edge of the colorbuffer, among other things.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
1cfec6e2c8 r600g: set CB_TARGET_MASK to 0xf and not 0xff for resolve on evergreen
independent_blend_enable must be true, so that the colormask isn't replicated
in all colorbuffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Marek Olšák
1516a4f353 gallium/u_blitter: initialize sample mask in resolve
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Tom Stellard
07c71d6ede r300/compiler: Use variable lists in the rename_regs pass 2012-08-26 20:39:49 -04:00
Eric Anholt
7540f25a34 i965: Rewrite the comment describing the query object support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
f0159018d7 i965/gen6+: Add support for GL_ARB_timer_query.
Needs updated libdrm.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
9a2943ddf2 i965: Add support for GL_ARB_occlusion_query2.
This extension is just a bit of core code on top of the GL_ARB_occlusion_query
support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
b765119c5d mesa: Add constants for the GL_QUERY_COUNTER_BITS per target.
Drivers need to be able to communicate their actual number of bits populated
in the field in order for applications to be able to properly handle rollover.

There's a small behavior change here: Instead of reporting the
GL_SAMPLES_PASSED bits for GL_ANY_SAMPLES_PASSED (which would also be valid),
just return 1, because more bits don't make any sense.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-26 10:40:28 -07:00
Eric Anholt
6754ec831e i965: Fix accumulator_contains() test to also reject swizzles of the dst.
When faced with this sequence:

	MOV	R1, c[1];
	MAD	R0, R2, R1.x, R1.y;

we were concluding that the MOV of R1 set up our accumulator and so we could
just use the previous result.  Only, it's got R1.xyzw in it instead of the
r1.y we're looking for.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784
NOTE: This is a candidate for the 8.0 branch.
2012-08-26 09:58:40 -07:00
Jakob Bornecrantz
33ee019422 st/dri: Support width and height getters
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:18 +02:00
Jakob Bornecrantz
15effe1fab st/dri: Claim to support validate_usage
Support version 3 as well as 2, since that is only the new format query,
which Jesse added support for to st/dri when he added it to dri_inteface.h.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:10 +02:00
Jakob Bornecrantz
93ebec87ed dri: Make query image WIDTH and HEIGHT be version 4
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:50 +02:00
Jakob Bornecrantz
6bb71b8cbe dri: Remove image write function
Since its not used by anything anymore and no release has gone out
where it was being used.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:41 +02:00
Jakob Bornecrantz
a669a5055e gbm: Use libkms to replace DRI cursor images
Uses libkms instead of dri image cursor. Since this is the only user of the
DRI cursor and write interface we can remove cursor surfaces entirely from
the DRI interface and as a consequence also from the Gallium interface as
well. Tho to make everybody happy with this it would probably should add a
kms_bo_write function, but that is probably wise in anyways.

The only downside is that it adds a dependancy on libkms, this could how ever
be replaced with the dumb_bo drm ioctl interface.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:23 +02:00
Kenneth Graunke
a3685544e1 i965: Don't set iz_lookup the FS precompile's program key on Gen6+.
We already changed the actual program key builder to only set these bits
on gen < 6; this patch just brings the precompile state back in line so
it doesn't mismatch every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 23:05:35 -07:00
Kenneth Graunke
98211d5af7 i965/fs: Fix INTEL_DEBUG=perf program key printing.
When dumping differences in program keys, it printed messages of the
format:

   [Name of thing that changed]  [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key.  With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

   [Name of thing that changed]  [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-25 23:01:50 -07:00
Kenneth Graunke
174d44a9c4 mesa: Use a new, more specific hook for shader uniform changes.
Gallium drivers and i965 don't require special notification when
sampler uniforms change.  They simply see the _NEW_TEXTURE and adjust
their indirection tables.  These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify.  Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange.  On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
85e8e9e000 i965: Use linker-assigned sampler IDs in instruction encoding.
When assigning uniform locations, the linker assigns each sampler
uniform a sequential numerical ID.  gl_shader_program::SamplerUnits maps
these sampler variable IDs to the actual texture units they reference
(specified via glUniform1i).

Previously, we encoded this mapping in the SEND instruction encoding:
the "sampler" was the texture unit number, and the binding table index
was SURF_INDEX_TEXTURE(the texture unit number).  This unfortunately
meant that whenever the application changed the value of a sampler
uniform, we had to recompile the shader to change the SEND instructions.

This was horrible for the game Cogs, which repeatedly switches between
using texture unit 0 and 1.  It also made fragment shader precompiles
useless: we'd do the precompile at glLinkShader() time, before the
application called glUniform1i to set the sampler values.  As soon as
it did that, we'd have to recompile, wasting time and space in the
program cache.

This patch encodes the SamplerUnits indirection in the binding table,
sampler state, and sampler default color tables.  Instead of baking the
texture unit number into the shader, we bake in the sampler variable ID
assigned by the linker.  Since those never change, we don't need to
recompile programs on uniform changes.

This does mean that the tables now depend on the linked shader program
being used for rendering, rather than simply representing all available
texture units.  This could cause an increase in state emission.

Another plus is that the sampler state and sampler default color tables
are now compact: we only emit as many entries as there are sampler
uniforms, with no holes in the table since the new sampler IDs are
sequential.  Previously we had to emit a full 16 entries every time,
since the tables tracked the state of all active texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
2faa592e7f i965: Add a "sampler state index" parameter to update_sampler_state().
This represents the index into the sampler state table or sampler
default color table (the two are identical).

Right now, this is still the texture unit, but that will change shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
28fab4295e i965: Un-hardcode WM binding table from update_texture_surface.
Currently, we mirror the VS and WM binding tables' texture entries.
That may not continue to be true, so in preparation, pass in the binding
table and surface index as arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
96a22f3583 i965/vs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
0ad2dce24a i965/fs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Don't bother renaming fs_instruction::sampler.  Although it's currently
the texture unit, this series will change that.  No need for the churn.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
bf0308d8d6 i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
76d1301e8e i965: Set SWIZZLE_NOOP for unused texture units in the program keys.
Previously, we left the swizzle key field as zero for unused texture
units.  The precompile sets all of them to SWIZZLE_NOOP, which meant
that we mismatched almost every time.

Since either works equally well, change it to SWIZZLE_NOOP to match
the precompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
f510dd5d60 i965: Remove four and a half year old TODO comments about samplers.
I can't actually understand what these mean, and they seem to
essentially say "we should simplify things", which is a nice goal but
not very specific.

Presumably things got cleaned up at some point.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
d1447f5bc9 i965: Fix brw_link_shader to return false rather than NULL.
Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type
'GLboolean {aka unsigned char}' from NULL [-Wconversion-null]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-with-great-enthusiasm-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Ian Romanick
f9767dac9a mesa/es: Validate glGetBufferParameteriv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:15:20 -07:00
Ian Romanick
93d109645a mesa/es: Validate glMapBuffer access in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: *Really* add proper core-profile and GLES3 filtering based on review
feedback from Eric Anholt.  It looks like previously there was some
rebase / merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
bd4e5dd355 mesa/es: Validate glBufferData usage in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering based on review feedback
from Eric Anholt.  It looks like previously there was some rebase /
merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
b0b6b76d52 mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
e2cf14d7b2 mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
ef723ecce4 mesa/es: Remove redundant vertex pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
a8f475d8f6 mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
c3e9a207d0 mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
e5ef0cbe0e mesa/es: Validate NormalPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
fb8218508a mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
07ccfef8d1 mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
28ee443d7b mesa/es: Remove redundant vertex attrib pointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
ae633d0b2e mesa/es: Remove redundant vertex attrib pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
946ddec163 mesa/es: Disallow BGRA vertex arrays in ES or ES2 contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
bbceed268e mesa: Rearrange array type checking, filter more types in ES
v2: Fix handling of GL_INT and GL_UNSIGNED_INT types pre-ES3.0, and fix
handling of GL_INT_2_10_10_10_REV and GL_UNSIGNED_INT_2_10_10_10_REV in
ES3.0.  Based on review comments by Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
a33f360e8f mesa: Refactor element type checking into its own function
This consolidates the tests and makes the emitted error message
consistent.

v2: Rename _mesa_valid_element_type to valid_elements_type.  Log the
enum string instead of the hex value in error messages.  Based on review
comments from Brian Paul and Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 19:13:12 -07:00
Brian Paul
229868edf7 wgl: update some comments 2012-08-24 14:09:03 -06:00
Brian Paul
4b7c0938e4 st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures
As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
a3af27e993 mesa: add generic compressed -> uncompressed format helper
_mesa_generic_compressed_format_to_uncompressed_format() probably wins the
prize for longest function name in Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
13d0bb21a9 mesa: don't try (generic) compression of 1D and 1D_ARRAY textures
See comments in the code for details.

Note: we only need to special-case the generic compressed formats since
specific texture formats are error-checked earlier to see if the compression
format is compatible with the texture type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
d47a6ada9c mesa: add texture target field to ChooseTextureFormat() driver hook
This will let us choose the actual hardware format depending on the
type of texture.

v2: fixup radeon, nouveau, intel and swrast drivers too

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 14:08:57 -06:00
Brian Paul
ba7218061b xlib: remove texture compression hackery
I think this was left-over debug code from long ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 13:15:27 -06:00
Brian Paul
09fafd3b85 st/mesa: clean up use of 'target' variable in st_context_teximage()
'target' was used both as a parameter of type st_texture_type and then
re-used for GL_TEXTURE_x targets.  Rename the function parameter and
add a new local 'GLenum target'.

And remove an extraneous break statement.
2012-08-24 13:15:27 -06:00
Matt Turner
261719b21c automake: convert vgapi 2012-08-24 11:08:19 -07:00
Matt Turner
ba4a36d8cd build: Check for bison-generated file before bailing because of no bison
.y/.c was a typo.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
179d8aa331 Move _mesa_dl* functions into dlopen.h and inline them
No point in having an extra function call for inlinable functions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Tapani Pälli
57c57df7b4 mesa/dlopen: use HAVE_DLOPEN instead of _GNU_SOURCE
Patches changes mesa to use 'HAVE_DLOPEN' defined by configure and Android.mk
instead of _GNU_SOURCE for detecting dlopen capability. This makes dlopen to
work also on Android where _GNU_SOURCE is not defined.

[mattst88] v2: HAVE_DLOPEN is sufficient for including dlfcn.h, remove
	       mingw/blrts checks around dlfcn.h inclusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
df4dccc7a9 build: Only add links to .so files if we're building them
Xlib-GLX and OSMesa support static building.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
2012-08-24 11:08:19 -07:00
Matt Turner
c56b57f4a1 build: Add libOSMesa.so.$(VERSION) link to libdir 2012-08-24 11:08:19 -07:00
Matt Turner
a8fd8cb9e7 build: Replace OSMESA_VERSION with generic VERSION_NUMBER
Can be used by other modules.
2012-08-24 11:08:19 -07:00
Matt Turner
383a70bf9a build: Order AC_CONFIG_FILES list
Makefiles before .pc files before directories. Alphabetize files of the
same type.
2012-08-24 11:08:19 -07:00
Matt Turner
8cdce6c136 build: Only build libmesa.la when needed
Namely, for Xlib-GLX, OSMesa, or test programs.
2012-08-24 11:08:19 -07:00
Matt Turner
00f3d9b11a build: Remove duplicate DRI automake conditionals 2012-08-24 11:08:19 -07:00
Matt Turner
d23b1b7977 build: Remove GLU_DIRS 2012-08-24 11:08:19 -07:00
Matt Turner
0abb26ebff build: Only generate dispatch assembly code that will be built 2012-08-24 11:08:19 -07:00
Paul Berry
5133bd6585 i965: don't clear resolve map when doing fast depth clears.
Previously, when performing a fast depth clear, we would also clear
the miptree's resolve map.  This destroyed important information,
since the resolve map contains information about needed resolves for
all levels and layers of the miptree, whereas a depth clear only
applies to a single level/layer combination at a time.  As a result,
resolves would sometimes fail to occur, leading to incorrect
rendering.

Fixes rendering artifacts with shadow maps in Unigine Heaven and
Unigine Sanctuary.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Paul Berry
4b8b6f385e i965/HiZ: remove assertion from intel_resolve_map_set().
There are three possible resolve map states for each (level, layer) of
a depth miptree: "needs HiZ resolve", "needs depth resolve", and
"needs neither".  When HiZ was first implemented on i965, any attempt
to directly transition between "needs HiZ resolve" and "needs depth
resolve" without passing through the "needs neither" state would have
been a bug indicating that a necessary resolve hadn't been performed.
Accordingly, intel_resolve_map_set() contained an assertion to verify
that no such direct transition happened.

However, now that we support fast depth clears, there is a valid
transition from the "needs HiZ resolve" to the "needs depth resolve"
state.  When doing a fast depth clear, the old state of the buffer is
irrelevant, since we are completely replacing it with the clear value,
so it is not necessary to do any resolves before clearing--we can
transition, if necessary, directly from the "needs HiZ resolve" state
to the "needs depth resolve" state.

To avoid spurious assertions in this valid case, this patch just
removes the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Christian König
9aacd5cc67 radeonsi: remove old tilling handling
Just use the functionality provided by the surface manager instead.

This fixes just another bunch of piglit tests.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-24 18:11:31 +02:00
Ian Romanick
86f29cf7d0 mesa/es: Validate glCreateShader targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
b042f7a1ff mesa/es: Validate glGetProgramiv pnames in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
1a200b68cd mesa: Filter glGetProgramiv pnames based on available extensions
Previously you could always glGetProgramiv one of the transform feedback
or geometry shader enums even if the extension wasn't supported.

In addtion, this reverts part of bda6ad27.  I think the hunks involving
GL_PROGRAM_BINARY_LENGTH_OES were spurious.  Mesa has no support for any
other part of GL_OES_get_program_binary.

v2: Remove redundant return in get_programiv based on review feedback
from Matt Turner.

v3: Correctly handle UBO related enums.

v4: Emit the bad enum in the _mesa_error call based on review feedback
from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Brian Paul
9282ebbaa5 swrast: implement cubical depth texture sampling
Fixes a few more failures in the piglit copyteximage test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 09:38:44 -06:00
Blaž Tomažič
87280d56a3 clover: Accept CL_MEM_READ_WRITE flag
Fix API functions for memory objects to accept CL_MEM_READ_WRITE flag.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
[ Francisco Jerez: Drop incorrect change in clCreateSubBuffer. ]
2012-08-24 17:10:14 +02:00
Tom Stellard
167ecf5ba3 radeon/llvm: Cleanup R600Instructions.td 2012-08-24 14:14:55 +00:00
Brian Paul
388af5b6f4 main: fix ES compile breakage 2012-08-24 06:40:06 -06:00
Brian Paul
4fec5e9154 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formats
As with the previous commit.

This fixes the last crash in the piglit copyteximage test but there's
still some failures.
2012-08-24 06:18:42 -06:00
Brian Paul
d78b44c265 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formats
Fix-up the texel fetch functions so that they handle 3D coords (as used for
array textures) and remove the "f_2d" part from their names.

Helps fix swrast crashes in piglit's copyteximage test.  More to come.
2012-08-24 06:18:41 -06:00
Brian Paul
fe2cc65fbb mesa: code movement in teximage.c
To get rid of a forward declaration.
2012-08-24 06:18:41 -06:00
Brian Paul
bdff1dfb39 mesa: consolidate glTexImage and glCompressedTexImage code
There was a lot of similar or duplicated code before.
To minimize this patch's size, use a forward declaration for
compressed_texture_error_check().  Move the function in the next patch.
2012-08-24 06:18:41 -06:00
Brian Paul
e93cb4b34f mesa: make glTexImage, glCompressedTexImage proxy code more alike
Next up, we can combine the teximage() and compressed_teximage() functions.
2012-08-24 06:18:41 -06:00
Brian Paul
c1a9e6010b mesa: rename texpal.[ch] to texcompress_cpal.[ch]
To be consistent with other files related to texture compression.
2012-08-24 06:18:41 -06:00
Brian Paul
aab06dc0f0 mesa: s/GLuint/gl_format/ in _mesa_compressed_format_to_glenum()
No real change here, just use the right type.
2012-08-24 06:18:41 -06:00
Brian Paul
46751edca9 mesa: new _mesa_num_tex_faces() helper
Not a real big help now, but will be useful for the
GL_ARB_texture_cube_map_array extension in the future.
2012-08-24 06:18:41 -06:00
Brian Paul
8a935d71ff mesa: make _mesa_get_proxy_tex_image() static
It's not used by any other file.
2012-08-24 06:18:41 -06:00
Brian Paul
637a79aa23 mesa: don't clear proxy image fields when regular GL error is generated
If a proxy texture call generates a regular GL error, we should not
clear the proxy image's width/height/depth/format fields.  Use a new
PROXY_ERROR token to distinguish proxy errors from regular GL errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
Brian Paul
1f5b1f9846 mesa: fix glTexImage proxy texture error generation
When calling glTexImage() with a proxy target most error conditions should
generate a GL error.  We were erroneously doing the proxy-error behaviour
(where we zeroed-out the image's width/height/depth/format fields) in too
many places.

There's another issue with proxy textures, but that'll be fixed in the
next patch.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
José Fonseca
3e3f99277d draw: Fix regression in draw_set_sampler(_views).
draw->samplers(_views) now has PIPE_SHADER_TYPES elements, instead of
PIPE_MAX_SAMPLERS as before.

Also, shader_stage must be less than PIPE_SHADER_TYPES to prevent buffer
overflow.

Trivial.
2012-08-24 11:28:00 +01:00
Vadim Girlin
e84d45fdb7 build: don't leave git_sha1.h.tmp after build/install
Fixes "`main/git_sha1.h.tmp': Permission denied" build error.
See https://bugs.freedesktop.org/show_bug.cgi?id=52064

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 11:16:14 +04:00
Tom Stellard
1434a86f50 radeon/llvm: Set End of Program bit on RAT instructions
This code was accidently dropped during the MCCodeEmitter conversion.
2012-08-23 21:54:32 +00:00
Tom Stellard
1bd7b29a66 radeon/llvm: Use correct instruction for moving immediates
This should fix an assertion failure that was happening in some compute
shaders.
2012-08-23 21:54:32 +00:00
Tom Stellard
2ad8608cb3 radeon/llvm: Fix some coding style issues 2012-08-23 21:54:32 +00:00
Tom Stellard
228a6641cc radeon/llvm: Pull changes from external version of the backend 2012-08-23 21:54:32 +00:00
Tom Stellard
5a1edb8655 radeon/llvm: Simplify the convert to ISA pass 2012-08-23 21:54:32 +00:00
Tom Stellard
cb5227b403 radeon/llvm: Make sure to use the Text section in the AsmPrinter 2012-08-23 21:54:31 +00:00
Matt Turner
68a2c510a6 build: Fix installation of GLES2 headers
Reported-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-08-23 14:07:35 -07:00
Matt Turner
fc9ea7c74d build: Fix GLES linkage with libglapi
Reported-by: Ian Romanick <idr@freedesktop.org>
2012-08-23 14:07:35 -07:00
Anuj Phogat
e592f7df03 i965/msaa: Add sample-alpha-to-coverage support for multiple render targets
Render Target Write message should include source zero alpha value when
sample-alpha-to-coverage is enabled for an FBO with  multiple render targets.
Source zero alpha value is used as fragment coverage for all the render
targets.

This patch makes piglit tests draw-buffers-alpha-to-coverage and
alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No
regressions are observed with piglit all.tests.

V2: Revert all the changes made in emit_color_write() function to
include src0 alpha for targets > 0. Now handling this case in a if
block.

V3: Correctly calculate the instruction length for buffer zero.
Properly handle the case of dual_src_blend when alpha-to-coverage
is enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-23 13:30:54 -07:00
Stéphane Marchesin
ff996cafce glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field
When too may uniforms are used, the error will be caught in
check_resources (src/glsl/linker.cpp).

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
2012-08-23 11:42:19 -07:00
Ian Romanick
9b028faeaa mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
dd0eb00487 mesa/es: Validate glCompressedTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
c11096e94a mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add GLES3 filtering.  I'm not 100% sure this is correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
9848e86af0 mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
409620e477 mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

v3: Collapse ALPHA, LUMINANCE, and LUMINANCE_ALPHA cases per review
comment from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
0686ccac95 mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
Also validate glCopyTexImage border.  This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
59d965333c mesa: Generate an error when glCopyTexImage border is invalid
NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
2dcb40bb44 mesa/es: Add support for GL_APPLE_texture_max_level
This is desktop OpenGL functionality that has always existed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
c9689e3e55 mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
b3dd524a10 mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile, GLES1, and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
4269cace79 mesa/es: Remove redundant glBindTexture target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
3f7c8364cf mesa: Filter glBindTexture targets based on supported features.
Fixed the piglit test arb_texture_buffer_object-negative-unsupported.

NOTE: This is a candidate for stable release branches.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
530c9d764b mesa/es: Validate tex image targets in Mesa code rather than the ES wrapper
This should take care of all the TexImage, TexSubImage, CopyTexImage,
CompressedTexImage3DOES, and CopyTexSubImage type paths.

v2: Add proper core-profile and GLES3 filtering.

v3: Squash the CompressedTexImage3DOES patch per review comment from
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
ea9b212fca mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
a0595cb450 mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper
Ditto for glGetTexParameter targets.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
842efb9447 mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
d53101a9f3 mesa: Refactor validate_texture_wrap_mode to use a switch-statement
This makes the next couple changes a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
2abf555496 meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist
This is a bit of a hack.  _mesa_meta_GenerateMipmap shouldn't even be
used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core
profile and ES2) because it uses fixed-function, and fixed-function
doesn't exist there either!

A GLSL-based _mesa_meta_GenerateMipmap should be available soon.  When
that is available, this patch will be irrelevant and should be reverted.

v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to
(ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review
comment from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-23 10:15:29 -07:00
Tapani Pälli
2ddfca9837 build/glsl: fix android build v2
Commit 77a3efc6b9 broke android build that
sets its own value for GLSL_SRCDIR before including Makefile.sources.
Patch moves overriding the value after include, this works as GLSL_SRCDIR
variable gets expanded only later.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-23 10:13:38 -07:00
Matt Turner
a6b8b709cd automake: convert es1api 2012-08-23 09:40:06 -07:00
Matt Turner
0f8110cb0c automake: convert es2api 2012-08-23 09:38:32 -07:00
Vadim Girlin
68d6441930 st/dri: pass config options to the state tracker
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
a6457c0692 st/mesa: accept and handle configuration options from st/dri
Currently there is a single option - force_glsl_extensions_warn.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
44f69fc825 st/dri: add force_glsl_extensions_warn option to dri options
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
e7c177ec9e st/dri: use driver name for driconf section lookup
The name is taken from the driver_descriptor, so it will be the same as
expected by driconf utility.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
6547733593 swrast: add DRM_DRIVER_DESCRIPTOR to store driver name 2012-08-23 19:57:50 +04:00
Paulo Alcantara
b41f36bde7 egl_dri2: Fix segmentation fault
The segmentation fault occurs when DRI2 is not loaded up and
dri2_setup_screen() function deferences dri2_dpy->dri2 (since it's NULL
at this point).

This patch fixes the segmentation fault by checking if dri2 pointer is
not NULL before deferencing it.

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-23 09:17:23 -06:00
Tom Stellard
90bd1d52bb radeon/llvm: Use the MCCodeEmitter for R600 2012-08-23 15:00:48 +00:00
Tom Stellard
235318a578 radeon/llvm: Use the MCCodeEmitter for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
2de24024c1 radeon/llvm: Set 64BitPtr feature bit for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
3f9b6aa0f4 radeon/llvm: Lower RETFLAG DAG Node to S_ENDPGM on SI 2012-08-23 15:00:48 +00:00
Tom Stellard
e30b4644b6 radeon/llvm: Add AsmPrinter 2012-08-23 15:00:48 +00:00
Tom Stellard
e61c54cb6b radeon/llvm: Mark JUMP as a pseudo instruction 2012-08-23 15:00:48 +00:00
Tom Stellard
ead72204f1 radeon/llvm: Remove the last uses of MachineOperand flags 2012-08-23 15:00:47 +00:00
Tom Stellard
67a47a445b radeon/llvm: Add flag operand to some instructions
This new operand replaces the MachineOperand flags in LLVM, which
will be deprecated soon.  Eventually all instructions should have a flag
operand, but for now this operand has only been added to instructions
that need it.
2012-08-23 15:00:47 +00:00
Tom Stellard
3a7a56e7aa radeon/llvm: Encapsulate setting of MachineOperand flags
MachineOperand flags will be removed soon, so it is convienent to
have only one function that modifies them.
2012-08-23 15:00:47 +00:00
Matt Turner
bee2edbf3d build: Link DRI drivers with dricore in case of no direct rendering
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
bfd7d6f58b build: Only build libmesagallium.la if building Gallium
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
f9786394e5 build: Clean glx Makefile.am
mapi/glapi is already built when make is run in src/glx.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
d9b109892d build: Put mapi/shared-glapi in CORE_DIRS
SRC_DIRS was overwritten (visible in the second hunk).

Also don't require mapi/shared-glapi to be built for GLES.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
8c9b78aad1 build: Only allow shared-glapi with DRI
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
32e8ce6d24 build: Set sensible DRI/X11/OSMesa defaults
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
53248e5f95 build: Print whether shared-glapi is enabled
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
625651cf81 build/x11: Force usage of C++ linker
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
9049b7f0fa build/x11: Don't link against shared-glapi
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
be5fe7b320 build: Remove deprecated --with-driver= flag
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Christian König
302c66ff81 radeonsi: rework vertex format handling
Preventing piglit's draw-vertices test from hanging the GPU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:54 +02:00
Christian König
07838603b9 radeonsi: fix SPI_PS_INPUT_ENA handling
We need to enable at least one interpolation mode,
otherwise the GPU will hang.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:49 +02:00
Vadim Girlin
8d1a9a984f r600g: fix lockups with dual_src_blend v2
Disable blending when dual_src_blend is enabled and number of color exports
in the current fragment shader is less than 2.

Fixes lockups with ext_framebuffer_multisample-
alpha-to-coverage-dual-src-blend piglit test.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-22 12:12:22 +04:00
Jakob Bornecrantz
c4610e9f92 st/dri: Add shared usage on buffers created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Jakob Bornecrantz
61e95b8a5f gbm: Add shared usage on images created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Anuj Phogat
df2c4cbced mesa: Fix generic compressed texture formats' handling in glTexImage/glCopyTexImage
The generic texture formats should be accepted by the <internalformat>
parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and
CopyTexImage2D functions. When the application specifies a generic
format, the driver is free to pick an uncompressed format.

This patch reverts the changes due to following commit:
commit a36581ccc0
mesa: do more teximage error checking for generic compressed formats

This patch fixes compressed texture format failures in intel oglconform
pxconv-gettex test case:
https://bugs.freedesktop.org/show_bug.cgi?id=47220

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-21 15:00:06 -07:00
Tom Stellard
1cb07bd3b8 radeon/llvm: ExpandSpecialInstrs - Add support for cube instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
6c99f2101f radeon/llvm: ExpandSpecialInstrs - Add support for vector instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
82a5d0c641 radeon/llvm: Add R600ExpandSpecialInstrs pass
This pass expends reduction instructions into a MachineInstrBundle that
contains 4 instruction, one for each instruction slot.
2012-08-21 15:42:44 +00:00
Tom Stellard
0588298575 radeon/llvm: Add helper function for getting sub reg indices 2012-08-21 15:42:44 +00:00
Michel Dänzer
1a25ebe3ce radeonsi: Handle NULL sampler views getting passed in by the state tracker.
Don't dereference NULL pointers, and if all views are NULL, don't generate an
invalid PM4 packet which locks up the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-21 15:42:25 +02:00
Ian Romanick
c1114c619a APIspec: Remove cruft about AMD_compressed_???_texture
Mesa doesn't support these extensions, and it seems unlikely that it
ever will

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
4c32ee5bca mesa/es: Remove redundant glFramebufferTexture3D textarget validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
7c9afe50fd mesa/es: Remove redundant glGetShaderiv pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
aaef441638 mesa/es: Remove redundant glCompressedTexImage border validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d39cb8e9ef mesa/es: Remove redundant glPointSizePointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d54004c352 mesa/es: Remove redundant glGetBufferPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
68d7ce3e9e mesa/es: Remove redundant glGetVertexAttribPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5be5cf6934 mesa/es: Remove redundant element type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
b99a8caff1 mesa/es: Remove redundant glGetShaderPrecisionFormat shader type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
c914ac239e mesa/es: Remove redundant depth func validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
af276d9d4b mesa/es: Remove redundant stencil op fail/zfail/zpass validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
f3f993153c mesa/es: Remove redundant shade model mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5a193557d1 mesa/es: Remove redundant light pname and light validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
0234410791 mesa/es: Remove redundant hint mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
a4251da3b2 mesa/es: Remove redundant separate stencil face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
9113d0e686 mesa/es: Remove redundant stencil function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
1087745afe mesa/es: Remove redundant logic op operand validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
bf03589882 mesa/es: Remove redundant alpha function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
8f55d83569 mesa/es: Remove redundant separate stencil mask face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
52d57985c6 mesa/es: Remove redundant front-face mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
e1dbf56a10 mesa/es: Remove redundant face culling mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
66404557db mesa/es: Remove redundant blend equation mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:31 -07:00
Ian Romanick
e39ea674d0 mesa/es: Remove redundant texture target validation
Mesa doesn't check the parameter passed to glMultiTexCoord*.  It does,
however, mask the texture value to prevent out-of-bounds writes.  This
patch will promote this non-conformant behavior to OpenGL ES 1.  I don't
think anyone will care, and the gets some silly code out of a hot path.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:05:11 -07:00
Ian Romanick
386e2f3289 mesa/es: Rearrange placement of GL_TEXTURE_MAX_ANISOTROPY_EXT in APIspec
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:45 -07:00
Ian Romanick
27e55805fb mesa/es: Remove redundant min/mag filter validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:27 -07:00
Mathias Fröhlich
926a4a922f radeon-llvm: Start multithreaded before using llvm.
This is required to make some of llvm's api calls
thread save. In particular the PassRegistry, which is
implicitly accessed while compiling shader programs.
The PassRegistry uses a mutex that is only active if
the llvm_is_multithreaded() returns true.
Calling llvm_start_multithreading() makes this happen
and by calling this function we try to make sure that
we can savely compile shaders in paralell.
Since there is also a call llvm_stop_multithreading()
in the llvm api, we cannot guarantee that this does
not get switched off while we are relying on this being
set, but for the easier use cases this fixes a race with
the radeon llvm compiler we have as of today.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 16:27:23 +00:00
archibald
59361d76a5 r600g: Move common compute/3D register init to its own function
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 15:35:09 +00:00
Christoph Bumiller
c51f8e2790 nv50/ir/tgsi: handle DP2 in tgsi Instruction srcMask
Solved by Tiziano Bacocco on IRC.
2012-08-18 17:38:56 +02:00
Christoph Bumiller
f3a7be740d nv50/ir/emit: don't forget saturation bit on f32 add immediate
Solved by Maxim Levitsky on IRC.
2012-08-18 17:38:45 +02:00
Tilman Sauerbeck
d0ace4e949 mesa: use #if over #ifdef in the FEATURE_ES1 check to fix a build failure.
mfeatures.h will define FEATURE_ES1 to 0 if it's not defined yet.

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-18 07:53:54 -06:00
Brian Paul
5b542681dc st/mesa: fix sampler view counting
In the past, when we called pipe::set_sampler_views(n) the drivers set
samplers [n..MAX] to NULL.  We no longer do that.  The state tracker
code was already trying to set unused sampler views to NULL to cover
that case, but the logic was broken and unnoticed until now.  This patch
fixes it.

Strictly speaking, this patch shouldn't be necessary.  Drivers should simply
ignore unused samplers and sampler views.  But some drivers like llvmpipe (and
others?) count those things and they figure into state validation.  That could
be fixed in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53617

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-18 07:40:10 -06:00
Brian Paul
d65eb02537 util: update and fix u_upload_mgr.h comments 2012-08-18 07:39:52 -06:00
Brian Paul
84e5cb37d3 st/mesa: use Elements() instead of hard-coded number
And add a comment about the velems_util_draw[] array.
2012-08-18 07:39:52 -06:00
Brian Paul
1a9e4d5113 mesa: remove unused params, add const qualifiers
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:52 -06:00
Brian Paul
a6af24ee14 mesa: querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE for a buffer obj is illegal
GL_INVALID_OPERATION is to be raised when querying a non-compressed
image/buffer.  Since a buffer object can't have a compressed format this
query always generates an error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:51 -06:00
Ian Romanick
34472a0d87 mesa/es: Don't generate ES1 type conversion wrappers
These are gradually going to get whittled away and eventually folded into the
source files with the native type functions.

v2: Add (speculative) SConscript changes.  These may be broken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-17 18:12:20 -07:00
Eric Anholt
d707e337f5 i965: Fix bug in the old FS backend's projtex() calculation.
In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not
just texcoords.  Now that we have _mesa_vert_result_to_frag_attrib(), we can
fill in the other FS inputs with correct proj_attrib_mask info.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-17 10:05:34 -07:00
Kenneth Graunke
3df13b32e5 mesa: Support GL_TEXTURE_BUFFER in GetTexLevelParameter[if]v in GL 3.1+.
The OpenGL 3.1 specification explicitly allows this.  Oddly, the
ARB_texture_buffer_object spec's issues section claims this isn't
allowed, but proceeds to explain that the extension simply doesn't edit
the underlying spec to allow it, and thus it didn't appear in the list
of legal texture targets.

Thus, this patch legalizes it only in 3.1+ contexts, but still returns
INVALID_ENUM in earlier contexts that expose ARB_texture_buffer_object.

Unfortunately, the behavior of the call is horrendously undefined.

Fixes oglconform's tbo/negative.textureParams test.

v2: Require desktop OpenGL.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
8c37fc1e92 mesa: Split out part of glGetTexLevelParameter into a helper function.
Move the _mesa_GetTexLevelParameter[iv] functions below the helper
function so the prototype is available.

This will be useful in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
58d11524da mesa: Add GL_TEXTURE_CUBE_MAP to _mesa_max_texture_levels(). [v2]
For cube maps, _mesa_generate_mipmap() calls this with
GL_TEXTURE_CUBE_MAP (the gl_texture_object's Target) rather than one
of the faces.  This caused _mesa_max_texture_levels() to return 0, which
resulted in maxLevels == -1 and the next line's assertion to fail.

This function is called from seven places:
- fbobject.c: framebuffer_texture()
- mipmap.c: _mesa_generate_mipmap()
- texgetimage.c:
  - getteximage_error_check()
  - getcompressedteximage_error_check()
- texparam.c: _mesa_GetTexLevelParameteriv()
- texstorage.c: tex_storage_error_check()

All of these (or their callers) now explicitly check for invalid targets
already, so this shouldn't cause invalid targets to slip through.
(Technically _mesa_generate_mipmap() doesn't check for invalid targets,
but the API-facing _mesa_GenerateMipmapEXT() function does.)

+2 oglconforms (float-texture/mipmap.automatic and mipmap.manual)

In addition to fixing the mipmap bug, it should also cause glTexStorage
to accept GL_TEXTURE_CUBE_MAP, which is explicitly allowed by the spec.

v2: Drop alterations to callers; this is now in a patch series that adds
    explicit checking to API functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
9e4fde85e4 mesa: Add explicit target checking to GetTexLevelParameter[if]v().
Previously, it relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels(), so
this patch should not introduce any change in behavior.  Future patches
will cause the two to diverge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
63396ce4c0 mesa: Add explicit target checking to Get[Compressed]TexImage().
Previously, they relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels() but
removed the proxy targets, as both functions explicitly rejected those
targets.  This changes the order in which we check errors, which could
change whether we return INVALID_VALUE or INVALID_ENUM.  However, it
shouldn't change the list of accepted targets.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Brian Paul
f69273f952 llvmpipe: remove polygon stipple assertion
It's possible for us to have an unused sampler bound when the fragment
shader itself doesn't use any samplers.  So the assertion isn't valid.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53616
2012-08-17 09:07:49 -06:00
Brian Paul
553a08d314 svga: minor code reformatting
To be consistent with other functions.
2012-08-16 17:03:43 -06:00
Matt Turner
81ba2c53b6 build: Remove -shared from OSMesa's LDFLAGS
Would break the static build.
2012-08-16 15:04:54 -07:00
Matt Turner
d12b07eb1a build: Remove EXTRA_LIB_PATH
You can add extra library paths to LDFLAGS directly.
2012-08-16 15:04:54 -07:00
Matt Turner
e273ed37ea build: Require X11 pkg-config files 2012-08-16 15:04:53 -07:00
Marek Olšák
f36c404f90 r600g: disable tiling for 422 formats again 2012-08-16 20:44:54 +02:00
Marek Olšák
795834432b r600g: fix blits of subsampled formats 2012-08-16 20:44:54 +02:00
Marek Olšák
6fd9218bb4 r600g: fix copying between NPOT mipmapped compressed textures
We aligned the dimensions to the blocksize, then divided by it
(in r600_blit.c), then minified, which was wrong.

The minification must be done first, not last.
This fixes piglit/fbo-generatemipmap-formats with S3TC and maybe
a bunch of other tests too. Tested on RV730.
2012-08-16 20:44:54 +02:00
Marek Olšák
b8e9cf5d96 r600g: make F2U trans-only on r600-r700
This fixes a failing assertion in r600_asm.c.
2012-08-16 20:44:53 +02:00
Marek Olšák
0d7e002815 r600g: set CB_COLOR_INFO to INVALID for disabled colorbuffers on r600-r700
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-16 20:44:53 +02:00
Marek Olšák
951ac46a6a r600g: rename r600_resource_texture to r600_texture 2012-08-16 20:44:53 +02:00
Marek Olšák
952c905767 r600g: always put tiled textures in VRAM 2012-08-16 20:44:53 +02:00
Marek Olšák
773ff5705f r600g: cleanup r600_resource_texture in favor of radeon_surface 2012-08-16 20:44:53 +02:00
Marek Olšák
362a25aac5 r600g: remove unused parameter in r600_texture_create_object 2012-08-16 20:44:53 +02:00
Marek Olšák
c4993d15eb r600g: fixup the usage flag for the flushed depth texture 2012-08-16 20:44:53 +02:00
Philipp Brüschweiler
0efd564a09 wayland-drm: close fd after the display is uninitialized
This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
wl_drm display destruction.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-08-16 13:17:06 -04:00
José Fonseca
50dec63790 scons: Fix MinGW cross compilation.
Compensate for the recent changes and assumptions added to
Makefiles.sources
2012-08-16 17:21:52 +01:00
Tom Stellard
5f82d19248 radeon/llvm: Lower implicit parameters before ISel 2012-08-16 16:04:51 +00:00
Brian Paul
0d308ef8fe gallium/draw: move misplaced brace 2012-08-16 09:16:42 -06:00
Brian Paul
f6b7157550 mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image
This seems to be expected by the WebGL texture-mips test.  The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

See http://bugs.freedesktop.org/show_bug.cgi?id=44912

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-16 09:11:14 -06:00
Brian Paul
d663a557fd r600: update sampler, sampler_view code for the future
For when we have pipe->set_sampler_states(pipe, shader, start, num, samplers),
etc.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-16 09:01:31 -06:00
Brian Paul
10e552d056 rbug: update data structures, functions for future changes
To support geom/compute/etc shaders, samplers, sampler views, etc.
To support pipe->bind_sampler_states() w/ start_slot.
2012-08-16 09:01:31 -06:00
Brian Paul
109e87dc6a gallium/trace: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
d4ab8bd095 gallium/identity: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
f3cc4990a0 galahad: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
bd3733c0be svga: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
c969cb1447 llvmpipe: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
25a42f39e3 softpipe: add 'start' parameter to bind_sampler_states/views()
To support updating a sub-range of sampler states/views in the future.
Note that we always pass start=0 at this time.
2012-08-16 09:01:31 -06:00
Brian Paul
348ac08bfd gallium/trace: consolidate sampler, sampler_view code 2012-08-16 09:01:31 -06:00
Brian Paul
0ad95b923a gallium/identity: consolidate sampler, sampler_view code
This will simplify things when the pipe_context functions are consolidated.
2012-08-16 09:01:31 -06:00
Brian Paul
f3c3aff6ef st/mesa: add support for GS textures and samplers 2012-08-16 09:01:31 -06:00
Brian Paul
6c8a132158 st/mesa: combine vertex/fragment sampler state in arrays
As with other recent changes, put the vertex and fragment sampler state
into arrays indexed by the shader type.  This will let us easily add
support for other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
cab2fed135 gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define
PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS
were all defined to the same value (16).

In various places we're creating arrays such as
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming
the same number of max samplers for all shader stages anyway.

Of course, drivers are still free to advertise different numbers of max
samplers for different shaders.
2012-08-16 09:01:31 -06:00
Brian Paul
a2c1df4c9a draw: index samplers and sampler_view state by shader type
So that we can handle GS state and other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
bef196c792 draw: move tgsi-related state into a tgsi sub-struct
To better organize things a bit.
2012-08-16 09:01:31 -06:00
Brian Paul
df87fb5913 gallium: add a shader stage/type param to some draw functions
To prepare for geometry shader texture support in the draw module.
Note: we still only handle the vertex shader case.
2012-08-16 09:01:31 -06:00
Brian Paul
a8ed00d5f1 st/mesa: silence signed/unsigned comparison warning 2012-08-16 09:00:08 -06:00
Brian Paul
d733e5da9c svga: move result->key expression after result != NULL check 2012-08-16 08:58:55 -06:00
Brian Paul
50188adf7d svga: fix result==NULL logic in emit_fs_consts()
The previous test for result != NULL was kind of bogus since we dereferenced
the pointer earlier in the code.  Now, check for result != NULL first, then
get the result->key info.

Also, remove the useless "offset +=" code at the end.
2012-08-16 08:58:55 -06:00
Brian Paul
d55e0f1ba0 svga: update comment (s/SVGA_NEW_VS_RESULT/SVGA_NEW_VS_PRESCALE/) 2012-08-16 08:58:55 -06:00
Brian Paul
2a5eeeaebe svga: rename svga_hw_vs_parameters -> svga_hw_vs_constants
and similarly for svga_hw_fs_parameters
2012-08-16 08:58:55 -06:00
Niels Ole Salscheider
8cc1860d4a st/mesa: index can be negative in the PROGRAM_CONSTANT case
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-16 08:56:09 -06:00
Brian Paul
fd41cbc557 mesa: add cast to silence warning in _mesa_pack_rgba_span_from_ints() 2012-08-16 08:55:48 -06:00
Brian Paul
658044cde1 meta: remove unused variable 2012-08-16 08:53:55 -06:00
Michel Dänzer
1b11395a36 radeonsi: Fix symbol conflicts with r600g.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50389

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 12:01:16 +02:00
Michel Dänzer
51d9f37a72 radeonsi: Fix memory leaks if returning early from some state functions.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
4b64fa2ff1 radeonsi: Fix LLVM context leak.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
18abc270c5 gallium/radeon: Don't assign virtual address space for BO that already has one.
We'd end up re-using the old one and throwing away the new one anyway, but only
after a roundtrip to the kernel.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
a60be05284 gallium/radeon: Create hole for waste when allocating from va_offset.
Otherwise, the wasted area could never be used for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
1f455ef5bc gallium/radeon: Fix potential address space loss in radeon_bomgr_force_va().
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
6d59b7f6dc gallium/radeon: Delete uppermost virtual address space hole if it's at the top.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
f5fe81daea gallium/radeon: Fix losing holes when allocating virtual address space.
If a hole exactly matches the allocated size plus alignment, we would fail to
preserve the alignment as a hole. This would result in never being able to use
the alignment area for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
206d07625c gallium/radeon: Merge holes when freeing virtual address space.
Otherwise we'll likely end up with an ever increasing amount of ever smaller
holes.

Requires keeping the list ordered wrt offsets.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:39:36 +02:00
Michel Dänzer
c25968f3e2 gallium/radeon: Make va_offset 64 bits wide.
Otherwise we'd wrap around after 32 bits. The kernel currently limits GPU
virtual address space to 4GB anyway, but that will probably change sooner or
later, and this would result in confusing error messages when running out of
virtual address space even now.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:37:33 +02:00
Vinson Lee
1597176f70 llvmpipe: Silence Coverity incorrect sizeof expression defect.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:15:49 -07:00
Vinson Lee
3d6892c479 scons: Add option to enable floating-point textures.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:04:24 -07:00
Dave Airlie
6a3ac03f2b glx/dri2: add dri2 prime support.
This adds support for having libGL pick a different driver for prime support.

DRI_PRIME env var is set to the value retrieved from the server randr
provider calls, by the calling process. (generally DRI_PRIME=1 will be
the right answer).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-16 10:02:10 +10:00
Vincent Lejeune
565a4e2a86 radeon/llvm: Enable if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
a614979286 radeon/llvm: Add callbacks needed by if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
0eca5fd919 radeon/llvm: Lower branch/branch_cond into predicated jump
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
6db2e9fdb0 radeon/llvm: Add a predicated JUMP instruction
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8263408a91 radeon/llvm: Support for predicate bit
Tom Stellard:
  - A few changes to predicate register defs

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8f597d57e9 r600g: Glue to handle predicate aware output from llvm
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
72f7632c6b r600g: Fix instruction group merge when there are predicated insts.
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
56227f875b radeon/llvm: Do not use PV/PS if PRED_SEL does not match
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
da676eab93 r600g: Add support for predicates
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Christian König
cf76edd300 radeonsi: move ps sampler state into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
ec5b698525 radeonsi: move ps sampler views into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
54de6f452c radeonsi: move vertex state descriptors into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
f2c95d93db radeonsi: add shader data infrastructure
With this we can embed data for the shaders (like resource
descriptors) into the PM4 stream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
4444b9d1ec radeon/llvm: add support to fetch temps as vectors
Necessary for texture fetches with temp regs as source on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Tom Stellard
b6051bc785 radeon/llvm: Remove AMDGPUUtil.cpp 2012-08-15 18:35:26 +00:00
Apostolos Bartziokas
040c2e0456 radeon/llvm: Cleanup AMDGPUUtil.cpp 2012-08-15 18:35:25 +00:00
Tom Stellard
3aaa209293 radeon/llvm: Lower loads from USE_SGPR adddress space during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
40c41fe890 radeon/llvm: Add live-in registers during DAG lowering
Psuedo instructions emulating live-in registers have been removed
and their corresponding intrinsics are now being lowered during DAG
lowering.
2012-08-15 18:35:25 +00:00
Tom Stellard
f3480f9234 radeon/llvm: Lower store_output intrinsic during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
a76a0f7422 radeon/llvm: Force VTX_READ instructions to use same reg for src and dst
I was seeing some GPU hangs that seemed to be cause by ALU instructions
writing to the same register used as the source for VTX_READ.  Adding
this constraint to the VTX_READ instructions avoids this situation.
2012-08-15 18:35:25 +00:00
Marek Olšák
97b4b97b2f radeonsi: fix build breakage after u_blitter changes 2012-08-15 20:03:37 +02:00
Marek Olšák
e0cc61bd91 gallium/u_blitter: document custom meta helpers 2012-08-15 19:20:58 +02:00
Marek Olšák
b3b5bb9ddb r600g: disable handling of DISCARD_RANGE
https://bugs.freedesktop.org/show_bug.cgi?id=53130
2012-08-15 19:20:58 +02:00
Marek Olšák
44f14ebd7b r600g: implement timestamp query and get_timestamp hook
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 19:20:58 +02:00
Marek Olšák
1932bc8aae r600g: enable MSAA on evergreen by default
v2: add the DRM version check
2012-08-15 19:20:58 +02:00
Marek Olšák
870af19d70 r600g: implement copying between MSAA textures 2012-08-15 19:20:58 +02:00
Marek Olšák
0f86915c53 r600g: implement MSAA color resolve 2012-08-15 19:20:58 +02:00
Marek Olšák
94b634eca0 r600g: implement MSAA depth-stencil decompression and resolve
and integer textures, which are resolved the same as depth, I think.
2012-08-15 19:20:58 +02:00
Marek Olšák
6d3ad2dd2b r600g: implement TXQ_LZ opcode 2012-08-15 19:20:57 +02:00
Marek Olšák
4b78df9c81 r600g: implement MSAA rendering and texturing for evergreen and cayman 2012-08-15 19:20:57 +02:00
Marek Olšák
a01791add0 r600g: implement set_sample_mask 2012-08-15 19:20:57 +02:00
Marek Olšák
6517225078 r600g: implement alpha-to-coverage 2012-08-15 19:20:57 +02:00
Marek Olšák
26cb887ea2 r600g: implement alpha-to-one 2012-08-15 19:20:57 +02:00
Marek Olšák
4f21595276 r600g: remove support for 3-channel colorbuffers
We have no sampler support for them.
2012-08-15 19:20:57 +02:00
Marek Olšák
2f14202f52 configure.ac: bump libdrm_radeon requirement to 2.6.38 2012-08-15 19:20:57 +02:00
Marek Olšák
a7f4d3b740 winsys/radeon: print error if CS is overflowed
and don't submit the CS to the kernel.
2012-08-15 19:20:57 +02:00
Marek Olšák
dc5e61d884 gallium/u_blitter: implement X and Y texture flipping 2012-08-15 19:20:57 +02:00
Marek Olšák
825b45366d gallium/u_blitter: implement blitting multisample resources
It can blit only one sample at a time (it should be called in a loop).
2012-08-15 19:20:57 +02:00
Marek Olšák
dacf5dc9ac gallium: add TGSI support for multisample textures
The only allowed instructions are TXQ_LZ and TXF.

TXQ_LZ is like TXQ, but without the LOD parameter (which is always zero
with MSAA textures)

The 3rd or the 4th texcoord component in TXF should contain the sample index
for a 2D_MSAA or 2D_ARRAY_MSAA texture, respectively.
2012-08-15 19:20:57 +02:00
Marek Olšák
ba53573a8b gallium/tgsi: fix TGSI text parser
The problem was that the string matching succeeded e.g. for "2D" when there
was actually "2D_MSAA" and then failed parsing "_MSAA".

To prevent similar failures in the future, let's fix this kind of error
everywhere.
2012-08-15 19:20:57 +02:00
Marek Olšák
b7c4ee21c5 gallium/u_blit: set dst format from pipe_resource, not pipe_surface
We use it to decide whether we can use resource_copy_region.

NOTE: This is a candidate for the 8.0 branch.
2012-08-15 19:20:57 +02:00
Marek Olšák
1a17c42344 gallium: make pipe_box signed in order to represent flipped blits
This will be used by u_blitter.
2012-08-15 19:20:57 +02:00
Marek Olšák
03b78ceb50 st/mesa: don't clamp fragment color with integer colorbuffer 2012-08-15 19:20:57 +02:00
Marek Olšák
e06d6168cb mesa: flush vertices in test_framebuffer_completeness 2012-08-15 19:20:57 +02:00
Michel Dänzer
538085c5d4 st/egl: Fix up for ClientVersion -> ClientMajorVersion rename.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53513

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-15 10:49:39 +02:00
Jordan Justen
b3900ed5ad i965: add ARB_texture_rgb10_a2ui support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
091eb15b69 meta: allow CopyTexSubImage on integer formats
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
6671d0dad3 mesa ReadPixels: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
f7333b6345 mesa pack: handle packed integer formats with clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
1a814217c3 mesa unpack: call _mesa_problem when unpack function is not available
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
b3dd048cbb mesa texstore: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7208505d30 mesa GetTexImage: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7ef270867c mesa pack: handle uint and int clamping properly
Rename _mesa_pack_rgba_span_int to _mesa_pack_rgba_span_from_uints.
Add _mesa_pack_rgba_span_from_ints.

These separate routines allow the integer clamping to be handled
properly for signed versus unsigned integers.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Chad Versace
1938501fbf intel: Fix rendering to a multisample front buffer
We need to downsample before flushing BUFFER_FAKE_FRONT_LEFT to
BUFFER_FRONT_LEFT in intel_flush_front.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
a43599d1d1 intel: Clean up intel_flush_front
Stop repeating ourselves. Replace the 4 instances of
`driContext->driDrawablePriv` with `driDrawable`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
38b748ce29 intel: Refactor intel_downsample_for_dri2_flush
Move it from intel_screen.c to intel_context.c. Redeclare as non-static.
A future commit will use it in multiple files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Ian Romanick
cde2b7e55d docs: Add EGL extensions to release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-14 15:45:17 -07:00
Ian Romanick
dbecb41300 egl: Allow OpenGL ES 3.0 as a version
In the DRI2 back-end this will get the same API as GLES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
a2ce2eba26 dri2: Note that __DRI_API_GLES2 is also used for OpenGL ES 3.0
Unlike 1.x to 2.0, OpenGL ES 3.0 is backwards compatible with 2.0.  Use the
same API flag for both.  Applications that specifically want 3.0 will specify
this using the major / minor version attributes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
7b4b4f8e68 egl_dri2: Add support for EGL_KHR_create_context and EGL_EXT_create_context_robustness
Just like in GLX, EGL_KHR_create_context requires DRI2 version >= 3, and
EGL_EXT_create_context_robustness requires both DRI2 version >= 3 and the
__DRI2_ROBUSTNESS extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
f171571bfc egl: Implement front-end support for EGL_EXT_create_context_robustness
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
63beb3df98 egl: Implement front-end support for EGL_KHR_create_context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
9d76ad2fac egl_dri2: Silence warnings about missing initializers
egl_dri2.c: At top level:
egl_dri2.c:325:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:325:4: warning: (near initialization for 'swrast_driver_extensions[2].version') [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: (near initialization for 'swrast_core_extensions[1].version') [-Wmissing-field-initializers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
3fd79dd988 egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersion
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
ce55741cbc egl_dri2: Use createContextAttribs if DRI2 version >= 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
38f91f2b08 egl_dri2: Require DRI2 version 2
The extra block in dri2_create_context is to prevent extra white space noise
in the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
0c445bb618 dri_util: Compare against the correct API enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
258771882d mesa: Enable GL_ARB_invalidate_subdata
v2: Add GL_ARB_invalidate_subdata to release notes at Brian's
suggestion.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
07e12c4917 mesa: Add skeleton implementations of glInvalidateTex{Sub,}Image
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Add comment explaining why minimum dimensions are set to 1 for some
texture targets.  Add default case to switch statement to silence
compiler warnings and detect new texture targets.  Both changes
suggested by Brian.  Also use _mesa_is_desktop_gl as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
f241ffd48c mesa: Add skeleton implementations of glInvalidateBuffer{Sub,}Data
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Use _mesa_bufferobj_mapped instead of testing
gl_buffer_object::Pointer as suggested by Brian.  Also use
_mesa_is_desktop_gl as suggested by Ken.

v3: Add a comment by the map subrange / discard range overlap test and
fix an off-by-one error noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
e2370bcc1d mesa/es: Pass context to _mesa_init_bufferobj_dispatch
With this change _mesa_init_bufferobj_dispatch won't set function
pointers that don't exist in OpenGL ES.

v2: Use _mesa_is_desktop_gl and _mesa_is_gles3 as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
342be8aa88 mesa: Add skeleton implementations of glInvalidate{Sub,}Framebuffer
These are part of GL_ARB_invalidate_subdata and OpenGL ES 3.0.

v2: Reject aux buffers in core context, and use _mesa_is_desktop_gl and
_mesa_is_gles3.  Both suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
12249b9c96 glapi: Add GL_ARB_invalidate_subdata
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
2a1ca4ff73 mesa/es3: Add _mesa_is_gles3 predicate
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:29 -07:00
Ian Romanick
9bcb9fad65 intel: Implement ARB_texture_storage
This is basically cut-and-paste from the swrast implementation, and it
could probably be (slightly) more optimal.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:19 -07:00
Ian Romanick
92b614172f mesa: update glext.h to version 83
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 12:19:24 -07:00
Matt Turner
79e9e1b32f build: Use MKDIR_P in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
02f52e8df5 build: Use AM_V_GEN in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
1b200d9001 build: Fix autogen.sh to allow out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
85d355f122 build: Fix out-of-tree generation of builtin_function.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
2191a79b4e build: Fix gtest out-of-tree build
Introduced by 3d000e7dd.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
e939250b63 build: Fix out-of-tree generation of api_exec_es{1,2}.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
5c2a6b74ed build/sources.mak: Add src/glsl/glcpp to INCLUDE_DIRS
Fixes problem where libdricore's of-out-tree build couldn't find
glcpp.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Matt Turner
fa74175210 build/sources.mak: Remove unused GLSL_LIBS
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Ian Romanick
707f067915 mesa: Kill GL_ARB_shadow_ambient with fire
No driver supports this extension, and it seems unlikely than any driver
ever will.  I think r300c may have supported it at one time, but that
driver has already been removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-14 10:40:04 -07:00
Tom Stellard
b49771970b radeon/llvm: Inline immediate offset when lowering implicit parameters 2012-08-14 14:06:20 +00:00
Tom Stellard
2fae8227ad radeon/llvm: Use correct opcocde for BREAK_LOGICALNZ_i32 2012-08-14 13:26:30 +00:00
José Fonseca
ea8dcfc90d scons: Populate top_srcdir and top_builddir variables when reading Makefiles.sources.
This is not entirely correct, as scons doesn't put binaries in a
"src" subdirectory, but doesn't seem to be a problem for now.
2012-08-14 12:19:56 +01:00
Kenneth Graunke
605f964d5c mesa: Use GLdouble for depthMax in final unpack conversions.
The final step of _mesa_unpack_depth_span is to take the temporary
GLfloat depth values and convert them to the desired format.  When
converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use
double-precision math to avoid overflow and precision problems.

Or at least that's the idea.  Unfortunately

   GLdouble z = depthValues[i] * (GLfloat) depthMax;

actually causes single-precision multiplication, since both operands are
GLfloats.  Casting depthMax to GLdouble causes the scaling to be done
with double-precision math.

Fixes a regression in oglconform's depth-stencil basic.read.ds test
since c60ac7b179, where the expected and
actual values differed slightly.  For example, 0xcfa7a6 vs. 0xcfa7a4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 19:16:38 -07:00
Eric Anholt
43e3a7533d i965: Fix the scaling of seconds to ms in perf debug.
*headdesk*
2012-08-13 17:50:25 -07:00
Ian Romanick
d606926013 i965: Validate API and version in brwCreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:38:55 -07:00
Ian Romanick
db273724c9 i915: Validate API and version in i915CreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:36:50 -07:00
Ian Romanick
a81e4b3e92 i830: Validate API and version before calling i830CreateContext
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-13 17:23:48 -07:00
Ian Romanick
2b63624326 intel: In the i915 driver, the chipset cannot be i965
In the i965 dirver, the chipset must be i965.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-13 17:23:24 -07:00
Ian Romanick
70f47505a2 dri: Pass API_OPENGL_CORE through to the drivers
This forces the drivers to do at least some validation of context API
and version before creating the context.  In r100 and r200 drivers, this
means that they don't do any post-hoc validation.

v2: Actually reject compatibility profile 3.2+ contexts.  Thanks Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:12 -07:00
Ian Romanick
7e81f553bc mesa: Filter a bunch more functions based on API
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:00 -07:00
Ian Romanick
0fef911ce4 mesa: Don't advertise extensions that are part of GL 1.5 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
aa0b1e902b mesa: Don't advertise extensions that are part of GL 1.4 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
213945385a mesa: Don't advertise extensions that are part of GL 1.3 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
7ef1869d69 mesa: Don't advertise extensions that are part of GL 1.2 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
4d39b86315 mesa: Don't advertise deprecated extensions in a core context
It may be possible to trim the list of extensions futher.  These are
just the obvious extensions that add functionality that the core context
explicitly forbids.  Apple's core-context extension list is *just* the
extensions on top of the core GL version.  I'm not sure we want to go
that far, but removing some things that have been in core since 2.1 may
be okay.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Christopher James Halse Rogers
cd4a61100d build: Fix libdricore out-of-tree builds (v2)
v2: Add both top_srcdir and top_builddir to mesa asm include dirs.
    These require both in-tree and build-time-generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:54 -07:00
Christopher James Halse Rogers
73fef0178a build/mapi: More killing of TOP in favour of top_srcdir
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:47 -07:00
Christopher James Halse Rogers
77a3efc6b9 build/glsl: fix location of generated files.
Like in src/mesa, use GLSL_BUILDDIR/GLSL_SRCDIR to unambiguously
distinguish between in-tree and generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:39 -07:00
Christopher James Halse Rogers
37a1b8083e build/glapi: fix includes for generated files
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:31 -07:00
Christopher James Halse Rogers
3fe69bac49 build: fix out of tree generation of glapi_mapi_tmp.h
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:25 -07:00
Christopher James Halse Rogers
726f534bbb build/glx: fix include paths for out-of-tree builds
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:17 -07:00
Christopher James Halse Rogers
b2ecaab7ad build: fix location of generated files in src/mesa (v4)
Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
    top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
    These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-08-13 12:24:04 -07:00
Kenneth Graunke
4e087de51a intel: Reserve enough space to finish occlusion queries on Gen6.
After realizing that brw_finish_batch emitted some final PIPE_CONTROLs
to record occlusion queries, Chris noted that we probably hadn't
reserved enough space to actually emit them.

Reserving a full 60 bytes seems a bit harsh, since we only need that
much if occlusion queries are actually active.  Plus, 28 bytes would be
sufficient for Gen7, and 24 for Gen4-5.

We could optimize this in the future, but it doesn't seem too critical.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:28 -07:00
Kenneth Graunke
9da50667f4 intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.
On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
some extra PIPE_CONTROLs to capture the current occlusion query data.
Unfortunately, it was being called *after* _intel_batchbuffer_flush
added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
inside the batch.

Not only does this likely cause bogus occlusion query values, it can
also cause crashes: with the recent change to use 64-bit depth count
writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
happened after the MI_NOOP padding.  This resulted in an odd-length
batch buffer, which resulted in execbuf2 returning -EINVAL and the
application dying with an intel_do_flush_locked failure.

On older generations, finish_batch() doesn't emit any state, so this
change shouldn't have any effect.

Huge thanks to Chris Wilson for helping me figure this out.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:13 -07:00
Eric Anholt
006c1a3c65 i965: Add perf debug for stalls during shader compiles.
v2: fix bad comment from before I gave up and decided to just use doubles.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
97a5f0ff2e i965: Add performance debug for when the state cache gets nuked.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
fc3b7c9b56 i965: Add performance debug for shader recompiles.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
b4da272a6e i965: Add performance debug for fast clear fallbacks.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
0e723b135b intel: Add performance debug for some common GPU stalls.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
4cfb9e3000 i965: Add performance debug for register spilling.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
d72ff03e69 i965: Add INTEL_DEBUG=perf for failure to compile 16-wide shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
79198063b8 intel: Rename INTEL_DEBUG=fall to INTEL_DEBUG=perf.
I want to introduce some more debug output for performance surprises that
includes fallbacks, but aren't necessarily software rasterization.  Leave
INTEL_DEBUG=fall in place for those that have used that flag before.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:24 -07:00
Pauli Nieminen
bf6c1b7470 meta: texture rectangle textures may not have mipmaps
Avoid INVALID_OPERATION error if decompressing rectangle texture.
Setting mipmap level limits for those textures is error that must not be
hit by meta code to mislead user.

[v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's
original changes.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:46 -07:00
Pauli Nieminen
b9daa83463 meta: Use sampler object for mipmap generation
Sampler objects are perfect for meta operations.Sampler object
is separate state object that shadows the sampling state in texture
object. With sampler object mipmap can maintain same sampling state for
all subsequent generation requests.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:43 -07:00
Pauli Nieminen
ac4dc5e931 mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled
Sampler queries are so far made only for enabled texture unit. But if
any code would query sampler before checking texture unit state that
would result to NULL deference.

Making the inline helper easier to use with NULL check makes a lot sense
because compiler is likely to combine the checks for the current texture.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:41 -07:00
Pauli Nieminen
5606bd574e mesa: Remove unnecessary parameters CompressedTexImage
In tune with previous patches. Again there is duplication of information
in function parameters that is good to remove.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:30 -07:00
Pauli Nieminen
c9a7dfcf92 mesa: Remove unnecessary parameters from AllocTextureImageBuffer
Size and format information is always stored in gl_texture_image
structure. That makes it preferable to remove duplicate information from
parameters to make interface easier to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:28 -07:00
Pauli Nieminen
c5af889180 mesa: Remove unnecessary parameters from TexImage
gl_texture_image structure always holds size and internal format before
TexImage driver hook is called. Those passing same information in
function parameters only duplicates information making the interface
harder to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:13 -07:00
Tom Stellard
e98ace934e configure: Check xcb version when X11 pkgconfig exists
Commit 6882381a2e added a dependency on a
newer version of xcb, but the version check wasn't added in all the
necessary places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:42:43 -07:00
Chí-Thanh Christopher Nguyễn
4c73282d2b gbm: Fix build without gallium_drm_loader
pipe_loader_drm_probe_fd only exists if HAVE_PIPE_LOADER_DRM is defined.
Patch improved as suggested by Vadim A. Misbakh-Soloviov.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52962
2012-08-12 14:38:32 -07:00
Christian König
9f5ff5981c radeonsi: move drawing into new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
583c212115 radeonsi: move sync handling into new state handler
So we can remove all the old atom handling.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
303f4b7dcd radeonsi: separate and disable streamout for now
I have my doubts that this code still works on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
696b6cf466 radeonsi: remove ps_partial_flush
Not needed any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
7acb194a7b radeonsi: remove r6xx_flush_and_inv atom
It is not used any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
708337e62e radeonsi: move init state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
862df0885a radeonsi: add support for PKT3 cmds to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
ce40e4726c radeonsi: cleanup shader headers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Chad Versace
996ff1c9bf Revert "mesa: Remove C++11 narrowing warnings"
This reverts commit 9f5a5d541d.

Fixes the following build error on GCC 4.2.3:
  cc1plus: error: unrecognized command line option "-Wno-narrowing"
The GCC Manual incorrectly stated that commit 9f5a5d54 woulde be safe for
old versions of GCC.

Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 14:05:14 -07:00
Brian Paul
16c702ef3b softpipe: fix softpipe_delete_fs_state() failed assertion
The var!=softpipe->fs_variant assertion was failing because we weren't
nulling the softpipe->fs_variant pointer when binding a new shader.
Since softpipe->fs_variant depends on the current fs, it's of no use
when a new FS is bound.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53318

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 13:27:04 -06:00
Brian Paul
3487b93cc4 cso: rearrange some structure fields for consistency 2012-08-10 12:14:17 -06:00
Brian Paul
cf77c29e60 st/mesa: fix renderbuffer validation bug
After we attach a new renderbuffer in this function we need to make
sure Mesa's update_framebuffer() gets called.

Fixes crash in WebGL conformance/textures/texture-attachment-formats.html,
but the test still fails for other reasons.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53316

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 11:49:36 -06:00
Chad Versace
9f5a5d541d mesa: Remove C++11 narrowing warnings
Add -Wno-narrowing to CXXFLAGS for gcc.

It is safe to add this flag even for versions of gcc that don't recognize
it.  From the GCC Manual [1]: "[GCC] allows the use of new -Wno- options
with old compilers".

This removes warnings of the form
    warning: narrowing conversion of X from 'int' to 'float' inside { } is
    ill-formed in C++11 [-Wnarrowing]
in ff_fragment_shader.cpp and gen6_blorp.cpp of the form.  When building
i965, I observed no other difference in the build output.

[1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 09:59:41 -07:00
Brian Paul
f7af4beae5 gallivm: fix crash in lp_sampler_static_state()
Fixes WebGL conformance/uniforms/uniform-default-values.html crash.

We need to check for the null view pointer before accessing view->texture.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53317

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:25 -06:00
Brian Paul
9b04abe368 st/mesa: fix glCopyTexSubImage crash
Fixes a WebGL crash.  The dest texture image is at level 2 and is of
size 1x1 texel.  The st texture image is a stand-alone resource, not
a pointer into a complete mipmap.  So the resource has one level and
trying to write to level 2 blows up.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314
and http://bugs.freedesktop.org/show_bug.cgi?id=53319

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:17 -06:00
Chad Versace
6cb9e99a75 intel: Always downsample in intel_miptree_map_multisample
Always downsample before mapping, even if the map mode contains
GL_MAP_INVALIDATE_RANGE_BIT. If we neglect to downsample when only
a subrect is mapped then the upsample in intel_miptree_unmap_multisample
may write garbage to the region outside the subrect.

(Eric gave my patch e88cfbb a conditional reviewed-by with the condition
that it always downsample before mapping. I forgot to make that change
before pushing the patch.)

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-09 15:21:02 -07:00
Eric Anholt
04a11b5f5e i965/gen6+: Add support for edge flags.
Fixes the 3 new piglit edgeflag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40707
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:50 -07:00
Eric Anholt
b3367f56d8 i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.
Fixes piglit gl-2.0/edgeflag.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
3eb8d71225 i965/vs: Add comment noting copy_edgeflag state dependency.
It's already in the state struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
e119f98472 i965/vs: Add support for copying user edge flags.
Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Olivier Galibert
7426d9d769 i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.
If there was an edge flag or a two-side-color pair present, we'd end up
mismatched and read values from earlier in the VUE for later FS inputs.

v2: Fix regression in gles2conform shaders generating point size. (change by
    anholt)

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 branch.
2012-08-09 09:07:49 -07:00
Vinson Lee
3466538171 st/mesa: Initialize tgsi_texture_offset Padding field.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 22:36:27 -07:00
Kenneth Graunke
68bccc40f5 glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.
If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0.  (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-08 17:15:21 -07:00
Tapani Pälli
94f22fbe78 intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2
Patch changes i915 and i965 drivers to use fixed function version of
meta clear when running on ES 1.1. This fixes rendering errors seen with
Google Maps, Angry Birds and Gallery3D on Android platform.

Change 88128516d4 exposes all extensions
internally to be available independent of GL flavour, therefore check
against ARB_fragment_shader does not work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 17:15:21 -07:00
Kenneth Graunke
5deb1d1a1f i965: Rework the extra flushes surrounding occlusion queries.
This removes the CS stall on Ivybridge.

On Sandybridge, the depth stall needs to be preceded by a non-zero
post-sync op, which requires a CS stall, which needs a stall at
scoreboard.  Emit the full workaround.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 17:15:21 -07:00
Eric Anholt
b0adbda75a i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.
I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates.  Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:31 -07:00
Eric Anholt
9b4053cabd i965: Drop the confusing saturate argument to math instruction setup.
This was ridiculous.  We were ignoring the inst->header.saturate flag in the
case of math and only math.  On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument.  On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:30 -07:00
Eric Anholt
33dfdc735e i965: Make brw_set_saturate() use stdbool.
There was a chance for brw_wm_emit.c to screw up and pass (1 << 4) instead of
1, which would get converted to 0 when stored.  Instead, use stdbool which
converts nonzero to true/1 like we want.
2012-08-08 16:21:30 -07:00
Eric Anholt
1b148e660e mesa: In conditional rendering fallback, check the query status.
Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Eric Anholt
4bbd120368 mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting.  It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Ian Romanick
9f7b3d1713 Make shared-glapi the default
You can't practically have desktop OpenGL and OpenGL ES on the same system
without this.  The benefits of not having it (e.g., a more compact dispatch
table) are irrelevant.

v2: Don't mark shared-glapi as experimental.  Review suggestion by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
5602f0f955 mesa/tests: Fix trivial typos in src/mapi/glapi tests
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
45d3d0ad21 mesa/tests: Add tests for the generated shared-glapi dispatch table
These are largely based on the src/mapi/glapi/tests.  However,
shared-glapi provides less external visibility into the dispatch table,
so there is less to test.  Also, shared-glapi does not implement
_glapi_get_proc_name, so that test was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
d9f899bb93 glapi: Prevent accidental use of lies w/shared-glapi
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
99fee476a1 glx: Don't use glapitable.h at all
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  Avoiding the use of glapitable.h avoids the lies.  The only
entries used in this code are entries that are ABI.  For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
f5dffb7e36 glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  There are two completely separate code generation paths used to
assign dispatch offset.  Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed.  There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi.  So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
52d6df8aa7 mesa/tests: Don't build glapi tests with shared-glapi
This fixes 'make check' on with --enable-shared-glapi.  This test cannot work
in that environment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:25 -07:00
Kenneth Graunke
e45a9ce474 i965: Use 64-bit writes for occlusion queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:23 -07:00
Kenneth Graunke
20c09b82d0 i965: Refactor depth count write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:21 -07:00
Kenneth Graunke
a2cdd5ada8 i965: Emit a CS stall before timestamp writes.
This implements one of the Sandybridge PIPE_CONTROL workarounds.  It
doesn't appear to be required for Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:19 -07:00
Kenneth Graunke
c4c78c275a i965: Use 64-bit writes for timestamp queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:16 -07:00
Kenneth Graunke
03f14664b6 i965: Refactor timestamp write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:14 -07:00
Kenneth Graunke
61d0b9f52c intel: Make the length for PIPE_CONTROL explicit.
PIPE_CONTROL has variable length, depending upon generation and whether
we want to do 32-bit or 64-bit data writes.  Make it explicit, rather
than hiding a length of 4 in the #define for _3DSTATE_PIPE_CONTROL.

Generated by s/3DSTATE_PIPE_CONTROL/3DSTATE_PIPE_CONTROL | (4 - 2)/g.
This is equivalent since the #define used to have | 2 in it.  A grep
through the sources shows that all instances have been converted, so
it's safe to remove the | 2 from the #define.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:23:57 -07:00
Brian Paul
ecac178aa2 swrast: add missing switch case for API_OPENGL_CORE
To silence compiler warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
b4d6502fcd gallivm: remove unused src_elem_type variable
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
f21669e9a2 svga: remove unused svga_shader::use_sm30 field, add comments
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
16a289195e svga: remove unused svga_winsys_handle type
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Michel Dänzer
82cd9c0fc2 radeonsi: If pixel shader compilation fails, use a dummy shader.
Otherwise we're likely to hang the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 15:33:38 +02:00
Christian König
be42a45e02 radeonsi: fix memory leak and/or segfaults
Fix a stupid typo that could lead to memory
leaks and/or segfaults.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:36:49 +02:00
Christian König
8c44e5a144 radeon/winsys: fix winsys VM handling
Move releasing the VM area after closing the bo handle.

This partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45018

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:35:10 +02:00
Vinson Lee
7528e2104f translate: Fix typo in is_legal_int_format_combo.
Fixes same on both sides defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-07 22:34:28 -07:00
Marek Olšák
1ea263fccb r600g: remove unused parameters in texture functions 2012-08-07 23:39:52 +02:00
Eric Anholt
4a078516b6 i965: Enable uniform buffer objects on gen6+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
04871058eb i965/vs: Add support for loading uniform buffer variables as pull constants.
Unlike the FS side in the previous commit, this does variable indexing just
fine, using the same code as we used for other variable-indexed pull
constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
90de96ff0d i965/fs: Add support for loading uniform buffer variables as pull constants.
Variable array indexing isn't finished, because the lowering pass
turns it all into conditional moves of constant index accesses so I
can't test it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bb020d09c3 i965/vs: Add a surface index to VS_OPCODE_PULL_CONSTANT instructions.
Similar to the previous commit for the fragment shader, now we have a buffer
index and an offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
454dc83f66 i965/fs: Communicate the pull constant block read parameters through fs_regs.
I wanted to add the surface index as a variable value for UBO support,
and a reg seemed like the obvious way to go.  This exposes more of the
information to CSE, which we'll probably want to apply to pull
constant loads for UBOs eventually (you might access 4 floats in a
row, each of which would produce an oword block read of the same
block).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
25d2bf3845 i965: Bind UBOs as surfaces like we do for pull constants.
v2: Comment fix, drop extraneous parens (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5bffbd7ba2 i965: Add an offset argument to constant buffer setup.
We'll use this for UBO surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5fc5b29a54 mesa: Add support for glUniformBlockBinding() in display lists.
Fixes piglit GL_ARB_uniform_buffer_object/dlist.

v2: Use the .ui fields instead of .i for type consistency (review by Brian
    Paul)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bfa046b5f2 mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
1eb3c06ae8 mesa: Default to GL 3.1's limits on uniform blocks.
The ARB spec lets you get away with the default block counting against the
blocks for combined size limits.  The core spec says you need to be able to
support the maximum size of default block *and* the maximum size of each
uniform block.  I see no reason that any driver would have a problem with
that.

Fixes gl 3.1/minmax (with an associated fix to the test)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
803262a5f5 glsl: Refuse to parse uniform block declarations when UBOs aren't available.
Fixes piglit
GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
e45f1b11c0 glsl: Align GL_UNIFORM_BLOCK_DATA_SIZE according to std140 rules.
Fixes piglit GL_ARB_uniform_buffer_object/data-size test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
86e0045578 glsl: Only flag RowMajor on matrix-type variables.
We were only propagating it to the API when the variable was a matrix type,
but we were still tripping over it in lower_ubo_reference when it was set on a
vector.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
ffb2d43059 glsl: Fix calculation of std140 offset alignment for mat2s.
We were getting the base offset of a vec2, not of a vec2[2] like the quoted
spec text says we should.

v2: Fix swapped then/else cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
300315fe69 glsl: Fix glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX).
Previously, we were returning the index into the UniformBlocks of one of the
linked shaders, when it's supposed to be the program global index.

Fixes piglit getactiveuniformsiv-uniform_block_index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
af3fc6bb28 ir_to_mesa: Don't whack the ->location field of uniform block variables.
Fixes some failures in GL_ARB_uniform_buffer_object/maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
56e82e30cb mesa: Make glBindBufferBase/glBindBufferRange() work on just-genned names.
In between glGenBuffers() and glBindBuffer(), the buffer object points to this
dummy buffer with a name of 0, and a glBindBufferBase() would point to that.
It seems pretty clear, given that glBindBufferBase() only cares about the
current size of the buffer at render time, that it should bind up the buffer
that you passed in instead of pointing it at this useless dummy buffer.

However, what should glBindBufferRange() do?  As of this patch, it will
promote the genned buffer to a proper buffer like it had been
glBindBuffer()ed, and then detect that the size is greater than the buffer's
current size of 0 and throw INVALID_VALUE.  It seems like the most reasonable
answer here.

Note that this also changes the behavior of these two on non-glGenBuffers() bo
names.  We haven't yet set up the error throwing for glBindBuffers() on gl
3.1+, and my assumption is that these two functions should inherit their
behavior on un-genned names from glBindBuffers().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
a75f2681d2 glsl: Add a lowering pass to turn complicated UBO references to vector loads.
v2: Reduce the impenetrable code in emit_ubo_loads() by 23 lines by keeping
    the ir_variable as the variable part of the offset from handle_rvalue(),
    and track the constant offsets from that with a plain old integer value,
    avoiding a bunch of temporary variables in the array and struct handling.
    Also, fix file description doxygen.
v3: Fix a row vs col typo, and fix spelling in a comment.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-07 13:54:47 -07:00
Eric Anholt
8c2a983835 glsl: Add a variant of the rvalue visitor for handle_rvalue() on the way down.
For the UBO lowering pass, I want to see the whole dereference chain for
replacing, not the innermost ir_dereference_variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
2ea3ab14f2 glsl: Add a "ubo_load" expression type for fetches from UBOs.
Drivers will probably want to be able to take UBO references in a
shader like:

        uniform ubo1 {
                float a;
                float b;
                float c;
                float d;
        }

        void main() {
             gl_FragColor = vec4(a, b, c, d);
        }

and generate a single aligned vec4 load out of the UBO.  For intel,
this involves recognizing the shared offset of the aligned loads and
CSEing them out.  Obviously that involves breaking things down to
loads from an offset from a particular UBO first.  Thus, the driver
doesn't want to see

	variable_ref(ir_variable("a")),

and even more so does it not want to see

	array_ref(record_ref(variable_ref(ir_variable("a")),
          "field1"), variable_ref(ir_variable("i"))).

where a.field1[i] is a row_major matrix.

Instead, we're going to make a lowering pass to break UBO references
down to expressions that are obvious to codegen, and amenable to
merging through CSE.

v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
71ba6de342 glsl: Fix a reference to UniformBlocks during uniform linking.
When converting var->location from pointing at the program's UniformBlocks to
pointing at the linked shader's UniformBlocks, I missed this change.  It
usually worked out in the end because the two lists happen to be the same in
many testcases.

Fixes a valgrind complaint on
oglconform ubo-compile.cpp advanced.std140.2stage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
7e42302e71 glsl: Update the notes on adding a new expression type.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
9c1b41879a mesa: Replace VersionMajor/VersionMinor with a Version field.
As we get into supporting GL 3.x core, we come across more and more features
of the API that depend on the version number as opposed to just the extension
list.  This will let us more sanely do version checks than "(VersionMajor == 3
&& VersionMinor >= 2) || VersionMajor >= 4".

v2: Fix a bad <= 30 check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:19 -07:00
Eric Anholt
3aaeb3e5e7 intel: Fix compiler warnings from winsys msaa. 2012-08-07 11:47:11 -07:00
Chad Versace
e943e5c291 intel: Advertise multisample DRI2 configs on gen >= 6
This turns on window system MSAA.

This patch changes the id of many GLX visuals and configs, but that
couldn't be prevented. I attempted to preserve the id's of extant configs
by appending the multisample configs to the end of the extant ones. But
somewhere, perhaps in the X server, the configs are reordered with
multisample configs interspersed among the singlesample ones.

Test results:
  Tested with xonotic and `glxgears -samples 1` on Ivybridge.

  No piglit regressions on Ivybridge.

  On Sandybridge, passes 68/70 of oglconform's
  winsys multisample tests.  The two failing tests are:
      multisample(advanced.pixelmap.depth)
      multisample(advanced.pixelmap.depthCopyPixels)
  These tests hang the gpu (on kernel 3.4.6) due to
  a glDrawPixels/glReadPixels pair on an MSAA depth buffer.  I don't expect
  realworld apps to do that, so I'm not too concerned about the hang.

  On Ivybridge, passes 69/70. The failing case is
  multisample(advanced.line.changeWidth).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:34 -07:00
Chad Versace
8b5d68dd28 intel: Clarify intel_screen_make_configs
This function felt sloppy, so this patch cleans it up a little bit.

- Rename `color` to `i`. It is not a color value, only an iterator int.
- Move `depth_bits[0] = 0` into the non-accum loop because that is where
  it used. The accum loop later overwrites depth_bits[0].
- Rename `depth_factor` to `num_depth_stencil_bits`.
- Redefine `msaa_samples_array` as static const because it is never
  modified. Rename to `singlesample_samples`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
a4bf68ca50 dri: Simplify use of driConcatConfigs
If either argument to driConcatConfigs(a, b) is null or the empty list,
then simply return the other argument as the resultant list.

All callers were accomplishing that same behavior anyway. And each caller
accopmplished it with the same pattern. So this patch moves that external
pattern into the function.

Reviewed-by: <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
b2d428cb8d intel: Refactor creation of DRI2 configs
DRI2 configs were constructed in intelInitScreen2. That function already
does too much, so move verbatim the code for creating configs to a new
function, intel_screen_make_configs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
61fd684782 intel: Downsample on DRI2 flush
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e88cfbb95f intel: Support mapping multisample miptrees
Add two new functions: intel_miptree_{map,unmap}_multisample, to which
intel_miptree_{map,unmap} dispatch. Only mapping flat, renderbuffer-like
miptrees are supported.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4c0ccc13bd intel: Refactor use of intel_miptree_map
Move the opencoded construction and destruction of intel_miptree_map into
new functions, intel_miptree_attach_map and intel_miptree_release_map.
This patch prevents code duplication in a future commit that adds support
for mapping multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
81980958d0 intel: Refactor intel_miptree_map/unmap
Move the body of intel_miptree_map into a new function,
intel_miptree_map_singlesample. Now intel_miptree_map dispatches to the
new function. A future commit adds a multisample variant.

Ditto for intel_miptree_unmap.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6b56140b4b i965: Mark needed downsamples for msaa winsys buffers
Add function intel_renderbuffer_set_needs_downsample. It is a no-op
except on multisample winsys buffers shared with DRI2.

Mark the needed downsamples with the new function at two locations:
    - Immediately after drawing is complete.
    - After blitting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
d3746354fb intel: Define functions for up/downsampling on miptrees
Flesh out the stub functions intel_miptree_{up,down}sample.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6cc9df331b i965: Add function brw_blorp_blit_miptrees
Define a function, brw_blorp_blit_miptrees, that simply wraps
brw_blorp_blit_params + brw_blorp_exec with C calling conventions. This
enables intel_miptree.c, in a following commit, to perform blits with
blorp for the purpose of downsampling multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
f4873babdc intel: Allocate miptree for multisample DRI2 buffers
Immediately after obtaining, with DRI2GetBuffersWithFormat, the DRM buffer
handle for a DRI2 buffer, we wrap that DRM buffer handle with a region and
a miptree. This patch additionally allocates an accompanying multisample
miptree if the DRI2 buffer is multisampled.

Since we do not yet advertise multisample GL configs, the code for
allocating the multisample miptree is currently inactive.

This patch adds the following fields to intel_mipmap_tree:
    singlesample_mt
    needs_downsample
and the following function stubs:
    intel_miptree_downsample
    intel_miptree_upsample

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4eba67285f intel: Refactor creation of hiz and mcs miptrees
Move the logic for creating the ancillary hiz and mcs miptress for winsys
and non-texture renderbuffers from intel_alloc_renderbuffer_storage to
intel_miptree_create_for_renderbuffer. Let's try to isolate complex
miptree logic to intel_mipmap_tree.c.

Without this refactor, code duplication would be required along the
intel_process_dri2_buffer codepath in order to create the mcs miptree.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e2f2376e88 intel: Set num samples for winsys renderbuffers
Add a new param, num_samples, to intel_create_renderbuffer and
intel_create_private_renderbuffer.

No multisample GL config is yet advertised, so the value of num_samples is
currently 0.  For server-owned winsys buffers, gl_renderbuffer::NumSamples
is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
53fa28f7b1 intel: Refactor quantize_num_samples
Rename quantize_num_samples to intel_quantize_num_samples and change the
first param from struct intel_context* to struct intel_screen*. The
function will later be used by intelCreateBuffer, which is not bound to
any context but is bound to a screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
7a2e40ed28 intel: Update stale comment for intel_miptree_slice::map
The comment referred to intel_tex_image_map/unmap, but should more
accurately refer to intel_miptree_map/unmap.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Paulo Zanoni
4b40375c43 i965: add more Haswell PCI IDs
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:13:47 -03:00
Brian Paul
8433f80add egl: remove redundant PFNEGLQUERYSTREAMTIMEKHRPROC typedef
This typedef is present earlier in the header and isn't part of the
EGL_KHR_stream_cross_process_fd extension.  Looks like a Khronos glitch.
2012-08-07 07:31:05 -06:00
Brian Paul
99695f58fd softpipe: fix loop limit for tex_cache[] array
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53199
2012-08-07 08:00:46 -06:00
Vinson Lee
7d65356d8a st/mesa: Fix a potential memory leak in get_mesa_program.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:08:56 -07:00
Vinson Lee
c3894bc2d5 gallivm: Add constructor for raw_debug_ostream.
Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:07:31 -07:00
Brian Paul
e622723918 docs: update ARB_debug_output status to DONE 2012-08-06 16:48:00 -06:00
Jason Wood
56c1f55c51 docs: Add OpenGL 4.3 requirements
v2: Note that GLSL 4.3 has not been started, and that
ARB_compute_shader has been started in Gallium drivers.

Signed-off-by: Jason Wood <sandain@hotmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:41:24 -06:00
Ian Romanick
45e592c3dd egl: Import eglext.h version 14
This is necessary for EGL_KHR_create_context work (including writing
piglit tests).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
b50703aea5 egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_context
KHR extension name is reserved for Khronos ratified extensions, and there is
no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}.  Replace these
three extensions with EGL_KHR_surfaceless_context since that extension
actually exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
cb77f5dd1f egl_dri2: Refactor dereference of dri2_ctx_shared
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
05413ddb1d egl_dri2: Remove swrast version >= 2 checks
Since support for swrast version 2 was added (f55d027a), it has also been
required.  In swrast_driver_extensions, version 2 is set for __DRI_SWRAST
extension.  Remove the spurious version checks sprinked through the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
63adb6b9ea dri2: Fix bug in attribute handling for non-desktop OpenGL contexts
Previously an error would be generated if any attributes were specified when
creating a non-desktop OpenGL context.  This was a mistake, and it will
prevent old drivers from working with new EGL libraries that add support for
the createContextAttribs interface.  Instead, match the behavior of
EGL_KHR_create_context: allow versions that make sense, reject non-zero flags.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Andreas Boll
102617bc52 docs: update piglit url
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Andreas Boll
933e13e2af docs/helpwanted: add r600g and i915g todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Kenneth Graunke
caa4ae5d7d i965: Allocate dummy slots for point sprites before computing VUE map.
Commit f0cecd43d6 moved the VUE map computation to be only once, at
VS compile time.  However, it did so in slightly the wrong place: it
made the one call to brw_vue_compute_map happen right before the
allocation of dummy slots for replaced point sprite coordinates, causing
a different VUE map to be generated (at least on Ironlake).

Fixes a regression in Piglit's point-sprite test on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46489
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:40 -07:00
Kenneth Graunke
54c045b93c i965/vs: Don't clobber sampler message MRFs with subexpressions.
See the preceding commit for a description of the problem.

NOTE: This is a candidate for stable release branches.

v2: Use a separate dPdx variable rather than reusing the lod src_reg.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:15 -07:00
Kenneth Graunke
c0f60106df i965/fs: Don't clobber sampler message MRFs with subexpressions.
Consider a texture call such as:

   textureLod(s, coordinate, log2(...))

First, we begin setting up the sampler message by loading the texture
coordinates into MRFs, starting with m2.  Then, we realize we need the
LOD, and go to compute it with:

   ir->lod_info.lod->accept(this);

On Gen4-5, this will generate a SEND instruction to compute log2(),
loading the operand into m2, and clobbering our texcoord.

Similar issues exist on Gen6+.  For example, nested texture calls:

  textureLod(s1, c1, texture(s2, c2).x)

Any texturing call where evaluating the subexpression trees for LOD or
shadow comparitor would generate SEND instructions could potentially
break.  In some cases (like register spilling), we get lucky and avoid
the issue by using non-overlapping MRF regions.  But we shouldn't count
on that.

Fixes four Piglit test regressions on Gen4-5:
- glsl-fs-shadow2DGradARB-{01,04,07,cumulative}

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:11 -07:00
Kenneth Graunke
27bf9c1997 i965/fs: Factor out texcoord setup into a helper function.
With the textureRect support and GL_CLAMP workarounds, it's grown
sufficiently that it deserves its own function.  Separating it out
makes the original function much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:09 -07:00
Kenneth Graunke
82bfb4b41a i965/fs: Move message header and texture offset setup to generate_tex().
Setting the texture offset bits in the message header involves very
specific hardware register descriptions.  As such, I feel it's better
suited for the lower level "generate" layer that has direct access to
the weird register layouts, rather than at the fs_inst abstraction layer.

This also parallels the approach I took in the VS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:00 -07:00
Jerome Glisse
2df399c34b r600g: atomize sampler state v2
Use atom for sampler state. Does not provide new functionality
or fix any bug. Just a step toward full atom base r600g.

v2: Split seamless on r6xx/r7xx into it's own atom. Make sure it's
    emited after sampler and with a pipeline flush before otherwise
    it does not take effect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-08-06 12:04:55 -04:00
Alex Deucher
d3f8000bfc radeonsi: add some new pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Alex Deucher
a6146d2566 r600g: add additional evergreen pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Brian Paul
8eeeef3705 st/mesa: merge fragment/vertex sampler update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:20 -06:00
Brian Paul
819e786339 st/mesa: massage update_vertex_samplers() code
...to look like update_fragment_samplers() code, as with the previous
commit.  The next step would be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:19 -06:00
Brian Paul
2aac0d145a st/mesa: merge fragment/vertex texture update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:11 -06:00
Brian Paul
dd6aafcf72 st/mesa: massage the update_vertex_textures() code
...to look like update_fragment_textures() code.  The next step would
be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
5749ae919e st/mesa: rename some vertex/fragment state fields for better consistency
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
29604441de llvmpipe: consolidate the sampler and sampler view setting code
Less code.  And as with softpipe, if/when we consolidate the pipe_context
functions for binding sampler state, this will make the llvmpipe changes
trivial.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
b3538d3563 llvmpipe: combine vertex/fragment sampler state into an array
This will allow code consolidation in the next patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
1f34e1a6cb softpipe: consolidate vert/frag/geom sampler setting functions
The functions for setting samplers and sampler views for vertex,
fragment and geometry shaders were nearly identical.  Now they
use shared code.

In the future, if the pipe_context functions for setting samplers
and sampler views for vert/frag/geom/compute are combined, this
will make updating the softpipe driver a snap.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
d6c3e6d8f3 softpipe: consolidate sampler-related arrays
Combine separate arrays for vertex/fragment/geometry samplers, etc into
one array indexed by PIPE_SHADER_x.

This allows us to collapse separate code for vertex/fragment/geometry
state into loops over the shader stage.  More to come.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
0a14e9f09f softpipe: combine vert/frag/geom texture caches in an array
This lets us consolidate some code now, and more in subsequent patches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Vinson Lee
61b62c007a mesa: Fix off-by-one error in Parse_TextureImageId.
Fixes out-of-bounds write defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:42:23 -07:00
Vinson Lee
3e7b3a04bf util: Move dereference after null check in util_resource_copy_region.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:41:27 -07:00
Brian Paul
a5ca29100b i915g: silence a const pointer warning 2012-08-04 08:38:11 -06:00
Marek Olšák
f9a498d1bc radeonsi: fix build failure after blitter changes 2012-08-04 16:34:24 +02:00
Marek Olšák
cb922b63eb r600g: precompute color buffer state in pipe_surface and reuse it 2012-08-04 14:05:52 +02:00
Marek Olšák
cdc681c3ad r600g: precompute depth buffer state in pipe_surface and reuse it
This is done on-demand, because we don't know in advance if a zbuffer
will be bound as depth or color.
2012-08-04 14:05:51 +02:00
Marek Olšák
e6dfc8c77b r600g: simplify create_surface 2012-08-04 14:05:51 +02:00
Marek Olšák
581f7e3101 r600g: drop the old texture allocation code
Made obsolete by the libdrm surface allocator.
2012-08-04 14:05:51 +02:00
Marek Olšák
7c371f4695 r600g: make sure copying of all texture formats is accelerated 2012-08-04 14:05:51 +02:00
Marek Olšák
84645fa613 gallium/u_blitter: add a query for checking whether copying is supported
v2: add comments
2012-08-04 14:05:37 +02:00
Marek Olšák
e2f623f1d6 r600g: don't decompress depth or stencil if there isn't any 2012-08-04 13:53:07 +02:00
Marek Olšák
ea72351a91 r600g: correct texture memory size for Z32F_S8X24 on evergreen 2012-08-04 13:53:07 +02:00
Marek Olšák
c8ff737a18 gallium/u_blitter: remove fallback for stencil copy that all drivers skipped
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
ef1bf6d69e gallium/u_blitter: add ability to blit only depth or only stencil
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8842678047 gallium: define PIPE_MASK_RGBAZS
I need this and it seems like it could be useful.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8aaf6972d1 gallium/u_blitter: minor cleanup
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
67a3e5bc32 gallium/tgsi: fixup texture name strings
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6c420b1668 gallium/u_blitter: set sample mask to ~0
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
9d1ef354f9 gallium/u_blit: bail out if src is a multisample texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6b3f1ae12b gallium/u_blit: check nr_samples before using resource_copy_region
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
e7689303a8 gallium: set sample mask to ~0 for clear, blit and gen_mipmap
The sample mask affects single-sampled rendering too (it's orthogonal
to the color mask).

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:06 +02:00
Dave Airlie
cd97a5f660 r600g: fix F2U opcode translation
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-08-04 13:45:27 +02:00
Vinson Lee
5bce0b5175 draw: Ensure channel in convert_to_soa is initialized.
Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-03 22:28:31 -07:00
Vinson Lee
9d36b3abfd u_blitter: Move a pointer dereference after null check.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 22:27:13 -07:00
Matt Turner
fb85558ab1 Use C99 NAN and INFINITY macros 2012-08-03 15:02:09 -07:00
Brian Paul
65da837fcf gallium/tests/trivial: updates for CSO interface changes 2012-08-03 11:58:43 -06:00
Brian Paul
c61d3fe8bd st/xorg: updates for CSO interface changes 2012-08-03 11:56:36 -06:00
Brian Paul
459dd56897 st/xa: updates for CSO interface changes 2012-08-03 11:56:28 -06:00
Brian Paul
3d1bec5d9a vega: fix build breakage from cso sampler/view changes 2012-08-03 08:33:23 -06:00
Brian Paul
832706a80b cso: remove unreachable break statements 2012-08-03 07:16:35 -06:00
Brian Paul
076e5eacf1 cso: 80-column wrapping, remove trailing whitespace, etc 2012-08-03 07:16:35 -06:00
Brian Paul
ea6f035ae9 gallium: consolidate CSO sampler and sampler_view functions
Merge the vertex/fragment versions of the cso_set/save/restore_samplers()
functions.  Now we pass the shader stage (PIPE_SHADER_x) to the function
to indicate vertex/fragment/geometry samplers.  For example:

cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler);

This results in quite a bit of code reduction, fewer CSO functions and
support for geometry shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 07:16:35 -06:00
Vinson Lee
350f12fb65 st/mesa: Ensure dst in compile_instruction is initialized.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-02 21:10:49 -07:00
Tom Stellard
f6ad8b45c2 radeon/llvm: Add $(LLVM_LDFLAGS) to the loader linker flags 2012-08-02 20:12:11 +00:00
Tom Stellard
4a89a20717 radeon/llvm: Add support for more f32 CMP instructions on SI 2012-08-02 20:12:11 +00:00
Tom Stellard
a35eea7868 radeon/llvm: Add support for fneg on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
4104bae063 radeon/llvm: Add support for fp_to_sint on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
f7fcaa07df radeon/llvm: Remove CMOVLOG DAG node 2012-08-02 20:12:06 +00:00
Tom Stellard
a5ac8ee2c5 radeonsi: Properly initialize si_shader_ctx.radeon_bld 2012-08-02 13:21:30 -04:00
Michel Dänzer
c2bae6b91d radeonsi: Handle TGSI TXP opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:47 +02:00
Michel Dänzer
93b4f1f97e radeonsi: Handle TGSI DIV opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:16 +02:00
Brian Paul
daf4254d07 svga: remove questionable INLINE qualifiers 2012-08-02 09:40:41 -06:00
Brian Paul
421f134028 svga: sort #includes 2012-08-02 09:40:40 -06:00
Brian Paul
81f2f3f65c svga: add some comments in svga_screen_cache.c 2012-08-02 09:40:40 -06:00
Brian Paul
4b5a5898b1 svga: whitespace, formatting fixes 2012-08-02 09:40:40 -06:00
Brian Paul
bcd8d9713d svga: remove unneeded 'struct svga_screen' declarations 2012-08-02 09:40:40 -06:00
Brian Paul
8551635242 mesa: fix default_access_mode() result for ES2
The GL_OES_mapbuffer extension is supported by OpenGL ES 1 and ES 2 so return
GL_MAP_WRITE_BIT for both ES versions, not just ES 1.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-02 09:40:40 -06:00
Brian Paul
3eb2b5c5e4 mesa: default_access_mode() returns a GLbitfield, not GLenum 2012-08-02 09:40:40 -06:00
José Fonseca
4bd36956f8 scons: set YACCHXXFILESUFFIX to stop needless rebuilding of the parser
Before, the GLSL parser was getting rebuilt every time that scons was
run.  The problem was scons was expecting a glsl_parser.hpp file but
we were generating a glsl_parser.h file.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-02 09:40:40 -06:00
Christian König
41625afa2f radeonsi: initial VDPAU target
Windowed speed is of course way to slow, but fullscreen
works like a charm now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 15:15:23 +02:00
Christian König
a3c6607be1 radeon/llvm: fix fp immediates on SI
I don't know if this is a good idea, but it
fixes the problem at hand.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 15:15:00 +02:00
Christian König
250b7fdd26 radeonsi: fix TEX writemask
Using the writemask in the sampler results in packet
VGPRS. For now just sample all components and let
llvm chose the right one.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 12:05:33 +02:00
Christian König
3508815d17 radeonsi: fix shader param and color count
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:57 +02:00
Christian König
92b96a883f radeonsi: fix texture loads from sampler > 0
The backend is multiplying the offset by the numbers of
elements anyway, so doing it twice just makes everything
crash.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:52 +02:00
Christian König
9b7dc5e81c radeonsi: disable tiling until we fixed all bugs
Currently there are more important things to worry about.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:40 +02:00
Vinson Lee
8734584952 scons: Add support for Intel Compiler.
The patch makes the SCons build with Intel Compiler successful.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 21:28:47 -07:00
Pauli Nieminen
204bfb904b meta: Use sampler object in framebuffer blit
Framebuffer blit needs to setup texture sampling with no reference to the
user's texturing state, and a sampler object lets us avoid a bunch of changes
to the user's state setup.

We don't bother caching the sampler object since we're changing parameters in
it based on the filtering option to glBlitFramebuffer().

Fixes piglit GL_ARB_sampler_objects/framebufferblit and rendering in l4d2 (our
setting of srgb decode wasn't being respected due to the user's sampler object
being active).

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
676a563d5b meta: Add sampler object to texture decompression
Sampler objects can be used to shadow texture object state without
modifying original application state. Decompression path feels a bit
like path where caching shouldn't happen. But as everything else is
cached already I decided to cache sampler state too.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
5a320d5bcf mesa: Allow meta module to call sampler functions
To allow meta module to use sample objects mesa GL functions need to be
visible and linkable for meta module.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
cbdc1d5354 swrast: Support sampler object for texture fetching state
swrast needs to pass sampler object into all texture fetching functions
to use correct sampling state when sampler object is bound to the unit.
The changes were made using half manual regular expression replace.

v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current
    values aren't set yet, so we need to look at our texObj2D. (anholt)

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:55:51 -07:00
Pauli Nieminen
8129dabb5f mesa: Make ARB_sampler_objects mandatory
To allow meta acceleration operations to use sampler objects the
ARB_sampler_objects extension needs to be mandatory for all drivers.
Because the extension doesn't have any hardware dependencies it is
trivial to implement.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
ae58f9696c mesa/program: Use sampler object state if present
CompareFailValue is part of Sampler state that needs to be read from
bound sampler object if present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
cae7636852 mesa/ff_shader: Fix sampler state reading
Fixed function fragment shader generator was incorrectly read texture
sampling state directly from texture object. To make sure that
ARB_sampler_object works correctly shader generator has to use the
bound sampler if one exist.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
6f6bd8aedc radeon&r200: Add support for ARB_sampler_objects
Preparation for the mandatory support of ARB_sampler_objects. I have tested
this patch with rv280 only.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
10169e7adc radeon: Fix printf format not to warn in 64bit
When I build tested radeon changes I noticed two warnings about format
size missmatch in 64bit. I decided to clean them to make relevant
compiler warnings easier to spot.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
54808e560f nouveau: Add support for ARB_sampler_objects
ARB_sampler_objects is very simple software only extension to support.  I want
to make it a mandatory extension for Mesa drivers to allow the meta module to
use it.

This patch add support for the extension to nouveau. It is completely untested
search and replace patch, except for flagging the texture state as needing to
be recomputed when a sampler object is present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
765509903b mesa/samplerobj: Support EXT_texture_sRGB_decode
sRGBDecode state is part of sampler object state but mesa was missing
handlers to access the state. This patch adds the support for required
state changes and queries.

GL_EXT_texture_sRGB_decode issue 4:
"4) Should we add forward-looking support for ARB_sampler_objects?

        RESOLVED: YES

        If ARB_sampler_objects exists in the implementation, the sampler
        objects should also include this parameter per sampler."

Fixes piglit GL_ARB_sampler_objects/GL_EXT_texture_sRGB_decode.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
c37efbfe4c mesa: Move DepthMode to texture object
GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on
compatibility profile specifications.

OpenGL specification 4.1 compatibility 20100725 3.9.2:
"... The values accepted in the pname parameter
are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_-
FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_-
LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and
TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and
in the sampler state in table 6.26 is not part of the sampler state, and remains in the
texture object."

The list of states is in Table 6.24 "Textures (state per texture
object)" instead of 6.25 mentioned in the specification text.

Same can be found from 3.3 compatibility specification.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:30:13 -07:00
Paul Berry
c18806cebf i965/msaa: Allow GL_SAMPLES to be set to 1 prior to Gen6.
This patch allows GL_SAMPLES to be set to either 0 or 1 on i965
platforms that don't support MSAA (those prior to Gen6).  Setting
GL_SAMPLES=1 has the same effect as setting it to 0 on these platforms
(because MSAA is unsupported), but is distinguishable via the GL API.

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

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:20 -07:00
Paul Berry
97fc89c6cb i965/msaa: Treat GL_SAMPLES=1 as equivalent to GL_SAMPLES=0.
EXT_framebuffer_multisample is a required subpart of
ARB_framebuffer_object, which means that we must support it even on
platforms that don't support MSAA.  Fortunately
EXT_framebuffer_multisample allows for this by allowing GL_MAX_SAMPLES
to be set to 1.

This leads to a tricky quirk in the GL spec: since
GlRenderbufferStorageMultisamples() accepts any value for its
"samples" parameter up to and including GL_MAX_SAMPLES, that means
that on platforms that don't support MSAA, GL_SAMPLES is allowed to be
set to either 0 or 1.  On platforms that do support MSAA, GL_SAMPLES=1
is not used; 0 means no MSAA, and 2 or higher means MSAA.

In other words, GL_SAMPLES needs to be interpreted as follows:
  =0  no MSAA (possible on all platforms)
  =1  no MSAA (only possible on platforms where MSAA unsupported)
  >1  MSAA (only possible on platforms where MSAA supported)

This patch modifies all MSAA-related code to choose between
multisampling and single-sampling based on the condition (GL_SAMPLES >
1) instead of (GL_SAMPLES > 0) so that GL_SAMPLES=1 will be treated as
"no MSAA".

Note that since GL_SAMPLES=1 implies GL_SAMPLE_BUFFERS=1, we can no
longer use GL_SAMPLE_BUFFERS to distinguish between MSAA and non-MSAA
rendering.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:15 -07:00
Tomeu Vizoso
d5c918f6ad glsl: Add support for OES_standard_derivatives in GLSL ES.
Previously, we advertised the extension but the builtin functions
were enabled only for GLSL and not for ES.

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

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-01 10:44:44 -07:00
Chad Versace
8c94f6bbd8 intel: Use consistent pattern in intelCreateBuffer
The 16-bit depth case did not follow the function's prevalent pattern.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:40 -07:00
Chad Versace
2b4fbc4d7d intel: Decrease nesting level in intelCreateBuffer
Nearly the whole function body was contained in the 'else' branch. The
'if' branch did one thing: return early with an error. Clean things up by
moving all the code out of the 'else' branch. Decreases max nesting level
from 4 to 3.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:38 -07:00
Chad Versace
83fa0842ca intel: Remove dead code in intelAllocateBuffer
After commit "intel: Convert to using private depth/stencil buffers", we
request from DRI2GetBuffersWithFormat only the front left and back left
buffers. We no longer request depth and stencil buffers.

Assert that in intelAllocateBuffer and remove the related dead code.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:36 -07:00
Matt Turner
84ead7b4e8 configure.ac: Remove extra ;;
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53053
2012-08-01 10:12:50 -07:00
Matt Turner
33ae29c93b configure.ac: Don't duplicate CFLAGS
These assignments caused CFLAGS specified on the configure line to
appear twice in the final CFLAGS. Removing them makes the behavior
reasonable -- USER_CFLAGS are appended at the end of CFLAGS, allowing
the builder to override flags added by configure.ac like
-fno-strict-aliasing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
14819eb588 configure.ac: Remove contractions to stop breaking syntax highlighting
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
0e38a3ca52 configure.ac: remove remnants of ppc asm support
Missed by d387899388.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:22 -07:00
Adam Jackson
33ef67ab20 linux: Default to dri not xlib on all arches
Even on s390{,x} where there's no video card, you still want this so GLX
protocol works.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-08-01 12:37:25 -04:00
Christoph Bumiller
8592933de8 nv50,nvc0: make resolve sampler objects allow sRGB conversion
Just figured out what that bit does.

Note: It's converted back to sRGB on write, so no effective
conversion occurs.
2012-08-01 15:39:46 +02:00
Christoph Bumiller
6286d9810b Revert "gallium: specify resource_resolve destination via a pipe_surface"
This reverts commit 5d5af7d359.

It turns out the issue this was supposed to fix merely counter-acted
a bug in the hardware driver that I wasn't aware of.

The resource_resolve is not supposed to do sRGB conversion, period.
(This would violate the requirement that source and destination must
be of the same format).
2012-08-01 15:39:46 +02:00
Roland Scheidegger
be2dcc5e9f r200: get rid of dubious aux scissor bits
no point in emitting aux scissor values if we
a) never enable them
b) never set the actual values

plus it is enough to have that aux scissor enable reg (which we never set to
enable) in one place not two.
2012-08-01 14:58:47 +02:00
Roland Scheidegger
c0c216c469 radeon/r200: get rid of some unneeded cliprect/scissor code
Noone was interested in the number of cliprects, and noone cared
about the intersect result neither. So just nuke this.
2012-08-01 14:58:38 +02:00
Roland Scheidegger
549470aa1a r200: get rid of old gart memory functions from old dri1
Those functions are SO dead.
2012-08-01 14:58:29 +02:00
Roland Scheidegger
de694b6b10 radeon/r200: fix bogus clears
There were several problems with these functions (which are a remnant
of dri1 hyperz mostly - should bring it back somehow someday).
First, it would always do a swrast clear if the buffer to clear was a fbo.
Second, for buffers we wouldn't handle the clear (I guess aux/accum?) we
would actually still have tried to clear that later even when we already
cleared it with swrast.
2012-08-01 14:58:23 +02:00
Roland Scheidegger
5b88a2a22d radeon/r200: fix bogus assert/scissor wrt width/height 2048
This addresses one issue raised in bug #51658 discovered by Eugene St Leger.
The assert is bogus since there's no problem with texture width/height being
2048 (the width/height programmed is width/height minus one).
OTOH though the programmed size for scissor rect should be width/height
minus one too otherwise bad things may happen (as it is inclusive, and there's
not enough bits for more than a value of 2047).
2012-08-01 14:58:15 +02:00
Christian König
6574fe3c4a radeon/llvm: fix calculation of max register number
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-01 11:15:06 +02:00
Tom Stellard
a488fdd3d9 radeon/llvm: Add pseudo-support for 64-bit immediate types on SI
SI does not support 64-bit immediates natively, but llvm will generate
i64 immediates when indexing loads and stores (since SI has 64-bit
pointers).  The i64 indices will always be small enough to fit into
32-bits (i.e. the high 32 bits will always be all zeros), so we can
treat these index values as 32-bits.
2012-07-31 20:19:21 +00:00
Tom Stellard
be46874281 radeon/llvm: Fix incorrect return value in SelectADDRReg()
We need to return true when we match the pattern.
2012-07-31 20:19:20 +00:00
Tom Stellard
056b77ca22 radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern
In tablegen, if two patterns match, the one that comes first in the file
is given preference.  We want the SMRD IMM pattern to be given
preference, because it encodes the pointer offset in its immediate
field, which saves us an add instruction.
2012-07-31 20:19:20 +00:00
Eric Anholt
877a897adc glsl: Reject linking shaders with too many uniform blocks.
Part of fixing piglit maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
fa08b8ad54 mesa: Return -1 for glGetUniformLocation on UBOs.
Fixes piglit ARB_uniform_buffer_object/getuniformlocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
bbd1d6124d glsl: Assign array and matrix stride values according to std140 layout.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
551bdf25bc glsl: Add support for default layout qualifiers for uniforms.
I ended up having to add rallocing of the ast_type_qualifier in order
to avoid pulling in ast.h for glsl_parser_extras.h, because I wanted
to track an ast_type_qualifier in the state.

Fixes piglit ARB_uniform_buffer_object/row-major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
7b77c64254 glsl: Merge UBO layout qualifiers in a qualifier list.
Yes, you get to say things like "layout(row_major, column_major)" and
get column major.

Part of fixing piglit ARB_uniform_buffer_object/row_major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
eed967bc9c mesa: Add support for GL_ARB_ubo's glGetActiveUniformName().
This is like a stripped-down version of glGetActiveUniform that just
returns the name, since the other return values (type and size) of
that function are now meant to be handled with
glGetActiveUniformsiv().

Fixes piglit ARB_uniform_buffer_object/getactiveuniformname

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
dc654370c3 mesa: Add support for most of the other pnames of glGetActiveUniformBlockiv().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
5a165d1f3a mesa: Add support for getting active uniform block names.
Fixes piglit ARB_uniform_buffer_object/getactiveuniformblockname.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
467304dfe5 mesa: Add support for glUniformBlockBinding() and the API to get it back.
Fixes piglit ARB_uniform_buffer_object/uniformbufferbinding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
fafa394c15 glsl: Incorporate all UBO language changes into GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
4070036259 mesa: Add support for glGetProgramiv pnames for UBOs.
Fixes piglit ARB_uniform_buffer_object/getprogramiv.

v2: Add extension checks.
v3: Appease MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Kenneth Graunke
3a90dc22d1 glsl: Refactor #version validation to be more future-proof.
The previous implementation required a flag in _mesa_glsl_parse_state
and line of code to initialize it for every version of the shading
language we intend to support.  As we look to add 150, 330, 400, 410,
420, and beyond, this gets rather unwieldy.

This patch retains the switch statement (to reject, say, #version 111),
but removes all the bits.  Code to check for ctx->API == API_OPENGL_CORE
could easily be added to the 110 and 120 cases to reject those.

v2: Use _mesa_is_desktop_gl to preserve the existing behavior in the
    presence of the new API_OPENGL_CORE enumeration.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-07-31 11:20:49 -07:00
Eric Anholt
19bd5936af i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.
Fixes some failures in getteximage-formats.

v2: Remove stray include, and drop extra test for encoding == GL_SRGB --
    _mesa_get_srgb_format_linear() returns the same format if it wasn't SRGB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48120
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
NOTE: This is a candidate for the 8.0 branch.
2012-07-31 11:14:23 -07:00
Kenneth Graunke
03ac5c54b5 glsl: Fix #pragma invariant(all) language version check.
It was using state->Const.GLSL_100ES, which is set if the driver
supports ARB_ES2_compatibility or we're in ES2 mode.  Instead, it should
use state->language_version, as that represents the actual GLSL version
of the shader being compiled.

Since the correct logic is < 120 && !100, just make it == 110.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 10:52:54 -07:00
Kenneth Graunke
d84b3a5a3c mesa: Support glGetString(GL_SHADING_LANGUAGE_VERSION) for >= 1.40.
This will need to get refactored when we add support for core profiles
or forward-compatible contexts, but we may as well have it in the
meantime.  This allows us to override the GLSL version and experiment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 10:52:54 -07:00
Brian Paul
591594ea1e ir_to_mesa: make size_swizzles[] array static const 2012-07-31 09:00:41 -06:00
Jon TURNEY
27013e5164 Move installing osmesa.pc to drivers/osmesa
Move installing osmesa.pc to drivers/osmesa, where it belongs better

This also restores the installation of gl.pc if we are building osmesa at the
same time as libGL, which was broken in commit 39785488 when the .pc
installation was converted to automake

v2:
Remove HAVE_OSMESA_DRIVER automake conditional, it's now pointless as we
will only be building in the drivers/osmesa directory if the condition it
checked was true.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 12:48:33 +01:00
Vinson Lee
2faa2b4f7e gallium/util: Use GCC built-in functions for NaN and infinity.
This patch fixes this build failure with Intel Compiler.

src/gallium/auxiliary/util/u_format_tests.c(903): error: floating-point operation result is out of range
     {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c01), UNPACKED_1x1(        NAN, 0.0, 0.0, 1.0)},

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-30 23:27:19 -07:00
Jordan Justen
3d0b54c7c6 mesa: don't enable legacy GL functions when using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
1fea3df6f4 intel: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
0f099df567 meta: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
4aecd8f031 glsl: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
09714c09a4 mesa: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
3d284dcba6 mesa: add api check functions
These functions make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
1c29b73f4d mesa: add API_OPENGL_CORE api
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Ian Romanick
d3de40742f glsl: Fix ir_last_opcode value.
Now that ir_quadop_vector exists, ir_last_binop and ir_last_opcode are
no longer the same.  Only one place currently uses this enumeration, and
already handles ir_quadop_vector correctly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:15:48 -07:00
Ian Romanick
9d998a2a59 glsl: Request an Nx1 type instance in ir_quadop_vector lowering pass.
No types have 0 columns.  The glsl_type::get_instance method contains

   if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
      return error_type;

To get a vector, use columns = 1.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:34 -07:00
Kenneth Graunke
13cb99dc73 glsl: Make bvec and ivec types accessible without using get_instance.
It's more convenient to use shortcuts like glsl_type::bvec2_type than
the longwinded glsl_type::get_instance(GLSL_TYPE_BOOL, 2, 1).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:09 -07:00
Tom Stellard
cd0949eb28 radeon/llvm: Cleanup AMDIL.h 2012-07-30 21:10:14 +00:00
Tom Stellard
2f921101c0 radeon/llvm: Rename all AMDIL* classes to AMDGPU* 2012-07-30 21:10:14 +00:00
Tom Stellard
b72ab79d73 radeon/llvm: Merge AMDILSubtarget into AMDGPUSubtarget 2012-07-30 21:10:13 +00:00
Tom Stellard
27ae41c83d radeon/llvm: Merge AMDILTargetLowering class into AMDGPUTargetLowering 2012-07-30 21:10:13 +00:00
Tom Stellard
c96490e3b5 radeon/llvm: Remove IL_cmp DAG node 2012-07-30 21:10:13 +00:00
Tom Stellard
aece7970eb radeon/llvm: Cleanup and reorganize AMDIL .td files 2012-07-30 21:10:13 +00:00
Tom Stellard
0ce6e50601 radeon/llvm: Remove lowering code for unsupported features
e.g. function calls, load/store from stack
2012-07-30 21:10:08 +00:00
Tom Stellard
caeaf43dad radeon/llvm: Remove AMDILVersion.td 2012-07-30 20:31:57 +00:00
Tom Stellard
c3111eb639 radeon/llvm: Remove AMDILAlgorithms.tpp 2012-07-30 20:31:57 +00:00
Tom Stellard
ac669c32c6 radeon/llvm: Merge AMDILInstrInfo.cpp into AMDGPUInstrInfo.cpp 2012-07-30 20:31:57 +00:00
Tom Stellard
3a0187b1b5 radeon/llvm: Merge AMDILRegisterInfo into AMDGPURegisterInfo 2012-07-30 20:31:57 +00:00
Tom Stellard
9c42fb6f26 radeon/llvm: Change the tablegen target from AMDIL to AMDGPU 2012-07-30 20:31:56 +00:00
Kenneth Graunke
f56dfc3213 i965: Support MESA_FORMAT_SIGNED_RGBA_16.
The hardware supports this format with no known quirks, so we may as
well enable it.

Alpha blending is not supported until Sandybridge, but as far as I can
tell, OpenGL doesn't require alpha blending on SNORM formats.  Plus, we
already expose R8G8B8A8_SNORM which has a similar restriction.

Fixes 6 piglit texwrap-2D-*SNORM* cases,
gl-3.1/required-sized-texture-formats, and 10 oglconform snorm-textures
subcases

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-30 09:35:58 -07:00
Elvis Lee
e7a4a2b18b gbm: Fix build for wayland include
backends/gbm_dri.c fails to find wayland-server.h.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-30 11:58:02 -04:00
Brian Paul
b51be8786f mesa: fix _math_matrix_copy(), again
The matrix is 16 GLfloats in size.  Since from->inv is just a pointer (not
an array), sizeof(*from->inv) wasn't right.
2012-07-30 08:30:15 -06:00
Vinson Lee
502c10839e mesa: Fix wrong sizeof argument in _math_matrix_copy.
Fixes Coverity wrong sizeof argument defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-30 08:13:55 -06:00
Christian König
86490bc150 radeonsi: fix db and stencil setup v2
v2: fix tiling for small pitches, that finally makes
    glxgears and readPixSanity work

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:04 +02:00
Christian König
7dace3a3cf radeonsi: fix stencil op mapping
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:00 +02:00
Christian König
ad15c8c0f1 radeonsi: fix assertion in si_bind_vs_sampler
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:55 +02:00
Christian König
1fb8ee62fa radeonsi: fix shader binding
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:51 +02:00
Christian König
f18fd255cf radeonsi: fix dummy export in shaders v2
v2: add assertion for vertex shader

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:34 +02:00
Christian König
b15e3ae5b4 radeonsi: fix vertex buffer and elements
Let's just use the T# descriptors until we get a fetch shader.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:32 +02:00
Christian König
d51b9b70d5 radeonsi: fix shader size and handling
We should always upload the shader here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:08 +02:00
Christian König
fe41287ffa radeonsi: rename r600_resource to si_resource
Also split it into seperate header and add
some helper functions.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:44:38 +02:00
Kenneth Graunke
dcf8754cce glcpp: Add a newline to expanded #line directives.
Otherwise, the preprocessor happily outputs

    #line 2 4 <your next line of code>

and the main compiler gets horribly confused and fails to compile.

This is not the right solution (line numbers in error messages will
likely be off-by-one in certain circumstances), but until Carl comes
up with a proper fix, this gets programs running again.

Fixes regressions in Regnum Online, Overgrowth, Piglit, and others since
commit aac78ce823.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-28 13:33:50 -07:00
Christoph Bumiller
5d5af7d359 gallium: specify resource_resolve destination via a pipe_surface
The format member of pipe_surface may differ from that of the
pipe_resource, which is used to communicate, for instance, whether
sRGB encode should be enabled in the resolve operation or not.

Fixes resolve to sRGB surfaces in mesa/st when GL_FRAMEBUFFER_SRGB
is disabled.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 14:58:18 +02:00
Christoph Bumiller
51e41a0d89 st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, too
sRGBEnabled should affect both textures and renderbuffers, so we need
to check/update the pipe_surface format for both.

Fixes, for instance, rendering appearing too bright in wine applications
using sRGB multisample renderbuffers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 13:14:30 +02:00
Christoph Bumiller
acd66ec033 nv50: fix depth/stencil multisample memory storage types
Leftover from libdrm_nouveau v2 interface change.
2012-07-28 13:14:03 +02:00
Christoph Bumiller
cd3d85b63d nv50: fix resource_resolve shader start offsets 2012-07-28 13:11:56 +02:00
Brian Paul
f612e55e45 st/mesa: undo a couple static asserts
Hmm, gcc didn't catch these mistakes, but MSVC did.
2012-07-27 16:10:58 -06:00
Brian Paul
322a2938f3 st/mesa: use STATIC_ASSERT in a few places 2012-07-27 15:47:38 -06:00
Brian Paul
59c67f8116 mesa: whitespace, etc. fixes in program.h 2012-07-27 15:43:53 -06:00
Brian Paul
906febaf8b meta: fix glDrawPixels fallback test, stencil drawing
Remove the check for pixel transfer ops.  If any RGB/depth scale/bias
is in effect, it'll be applied in the glTexImage step.

If drawing stencil pixels we need to disable pixel transfer so that
alpha scale/bias are not applied to the stencil data.

These issues were spotted by Roland.

Fixes Blender performance issues reported in
http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-27 14:53:16 -06:00
Brian Paul
a80b7407f3 radeon: fix 'sowftware' typo 2012-07-27 14:53:16 -06:00
Eric Anholt
fbf86c7f0f i965/gen7: Reduce GT1 WM thread count according to updated BSpec.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>

https://bugs.freedesktop.org/show_bug.cgi?id=52382
2012-07-27 11:42:19 -07:00
Kenneth Graunke
cbcf750d5f i965: Fix typo in shader channel select field name.
"chanel" isn't very searchable.  I can type, honest!

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 11:31:07 -07:00
Paul Berry
ee9f6a34cc i965/msaa: Use MESA_FORMAT_R8 for MCS buffer.
No functional change.  This patch modifies intel_miptree_alloc_mcs to
allocate the 4x MCS buffer using MESA_FORMAT_R8 instead of
MESA_FORMAT_A8.  In principle it doesn't matter, since we only access
the buffer using MCS-specific hardware mechanisms, so all that's
important is to use a format with the correct size.  However,
MESA_FORMAT_A8 has enough unusual behaviours that it seems prudent to
avoid it.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 10:42:19 -07:00
Zou Nan hai
588881430a intel: increase wm thread number to 80 on gen6 GT2
It seems reset is not required for setting the max_wm_threads to 80
on gen6 GT2.

Increases performance in the Counter-Strike: Source video stress test
by 7.18% (n=5).

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-07-27 10:32:17 -07:00
Tom Stellard
fdd8df20e4 r600g: Emit dispatch state for compute directly to the cs
We no longer rely on an evergreen_compute_resource for emitting dispatch
state.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
dc0b8a4628 r600g: Initialize VGT_PRIMITIVE_TYPE in the start_cs_cmd atom
The value of this register will always be DI_PT_POINTLIST for compute
shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
d3b0130491 r600g: Atomize compute shader state
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
5497391067 r600g: Add helper functions for emitting compute SET_CONTEXT packets
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
c9ef27276f radeon/llvm: Add instruction defs for branches on SI 2012-07-27 17:08:09 +00:00
Tom Stellard
ee0f0f03c6 radeon/llvm: Fix VOPC and V_CNDMASK encoding 2012-07-27 17:08:09 +00:00
Tom Stellard
d4bdd09d47 radeon/llvm: Assert if we try to copy SCC reg 2012-07-27 17:08:09 +00:00
Tom Stellard
fd1f19a191 radeon/llvm: Add SI DAG optimizations for setcc, select_cc
These are needed for correctly lowering branch instructions in some
cases.
2012-07-27 17:08:08 +00:00
Tom Stellard
cd5d4c5073 radeon/llvm: Add support for encoding SI branch instructions 2012-07-27 17:08:08 +00:00
Tom Stellard
50ff2dc0a4 radeon/llvm: Add special nodes for SALU operations on VCC
The VCC register is tricky because the SALU views it as 64-bit, but the
VALU views it as 1-bit.  In order to deal with this we've added some
special bitcast and binary operations to help convert from the 64-bit
SALU view to the 1-bit VALU view and vice versa.
2012-07-27 17:08:08 +00:00
Tom Stellard
c424975572 radeon/llvm: Add i1 registers for SI. 2012-07-27 17:08:08 +00:00
Tom Stellard
bdda1cb914 radeon/llvm: Fix CCReg definitions on SI 2012-07-27 17:08:08 +00:00
Tom Stellard
ae9be358f2 radeonsi: Enable PIPE_SHADER_CAP_INTEGERS 2012-07-27 17:08:08 +00:00
Tom Stellard
022b54359a radeonsi: Add support for loading integers from constant memory 2012-07-27 17:08:07 +00:00
Tom Stellard
ad95bcb31f radeon/llvm: Add bitconvert patterns for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
4cab682184 radeon/llvm: Add custom lowering for SELECT_CC nodes on SI 2012-07-27 17:08:07 +00:00
Tom Stellard
ba76684292 radeon/llvm: Move conditional pattern leafs to common tablegen file 2012-07-27 17:08:07 +00:00
Tom Stellard
d36455ba2c radeon/llvm: Implement getSetCCResultType for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
e8825ce6e1 radeon/llvm: Custom lower BR_CC for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
87272e9e25 radeon/llvm: Move lowering of BR_CC node to R600ISelLowering
SI will handle BR_CC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:07 +00:00
Tom Stellard
92823fb72a radeon/llvm: Move lowering of SETCC node to R600ISelLowering
SI will handle SETCC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Tom Stellard
46d12c99a2 radeon/llvm: Use correct node type when lowering SETCC 2012-07-27 17:08:06 +00:00
Tom Stellard
47d1b0a809 radeon/llvm: Move LowerSELECT_CC into R600ISelLowering
SI will handle SELECT_CC different from R600, so we need to move it out
of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Eric Anholt
11ff18fcf5 automake: Remove OPT_FLAGS.
If you want to change your compiler arguments, just set CFLAGS/CXXFLAGS.
Having Mesa have this separate variable is a great way to have your arguments
not thoroughly propagated to all compiler invocations.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Eric Anholt
87a1c4f233 automake: Remove ARCH_FLAGS.
In all current uses, it was appended to CFLAGS, which already had -m32.  If
you want to do some other flag supplied to compiler invocations, there's
CFLAGS/CXXFLAGS.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Paul Berry
4df2848786 i965/msaa: use ROUND_DOWN_TO macro.
No functional change.  This patch modifies brw_blorp_blit.cpp to use
the ROUND_DOWN_TO macro instead of open-coded bit manipulations, for
clarity.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 15:02:10 -07:00
Brian Paul
f37f1a7209 svga: initialize svga_compile_key to zeros to be safe 2012-07-26 16:00:31 -06:00
Brian Paul
dafa77201f svga: fix invalid memory reference in needs_to_create_zero()
The emit->key.fkey info is only valid if we're generating a fragment shader.
We should not look at it if we're generating a vertex shader.

When generating a vertex shader, the value of emit->key.fkey.num_textures was
garbage and the loop over num_textures would read invalid data.  At best
this would cause us to emit an unused constant.  At worse, we could segfault.
Just by dumb luck, fkey.num_textures was usually a smallish integer.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-26 16:00:31 -06:00
Brian Paul
38184dcd54 radeon: fix Base/base typo
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52563
2012-07-26 15:57:20 -06:00
Daniel Charles
948c8f502a android-build: fix dricore build for autogenerated files (v3)
Recently more files were removed from control to be auto-generated
in the dricore library. Android build was not able to locate the
new files if they were not created beforehand.

LOCAL_SRC_FILES includes some of those files and Android.gen.mk
re-defines this variable by filtering out the auto-generated files.
Unfortunately for this variable it is not the same to have the SRCDIR
variable defined as the current directory.

By re-defining SRCDIR for the autotools build the Android build system
is happy again and the new files were actually removed from the sources
to use the auto generated versions.

Also patch d5c1801a01 was partially reverted as the files
can not be compiled to the LOCAL_PATH, instead they should live on the
intermediates folder so that a clean can wipe them out.

v3: [chad] Fix the definition of SRCDIR in libdricore/Makefile.am.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
2012-07-26 14:51:20 -07:00
Brian Paul
0e893b4261 radeon: set swrast_renderbuffer::ColorType field when mapping renderbuffers
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
2012-07-26 13:59:44 -06:00
Brian Paul
a73e9207da xlib: add X error handler around XGetImage() call
XGetImage() will generate a BadMatch error if the source window isn't
visible.  When that happens, create a new XImage.  Fixes piglit 'select'
test failures with swrast/xlib driver.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-26 13:59:44 -06:00
Brian Paul
66adc807c4 mesa: remove obsolete matrix comment 2012-07-26 13:59:44 -06:00
Brian Paul
1e37d54d9d mesa: fix comment typo: s/pointer/point/ 2012-07-26 13:59:44 -06:00
Brian Paul
66d9ac5ac7 mesa: remove _math_matrix_alloc_inv()
Always allocate space for the inverse matrix in _math_matrix_ctr()
since we were always calling _math_matrix_alloc_inv() anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 13:59:44 -06:00
Brian Paul
50db812915 mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit
a divide by zero.  There's a check to prevent this (we basically give up on
computing the inverse and return the identity matrix.)  This patch loosens
this test to fix a lighting bug reported by Lars Henning Wendt.

v2: use abs(det) to handle negative values

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
2012-07-26 13:59:43 -06:00
Paul Berry
148c8e639d i965: Use sendc for all render target writes on Gen6+.
The sendc instruction causes the fragment shader thread to wait for
any dependent threads (i.e. threads rendering to overlapping pixels)
to complete before sending the message.  We need to use sendc on the
first render target write in order to guarantee that fragment shader
outputs are written to the render target in the correct order.

Previously, we only used the "sendc" instruction when writing to
binding table index 0.  This did the right thing for fragment shaders,
because our fragment shader back-ends always issue their first render
target write to binding table index 0.  However, it did the wrong
thing for blorp, which performs its render target writes to binding
table index 1.

A more robust solution is to use sendc for all render target writes.
This should not produce any performance penalty, since after the first
sendc, all of the dependent threads will have completed.

For more information about sendc, see the Ivy Bridge PRM, Vol4 Part3
p218 (sendc - Conditional Send Message), and p54 (TDR Registers).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 10:49:38 -07:00
Paul Berry
8f37ea414f i965/msaa: Remove TODO comments that are no longer relevant.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:49:38 -07:00
Paul Berry
c738ea1191 intel: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in the i915 and 965 drivers over to use _mesa_is_user_fbo()
and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:48:36 -07:00
Paul Berry
284ad9c3b2 mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in core mesa, the state tracker, and src/mesa/program over
to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:38:05 -07:00
Oliver McFadden
e72f20641a glsl: warning: pragma `invariant(all)' not supported in GLSL ES 1.00
The OpenGL(R) ES Shading Language
Version 1.00 Revision 17 (12 May, 2009)

> 4.6.1 The Invariant Qualifier
> ... To force all output variables to be invariant, use the pragma
> #pragma STDGL invariant(all)

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 13:09:15 +03:00
Kenneth Graunke
16cba717c2 shared-glapi: Install libglapi.so.0.0.0 and .0 links in lib/.
We already provided these files on 'make install', but only created a
'libglapi.so' in the top-level lib/ convenience folder.  We used to
create all three, but at some point in the build system churn, it broke.

Various applications (like the ES2 conformance suite) seem to link
against libglapi.so.0, so without these links, setting LD_LIBRARY_PATH
and LIBGL_DRIVERS_PATH can lead to using /usr/lib/libglapi.so.0 with
/home/whatever/libGL.so, which leads to API calls getting routed
incorrectly (i.e. glCompileShader -> _mesa_LinkProgramARB), which leads
to rage problems.

Preserve developer sanity...install links.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 22:37:24 -07:00
Vinson Lee
4f109ca4e8 scons: Fix build with clang.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 17:04:30 -07:00
Eric Anholt
cc44aa7749 i965: Remove unused param conversion code.
Ever since ctx->NativeIntegers was set, the conversion flag has been
PARAM_NO_CONVERT.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 10:29:56 -07:00
Olivier Galibert
fa76d04aea softpipe: fix copy/paste error in tex sample code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=52369

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 07:47:19 -06:00
Jon TURNEY
f9089f4022 Remove redundant osmesa shared library install from Makefile.old
Since osmesa now has been converted to Makefile.am, an appropriate install: rule
is generated to install the shared libary, so we no longer need to do that in
src/mesa/Makefile.old

This leaves nothing in src/mesa/Makefile.old but the tags: rule, so move that to
Makefile.am and remove Makefile.old

Also, nothing now uses OSMESA_LIB_GLOB anymore, so remove it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:41:07 +01:00
Jon TURNEY
bd4a3cce96 Update mesa/drivers/x11/Makefile.am for xm_image.h removal
Commit 6c6803f28d removed xm_image.[ch], and removed
xm_image.c, but not xm_image.h from the Makefile, this was subsequently carried over
into Makefile.am

Remove xm_image.h from Makfile.am.  This allows 'make dist' to succeed, even if it
doesn't do anything useful

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:40:10 +01:00
Jon TURNEY
9f84d645a4 drivers/osmesa: Link OSMesa using -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:39:42 +01:00
Jon TURNEY
50b13217ba drivers/X11: Link X11 libGL with -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:38:38 +01:00
Vinson Lee
491d82e9df Revert "scons: Add instrumentation component libraries to linking on llvm-3.2."
This reverts commit e2e7b467d8.

No longer needed after llvm-3.2svn r160611.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-07-24 22:49:49 -07:00
Paul Berry
497bf5dd2b i965/msaa: Switch on 8x MSAA for Gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:59 -07:00
Paul Berry
7285612713 i965/msaa: Adjust MCS buffer allocation for 8x MSAA.
MCS buffers use 32 bits per pixel in 8x MSAA, and 8 bits per pixel in
4x MSAA.  This patch adjusts the format we use to allocate the buffer
so that enough memory is set aside for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
304be9db14 i965/msaa: Remove assertion in 3DSTATE_SAMPLE_MASK to allow 8x MSAA.
The code to emit 3DSTATE_SAMPLE_MASK was already correct for 8x
MSAA--this patch just removes an assertion that would have prevented
it from being used for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
2a9ab29ed9 i965/msaa: Adjust 3DSTATE_MULTISAMPLE packet for 8x MSAA.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
7fae97c98b i965/blorp: Encode and decode IMS format for 8x MSAA correctly.
This patch updates the blorp functions encode_msaa() and decode_msaa()
to properly handle the encoding of IMS MSAA buffers when
num_samples=8.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
619471dc32 i965/blorp: Compute sample number correctly for 8x MSAA.
When operating in persample dispatch mode, the blorp engine would
previously assume that subspan N always represented sample N (this is
correct assuming 4x MSAA and a 16-wide dispatch).  In order to support
8x MSAA, we must compute which sample is associated with each subspan,
using the "Starting Sample Pair Index" field in the thread payload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
082874e389 i965/blorp: Properly adjust primitive size for 8x MSAA.
When rendering to an IMS MSAA surface on Gen7, blorp sets up the
rendering pipeline as though it were rendering to a single-sampled
surface; accordingly it must adjust the size of the primitive it sends
down the pipeline to account for the interleaving of samples in an IMS
surface.

This patch modifies the size adjustment code to properly handle 8x
MSAA, which makes room for the extra samples by using an interleaving
pattern that is twice as wide as 4x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
17eae9762c i965/blorp: Parameterize manual_blend() by num_samples.
This patch adds a num_samples argument to the blorp function
manual_blend(), allowing it to be told how many samples need to be
blended together.  Previously it assumed 4x MSAA, since that was all
we supported.

We also bump up LOG2_MAX_BLEND_SAMPLES from 2 to 3, so that
manual_blend() will be able to handle 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
4afee38a2f i965/msaa: Remove comment about falsely claiming to support MSAA.
Gen6+ hardware now supports MSAA properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:58 -07:00
Paul Berry
ff9313fac7 i965/blorp: Handle DrawBuffers properly.
When the client program uses glDrawBuffer() or glDrawBuffers() to
select more than one color buffer for drawing into, and then performs
a blit, we need to blit into every single enabled draw buffer.

+2 oglconforms.

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

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
fa1d267beb i965/blorp: Rearrange order of blit validation and preparation steps.
This patch rearranges the order of steps performed by a blorp blit
from this:

- Sync up state of window system buffers.
- Find buffers.
- Find miptrees.
- Make sure buffer formats match.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

To this:

- Sync up state of window system buffers.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Find buffers.
- Make sure buffer formats match.
- Find miptrees.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

The steps are the same, but they are now performed in an order that
will make it possible to implement correct DrawBuffers support.  Note
that the last four steps are now in a separate function
(do_blorp_blit), since they will need to be executed repeatedly when
DrawBuffers support is added.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
eac4f1a707 i965/blorp: Don't fall back to swrast when miptrees absent.
Previously, the blorp engine would fall back to swrast if the source
or destination of a blit had no associated miptree.  This was
unnecessary, since _mesa_BlitFramebufferEXT() already takes care of
making the blit silently succeed if there are no buffers bound, so the
fallback paths could never actually happen in practice.

Removing these fallback paths will simplify the implementation of
correct DrawBuffers support in blorp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0dbec6ae07 i965/blorp: Fixup scissoring of blits to window system buffers.
This patch modifies the order of operations in the blorp engine so
that clipping and scissoring are performed before adjusting the
coordinates to account for the difference in origin convention between
window system buffers and framebuffer objects.  Previously, we would
do clipping and scissoring after adjusting for origin conventions, so
we would get scissoring wrong in window system buffers.

Fixes Piglit test "fbo-scissor-blit window".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
da54d2e576 i965/blorp: Simplify check that src/dst width/height match.
When checking that the source and destination dimensions match, we
don't need to store the width and height in variables; doing so just
risks confusion since right after the check, we do clipping and
scissoring, which may alter the width and height.

No functional change.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
bac43b8bb7 i965/msaa: Work around problems with null render targets on Gen6.
On Gen6, multisampled null render targets don't seem to work
properly--they cause the GPU to hang.  So, as a workaround, we render
into a dummy color buffer.

Fortunately this situation (multisampled rendering without a color
buffer) is rare, and we don't have to waste too much memory, because
we can give the workaround buffer a very small pitch.

Fixes piglit test "EXT_framebuffer_multisample/no-color {2,4}
depth-computed *" on Gen6.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0aeb87023e i965: Set width, height, and tiling properly for null render targets.
The HW docs say that the width and height of null render targets need
to match the width and height of the corresponding depth and/or
stencil buffers, and that they need to be marked as Y-tiled.  Although
leaving these values at 0 doesn't seem to cause any ill effects, it
seems wise to follow the documented requirements.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
691c55f356 i965/msaa: Control multisampling behaviour via the visual.
Previously, we used the number of samples in draw buffer 0 to
determine whether to set up the 3D pipeline for multisampling.  Using
the visual is cleaner, and has the benefit of working properly when
there is no color buffer.

Fixes all piglit tests "EXT_framebuffer_multisample/no-color" on Gen7.
On Gen6, the "depth-computed" variants of these tests still fail; this
will be addresed in a later patch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
48fdfbcb58 msaa: Compute visual samples/sampleBuffers from all buffers.
This patch ensures that Visual.samples and Visual.sampleBuffers are
set correctly even in the case where there is no color buffer.
Previously, these values would retain their default value of 0 in this
circumstance, even if the depth or stencil buffer was multisampled.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:56 -07:00
Anthony G. Basile
f35e380dd2 Fix compile time errors when building against uclibc
Mesa misses a few checks when compiling on a uclibc system
which cause it to fall back on glibc-ism.  This patch
addresses those issues.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-07-24 13:00:47 -07:00
Jerome Glisse
1ffac44e83 r600g: enable streamout only on 2.14 or latter kernel
The kernel streamout support was supposed to get into 3.3 along
the tiling change and thus use the same kernel version bump of
2.13 to report userspace that streamout register were supported.

This is not what happen. So as streamout kernel support did not
bump the kernel driver version, rely on kernel 2.14 version bump
to know if streamout is enabled or not. Which means you need at
least 3.4 kernel.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-24 15:08:31 -04:00
Jordan Justen
881bb4ac72 intel: move error on create context to proper path
The error was being set on the non-error path, rather
than the error path.

NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:59:19 -07:00
Jordan Justen
01168df4d9 mesa context: generate an error for uninstalled context functions
For 'non-legacy' contexts we will want to generate an error
if an uninstalled function is called.

The effect of this change will be that we can avoid installing
legacy functions, and they will then generate an error as
needed for deprecated functions in GL >= 3.1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:50:35 -07:00
Brian Paul
1f9239ec8d nouveau: include glformats.h to get missing prototype
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52449
2012-07-24 10:33:20 -06:00
Brian Paul
a271a0c9f6 mesa: improve comment in build_tnl_program() 2012-07-24 09:54:50 -06:00
Brian Paul
8f2a13c5e3 docs: the legacy makefile system is removed in Mesa 8.1 2012-07-24 08:49:02 -06:00
Brian Paul
7e18a039ee mesa: move _mesa_error_check_format_and_type() to glformats.c
Now all the format/type-related helper functions are in glformats.c
and image.c is just image-related functions.
2012-07-24 08:37:29 -06:00
Brian Paul
a1287f549a mesa: move more format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Brian Paul
8b762ebd72 mesa: move some format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Christian König
de3335dba8 radeonsi: remove old state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
9b213c871a radeonsi: move everything else into the new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
53d47889e6 radeonsi: move format handling into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
73dd906ba0 radeonsi: move remaining sampler state into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
ca9cf611b6 radeonsi: move draw state into new handling
Split it out into si_state_draw.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
0d6b0b512a radeonsi: move constants to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
baf2039756 radeonsi: move sampler states into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
3c09f11e5c radeonsi: move shaders to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
bd2a5cf328 radeonsi: move spi into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
840f05da6b radeonsi: move init state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e4e6f954ae radeonsi: move draw_info to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
76660dfcce radeonsi: move CB_TARGET_MASK into fb/blend state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e6937211da radeonsi: move stencil_ref to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
b41b3eb989 radeonsi: move dsa state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bd18a316e1 radeonsi: move infeered fb/rs state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
f67fae0e43 radeonsi: move rasterizer state into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
835098a529 radeonsi: move framebuffer to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
7e011d92c9 radeonsi: move viewport to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
43f414f7b7 radeonsi: move scissor state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
9cbbe0d4e6 radeonsi: move clip state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
0a091a4824 radeonsi: move blend color to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
63636ae52a radeonsi: move blender to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bf7302a6e1 radeonsi: rework state handling v2
Add a complete new state handling for SI.

v2: fix spelling error

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Brad King
27382c0f7b automake: Honor GL_LIB for mangled/custom lib names
Commit 2d4b77c7 (automake: Convert src/mesa/drivers/x11/Makefile to
automake, 2012-06-12) dropped the old Makefile, which used GL_LIB, and
replaced it with a Makefile.am hard-coding the name "GL".  This broke
handling of --enable-mangling and --with-gl-lib-name options which
depend on GL_LIB to specify the GL library name.

Use "@GL_LIB@" in src/mesa/drivers/x11/Makefile.am to configure the
library name.  Also use this approach to simplify src/glx/Makefile.am
and drop the HAVE_MANGLED_GL conditional.  While at it, fix the
compatibility link we create in "lib" for the software-only driver to
use version GL_MAJOR instead of hard-coding "1".

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-07-23 22:34:13 -07:00
Marek Olšák
82fc813ca8 st/mesa: fix DDY opcode for FBOs
This fixes piglit/fbo-deriv.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
f40b5723f0 st/mesa: set the centroid qualifier in fragment shader inputs
This fixes some centroid tests in the EXT_framebuffer_multisample piglit group.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
162b3ad94d st/mesa: flush the glBitmap cache before changing framebuffer state
This fixes the piglit EXT_framebuffer_multisample/bitmap tests.

Note that we must not rely on ctx->DrawBuffer when flushing the cache, because
that's already updated with a new framebuffer. We want to draw into the old
framebuffer where glBitmap was called.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
07b9b3c37b st/mesa: set the correct window renderbuffer internal format
The multisample-resolve blit relies on this being correct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
Marek Olšák
5927227576 mesa: fix format checking when doing a multisample resolve
v2: make it more bullet-proof

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
José Fonseca
c30bf68946 gallivm: Prefer the standard JIT engine whenever possible.
Testing shows that the standard JIT engine retrofited with AVX support is quite
stable and as capable to handle AVX instructions as MC-JIT is.

And the old JIT is much more memory efficient, as we don't need to
allocate one engine instance per shader, as we do for MC-JIT due to its
incompleteness.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-23 17:46:38 +01:00
Jerome Glisse
cb149bf9e1 r600g: don't emit forbidden reg with old kernel on evergreen
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:42:36 -04:00
Jerome Glisse
b7b5a77ec0 r600g: don't emit forbidden register on old kernel
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:28:25 -04:00
Vincent Lejeune
bc4b4c605c radeon/llvm: Fix a bug with IF LOGICALNZ with int operand
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-23 15:04:36 +00:00
Tom Stellard
044de40cb0 pipe_loader: Try to connect with the X server before probing pciids v2
When X is running it is neccesary for pipe_loader to authenticate with
DRM, in order to be able to use the device.

This makes it possible to run OpenCL programs while X is running.

v2:
  - Fix C++ style comments
  - Drop Xlib-xcb dependency
  - Close the X connection when done
  - Split auth code into separate function

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-07-23 13:25:36 +00:00
Tom Stellard
17f6c9195f configure.ac: Add --with-llvm-prefix option
This option allows you to specify the llvm install prefix.  It is
useful for switching between different versions of LLVM.
2012-07-23 13:25:36 +00:00
Kenneth Graunke
c3bc41011f mesa: Prevent repeated glDeleteShader() from blowing away our refcounts.
Calling glDeleteShader() should mark shaders as pending for deletion,
but shouldn't decrement the refcount every time.  Otherwise, repeated
glDeleteShader() is not safe.

This is particularly bad since glDeleteProgram() frees shaders: if you
first call glDeleteShader() on the shaders attached to the program (thus
decrementing the refcount), then called glDeleteProgram(), it would try
to free them again (decrementing the refcount another time), causing
a refcount > 0 assertion to fail.

Similar to commit d950a778.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:34:44 -07:00
Matt Turner
cfdf60f236 imports.h: Correct ceilf typo.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:06:08 -07:00
Marek Olšák
f96405f254 st/mesa: remove st_flush_bitmap wrapper
just a cleanup
2012-07-22 03:32:55 +02:00
Jordan Justen
749c9060ac mesa formats: add MESA_FORMAT_ABGR2101010_UINT
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
1c8812c244 mesa formats: unpack ARGB8888/XRGB8888
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
8c265cf5ef mesa pack: use _mesa_problem instead of assert
If the pack type is not supported, use _mesa_problem
rather than asserting.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
9ad8f431b2 mesa: add glformats integer type/format detection routines
_mesa_is_integer_format is moved to formats.c and renamed
as _mesa_is_enum_format_integer.

_mesa_is_format_unsigned, _mesa_is_type_integer,
_mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer
are added.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Vinson Lee
e2e7b467d8 scons: Add instrumentation component libraries to linking on llvm-3.2.
llvm-3.2svn r160587 moved createBoundsCheckingPass from
lib/Transforms/Scalar to lib/Transforms/Instrumentation.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-21 10:38:25 -07:00
Matt Turner
d24cf88a1a Remove unused _mesa_memset16
Unused since commit fd104a845.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
f58ba6ca91 Remove _mesa_inv_sqrtf in favor of 1/SQRTF
Except for a couple of explicit uses, _mesa_inv_sqrtf was disabled since
its addition in 2003 (see f9b1e524).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
948b1c541f Remove _mesa_sqrt* in favor of plain sqrt
Temporarily disabled since 2003 (see 386578c5b).

This saves us from calling sqrt() 128 times to generate the sqrttab in
one_time_init().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
ec79138138 Use INV_SQRT instead of 1/SQRTF
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
José Fonseca
bd9bf7a424 autoconf: Only kink mcjit component when available.
Should fix build failures with older LLVM version, but only tested on
LLVM 3.1.
2012-07-21 11:43:35 +01:00
Chad Versace
735070c45b i830: Fix stack corruption
Found by compiler warning:
    i830_texstate.c:131:28: warning: argument to 'sizeof' in 'memset' call
          is the same expression as the destination; did you mean to
          dereference it?  [-Wsizeof-pointer-memaccess]
       memset(state, 0, sizeof(state));
              ~~~~~            ^~~~~

On 64-bit systems, memset here would write an extra 4 bytes.

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-20 16:01:57 -07:00
José Fonseca
1a8f6ac5a4 mesa: disable MSVC global optimization in pack.c
To reduce excessive compilation time in release mode.

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Brian Paul <brianp@vmware.com>
2012-07-20 16:23:22 -06:00
Brian Paul
9fd4e9e9e6 mesa: whitespace fixes in pbo.c 2012-07-20 16:22:59 -06:00
Brian Paul
ac14f569fe mesa: update texstore.c comment 2012-07-20 15:13:19 -06:00
Roland Scheidegger
70a969f123 llvmpipe: use runtime loop instead of static loop for looping over quads
This can potentially cut shader program size by a factor of 4 for 4-wide
execution respectively 2 for 8-wide execution and while this ratios aren't
quite reached for more complex shaders it can be close.
Could not really measure a performance difference so far except for trivial
shaders (glxgears).
There seems to be a fair amount of unnecessary move's generated especially
at the beginning it might be possible to optimize those away somehow.
Things aren't quite as clean, some additional stuff needs to be done for
keeping both paths working (though llvm might be able to optimize this away).
glxgears seems to lose about 5-10% of performance, looking at the generated
shaders this is actually less than I'd think it would be - both 4 and 8-wide
shaders, despite containing a loop actually have about 10% more instructions
in total, and will have roughly 50% more executed instructions (though mostly
cheap ones). Need to figure out how to reduce overhead...

v2: keep complex interpolation for 4-wide mode, adapt to interface changes.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-20 20:17:15 +01:00
Roy Spliet
542bd6941f nv30: Support negative offsets in indirect constant access.
Fixes piglit vp-address-01 amongst several others.

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Reviewed-by: Lucas Stach <dev@lynxeye.de>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 20:31:40 +02:00
Bryan Cain
248e6f0331 nv50/ir: set position before i instead of i->next in NV50LoweringPreSSA::visit
Fixes rendering glitches in Psychonauts such as Raz's eyes flickering white.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51962.
2012-07-20 20:30:07 +02:00
Eric Anholt
b2a44cde64 i965/gen7: Increase the WM threads to hardware limits.
This thread count is only supposed to be enabled when "WIZ Hashing Disable in
GT_MODE register enabled."  I've always been confused whether that means the
bit in the register should be 1 or 0.  For my IVB GT2's register 0x7008 value
of 0x0, this appears to work fine.

Improves l4d2 performance at 640x480 by 0.88 +/- 0.11% (n=88).  Improves
performance with rasterization at 1280x1024 by 1.45% +/- 0.36% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-20 11:05:39 -07:00
Eric Anholt
8ab5842a6d glsl: Assign locations for uniforms in UBOs using the std140 rules.
Fixes piglit layout-std140.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:44:04 -07:00
Eric Anholt
9feb403b0e glsl: Don't resize arrays in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:59 -07:00
Eric Anholt
0cea8a56b6 glsl: Don't dead-code eliminiate uniforms declared in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:52 -07:00
Eric Anholt
548bce4733 mesa: Implement the UBO-specific pnames of glGetActiveUniformsiv.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:50 -07:00
Eric Anholt
a74507dc94 glsl: Propagate uniform block information into gl_uniform_storage.
Now we can actually return information on uniforms in uniform blocks
in the new queries.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:47 -07:00
Eric Anholt
ddc88fbf51 mesa: Add implementation of glGetUniformBlockIndex().
Now that we finally have a list of uniform blocks in the linked shader
program, we can tell what their indices are.

Fixes piglit GL_ARB_uniform_buffer_object/getuniformblockindex.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:44 -07:00
Eric Anholt
093b20666d glsl: Set the uniform_block index for the linked shader variables.
At this point in the linking, we've totally lost track of the struct
gl_uniform_buffer that this pointed to in the original unlinked
shader, so we do a nasty n^2 walk to find it the new one based on the
variable name.

Note that these point into the shader's list of gl_uniform_buffers,
not the linked program's.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:42 -07:00
Eric Anholt
9f1a4a6340 mesa: Add support for glGetActiveUniformsiv on non-UBO pnames.
We'll need to propagate the UBO fields to the uniform storage records
before we can handle the other pnames.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:40 -07:00
Eric Anholt
acfbdfcbc8 mesa: Add support for glGetUniformIndices().
This is a single entrypoint that maps from a series of names to the
indices of those names within the active uniforms list.  Each index is
like glGetUniformLocation()'s return value, except that it doesn't
encode an array offset.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:35 -07:00
Eric Anholt
abcdbdf9cc mesa: Move the _mesa_uniform_merge_location_offset to glGetUniformLocation().
With the upcoming GL_ARB_uniform_buffer_object changes, the only
other caller that will want the cooked value is state_tracker.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:33 -07:00
Eric Anholt
f609cf782a glsl: Merge the lists of uniform blocks into the linked shader program.
This attempts error-checking, but the layout isn't done yet.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:28 -07:00
Eric Anholt
b3c093c79c glsl: Translate the AST for uniform blocks into some IR structures.
We're going to need this structure to cross-validate the uniform
blocks between shader stages, since unused ir_variables might get
dropped.  It's also the place we store the RowMajor qualifier, which
is not part of the GLSL type (since that would cause a bunch of type
equality checks to fail).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:19 -07:00
Eric Anholt
f7561e8ecd glsl: Turn UBO variable declarations into ir_variables and check qualifiers.
Fixes piglit layout-*-non-uniform and layout-*-within-block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:12 -07:00
Lucas Stach
cdad337fec st/xorg: fix masked transformations
Someone tried to be clever and "optimized" add_vertex_data2() to just use
two points for the texture coordinates and then reuse individual
components. Sadly this is not how matrix multiplication works.

Fixes rendercheck -t tmcoords

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 18:47:54 +02:00
Paul Berry
60c3e69dbf i965/blorp: Use IMS layout when texturing from depth/stencil surfaces.
Previously, on Gen7, when texturing from a depth or stencil surface,
the blorp engine would configure the 3D pipeline as though the input
surface was non-multisampled, and perform the necessary coordinate
transformations in the fragment shader to account for the IMS layout.
This meant outputting a lot of extra fragment shader code, and it
raised some uncertainty about how to deal with very large surfaces.

This patch modifies blorp to configure the 3D pipeline properly for
IMS layout when reading from depth and stencil surfaces.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
0dd5e98aa5 i965/blorp: Loosen assertions in compute_msaa_layout_for_pipeline.
Previously, on Gen7, compute_msaa_layout_for_pipeline() would verify
that IMS layout is not used.  However, now that we configure
SURFACE_STATE correctly for IMS surfaces, IMS layout is available.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
989218b980 i965/blorp: Configure SURFACE_STATE correctly for IMS surfaces.
This patch modifies gen7_set_surface_num_multisamples() to set up the
SURFACE_STATE appropriately for texturing from IMS format MSAA
surfaces (which are only used on Gen7 for depth and stencil buffers).
Since the function now sets more than just the number of multisamples,
it's been renamed to gen7_set_surface_msaa().

This will make it possible to remove some kludginess from the blorp
engine.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
f91b4d92b9 i965/blorp: Optimize manual_blend() for compressed multisampled surfaces.
When downsampling a compressed multisampled surface, we can take a
shortcut to downsample any pixels that were completely covered by a
single primitive.  In this case, the first color value we fetch is the
correct final color for the downsampled pixel, so we can skip the rest
of the blending operation.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
e5d983267a i965/blorp: Fix integer downsampling on Gen7.
When downsampling an integer-format buffer on Gen7, we need to use the
"avg" instruction rather than the "add" instruction, to ensure that we
don't overflow the range of 32-bit integers.  Also, we need to use the
proper register type (BRW_REGISTER_TYPE_D or BRW_REGISTER_TYPE_UD) for
intermediate color data and for writing to the render target.

Note: this patch causes blorp to use the proper register type for all
operations (downsampling, upsampling, and ordinary blits).  Strictly
speaking, this is only necessary for downsampling, because the other
operations exclusively use MOV instructions on the color data.  But
it's simpler to use the proper register type in all cases.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
b961d37e61 i965/blorp: Modify manual_blend() to avoid unnecessary loss of precision.
When downsampling from an MSAA image to a single-sampled image, it is
inevitable that some loss of numerical precision will occur, since we
have to use 32-bit floating point registers to hold the intermediate
results while blending.  However, it seems reasonable to expect that
when all samples corresponding to a given pixel have the exact same
color value, there will be no loss of precision.

Previously, we averaged samples as follows:

    blend = (((sample[0] + sample[1]) + sample[2]) + sample[3]) / 4

This had the potential to lose numerical precision when all samples
have the same color value, since ((sample[0] + sample[1]) + sample[2])
may not be precisely representable as a 32-bit float, even if the
individual samples are.

This patch changes the formula to:

    blend = ((sample[0] + sample[1]) + (sample[2] + sample[3])) / 4

This avoids any loss of precision in the event that all samples are
the same, by ensuring that each addition operation adds two equal
values.

As a side benefit, this puts the formula in the form we will need in
order to implement correct blending of integer formats.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
6a27506181 i965: Add support for AVG instruction.
From the Ivy Bridge PRM, Vol4 Part3 p152:

    "The avg instruction performs component-wise integer average of
    src0 and src1 and stores the results in dst. An integer average
    uses integer upward rounding. It is equivalent to increment one to
    the addition of src0 and src1 and then apply an arithmetic right
    shift to this intermediate value."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
9544e44262 i965: Replace fs_visitor::kill_emitted with gl_fragment_program::UsesKill.
The kill_emitted variable was duplicating the functionality of
gl_fragment_program::UsesKill.  There's no need for both.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Paul Berry
0f1f2ff8db mesa: Set gl_fragment_program::UsesKill in do_set_program_inouts.
Previously, the code for setting this flag for GLSL programs was
duplicated in three places: brw_link_shader(), glsl_to_tgsi_visitor,
and ir_to_mesa_visitor.  In addition to the unnecessary duplication,
there was a performance problem on i965: brw_link_shader() set the
flag before doing its final round of optimizations, which meant that
if the optimizations managed to eliminate all the discard operations,
the flag would still be set, resulting (at least in theory) in slower
performance.

This patch consolidates all of the code that sets UsesKill for GLSL
programs into do_set_program_inouts(), which already is doing a
similar job for UsesDFdy, and which occurs after i965's final round of
optimizations.

Non-GLSL programs (ARB programs and the state tracker's glBitmap
program) are unaffected.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Kristian Høgsberg
a8c092266e gallium-egl: Move wayland query_buffer implementation
Move it to native_wayland_drm_bufmgr_helper.c which only gets compiled when
wayland is enabled and which already includes the right headers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 16:11:06 -04:00
Olivier Galibert
fbe3fa74e5 softpipe: Fix segfault with fbo-cubemap.
The cube sampler generates two-dimensional texture coordinates and
hence passes NULL for the array for the third one.  The actual 2D
sampler, lower in the pipe, knew not to used that array since it
didn't need it.  But the samplers have become single-texel and the
coordinate array dereference has been moved up one step, to a level
where the code does not know only two coordinates are used.  Hence the
segfault.

The simplest fix by far is to add a third dummy coordinate array in
the call to the next pipe step, which will be dereferenced to an
harmless 0 which then will be happily ignored by the sampler.

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

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-19 13:19:14 -06:00
Kristian Høgsberg
d7522ed130 wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_buffer
We're going to make the public wl_buffer struct as small as possible.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e23bfdb329 wayland: Use existing EGL_TEXTURE_FORMAT for querying wl_buffer texture format
We also reuse EGL_TEXTURE_RGBA and EGL_TEXTURE_RGB, adding only the new
planar YUV texture formats: EGL_TEXTURE_Y_U_V_WL, EGL_TEXTURE_Y_UV_WL and
EGL_TEXTURE_Y_XUXV_WL.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e1b45a3c06 gallium-egl: Implement eglQueryWaylandBufferWL
Support this query for gallium EGL too.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kenneth Graunke
d43f4181e1 glsl: Remove open coded version of ir_variable::interpolation_string().
Presumably the function didn't exist when we wrote this code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 11:00:00 -07:00
Paul Berry
d08fdacd58 i965: Avoid unnecessary recompiles for shaders that don't use dFdy().
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This patch avoids unnecessarily recompiling shaders that don't use
dFdy(), by only setting render_to_fbo in the wm program key if the
shader actually uses dFdy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:25 -07:00
Paul Berry
ce1d2f08f9 glsl: Set UsesDFdy appropriately for GLSL shaders.
This patch updates the ir_set_program_inouts_visitor so that it also
sets gl_fragment_program::UsesDFdy.

This is a bit of a hack (since dFdy() isn't an input or an output),
but there's no other obvious visitor to squeeze this functionality
into, and it would be silly to create a brand new visitor just for
this purpose.

v2: use local 'fprog' var to avoid repeated casting.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:21 -07:00
Paul Berry
a0f7b86959 mesa: Set UsesDFdy appropriately for assembly programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:19 -07:00
Paul Berry
5e310e9f83 mesa: Add UsesDFdy to struct gl_fragment_program.
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This boolean will allow it to avoid unnecessarily recompiling shaders
that don't use dFdy().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:01 -07:00
Kenneth Graunke
658a63e5d9 drirc: Add disable_blend_func_extended workaround for Unigine OilRush.
The previous commit implemented the workaround, cited a bug report
about OilRush, but actually only enabled the workaround for the demos.

Turn it on for OilRush too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-19 01:40:24 -07:00
Kenneth Graunke
040894391a i965: Add a driconf option to disable GL_ARB_blend_func_extended.
Unigine Heaven (at least) has a bug where it incorrectly uses the
GL_ARB_blend_func_extended extension.

Dual source blending allows two color outputs per render target;
individual shader outputs can be assigned to be either the first or
second blending input by setting the 'index' via one of two methods:

- An API call: glBindFragDataLocationIndexed()
- The GLSL 'layout' qualifier provided by GL_ARB_explicit_attrib_location

Both of these only work on user defined fragment shader outputs; it's an
error to use either on built-in outputs like gl_FragData.

Unigine uses gl_FragData and gl_FragColor exclusively, and doesn't even
attempt to use either method to set index == 1.  However, it does set
the blending function to SRC1 enums, which requires a fragment shader
output with index == 1 or else rendering is undefined.

In other words, enabling ARB_blend_func_extended causes Unigine to
render incorrectly, resulting in an apparent regression, even though our
driver code (as far as I can tell) is perfectly fine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-19 01:22:34 -07:00
Brian Paul
768be75c44 mesa: remove stale comment 2012-07-18 16:51:47 -06:00
Brian Paul
e4f8d33aea mesa: use gl_program cast wrappers
In a few cases, remove unneeded casts.
And fix a few other const-correctness issues.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Brian Paul
1170b5aa9f mesa: add some gl_program cast wrappers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Marek Olšák
c3c83af380 r600g: setup streamout before calling last r600_need_cs_space before drawing
This fixes CS checker errors due to registers not being initialized, because
the flush occured after dirty state was emitted but before drawing.
2012-07-18 22:42:58 +02:00
Eric Anholt
a40c1f9522 i965/fs: Make register spill/unspill only do the regs for that instruction.
Previously, if we were spilling the result of a texture call, we would store
all 4 regs, then for each use of one of those regs as the source of an
instruction, we would unspill all 4 regs even though only one was needed.

In both lightsmark and l4d2 with my current graphics config, the shaders that
produce spilling do so on split GRFs, so this doesn't help them out.  However,
in a capture of the l4d2 shaders with a different snapshot and playing the
game instead of using a demo, it reduced one shader from 2817 instructions to
2179, due to choosing a now-cheaper texture result to spill instead of piles
of texcoords.

v2: Fix comment noted by Ken, and fix the if condition associated with it for
    the current state of what constitutes a partial write of the destination.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-07-18 12:30:06 -07:00
Eric Anholt
a454f8ec6d i965/fs.h: Refactor tests for instructions modifying a register.
There's one instance of a potential behavior change: propagate_constants may
now propagate into a part of a vgrf after a different part of it was
overwritten by a send that returns multiple registers.  I don't think we ever
generate IR that meets that condition, but it's something to note if we bisect
behavior change to this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
fc01376c50 i965/fs: Replace usage is_tex() with regs_written() checks.
In these places, we care about any sort of send that hits more than one reg,
not just textures.  We don't yet have anything else returning more than one
reg, so there's no change.

v2: Use mlen instead of is_tex() for the is-it-a-send check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
a6411520b4 i965/fs: Rename virtual_grf_next to virtual_grf_count.
"count" is a more useful name, since most of the time we're using it for
looping over the variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
40cd60a315 i965/fs: Move a block out of a loop in live variables setup.
This was accidentally copy-and-pasted inside.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Anuj Phogat
cd5cd85a43 i965/msaa: Disable alpha-to-{coverage, one} when drawbuffer zero is in integer format
OpenGL specification 3.3 (page 196), section 4.1.3 says:
If drawbuffer zero is not NONE and the buffer it references has an
integer format, the SAMPLE_ALPHA_TO_COVERAGE and SAMPLE_ALPHA_TO_ONE
operations are skipped."
This should work properly even if there are other draw buffers that
are not in integer format.

This patch makes following piglit tests pass on mesa:
int-draw-buffers-alpha-to-coverage
int-draw-buffers-alpha-to-one

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-18 11:54:12 -07:00
Lucas Stach
fb18ec4f27 st/xorg: attach EDID to outputs
Allows tools like GNOME's monitor configuration to show meaningful names.

v2: fix resource leak

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:16 +02:00
Lucas Stach
9de16ac0a8 st/xorg: remove superfluous memset
exaDriverAlloc() uses calloc, which already initialises pExa to zero.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:07 +02:00
Lucas Stach
70f0eda127 st/xorg: reorder exa context creation and use screen param queries
Gives the x-server a more accurate description of the exa hardware
capabilities.

v2: drop NPOT check

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:18:55 +02:00
Olivier Galibert
229a1a7e4d softpipe: Take all lods into account when texture sampling.
This patch churns a lot because it needs to change 4-wide filters into
single pixel filters, since each fragment may use a different filter.

The only case not entirely supported is the anisotropic filtering.
Not sure what we want to do there, since a full quad is required by
that filter.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-18 08:02:39 -06:00
Marek Olšák
99c65bac34 r600g: implement wait-free buffer transfer for DISCARD_RANGE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 07:16:30 +02:00
Marek Olšák
8ac9801669 r600g: accelerate buffer copying
This will be useful for efficient handling of the DISCARD transfer flags.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 06:32:57 +02:00
Marek Olšák
f237fd431b r600g: update R600_MAX_DRAW_CS_DWORDS to take draw-opaque into account 2012-07-18 06:25:37 +02:00
Marek Olšák
30257c3291 r600g: move VGT_STRMOUT_DRAW_OPAQUE_OFFSET initialization into invariant state 2012-07-18 06:25:37 +02:00
Marek Olšák
d9ba1b0beb r600g: only set the index type if drawing is indexed 2012-07-18 06:25:37 +02:00
Marek Olšák
1cfb55c509 r600g: remove debug code for streamout 2012-07-18 06:25:37 +02:00
Marek Olšák
ff9a49328e r600g: inline r600_context_draw_opaque_count 2012-07-18 06:25:37 +02:00
Marek Olšák
1b699a4832 r600g: fix alphatest without a colorbuffer on evergreen 2012-07-18 06:25:36 +02:00
Marek Olšák
82a1d24175 r600g: fix alphatest without a colorbuffer on r6xx-r7xx 2012-07-18 04:35:38 +02:00
Marek Olšák
de4fd087cb r600g: always derive alphatest state from the first colorbuffer 2012-07-18 04:17:11 +02:00
Marek Olšák
bc2f5fc01e r600g: atomize alphatest state 2012-07-18 03:45:25 +02:00
Marek Olšák
5130196c0b r600g: try to fix line stippling with lineloops
The piglit test is failing, but visually it looks almost correct.
2012-07-18 02:17:10 +02:00
Marek Olšák
43e226b6ef r600g: optimize uploading depth textures
Make it only copy the portion of a depth texture being uploaded and
not the whole 2D layer.

There is also a little code cleanup.
2012-07-18 00:32:50 +02:00
Marek Olšák
b242adbe5c r600g: remove needless wrapper r600_texture_depth_flush 2012-07-18 00:21:53 +02:00
Marek Olšák
611dd52942 r600g: init_flushed_depth_texture should be able to report errors 2012-07-18 00:21:53 +02:00
Paul Berry
e9b908b014 msaa: Generate proper error for operations prohibited on MSAA buffers.
From the GL 3.0 spec, section 4.3.3, in the documentation for
CopyPixels():

    "An INVALID_OPERATION error will be generated if the object bound
    to READ_FRAMEBUFFER_BINDING is framebuffer complete and the value
    of SAMPLE_BUFFERS is greater than zero."

The same applies to CopyTexImage...() and CopyTexSubImage...()
functions, since they are defined in terms of CopyPixels().

Previously we were generating an INVALID_FRAMEBUFFER_OPERATION error
in these cases.

Fixes piglit tests
"EXT_framebuffer_multisample/negative-{copypixels,copyteximage}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 14:40:01 -07:00
Brian Paul
c4d2a14d6e gallivm: silence uninitialized variable warnings 2012-07-17 14:41:29 -06:00
Marek Olšák
9d699cd845 r600g: fix lockups with and enable dual source blending on evergreen
GL_ARB_blend_func_extended is now enabled on all chipsets.
2012-07-17 21:22:15 +02:00
Marek Olšák
c26fadf195 r600g: remove unused code after conversion of sampler views 2012-07-17 21:22:15 +02:00
Marek Olšák
5d8d4252f2 r600g: convert sampler view emission into atoms
Vertex and constant buffers are emitted in the same way.
This is mainly a simplification of the code. The cleanup is in another patch.
2012-07-17 21:22:15 +02:00
Marek Olšák
7022f49b52 r600g: only make constant buffers dirty if there's something to update 2012-07-17 21:22:15 +02:00
Marek Olšák
80755ff563 r600g: properly track which textures are depth
This fixes the issue with have_depth_texture never being set to false.
2012-07-17 21:22:15 +02:00
Marek Olšák
e5de73cafd r600g: consolidate and optimize sampler states changes for evergreen
Only set sampler states which changed.
2012-07-17 21:22:14 +02:00
Marek Olšák
883c43cdd4 r600g: don't invalidate texture caches when setting sampler states
Changing sampler states doesn't change resource bindings.
2012-07-17 21:22:14 +02:00
Marek Olšák
ba48f47ebf r600g: consolidate code for setting sampler views and fix bugs in the process
Issues fixed:

- set_vs_sampler_views for evergreen is now properly implemented.

- Added the missing inval_texture_cache call for evergreen.

- have_depth_texture was sometimes incorrectly set to false on evergreen even
  if there were depth textures in other shader stages. To fix this, set it
  to true once and never set it to false again. It's stupid, but it matches
  the r600 code. The proper fix is left to another patch.

- Optimizaton: The sampler views which aren't changed aren't updated.
2012-07-17 21:22:14 +02:00
Marek Olšák
d1ca16b273 r600g: remove unused flag have_depth_fb
This is a leftover from:

commit fe1fd67556
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 03:10:37 2012 +0200

    r600g: don't flush depth textures set as colorbuffers
2012-07-17 21:22:14 +02:00
Marek Olšák
585baac652 r600g: do fine-grained vertex buffer updates
If only some buffers are changed, the other ones don't have to re-emitted.
This uses bitmasks of enabled and dirty buffers just like
emit_constant_buffers does.
2012-07-17 21:22:14 +02:00
Marek Olšák
f4f2e8ebe1 r600g: don't call inval_shader_cache in r600_context_flush twice
It's already called in r600_constant_buffers_dirty.
2012-07-17 21:22:14 +02:00
Marek Olšák
6694a68d89 gallium/util: add util_bit_last - finds the last bit set in a word 2012-07-17 21:22:14 +02:00
Marek Olšák
018e3f75d6 r600g: fix all failing depth-stencil tests for evergreen 2012-07-17 21:22:14 +02:00
Michel Dänzer
761131ce45 configure.ac: Further LLVM fixups.
* Also add mcjit in the non-OpenCL case.
* Replace hardcoded llvm-config with $LLVM_CONFIG everywhere.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellad <thomas.stellard@amd.com>
2012-07-17 19:12:01 +02:00
Michel Dänzer
39c4bc7fdf glsl: Drop obsolete .gitignore entries.
Helps spotting and removing the obsolete generated files, which otherwise break
the build.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-07-17 18:30:32 +02:00
Tom Stellard
ed41a559dc configure.ac: Add libLLVMMCJIT to the LLVM_LDFLAGS
This is neccessary for linking the llvmpipe tests.  It appears this
dependency was introduced by the "wider native register" changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-17 12:08:24 -04:00
Eric Anholt
fadc9eaf97 intel: Add a comment explaining why we early return on matching BO names.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:08 -07:00
Eric Anholt
2b311fd802 intel: Drop other checks for old loader version.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:06 -07:00
Eric Anholt
1b4374d364 intel: Replace the non-getBuffersWithFormat compat path with an error message.
It's been broken (using NULL getBuffersWithFormat() instead of
getBuffers()) due to a copy and paste error for a year now.
GetBuffersWithFormat has been around since 2009, so I don't feel any
guilt in not supporting it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:04 -07:00
Eric Anholt
9bbf7c139b intel: Remove dead intel_framebuffer_has_hiz().
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:02 -07:00
Eric Anholt
bce58e155d intel: Convert to using private depth/stencil buffers (v2)
This means that GLX buffer sharing of these no longer works.  On the
other hand, just *look* at this code reduction.

v2:
  - [chad] Fix intelCreateBuffer for gen < 6. When the branch for
    !screen->hw_has_separate_stencil was taken,
    intel_create_private_renderbuffer was incorrectly not used.

  - [chad] Remove all code in intel_process_dri2_buffer for processing
    depth, stencil, and hiz buffers. That code is now dead.

CC: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:56 -07:00
Eric Anholt
433ff3e16e intel: Add a function for creating a private window system buffer.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:38 -07:00
Roland Scheidegger
bf484024b9 gallivm: (trivial) remove unnecessary bogus include 2012-07-17 17:11:18 +02:00
Kristian Høgsberg
2023bf996e gbm: Add gbm_bo_import for gallium gbm backend 2012-07-17 10:54:00 -04:00
Elvis Lee
1f2c87cc8f st/egl: Fix build for wayland includes
common/native_wayland_drm_bufmgr_helper.c fails to find wayland-server.h

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Elvis Lee
23f1e551cc st/gbm: renaming pitch to stride on gallium
commit '7250cd506baa0bd4649b30d87509cdd0cbc06a57'
changes struct gbm_bo, renaming it's 'pitch' to 'stride'.
This applies to Gallium.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Matt Turner
f42e601ce0 glx: build tests after libglx.la
Previously, if you ran make followed by make check it would work, but
if you just ran make check the test program would fail to compile.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-17 06:59:00 -07:00
José Fonseca
3469715a8a gallivm,draw,llvmpipe: Support wider native registers.
Squashed commit of the following:

commit 7acb7b4f60dc505af3dd00dcff744f80315d5b0e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:46:31 2012 +0100

    draw: Don't use dynamically sized arrays.

    Not supported by MSVC.

commit 5810c28c83647612cb372d1e763fd9d7780df3cb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:44:16 2012 +0100

    gallivm,llvmpipe: Don't use expressions with PIPE_ALIGN_VAR().

    MSVC doesn't accept exceptions in _declspec(align(...)). Use a
    define instead.

commit 8aafd1457ba572a02b289b3f3411e99a3c056072
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:41:56 2012 +0100

    gallium/util: Make u_cpu_detect.h header C++ safe.

commit 5795248350771f899cfbfc1a3a58f1835eb2671d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 2 12:08:01 2012 +0100

    gallium/util: Add ULL suffix to large constants.

    As suggested by Andy Furniss: it looks like some old gcc versions
    require it.

commit 4c66c22727eff92226544c7d43c4eb94de359e10
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Truly disable INF/NAN tests on MSVC.

    Thanks to Brian for spotting this.

commit 8bce274c7fad578d7eb656d9a1413f5c0844c94e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Disable INF/NAN tests on MSVC.

    Somehow they are not recognized as constants.

commit 6868649cff8d7fd2e2579c28d0b74ef6dd4f9716
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 15:05:24 2012 +0200

    gallivm: Cleanup the 2 x 8 float -> 16 ub special path in lp_build_conv.

    No behaviour change intended, like 7b98455fb40c2df84cfd3cdb1eb7650f67c8a751.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 5147a0949c4407e8bce9e41d9859314b4a9ccf77
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 14:28:19 2012 +0200

    gallivm: (trivial) fix issues with multiple-of-4 texture fetch

    Some formats can't handle non-multiple of 4 fetches I believe, but
    everything must support length 1 and multiples of 4.
    So avoid going to scalar fetch (which is very costly) just because length
    isn't 4.
    Also extend the hack to not use shift with variable count for yuv formats to
    arbitrary length (larger than 1) - doesn't matter how many elements we
    have we always want to avoid it unless we have variable shift count
    instruction (which we should get with avx2).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 87ebcb1bd71fa4c739451ec8ca89a7f29b168c08
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jul 4 02:09:55 2012 +0200

    gallivm: (trivial) fix typo for wrap repeat mode in linear filtering aos code

    This would lead to bogus coordinates at the edges.
    (undetected by piglit because this path is only taken for block-based
    formats).

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 3a42717101b1619874c8932a580c0b9e6896b557
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jul 3 19:42:49 2012 +0100

    gallivm: Fix TGSI integer translation with AVX.

commit d71ff104085c196b16426081098fb0bde128ce4f
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 15:17:41 2012 +0100

    llvmpipe: Fix LLVM JIT linear path.

    It was not working properly because it was looking at the JIT function
    before it was actually compiled.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit a94df0386213e1f5f9a6ed470c535f9688ec0a1b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Jun 28 18:07:10 2012 +0100

    gallivm: Refactor lp_build_broadcast(_scalar) to share code.

    Doesn't really change the generated assembly, but produces more compact IR,
    and of course, makes code more consistent.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 66712ba2731fc029fa246d4fc477d61ab785edb5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 17:30:13 2012 +0100

    gallivm: Make LLVMContextRef a singleton.

    There are any places inside LLVM that depend on it.  Too many to attempt
    to fix.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit ff5fb7897495ac263f0b069370fab701b70dccef
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 28 18:15:27 2012 +0200

    gallivm: don't use 8-wide texture fetch in aos path

    This appears to be a slight loss usually.
    There are probably several reasons for that:
    - fetching itself is scalar
    - filtering is pure int code hence needs splitting anyway, same
      for the final texel offset calculations
    - texture wrap related code, which can be done 8-wide, is slightly more
      complex with floats (with clamp_to_edge) and float operations generally
      more costly hence probably not much faster overall
    - the code needed to split when encountering different mip levels for the
      quads, adding complexity
    So, just split always for aos path (but leave it 8-wide for soa, since we
    do 8-wide filtering there when possible).
    This should certainly be revisited if we'd have avx2 support.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ce8032b43dcd8e8d816cbab6428f54b0798f945d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:41:19 2012 +0200

    gallivm: (trivial) don't extract fparts variable if not needed

    Did not have any consequences but unnecessary.

commit aaa9aaed8f80dc282492f62aa583a7ee23a4c6d5
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:09:06 2012 +0200

    gallivm: fix precision issue in aos linear int wrap code

    now not just passes at a quick glance but also with piglit...
    If we do the wrapping with floats, we also need to set the
    weights accordingly. We can potentially end up with different
    (integer) coordinates than what the integer calculations would
    have chosen, which means the integer weights calculated previously
    in this case are completely wrong. Well at least that's what I think
    happens, at least recalculating the weights helps.
    (Some day really should refactor all the wrapping, so we do whatever is
    fastest independent of 16bit int aos or 32bit float soa filtering.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit fd6f18588ced7ac8e081892f3bab2916623ad7a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 11:15:53 2012 +0100

    gallium/util: Fix parsing of options with underscore.

    For example

      GALLIVM_DEBUG=no_brilinear

    which was being parsed as two options, "no" and "brilinear".

commit 09a8f809088178a03e49e409fa18f1ac89561837
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 26 15:00:14 2012 +0100

    gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.

    Updated lp_build_printf to share common code.
    Removed specific lp_build_print_vecX.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit e59bdcc2c075931bfba2a84967a5ecd1dedd6eb0
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed May 16 15:00:23 2012 +0100

    draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.

    Starting with LLVM 3.0, named structures are meant not for debugging, but
    for recursive data types, previously also known as opaque types.

    The recursive nature of these types leads to several memory management
    difficulties.  Given that we don't actually need recursive types, avoid
    them altogether.

    This is an attempt to address fdo bugs 41791 and 44466. The issue is
    somewhat random so there's no easy way to check how effective this is.

    Cherry-picked from 9af1ba565d

commit df6070f618a203c7a876d984c847cde4cbc26bdb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 14:42:53 2012 +0200

    gallivm: (trivial) fix typo in faster aos linear int wrap code

    no longer crashes, now REALLY tested.

commit d8f98dce452c867214e6782e86dc08562643c862
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 18:20:58 2012 +0200

    llvmpipe: (trivial) remove bogus optimization for float aos repeat wrap

    This optimization for nearest filtering on the linear path generated
    likely bogus results, and the int path didn't have any optimizations
    there since the only shader using force_nearest apparently uses
    clamp_to_edge not repeat wrap anyway.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit c4e271a0631087c795e756a5bb6b046043b5099d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 23:01:52 2012 +0200

    gallivm: faster repeat wrap for linear aos path too

    Even if we already have scaled integer coords, it's way faster to use
    the original float coord (plus some conversions) rather than use URem.
    The choice of what to do for texture wrapping is not really tied to int
    aos or float soa filtering though for some modes there can be some gains
    (because of easier weight calculations).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 1174a75b1806e92aee4264ffe0ffe7e70abbbfa3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 14:39:22 2012 +0200

    gallivm: improve npot tex wrap repeat in linear soa path

    URem gets translated into series of scalar divisions so
    just about anything else is faster.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit f849ffaa499ed96fa0efd3594fce255c7f22891b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 00:40:35 2012 +0100

    gallivm: (trivial) fix near-invisible shift-space typo

    I blame the keyboard.

commit 5298a0b19fe672aebeb70964c0797d5921b51cf0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:24:28 2012 +0200

    gallivm: add new intrinsic helper to deal with arbitrary vector length

    This helper will split vectors which are too large for the hw, or expand
    them if they are too small, so a caller of a function using intrinsics which
    uses such sizes need not split (or expand) the vectors manually and the
    function will still use the intrinsic instead of dropping back to generic
    llvm code. It can also accept scalars for use with pseudo-vector intrinsics
    (only useful for float arguments, all x86 scalar simd float intrinsics use
    4vf32).
    Only used for lp_build_min/max() for now (also added the scalar float case
    for these while there). (Other basic binary functions could use it easily,
    whereas functions with a different interface would need different helpers.)
    Expanding vectors isn't widely used, because we always try to use
    build contexts with native hw vector sizes. But it might (or not) be nicer
    if this wouldn't need to be done, the generated code should in theory stay
    the same (it does get hit by lp_build_rho though already since we
    didn't have a intrinsic for the scalar lp_build_max case before).

    v2: incorporated Brian's feedback, and also made the scalar min/max case work
        instead of crash (all scalar simd float intrinsics take 4vf32 as argument,
        probably the reason why it wasn't used before).
        Moved to lp_bld_intr based on José's request, and passing intrinsic size
        instead of length.
        Ideally we'd derive the source type info from the passed in llvm value refs
        and process some llvmtype return type so we could handle intrinsics where
        the source and destination type isn't the same (like float/int conversions,
        packing instructions) but that's a bit too complicated for now.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 01aa760b99ec0b2dc8ce57a43650e83f8c1becdf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:19:18 2012 +0200

    gallivm: (trivial) increase max code size for shader disassembly

    64kB was just short of what I needed (which caused a crash) hence
    increase to 96kB (should probably be smarter about that).

commit 74aa739138d981311ce13076388382b5e89c6562
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:53:29 2012 +0100

    gallivm: simplify aos float tex wrap repeat nearest

    just handle pot and npot the same. The previous pot handling
    ended up with exactly the same instructions plus 2 more (leave it
    in the soa path though since it is probably still cheaper there).
    While here also fix a issue which would cause a crash after an assert.

commit 0e1e755645e9e49cfaa2025191e3245ccd723564
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:29:24 2012 +0100

    gallivm: (trivial) skip floor rounding in ifloor when not signed

    This was only done for the non-sse41 case before, but even with
    sse41 this is obviously unnecessary (some callers already call
    itrunc in this case anyway but some might not).

commit 7f01a62f27dcb1d52597b24825931e88bae76f33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:23:12 2012 +0100

    gallivm: (trivial) fix bogus comments

commit 5c85be25fd82e28490274c468ce7f3e6e8c1d416
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 20 11:51:57 2012 +0100

    translate: Free elt8_func/elt16_func too.

    These were leaking.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 0ad498f36fb6f7458c7cffa73b6598adceee0a6c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 15:55:34 2012 +0200

    gallivm: fix bug for tex wrap repeat with linear sampling in aos float path

    The comparison needs to be against length not length_minus_one, otherwise
    the max texel is never chosen (for the second coordinate).

    Fixes piglit texwrap-1D-npot-proj (and 2D/3D versions).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit d1ad65937c5b76407dc2499b7b774ab59341209e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 16:13:43 2012 +0200

    gallivm: simplify soa tex wrap repeat with npot textures and no mip filtering

    Similar to what is already done in aos sampling for the float path (but not
    the int path since we don't get normalized float coordinates there).
    URem is expensive and the calculation is done trivially with
    normalized floats instead (at least with sse41-capable cpus).
    (Some day should probably do the same for the mip filter path but it's much
    more complicated there hence the gain is smaller.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit e1e23f57ba9b910295c306d148f15643acc3fc83
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:38:56 2012 +0200

    llvmpipe: (trivial) remove duplicated function declaration

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 07ca57eb09e04c48a157733255427ef5de620861
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:37:34 2012 +0200

    llvmpipe: destroy setup variants on context destruction

    lp_delete_setup_variants() used to be called in garbage collection,
    but this no longer exists hence the setup shaders never got freed.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ed0003c633859a45f9963a479f4c15ae0ef1dca3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 16:25:29 2012 +0100

    gallivm: handle different ilod parts for multiple quad sampling

    This fixes filtering when the integer part of the lod is not the same
    for all quads. I'm not fully convinced of that solution yet as it just
    splits the vector if the levels to be sampled from are different.
    But otherwise we'd need to do things like some minify steps, and getting
    mip level base address separately anyway hence it wouldn't really look
    like much of a win (and making the code even more complex).
    This should now give identical results to single quad sampling.

commit 8580ac4cfc43a64df55e84ac71ce1a774d33c0d2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:14:47 2012 +0200

    gallivm: de-duplicate sample code common to soa and aos sampling

    There doesn't seem to be any reason why this code dealing with cube face
    selection, lod and mip level calculation is separate in aos and
    soa sampling, and I am sick of having it to change in both places.

commit fb541e5f957408ce305b272100196f1e12e5b1e8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:15:41 2012 +0200

    gallivm: do mip filtering with per quad lod_fpart

    This gives better results for mip filtering, though the generated code might
    not be optimal. For now it also creates some artifacts if the lod_ipart isn't
    the same for all quads, since instead of using the same mip weight for all
    quads as previously (which just caused non-smooth gradients) this now will
    use the right weights but with the wrong mip level in this case (can easily
    be seen with things like texfilt, mipmap_tunnel).
    v2: use logic helper suggested by José, and fix issue with negative lod_fpart
        values

commit f1cc84eef7d826a20fab6cd8ccef9a275ff78967
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 13 18:35:25 2012 +0200

    gallivm: (trivial) fix bogus assert in lp_build_unpack_broadcast_aos_scalars

commit 7c17dbae8ae290df9ce0f50781a09e8ed640c044
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:11:14 2012 +0100

    util: Reimplement half <-> float conversions.

    Removed u_half.py used to generate the table for previous method.

    Previous implementation of float to half conversion was faulty for
    denormalised and NaNs and would require extra logic to fix,
    thus making the speedup of using tables irrelevant.

commit 7762f59274070e1dd4b546f5cb431c2eb71ae5c3
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:12:16 2012 +0100

    tests: Updated tests to properly handle NaN for half floats.

commit fa94c135aea5911fd93d5dfb6e6f157fb40dce5e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:33:10 2012 +0200

    gallivm: do mip level calculations per quad

    This is the final piece which shouldn't change the rendering output yet.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 23cbeaddfe03c09ca18c45d28955515317ffcf4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 9 00:54:21 2012 +0200

    gallivm: do per-quad cube face selection

    Doesn't quite fix the piglit cubemap test (not sure why actually)
    but doing per-quad face selection is doing the right thing and
    definitely an improvement.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit abfb372b3702ac97ac8b5aa80ad1b94a2cc39d33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:22:59 2012 +0200

    gallivm: do all lod calculations per quad

    Still no functional change but lod is now converted to scalar after
    lod calculations.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 519368632747ae03feb5bca9c655eccbc5b751b4
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:46:10 2012 +0100

    gallivm: Added support for half-float to float conversion in lp_build_conv.

    Updated various utility functions to support this change.

commit 135b4d683a4c95f7577ba27b9bffa4a6fbd2c2e7
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:02:46 2012 +0100

    gallivm: Added function for half-float to float conversion.

    Updated lp_build_format_aos_array to support half-float source.

commit 37d648827406a20c5007abeb177698723ed86673
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:55:18 2012 +0100

    util: Updated u_format_tests to rigidly test half-float boundary values.

commit 2ad18165d96e578aa9046df7c93cb1c3284d8c6b
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:54:16 2012 +0100

    llvmpipe: Updated lp_test_format to properly handle Inf/NaN results.

commit 78740acf25aeba8a7d146493dd5c966e22c27b73
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:53:30 2012 +0100

    util: Added functions for checking NaN / Inf for double and half-floats.

commit 35e9f640ae01241f9e0d67fe893bbbf564c05809
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:05:13 2012 +0200

    gallivm: Fix calculating rho for 3d textures for the single-quad case

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

commit fc1220c636326536fd0541913154e62afa7cd1d8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:04:59 2012 +0200

    gallivm: do calcs per-quad in lp_build_rho

    Still convert to scalar at the end of the function.

commit 50a887ffc550bf310a6988fa2cea5c24d38c1a41
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 21 23:21:50 2012 +0200

    gallivm: (trivial) return scalar in lp_build_extract_range for length 1 vectors

    Our type system on top of llvm's one doesn't generally support vectors of
    length 1, instead using scalars. So we should return a scalar from this
    function instead of having to bitcast the vector with length 1 later elsewhere.

commit 80c71c621f9391f0f9230460198d861643324876
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 17:49:15 2012 +0100

    draw: Fixed bad merge error

commit c47401cfad0c9167de20ff560654f533579f452c
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:29:30 2012 +0100

    draw: Updated store_clip to store whole vectors instead of individual elements.

commit 2d9c1ad74b0b0b41861fffcecde39f09cc27f1cf
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:28:32 2012 +0100

    gallivm: Added lp_build_fetch_rgba_aos_array.

    A version of lp_build_fetch_rgba_aos which is targeted at simple array formats.

    Reads the whole vector from memory in one, instead of reading each element
    individually.

    Tested with mesa tests and demos.

commit ff7805dc2b6ef6d8b11ec4e54aab1633aef29ac8
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:27:40 2012 +0100

    gallivm: Added lp_build_pad_vector.

    This function pads a vector with undef to a desired length.

commit 701f50acef24a2791dabf4730e5b5687d6eb875d
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 17:27:19 2012 +0100

    util: Added util_format_is_array.

    This function checks whether a format description is in a simple array format.

commit 5e0a7fa543dcd009de26f34a7926674190fa6246
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:13:47 2012 +0100

    draw: Removed draw_llvm_translate_from and draw/draw_llvm_translate.c.

    This is "replaced" by adding an optimised path in lp_build_fetch_rgba_aos
    in an upcoming patch.

commit 8c886d6a7dd3fb464ecf031de6f747cb33e5361d
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 15:02:31 2012 +0100

    draw: Modified store_aos to write the vector as one, not individual elements.

commit 37337f3d657e21dfd662c7b26d61cb0f8cfa6f17
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 14:16:23 2012 +0100

    draw: Changed aos_to_soa to use lp_build_transpose_aos.

commit bd2b69ce5d5c94b067944d1dcd5df9f8e84548f1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:14:27 2012 +0100

    draw: Changed soa_to_aos to use lp_build_transpose_aos.

commit 0b98a950d29a116e82ce31dfe7b82cdadb632f2b
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:45 2012 +0100

    gallivm: Added lp_build_transpose_aos which converts between aos and soa.

commit 69ea84531ad46fd145eb619ed1cedbe97dde7cb5
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:01 2012 +0100

    gallivm: Added lp_build_interleave2_half aimed at AVX unpack instructions.

commit 7a4cb1349dd35c18144ad5934525cfb9436792f9
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 22 11:54:14 2012 +0100

    gallivm: Fix build on Windows.

    MC-JIT not yet supported there.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit afd105fc16bb75d874e418046b80d9cc578818a1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:17:26 2012 +0100

    llvmpipe: Added a error counter to lp_test_conv.

    Useful for keeping track of progress when fixing errors!

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit b644907d08c10a805657841330fc23db3963d59c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:16:46 2012 +0100

    llvmpipe: Changed known failures in lp_test_conv.

    To comply with the recent fixes to lp_bld_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit d7061507bd94f6468581e218e61261b79c760d4f
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:14:38 2012 +0100

    llvmpipe: Added fixed point types tests to lp_test_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 146b3ea39b4726dbe125ac666bd8902ea3d6ca8c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:26:35 2012 +0100

    llvmpipe: Changed lp_test_conv src/dst alignment to be correct.

    Now based on the define rather than a fixed number.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit f3b57441f834833a4b142a951eb98df0aa874536
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:06:44 2012 +0100

    gallivm: Fixed erroneous optimisation in lp_build_min/max.

    Previously assumed normalised was 0 to 1, but it can be -1 to 1
    if type is signed.
    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a0613382e5a215cd146bb277646a6b394d376ae4
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:04:49 2012 +0100

    gallivm: Compensate for lp_const_offset in lp_build_conv.

    Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
    Tested using lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a3d2bf15ea345bc8a0664f8f441276fd566566f3
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:01:25 2012 +0100

    gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.

    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit e7b1e76fe237613731fa6003b5e1601a2e506207
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 21 20:07:51 2012 +0100

    gallivm: Fix build with LLVM 2.6

    Trivial, and useful.

commit d3c6bbe5c7f5ba1976710831281ab1b6a631082d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 15 17:15:59 2012 +0100

    gallivm: Enable MCJIT/AVX with vanilla LLVM 3.1.

    Add the necessary C++ glue, so that we don't need any modifications
    to the soon to be released LLVM 3.1.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 724a019a14d40fdbed21759a204a2bec8a315636
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 22:04:06 2012 +0100

    gallivm: Use HAVE_LLVM 0x0301 consistently.

commit af6991e2a3868e40ad599b46278551b794839748
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 21:49:06 2012 +0100

    gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.

    Trivial.

commit 6f8a1d75458daae2503a86c6b030ecc4bb494e23
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Apr 2 22:14:15 2012 -0700

    gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.

    llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 62555b6ed8760545794f83064e27cddcb3ce5284
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 27 21:51:17 2012 -0700

    gallivm: Fix method overriding in raw_debug_ostream.

    Use matching type qualifers to avoid method hiding.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 6a9bd784f4ac68ad0a731dcd39e5a3c39989f2be
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 13 22:40:52 2012 -0700

    gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.

    llvm-3.1svn r152620 refactored the OProfile profiling code.
    createOProfileJITEventListener was moved from the llvm namespace to the
    llvm::JITEventListener namespace.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit b674955d39adae272a779be85aa1bd665de24e3e
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Mar 5 22:00:40 2012 -0800

    gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.

    llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
    MCRegisterInfo argument.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 11ab69971a8a31c62f6de74905dbf8c02884599f
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Wed Feb 29 21:20:53 2012 -0800

    Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."

    This reverts commit d5a6c17254.

    llvm-3.1svn r151687 makes MemoryObject accessor members const again.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 339960c82d2a9f5c928ee9035ed31dadb7f45537
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 14 16:19:56 2012 +0200

    gallivm: (trivial) fix assertion failure for mipmapped 1d textures

    In lp_build_rho, we may end up with a 1-element vector (for mipmapped 1d
    textures), but in this case we require the type to be a non-vector type,
    so need a cast.

commit 9d73edb727bd6d196030dc3026b7bf0c574b3e19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:12:07 2012 +0200

    gallivm: prepare for per-quad lod calculations for large vectors

    to be able to handle multiple quads at once in texture sampling and still
    do lod calculations per quad, it is necessary to get the per-quad derivatives
    into the lp_build_rho function.
    Until now these derivative values were just scalars, which isn't going to work.
    So we now use vectors, and since the interface needs to change we also do some
    different (slightly more efficient) packing of the values.
    For 8-wide vectors the packed derivative values for 3 coords would look like
    this, this scales to a arbitrary (multiple of 4) vector size:
    ds1dx ds1dy dt1dx dt1dy ds2dx ds2dy dt2dx dt2dy
    dr1dx dr1dy _____ _____ dr2dx dr2dy _____ _____
    The second vector will be unused for 1d and 2d textures.
    To facilitate future changes the derivative values are put into a struct, since
    quite some functions just pass these values through.
    The generated code seems to be very slightly better for 2d textures (with
    4-wide vectors) than before with sse2 (if you have a cpu with physical 128bit
    simd units - otherwise it's probably not a win).
    v2: suggestions from José, rename variables, add comments, use swizzle helper

commit 0aa21de0d31466dac77b05c97005722e902517b8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:10:31 2012 +0200

    gallivm: add undefined swizzle handling to lp_build_swizzle_aos

    This is useful for vectors with "holes", it lets llvm choose the most
    efficient shuffle instructions if some elements aren't needed without having to
    worry what elements to manually pick otherwise.

commit 00faf3f370e7ce92f5ef51002b0ea42ef856e181
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri May 4 17:25:16 2012 +0100

    gallivm: Get the LLVM IR optimization passes before JIT compilation.

    MC-JIT engine compiles the module immediately on creation, so the optimization
    passes were being run too late.

    So now we create a target data layout from a string, that matches the
    ABI parameters reported by the compiler.

    The backend optimization passes were always been run, so the performance
    improvement is modest (3% on multiarb mesa demo).

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 40a43f4e2ce3074b5ce9027179d657ebba68800a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed May 2 16:03:54 2012 +0200

    gallivm: (trivial) fix wrong define used in lp_build_pack2

    should fix stack-smashing crashes.

commit e6371d0f4dffad4eb3b7a9d906c23f1c88a2ab9e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 30 21:25:29 2012 +0200

    gallivm: add perf warnings when not using intrinsics with 256bit vectors

    Helper functions using integer sse2 intrinsics could split the vectors with AVX
    instead of using generic fallback (which should be faster).
    We don't actually expect to hit these paths (hence don't fix them up to actually
    do the vector splitting) so just emit warnings (for those functions where it's
    obvious doing split/intrinsic is faster than using generic path).
    Only emit warnings for 256bit vectors since we _really_ don't expect to hit
    arbitrary large vectors which would affect a lot more functions.
    The warnings do not actually depend on avx since the same logic applies to
    plain sse2 too (but of course again there's _really_ no reason we should hit
    these functions with 256bit vectors without avx).

commit 8a9ea701ea7295181e846c6383bf66a5f5e47637
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:37:07 2012 +0200

    gallivm: split vectors manually for avx in lp_build_pack2 (v2)

    There's 2 reasons for this:
    First, there's a llvm bug (fixed in 3.1) which generates tons of byte
    inserts/extracts otherwise, and second, more importantly, we want to use
    pack intrinsics instead of shuffles.
    We do this in lp_build_pack2 and not the calling code (aos sample path)
    because potentially other callers might find that useful too, even if
    for larger sequences of code using non-native vector sizes it might be
    better to manually split vectors.
    This should boost texture performance in the aos path considerably.
    v2: fix issues with intrinsics types with old llvm

commit 27ac5b48fa1f2ea3efeb5248e2ce32264aba466e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:26:22 2012 +0200

    llvmpipe: refactor lp_build_pack2 (v2)

    prettify, and it's unnecessary to assert when there's no intrinsic due to
    unsupported bit width - the shuffle path will work regardless.
    In contrast lp_build_packs2, should only rely on lp_build_pack2 doing the
    clamping for element sizes for which there is a sse2 intrinsic.
    v2: fix bug spotted by Jose regarding the intrinsic type for packusdw
    on old llvm versions.

commit ddf279031f0111de4b18eaf783bdc0a1e47813c8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:13:59 2012 +0200

    gallivm: add src width check in lp_build_packs2()

    not doing so would skip clamping even if no sse2 pack instruction is
    available, which is incorrect (in theory only, such widths would also always
    hit a (unnecessary) assertion in lp_build_pack2().

commit e7f0ad7fe079975eae7712a6e0c54be4fae0114b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 27 15:57:00 2012 +0200

    gallivm: (trivial) fix crash-causing typo for npot textures with avx

commit 28a9d7f6f655b6ec508c8a3aa6ffefc1e79793a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Apr 25 19:38:45 2012 +0200

    gallivm: (trivial) remove code mistakenly added twice.

commit d5926537316f8ff67ad0a52e7242f7c5478d919b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Apr 24 21:16:15 2012 +0200

    gallivm: add a new avx aos sample path (v2)

    Try to avoid mixing float and int address calculations. This does texture wrap
    modes with floats, and then the offset calculations still with ints (because
    of lack of precision with floats, though we could do some effort to make it work
    with not too large (16MB) textures).
    This also handles wrap repeat mode with npot-sized textures differently than
    either the old soa or aos int path (likely way faster but untested).
    Otherwise the actual address wrap code is largely similar to the soa path (not
    quite the same as this one also has some int code), it should get used by avx
    soa sampling later as well but doesn't handle more complex address modes yet
    (this will also have the benefit that we can use aos sampling path for all
    texture address modes).
    Generated code for that looks reasonable, but still does not split vectors
    explicitly for fetch/filter which means still get hit by llvm (fixed upstream)
    which generates hundreds of pinsrb/pextrb instead of two shuffles.
    It is not obvious though if it's much of a win over just doing address calcs
    4-wide but with ints, even if it is definitely much less instructions on avx.
    piglit's texwrap seems to look exactly the same but doesn't test
    neither the non-normalized nor the npot cases.
    v2: fix comments, prettify based on Brian's and Jose's feedback.

commit bffecd22dea66fb416ecff8cffd10dd4bdb73fce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 19 01:58:29 2012 +0200

    gallivm: refactor aos lp_build_sample_image_nearest/linear

    split them up to separate address calculations and fetching/filtering.
    Need this for being able to do 8-wide float address calcs and 4-wide
    fetch/filter later (for avx). Plus the functions were very big scary monsters
    anyway (in particular lp_build_sample_image_linear).

commit a80b325c57529adddcfa367f96f03557725c4773
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 16 17:17:18 2012 +0200

    gallivm: fix lp_build_resize when truncating width but expanding vector size

    Missed this case which I thought was impossible - the assertion for it was
    right after the division by zero...
    (AoS) texture sampling may ask us to do this, for things like 8 4x32int
    vectors to 1 32x8int vector conversion (eventually, we probably don't want
    this to happen).

commit f9c8337caa3eb185830d18bce8b95676a065b1d7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Apr 14 18:00:59 2012 +0200

    gallivm: fix cube maps with larger vectors

    This makes the branchless cube face selection code work with larger vectors.
    Because the complexity is quite high (cannot really be improved it seems,
    per-face selection would reduce complexity a lot but this leads to errors
    unless the derivatives are calculated all from the same face which almost
    doubles the work to be done) it is still slower than the branching version,
    hence only enable this with large vectors.
    It doesn't actually do per-quad face selection yet (only makes sense with
    matching lod selection, in fact it will select the same face for all pixels
    based on the average of the first four pixels for now) but only different
    shuffles are required to make it work (the branching version actually should
    work with larger vectors too now thanks to the improved horizontal add but of
    course it cannot be extended to really select the face per-quad unless doing
    branching per quad).

commit 7780c58869fc9a00af4f23209902db7e058e8a66
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 21:11:12 2012 +0100

    llvmpipe: (trivial) fix compiler warning

    and also clarify comment regarding availability of popcnt instruction.

commit a266dccf477df6d29a611154e988e8895892277e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 14:21:07 2012 +0100

    gallivm: remove unneeded members in lp_build_sample_context

    Minor cleanup, the texture width, height, depth aren't accessed in their
    scalar form anywhere. Makes it more obvious those values should probably be
    fetched already vectorized (but this requires more invasive changes)...

commit b678c57fb474e14f05e25658c829fc04d2792fff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 29 15:53:55 2012 +0100

    gallivm: add a helper for concatenating vectors

    Similar to the extract_range helper intended to get around slow code generated
    by llvm for 128bit insertelements.
    Concatenating two 128bit vectors this way will result in a single vinsertf128
    operation rather than two 64bit stores plus one 128bit load, though it might be
    mildly useful for other purposes as well.

commit 415ff228bcd0cf5e44a4c15350a661f0f5520029
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 19:41:15 2012 +0100

    gallivm: add a custom 2x8f->1x16ub avx conversion path

    Similar to the existing 4x4f->1x16ub sse2 path, shaves off a couple
    instructions (min/max mostly) because it relies on pack intrinsics clamping.

commit 78c08fc89f8fbcc6dba09779981b1e873e2a0299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 18:44:07 2012 +0100

    gallivm: add avx arithmetic intrinsics

    Add all avx intrinsics for arithmetic functions (with the exception
    of the horizontal add function which needs another look).
    Seems to pass basic tests.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit a586caa2800aa5ce54c173f7c0d4fc48153dbc4e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 15:31:35 2012 +0100

    gallivm: add avx logic intrinsics

    Add the blend intrinsics for 8-wide float and 4-wide double vectors.
    Since we lack 256bit int instructions these are used for int vectors as well,
    though obviously not for byte or word element values.
    The comparison intrinsics aren't extended for avx since these are only used
    for pre-2.7 llvm versions.

commit 70275e4c13c89315fc2560a4c488c0e6935d5caf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 00:40:53 2012 +0100

    gallivm: new helper function for extract shuffles.

    Based on José's idea as we can need that in a couple places.
    Note that such shuffles should not be used lightly, since data layout
    of <4 x i8> is different to <16 x i8> for instance, hence might cause
    data rearrangement.

commit 4d586dbae1b0c55915dda1759d2faea631c0a1c2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 18:27:25 2012 +0100

    gallivm: (trivial) don't overallocate shuffle variable

    using wrong define meant huge array...

commit 06b0ec1f6d665d98c135f9573ddf4ba04b2121ad
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 17:54:20 2012 +0100

    gallivm: don't do per-element extract/insert for vector element resize

    Instead of doing per-element extract/insert if the src vectors
    and dst vector differ in total size (which generates atrocious code)
    first change the src vectors size by using shuffles to destination
    vector size.
    We can still do better than that on AVX for packing to color buffer
    (by exploiting pack intrinsics characteristics hence eleminating the
    need for some clamps) but this already generates much better code.

    v2: incorporate feedback from José, Keith and use shuffle instead of
    bitcasts/extracts. Due to llvm deficiencies the latter cause all data
    to get moved to GPRs and back in pieces (even though the data in the
    regs actually stays the same...).

commit c9970d70e05f95d3f52fe7d2cd794176a52693aa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 19:33:19 2012 +0000

    gallivm: fix bug in simple position interpolation

    Accidental use of position attribute instead of just pixel coordinates.
    Caused failures in piglit glsl-fs-ceil and glsl-fs-floor.

commit d0b6fcdb008d04d7f73d3d725615321544da5a7e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 15:31:14 2012 +0000

    gallivm: fix emission of ceil opcode

    lp_build_ceil seems more appropriate than lp_build_trunc.
    This seems to be never hit though someone performs some ceil
    to floor magic.

commit d97fafed7e62ffa6bf76560a92ea246a1a26d256
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 22 11:46:52 2012 +0000

    gallivm: new vectorized path for cubemap calculations

    should be faster when adapted to multiple quads as only selection masks need to be different.
    The code is more or less a per-pixel version adapted to only do it per quad.
    A per pixel version would be much simpler (could drop 2 selects, 6 broadcasts and the messy
    horizontal add of 3 vectors at the expense of only 2 more absolute value instructions -
    would also just work for arbitary large vectors).
    This version doesn't yet work with larger vectors because the horizontal add isn't adjusted
    to be able to work with 2x4 vectors (and also because face selection wouldn't be done per
    quad just per block though that would be only a correctness issue just as with lod selection).
    The downside is this code is quite a bit slower. On a Core2 it can be sped up by disabling the
    hw blend instructions for selection and using logicop fallbacks instead, but it is still slower
    than the old code, hence leave that in for now. Probably will chose one or the other version
    based on vector length in the end.

commit b375fbb18a3fd46859b7fdd42f3e9908ea4ff9a3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 21 14:42:29 2012 +0000

    gallivm: fix optimized occlusion query intrinsic name

commit a9ba0a3b611e48efbb0e79eb09caa85033dbe9a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Mar 21 16:19:43 2012 +0000

    draw,gallivm,llvmpipe: Call gallivm_verify_function everywhere.

commit f94c2238d2bc7383e088b8845b7410439a602071
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 18:54:10 2012 +0000

    gallivm: optimize calculations for cube maps a bit

    this does some more vectorized calculations and uses horizontal adds if possible.
    A definite win with sse3 otherwise it doesn't seem to make much of a difference.
    In any case this is arithmetically identical, cannot handle larger vectors.
    Should be useful as a reference point against larger vector version later...

commit 21a2c1cf3c8e1ac648ff49e59fdc0e3be77e2ebb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 15:16:27 2012 +0000

    llvmpipe: slight optimization of occlusion queries

    using movmskps when available.
    While this is slightly better for cpus without popcnt we should
    really sum the vectors ourselves (it is also possible to cast to i4 before
    doing the popcnt but that doesn't help that much neither since llvm
    is using some optimized popcnt version for i32)

commit 5ab5a35f216619bcdf55eed52b0db275c4a06c1b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 13:32:11 2012 +0000

    llvmpipe: fix occlusion queries with larger vectors

    need to adjust casts etc.

commit ff95e6fdf5f16d4ef999ffcf05ea6e8c7160b0d5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Mar 19 20:15:25 2012 +0000

    gallivm: Restore optimization passes.

commit 57b05b4b36451e351659e98946dae27be0959832
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:34:22 2012 +0000

    llvmpipe: use existing min2 macro

commit bc9a20e19b4f600a439f45679451f2e87cd4b299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:07:27 2012 +0000

    llvmpipe: add some safeguards against really large vectors

    As per José's suggestion, prevent things from blowing up if some cpu
    would have 1024bit or larger vectors.

commit 0e2b525e5ca1c5bbaa63158bde52ad1c1564a3a9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:31:08 2012 +0000

    llvmpipe: fix mask generation for uberwide vectors

    this was the only piece preventing 16-wide vectors from working
    (apart from the LP_MAX_VECTOR_WIDTH define that is), which is the maximum
    as we don't get more pixels in the fragment shader at once.
    Hence adjust that so things could be tested properly with that size
    even though there seems to be no practical value.

commit 3c8334162211c97f3a11c7f64e9e5a2a91ad9656
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:19:41 2012 +0000

    llvmpipe: fix the simple interpolation method with larger vectors

    so both methods actually _really_ work now. Makes textures look
    nice with larger vectors...

commit 1cb0464ef8871be1778d43b0c56adf9c06843e2d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 17:26:35 2012 +0000

    llvmpipe: fix mask generation and position interpolation with 8-wide vectors

    trivial bugs, with these things start to look somewhat reasonable.
    Textures though have some swizzling issues it seems.

commit 168277a63ef5b72542cf063c337f2d701053ff4b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 16:04:03 2012 +0000

    llvmpipe: don't overallocate variables

    we never have more than 16 (stamp size) / 4 (minimum possible vector size).
    (With larger vectors those variables are still overallocated a bit.)

commit 409b54b30f81ed0aa9ed0b01affe15c72de9abd2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:56:48 2012 +0000

    llvmpipe: add some 32f8 formats to lp_test_conv

    Also add the ability to handle different sized vectors.

commit 55dcd3af8366ebdac0af3cdb22c2588f24aa18ce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:47:27 2012 +0000

    gallivm: handle different sized vectors in conversion / pack

    only fully generic path for now (extract/insert per element).

commit 9c040f78c54575fcd94a8808216cf415fe8868f6
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sun Mar 18 00:58:28 2012 +0100

    llvmpipe: fix harmless use of unitialized values

commit 551e9d5468b92fc7d5aa2265db9a52bb1e368a36
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:31:21 2012 +0100

    gallivm: drop special path in extract_broadcast with different sized vectors

    Not needed, llvm can handle shuffles with different sized result vector just
    fine. Should hopefully generate the same code in the end, but simpler IR.

commit 44da531119ffa07a421eaa041f63607cec88f6f8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:28:49 2012 +0100

    llvmpipe: adapt interpolation for handling multiple quads at once

    this is still WIP there are actually two methods possible not quite
    sure what makes the most sense, so there's code for both for now:
    1) the iterative method as used before (compute attrib values at upper left
    corner of stamp and upper left corner of each quad initially).
    It is improved to handle more than one quad at once, and also do some more vectorized
    calculations initially for slightly better code - newer cpus have full throughput with
    4 wide float vectors, hence don't try to code up a path which might be faster if there's
    just one channel active per attribute.
    2) just do straight interpolation for each pixel.
    Method 2) is more work per quad, but less initially - if all quads are executed
    significantly more overall though. But this might change with larger vector lengths.
    This method would also be needed if we'd do some kind of active quad merging when
    operating on multiple quads at once.
    This path contains some hack to force llvm to generate better code, it is still far
    from ideal though, still generates far too many unnecessary register spills/reloads.
    Both methods should work with different sized vectors.
    Not very well tested yet, still seems to work with four-wide vectors, need changes
    elsewhere to be able to test with wider vectors.

commit be5d3e82e2fe14ad0a46529ab79f65bf2276cd28
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:59:37 2012 +0000

    draw: Cleanup.

commit f85bc12c7fbacb3de2a94e88c6cd2d5ee0ec0e8d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:43:30 2012 +0000

    gallivm: More module compilation refactoring.

commit d76f093198f2a06a93b2204857e6fea5fd0b3ece
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Mar 15 21:29:11 2012 +0000

    llvmpipe: Use gallivm_compile/free_function() in linear code.

    Should had been done before.

commit 122e1adb613ce083ad739b153ced1cde61dfc8c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 13 14:47:10 2012 +0100

    llvmpipe: generate partial pixel mask for multiple quads

    still works with one quad, cannot be tested yet with more
    At least for now always fixed order with multiple quads.

commit 4c4f15081d75ed585a01392cd2dcce0ad10e0ea8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 22:09:24 2012 +0100

    llvmpipe: refactor state setup a bit

    Refactor to make it easier to emit (and potentially later fetch in fs)
    coefficients for multiple attributes at once.
    Need to think more about how to make this actually happen however, the
    problem is different attributes can have different interpolation modes,
    requiring different handling in both setup and fs (though linear and
    perspective handling is close).

commit 9363e49722ff47094d688a4be6f015a03fba9c79
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 19:23:23 2012 +0100

    llvmpipe: vectorize tri offset calc

    cuts number of instructions in quad-offset-factor from 107 to 75.
    This code actually duplicated the (scalar) code calculating the determinant
    except it used different vertex order (leading to different sign but it doesn't
    matter) hence llvm could not have figured out it's the same (of course with
    determinant vectorized in the other place that wouldn't have worked any longer
    neither).
    Note this particular piece doesn't actually vectorize well, not many arithmetic
    instructions left but tons of shuffle instructions...
    Probably would need to work on n tris at a time for better vectorization.

commit 63169dcb9dd445c94605625bf86d85306e2b4297
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 03:11:37 2012 +0100

    llvmpipe: vectorize some scalar code in setup

    reduces number of arithmetic instructions, and avoids loading
    vector x,y values twice (once as scalars once as vectors).
    Results in a reduction of instructions from 76 to 64 in fs setup for glxgears
    (16%) on a cpu with sse41.
    Since this code uses vec2 disguised as vec4, on old cpus which had physical
    64bit sse units (pre-Core2) it probably is less of a win in practice (and if
    you have no vectors you can only hope llvm eliminates the arithmetic for
    unneeded elements).

commit 732ecb877f951ab89bf503ac5e35ab8d838b58a1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 7 00:32:24 2012 +0100

    draw: fix clipping

    bug introduced by 4822fea3f0440b5205e957cd303838c3b128419c broke
    clipping pretty badly (verified with lineclip test)

commit ef5d90b86d624c152d200c7c4056f47c3c6d2688
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 23:38:59 2012 +0100

    draw: don't store vertex header per attribute

    storing the vertex header once per attribute is totally unnecessary.
    Some quick look at the generated assembly says llvm in fact cannot optimize
    away the additional stores (maybe due to potentially aliasing pointers
    somewhere).
    Plus, this makes the code cleaner and also allows using a vector "or"
    instead of scalar ones.

commit 6b3a5a57b0b9850854cfbd7b586e4e50102dda71
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 19:11:01 2012 +0100

    draw: do the per-vertex "boolean" clipmask "or" with vectors

    no point extracting the values and doing it per component.
    Doesn't help that much since we still extract the values elsewhere anyway.

commit 36519caf1af40e4480251cc79a2d527350b7c61f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 2 22:27:01 2012 +0100

    gallivm: fix lp_build_extract_broadcast with different sized vectors

    Fix the obviously wrong argument, so it doesn't blow up.

commit 76d0ac3ad85066d6058486638013afd02b069c58
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 2 12:16:23 2012 +0000

    draw: Compile per module and not per function (WIP).

    Enough to get gears w/ LLVM draw + softpipe to work on AVX doing:

      GALLIUM_DRIVER=softpipe SOFTPIPE_USE_LLVM=yes glxgears

    But still hackish -- will need to rethink and refactor this.

commit 78e32b247d2a7a771be9a1a07eb000d1e54ea8bd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 12:01:05 2012 +0000

    llvmpipe: Remove lp_state_setup_fallback.

    Never used.

commit 6895d5e40d19b4972c361e8b83fdb7eecda3c225
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Feb 27 19:14:27 2012 +0000

    llvmpipe: Don't emit EMMS on x86

    We already take precautions to ensure that LLVM never emits MMX code.

commit 4822fea3f0440b5205e957cd303838c3b128419c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 29 15:58:19 2012 +0100

    draw: modifications for larger vector sizes

    We want to be able to use larger vectors especially for running the vertex
    shader. With this patch we build soa vectors which might have a different
    length than 4.
    Note that aos structures really remain the same, only when aos structures
    are converted to soa potentially different sized vectors are used.
    Samplers probably don't work yet, didn't look at them.
    Testing done:
    glxgears works with both 128bit and 256bit vectors.

commit f4950fc1ea784680ab767d3dd0dce589f4e70603
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:57 2012 +0100

    gallivm: override native vector width with LP_NATIVE_VECTOR_WIDTH env var for debug

commit 6ad6dbf0c92f3bf68ae54e5f2aca035d19b76e53
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:24 2012 +0100

    draw: allocate storage with alignment according to native vector width

commit 7bf0e3e7c9bd2469ae7279cabf4c5229ae9880c1
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Feb 24 19:06:08 2012 +0000

    gallivm: Fix comment grammar.

    Was missing several words. Spotted by Roland.

commit b20f1b28eb890b2fa2de44a0399b9b6a0d453c52
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 19:22:09 2012 +0000

    gallivm: Use MC-JIT on LLVM 3.1 + (i.e, SVN)

    MC-JIT

    Note: MC-JIT is still WIP. For this to work correctly it requires
    LLVM changes which are not yet upstream.

commit b1af4dfcadfc241fd4023f4c3f823a1286d452c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 20:03:15 2012 +0100

    llvmpipe: use new lp_type_width() helper in lp_test_blend

commit 04e0a37e888237d4db2298f31973af459ef9c95f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 19:50:34 2012 +0100

    llvmpipe: clean up lp_test_blend a little

    Using variables just sized and aligned right makes it a bit more obvious
    what's going on.
    The test still only tests vector length 4.
    For AoS anything else probably isn't going to work.
    For SoA other lengths should work (at least with floats).

commit e61c393d3ec392ddee0a3da170e985fda885a823
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:48:30 2012 +0000

    gallivm: Ensure vector width consistency.

    Instead of assuming that everything is the max native size.

commit 330081ac7bc41c5754a92825e51456d231bf84dd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:44:14 2012 +0000

    draw: More simd vector width consistency fixes.

commit d90ca002753596269e37297e2e6c139b19f29f03
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:43:00 2012 +0000

    gallivm: Remove unused lp_build_int32_vec4_type() helper.

commit cae23417824d75869c202aaf897808d73a2c1db0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 17:32:16 2012 +0100

    gallivm: use global variable for native vector width instead of define

    We do not know the simd extensions (and hence the simd width we should use)
    available at compile time.
    At least for now keep a define for maximum vector width, since a global
    variable obviously can't be used to adjust alignment of automatic stack
    variables.
    Leave the runtime-determined value at 128 for now in all cases.

commit 51270ace6349acc2c294fc6f34c025c707be538a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 15:41:02 2012 +0000

    gallivm: Add a hunk inadvertedly lost when rebasing.

commit bf256df9cfdd0236637a455cbaece949b1253e98
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:24:23 2012 +0000

    llvmpipe: Use consistent vector width in depth/stencil test.

commit 5543b0901677146662c44be2cfba655fd55da94b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:19:59 2012 +0000

    draw: Use a consistent the vector register width.

    Instead of 4x32 sometimes, LP_NATIVE_VECTOR_WIDTH other times.

commit eada8bbd22a3a61f549f32fe2a7e408222e5c824
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 12:08:04 2012 +0000

    gallivm: Remove garbagge collection.

    MC-JIT will require one compilation per module (as opposed to one
    compilation per function), therefore no state will be shared,
    eliminating the need to do garbagge collection.

commit 556697ea0ed72e0641851e4fbbbb862c470fd7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 10:33:41 2012 +0000

    gallivm: Move all native target initialization to lp_set_target_options().

commit c518e8f3f2649d5dc265403511fab4bcbe2cc5c8
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:52:32 2012 +0000

    llvmpipe: Create one gallivm instance for each test.

commit 90f10af8920ec6be6f2b1e7365cfc477a0cb111d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:48:08 2012 +0000

    gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().

    Brittle, complex, and unecesary. Just use function pointer constant.

commit 98fde550b33401e3fe006af59db4db628bcbf476
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:21:26 2012 +0000

    gallivm: Add a lp_build_const_func_pointer() helper.

    To be reused in all places where we want to call C code.

commit 6cfedadb62c2ce5af8d75969bc95a607f3ece118
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:44:41 2012 +0000

    gallivm: Cleanup/simplify lp_build_const_string_variable.

    - Move to lp_bld_const where it belongs
    - Rename to lp_build_const_string
    - take the length from the argument (and don't count the zero terminator twice)
    - bitcast the constant to generic i8 *

commit db1d4018c0f1fa682a9da93c032977659adfb68c
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 11:52:17 2012 +0000

    gallivm: Set NoFramePointerElimNonLeaf to true where supported.

commit 088614164aa915baaa5044fede728aa898483183
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 22 19:38:47 2012 +0100

    llvmpipe: pass in/out pointers rather scalar floats in lp_bld_arit

    we don't want llvm to potentially optimize away the vectors (though it doesn't
    seem to currently), plus we want to be able to handle in/out vectors of arbitrary
    length.

commit 3f5c4e04af8a7592fdffa54938a277c34ae76b51
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:22:55 2012 +0100

    gallivm: fix lp_build_sqrt() for vector length 1

    since we optimize away vectors with length 1 need to emit intrinsic
    without vector type.

commit 79d94e5f93ed8ba6757b97e2026722ea31d32c06
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 17:00:46 2012 +0000

    llvmpipe: Remove lp_test_round.

commit 81f41b5aeb3f4126e06453cfc78990086b85b78d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:56:24 2012 +0100

    llvmpipe: subsume lp_test_round into lp_test_arit

    Much simpler, and since the arguments aren't passed as 128bit values can run
    on any arch.
    This also uses the float instead of the double versions of the c functions
    (which probably was the intention anyway).
    In contrast to lp_test_round the output is much less verbose however.
    Tested vector width of 32 to 512 bits - all pass except 32 (length 1) which
    crashes in lp_build_sqrt() due to wrong type.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 945b338b421defbd274481d8c4f7e0910fd0e7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 09:55:03 2012 +0000

    gallivm: Centralize the function compilation logic.

    This simplifies a lot of code.

    Also doing this in a central place will make it easier to carry out the
    changes necessary to use MC-JIT in the future.

gallivm: Fix typo in explicit derivative shuffle.

Trivial.

draw: make DEBUG_STORE work again

adapt to lp_build_printf() interface changes

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: get rid of vecnf_from_scalar()

just use lp_build_broadcast directly (cannot assign a name but don't really
need it, vecnf_from_scalar() was producing much uglier IR due to using
repeated insertelement instead of insertelement+shuffle).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

llvmpipe: fix typo in complex interpolation code

Fixes position interpolation when using complex mode
(piglit fp-fragment-position and similar)

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: fix clipvertex/position storing again

This appears to be the result of a bad merge.
Fixes piglit tests relying on clipping, like a lot of the interpolation tests.

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Fix explicit derivative manipulation.

Same counter variable was being used in two nested loops. Use more
meanigful variable names for the counter to fix and avoid this.

gallivm: Prevent buffer overflow in repeat wrap mode for NPOT.

Based on Roland's patch, discussion, and review .

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix dims for TGSI_TEXTURE_1D in emit_tex.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix explicit volume texture derivatives.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: fix 1d shadow texture sampling

Always r coordinate is used, hence need 3 coords not two
(the second one is unused).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Enable AVX support without MCJIT, where available.

For now, this just enables AVX on Windows for testing.  If the code is
stable then we might consider prefering the old JIT wherever possible.

No change elsewhere.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-17 13:42:39 +01:00
José Fonseca
ba9c1773d7 gallivm: Allow to force nearest filtering on a per-axis basis.
Experimental code, not really used yet.
2012-07-17 13:42:39 +01:00
Kristian Høgsberg
b262f56738 wayland: Include wl_drm format enum in wayland-drm.h
This gets referenced before we get to generate the header files, so just include the
enum that we need and don't include the generated header.
2012-07-17 08:30:39 -04:00
James Benton
e253175c9c llvmpipe: Fix bug with blend factor in complementary optimisations.
Fixes fdo 52168.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-17 13:16:38 +01:00
Christian König
89e755d762 radeonsi: fix vertex element state
The vertex element state isn't in registers any more, so
remove that old code. That fixes a memory corruption with
the blend state and gets eglgears partially working.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-17 10:44:12 +02:00
Christian König
4247fd9928 radeon/llvm: fix compiling when llvm is active, but opencl isn't
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-17 10:43:53 +02:00
Brian Paul
aa0becdbb6 mesa: include inttypes.h to get uint8_t type
To fix MSVC build.
2012-07-16 16:12:02 -06:00
Brian Paul
fe2a7b7e7f st/egl: fix uninitialized pointer bug
If no format is matched in the loop the value of xconf was undefined.

NOTE: This is a candidate for the 8.0 branch.
2012-07-16 16:03:31 -06:00
Brian Paul
2f92a9f721 r300g: silence uninitialized var warning 2012-07-16 16:03:31 -06:00
Elvis Lee
cf775c9cbf egl_dri2: NULL check for EGLNativeWindowType
Some application calls eglCreateWindowSurface with
EGLNativeWindowType parameter having zero value. It causes SEGV
and disturbs error handling like EGL_NO_SURFACE.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-16 16:03:31 -06:00
Jon TURNEY
d80fd04639 Fix building mesa with assembly enabled since a112ca5d
a112ca5d rather crassly smashed all the compiler flags together into AM_CFLAGS.
Separate them out the way they were before, putting pre-processor flags into
AM_CPPFLAGS, so assembly source gets preprocessed with the correct pre-processor
flags as well.

Also, remove unneeded CFLAGS from AM_CFLAGS, and CXXFLAGS from AM_CXXFLAGS

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Brian Paul <brianp@vmware.com>
2012-07-16 22:54:36 +01:00
Chad Versace
8dc074cd92 intel: Fix build broken by ETC1 patch
I suck at resolving merge conflicts and broke the build in a5a34b1.
This patch adds the missing field intel_mipmap_tree::wraps_etc1.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:29:24 -07:00
Chad Versace
a5a34b153d intel: Enable GL_OES_compressed_ETC1_RGB8_texture
Enable it for all hardware.

No current hardware supports ETC1, so this patch implements it by
translating the ETC1 data to RGBX data during the call to
glCompressedTexImage2D(). For details, see the doxygen for
intel_mipmap_tree::wraps_etc1.

Passes the Piglit test spec/OES_compressed_ETC1_RGB8_texture/miptree and
the ETC1 test in the GLES2 conformance suite.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:11:12 -07:00
Chad Versace
8ec721264c mesa: Add function for decoding ETC1 textures
Add function _mesa_etc1_unpack_rgba8888. It is intended to be used by
glCompressedTexSubImage2D to decode ETC1 textures into RGBA.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Chad Versace
d7458e401e gallium/util, mesa: Refactor etc1 unpack function
Move the body of util_etc1_rgb8_unpack_rgba_unorm8 into a new function
that can be shared between gallium and dri drivers,
texcompress_etc_tmp.h:etc1_unpack_rgba8888.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Kristian Høgsberg
7250cd506b gbm: Rename gbm_bo_get_pitch to gbm_bo_get_stride
We use pitch for 'pixels per row' and stride for 'bytes per row' pretty
consistently in mesa and most other places, so rename the gbm API.
2012-07-16 16:29:16 -04:00
Kristian Høgsberg
44f066b9ff gbm: Add new gbm_bo_import entry point
This generalizes and replaces gbm_bo_create_for_egl_image.  gbm_bo_import
will create a gbm_bo from either an EGLImage or a struct wl_buffer.
2012-07-16 16:29:15 -04:00
Roland Scheidegger
43ccded1e1 llvmpipe: destroy setup variants on context destruction
lp_delete_setup_variants() used to be called in garbage collection,
but this no longer exists hence the setup shaders never got freed.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
James Benton
8684ffc141 llvmpipe: Unified common code between AoS and SoA blending.
Added a new file lp_bld_blend.c for the common code.
Merged and added some simple optimisations.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
Kristian Høgsberg
636646a481 intel: Don't call _mesa_get_format_bytes for MESA_FORMAT_NONE
When we don't intend to texture from or render to a __DRIimage we
use __DRI_IMAGE_FORMAT_NONE.  In that case, we just create the __DRIimage
to reference the underlying buffer, and will create usable __DRIimages
from it using createSubImage later.

If we try to use _mesa_get_format_bytes() on MESA_FORMAT_NONE in
a debug build, we hit an assertion, so let's not do that.
2012-07-16 11:00:16 -04:00
Jon TURNEY
81de0431d6 Fix building glsl when using automake-1.12 after 68e04cc6
Commit 68e04cc6 was tested using automake-1.11.  Unfortunately, automake-1.12
made a "slightly backward-incompatible change" in the use of yacc with C++, and
for a .yy file, the generated header file is now named .hh, not .h

To work with both, write our own rule for running yacc, which generates a
header file named .h, rather than using automake's rule.

Also, remove things from BUILD_SOURCES which don't need to be there

Also, update EXCLUDE rules in doxygen/glsl.doxy, for change of generated files
from .cpp -> .cc, and glsl_lexer.h has never existed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-15 15:27:26 +01:00
Marek Olšák
bc6bff7947 r600g: compute needed CS space for vertex buffers correctly 2012-07-15 15:26:14 +02:00
Marek Olšák
15ca9d159e r600g: don't check the R600_GLSL130 env var
GLSL 1.3 has been enabled by default for quite a while.
2012-07-15 02:16:46 +02:00
Jerome Glisse
e634651024 r600g: fix DB decompression on evergreen
Separated out of the hyperz patch by Marek with minor modifications.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:06:44 +02:00
Tom Stellard
c2f444c54d r600g: Emit vertex buffers using the same method as constant buffers
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:27 +02:00
Tom Stellard
9b76ee70b2 r600g: Unify 3D and compute vertex buffer emission
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:21 +02:00
Marek Olšák
0b4c5dbb8c r600g: fix grammar constant_buffer -> constant_buffers 2012-07-15 01:41:11 +02:00
Andreas Boll
e3ff4d4c10 radeon/llvm: Fix CR/LF in AMDILSIDevice.h 2012-07-13 16:35:22 +00:00
Tom Stellard
cc3907856e radeon/llvm: Clean up AMDILIntrinsicInfo.cpp 2012-07-13 16:29:46 +00:00
Tom Stellard
f323c6260d radeon/llvm: Coding style fixes 2012-07-13 16:29:46 +00:00
Jon TURNEY
39d82a1b20 Fix linking gallium drivers and with dricore after defadf2b1
Commit defadf2b1 erroneously tries to make gallium drivers link with libdricore
as a static library, not a shared library

Also, change uses of DRI_LIB_DEPS in gallium driver Makefiles to
GALLIUM_DRI_LIB_DEPS, so the libraries added are used in the linking the gallium
driver

Also, fix the path to the libdricore.so symlink, it's made in LIB_DIR, not in
the libdricore directory

Also repair quoting of dricore settings of DRI_LIB_DEPS and GALLIUM_DRI_LIB_DEPS
variables so VERSION is interpolated in configure but TOP and LIB_DIR are
interpolated later (where they are known, but VERSION isn't)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-13 17:20:39 +01:00
Christoph Bumiller
9ed65301e0 nouveau: implement missing timer query functionality 2012-07-13 17:28:00 +02:00
Kristian Høgsberg
426a23af14 wayland: Stop trying to use make rules from aclocal, just copy and paste
Defeated by autotool, copy and paste to the rescue.

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

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-13 11:20:17 -04:00
José Fonseca
b3ba0a7afa mesa/st: Generates TGSI that always recognizes INSTANCEID/VERTEXID as integers.
Tested by running piglit draw-instanced, and by forcing llvmpipe advertise no native
integer support, which now produces:

VERT
DCL IN[0]
DCL SV[0], INSTANCEID
DCL OUT[0], POSITION
DCL OUT[1], COLOR
DCL CONST[0..19]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
DCL TEMP[2], LOCAL
DCL ADDR[0]
  0: U2F TEMP[0].x, SV[0]
  1: ARL ADDR[0].x, TEMP[0].xxxx
  2: MOV TEMP[1].xy, CONST[ADDR[0].x+8].xyxx
  3: ADD TEMP[2].x, IN[0].xxxx, TEMP[1].xxxx
  4: ADD TEMP[1].x, IN[0].yyyy, TEMP[1].yyyy
  5: MUL TEMP[2], CONST[16], TEMP[2].xxxx
  6: MAD TEMP[2], CONST[17], TEMP[1].xxxx, TEMP[2]
  7: MAD TEMP[2], CONST[18], IN[0].zzzz, TEMP[2]
  8: MAD TEMP[2], CONST[19], IN[0].wwww, TEMP[2]
  9: ARL ADDR[0].x, TEMP[0].xxxx
 10: MOV TEMP[1], CONST[ADDR[0].x]
 11: MOV OUT[0], TEMP[2]
 12: MOV OUT[1], TEMP[1]
 13: END
2012-07-13 13:01:52 +01:00
José Fonseca
6dddd18480 draw,gallivm: Fix draw_get_shader_param.
- Use LLVM limits when LLVM is being used, instead of TGSI limits
- Provide draw_get_shader_param_no_llvm for when llvm is never used (softpipe)
- Eliminate several of the hacks around draw shader caps in several drivers

Unfortunately the hack for PIPE_MAX_VERTEX_SAMPLERS is still necessary.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-13 13:01:51 +01:00
Jon TURNEY
99728076ec Don't explicitly link libOsmesa with libmesa's dependency libglsl
The libmesa convenience library is linked with the libglsl convenience
library.  libOsmesa is linked with libmesa, and also directly with libglsl.
When using libtool, this gives rise to duplicate symbol errors.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:44 +01:00
Jon TURNEY
b2a37e242e automake: convert libglapi
* "configure substitutions are not allowed in _SOURCES variables" in automake,
so remove the AC_SUBST'ed GLAPI_ASM_SOURCES and instead use some AM_CONDITIONALS
to choose which asm sources are used

* Change GLAPI_LIB to point to the .la file in other Makefile.am files, and make a link
to the .a file for the convenience of other Makefiles which have not yet been converted
to automake

v2:
- Use AM_CPPFLAGS for cleaner build output
- EXTRA_SOURCES is not needed
- Remove libglapi.a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:07 +01:00
Jon TURNEY
1e48dfeee6 Rename X86-64_API -> X86_64_API
automake doesn't allow hyphens in variable names

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:05 +01:00
Jon TURNEY
defadf2b15 Link dri drivers with mesa or dricore libtool library
Now mesa/drivers/dri is converted to automake, we want to update DRI_LIB_DEPS
so that we link with the libmesa or libdricore libtool library, as appropriate.

However, this is complicated by the fact that gallium/targets is not (yet)
converted, so we can't share the DRI_LIB_DEPS autoconf variable with that anymore.

Add an additional autoconf variable GALLIUM_DRI_LIB_DEPS, which is now used in
gallium/targets/Makefile.dri, to link with the libdircore or libmesa native library.

v2: libdricore$VERSION.a needs to be libdricore$(VERSION).a

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:03 +01:00
Jon TURNEY
cf362d00b9 Remove unused MESA_MODULES autoconf variable
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:01 +01:00
Jon TURNEY
a112ca5d5f automake: convert libmesa and libmesagallium
* "configure substitutions are not allowed in _SOURCES variables" in automake, so instead of
MESA_ASM_FILES, use some AM_CONDITIONALS to choose which architecture's asm sources are used
in libmesa_la_SOURCES. (Can't remove MESA_ASM_FILES autoconf variable as it's still used in
sources.mak)

* Update to link with the .la file in other Makefile.am files, and make a link to the
.a file for the convenience of other Makefiles which have not yet been converted to automake

v2: Remove stray -static from LDFLAGS
v3: Remove .a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:58 +01:00
Jon TURNEY
8676890018 Rename sparc/clip.S -> sparc/sparc_clip.S
Automake can't handle having both clip.S and clip.c, even though they have different paths

"src/mesa/Makefile.am: object `clip.lo' created by `$(SRCDIR)/sparc/clip.S' and `$(SRCDIR)/main/clip.c'"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:56 +01:00
Jon TURNEY
68e04cc601 automake: convert libglsl
v2: Use AM_V_GEN to silence generated code rules. Add BUILT_SOURCES to CLEANFILES
v3:
- Fix an accidental // in a path
- Use automake make rules for lex/yacc rather than writing our own
- Update .gitignore appropriately
- Build a libglcpp convenience library rather than awkwardly including
the files in libglsl and delegating the generation
- Remove libglsl.a compatibility link on clean
v4:
- Automake's rules for lex/yacc make .cc if source is .ll or .yy, and apparently we
must use those extensions "because of scons", so update everywhere glsl_parser.cpp
-> glsl_parser.cc and glsl_lexer.cpp -> glsl_lexer.cc. This fixes 'make tarballs'
and building with dricore enabled.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:41 +01:00
Laurent Carlier
284325d97b automake: convert libOSmesa
This also currently fix the installation of libOSmesa.

v2: Remove old Makefile, libOSmesa is now versioned, fix typos
v3: Keep config substitution alphabetized
v4: Update .gitignore
v5: Libraries will be in the builddir, not the srcdir.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:39 +01:00
Marek Olšák
1a06e8454e mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibility
This was not implemented, because the spec was changed just recently.

Everything has been in place already.

Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-13 01:36:07 +02:00
Kenneth Graunke
fe911c1d43 i965: Move loop over texture units into brw_populate_sampler_prog_key.
The whole reason I avoided this was because it might operate on a
brw_vertex_program or a brw_fragment_program.  However, that isn't a
problem: all we need is the gl_program base type.

This avoids awkwardly passing the loop counter 'i' as a parameter,
simplifies both callers, and also plumbs prog in place for future use.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 14:17:44 -07:00
Kenneth Graunke
86e401b771 i965: Always emit alpha when nr_color_buffers == 0.
If alpha-testing is enabled, we need to send alpha down the pipeline
even if nr_color_buffers == 0.  However, tracking whether alpha-testing
is enabled in the WM program key is expensive: it causes us to compile
multiple specializations of the same shader, using program cache space.

This patch removes the check for alpha-testing, and simply emits alpha
whenever nr_color_buffers == 0.  We believe this will also be necessary
for alpha-to-coverage, and it should add minimal overhead to an uncommon
case.  Saving the recompiles should more than make up the difference.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
Kenneth Graunke
16060531ba i965: Use the blitter in intel_bufferobj_subdata for busy BOs on Gen6+.
Previously we only did this pre-Gen6, and used pwrite on Gen6+.
In one workload, this cuts significant amount of overhead.

v2: Simplify the function based on Eric's suggestions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
José Fonseca
978807ef01 gallivm: Use %.9g to print floats.
So that we can see them in their full denormalized glory.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:35 +01:00
José Fonseca
5b8d80a783 scons: Remove -ffast-math.
We rely on proper IEEE 754 behavior in too many places for this.

See also commit 2fdbbeca43 with equivalent
change for autoconf.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:29 +01:00
José Fonseca
bd3aab8d79 scons: Also require recent XCB.
And don't trip when it's not found -- simply skip building src/glx.
2012-07-12 21:13:10 +01:00
Eric Anholt
6882381a2e mesa: Require current libxcb.
Without that, people with buggy apps that looked at just the server
string for GLX_ARB_create_context would call this function that just
threw an error when you tried to make a context.  Google shows plenty
of complaints about this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 12:29:12 -07:00
Tom Stellard
f92873be2c radeon/llvm: Don't use lp_build_swizzle_aos() for swizzles
This function assumes that lp_build_context::type is a vector type,
which is not true for r600 or radeonsi.

This fixes an assertion failure using glamor 2D accel.
2012-07-12 13:53:22 -04:00
Tom Stellard
185fc9a5ef radeonsi: Dump TGSI code prior to doing TGSI->LLVM conversion.
This way if the conversion fails, we know what the TGSI shader looks
like.
2012-07-12 13:53:22 -04:00
Kenneth Graunke
b546aebae9 i965: Delete previous workaround for textureGrad with shadow samplers.
It had many problems:
- The shadow comparison was done post-filtering.
- It required state-dependent recompiles whenever the comparison
  function changed.
- It didn't even work: many cases hit assertion failures.
- I never implemented it for the VS.

The new lowering pass which converts textureGrad to textureLod by
computing the LOD value works much better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:26 -07:00
Kenneth Graunke
b0c8d3be73 i965: Add a lowering pass to convert TXD to TXL by computing the LOD.
Intel hardware doesn't natively support textureGrad with shadow
comparisons.  So we need to generate code to handle it somehow.

Based on the equations of page 205 of the OpenGL 3.0 specification,
it's possible to compute the LOD value that would be selected given the
gradient values.  Then, we can simply convert the TXD to a TXL.

Currently, this passes 34/46 of oglconform's shadow-grad subtests;
four cubemap tests are regressed.  We should investigate this in the
future.

v2: Apply abs() to the scalar case (thanks to Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:23 -07:00
Kenneth Graunke
d9da350a83 glsl/ir_builder: Add a new swizzle_for_size() function.
This swizzles away unwanted components, while preserving the order of
the ones that remain.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:20 -07:00
Kenneth Graunke
0bb3d4ba54 glsl/ir_builder: Add a generic constructor for unary expressions.
I needed to compute logs and square roots in a patch I was working on,
and wanted to use the convenient interface.  We already have a similar
constructor for binops; adding one for unops seems reasonable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:18 -07:00
Kenneth Graunke
b656df990f glsl: Initialize coordinate to NULL in ir_texture constructor.
I ran into this while trying to create a TXS query, which doesn't have a
coordinate.  Since it didn't get initialized to NULL, a bunch of
visitors tried to access it and crashed.

Most of the time, this won't be a problem, but it's just a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:19:38 -07:00
José Fonseca
d9a8cd76e5 st/xorg: Fix build failure due to symbol clash. 2012-07-12 16:02:49 +01:00
Marek Olšák
0f3659bb56 docs: update relnotes-8.1 and GL3 status 2012-07-12 13:05:59 +02:00
Marek Olšák
63d8c8baa9 st/mesa: expose new transform feedback extensions 2012-07-12 13:05:59 +02:00
Marek Olšák
d24ece97e5 mesa: add ARB_transform_feedback_instanced extension enable flag
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
db7404defd mesa: implement new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
7e0cb473b0 mesa: implement display list support for new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
ce16ca4635 mesa: implement display list support for indexed query functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
553e13dbc2 mesa: implement indexed query functions from ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
375e73d859 mesa: implement glGet queries and error handling for ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
21cb5ed20d glsl: implement ARB_transform_feedback3 in the linker
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
9576d555e0 glapi: add ARB_transform_feedback_instanced
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
6d13d91f4e glapi: add ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
e773a48a3b r600g: fix uploading non-zero mipmap levels of depth textures
This fixes piglit/depth-level-clamp.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
fe1fd67556 r600g: don't flush depth textures set as colorbuffers
The only case a depth buffer can be set as a color buffer is when flushing.

That wasn't always the case, but now this code isn't required anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
6842d5fced r600g: don't set dirty_db_mask for a flushed depth texture
A flush depth texture is never set as a depth buffer and never flushed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
5a17d8318e r600g: flush depth textures bound to vertex shaders
This was missing/broken. There are also minor code cleanups.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
dee58f94af r600g: do fine-grained depth texture flushing
- maintain a mask of which mipmap levels are dirty (instead of one big flag)
- only flush what was requested at a given point and not the whole resource
  (most often only one level and one layer has to be flushed)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
df79eb5956 r600g: remove is_flush from DSA state
we can just update the state when decompressing, there's no need to add
additional info into the DSA state

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
43e3f19c76 r600g: set DISABLE in CB_COLOR_CONTROL if colormask is 0
this will be useful for in-place DB decompression, otherwise should be harmless

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
4fe74412cf r600g: move CB_SHADER_MASK setup into cb_misc_state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a1a1ff5ec0 r600g: move MULTIWRITE setup into cb_misc_state for r6xx-r7xx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
0ea76916e6 r600g: move CB_TARGET_MASK setup into new cb_misc_state
to remove some overhead from draw_vbo. This is a derived state.

BTW, I've got no idea how compute interacts with 3D here, but it should
use cb_misc_state, so that 3D and compute don't conflict.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5ba15d8d38 st/mesa: implement accelerated stencil blitting using shader stencil export
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a7f3697eb8 st/mesa: set colormask to zero when blitting depth
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5a74e17ab0 gallium/u_blit: remove useless memset calls
the structure is calloc'd.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
24e0a26335 gallium/u_blit: drop not-very-useful wrapper around util_blit_pixels_writemask
just rename it to util_blit_pixels

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
3f13b5da15 gallium/u_blit: don't do two copies for non-2D textures
Because u_blit couldn't sample a 1D, 3D, CUBE and ARRAY texture, we created
a 2D texture holding a copy of one slice of the source texture (even for 1D).

Let's just do it right.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
2dca61bcb3 gallium/util: move pipe_tex_to_tgsi_tex helper function into u_inlines
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
bdaf0a085b gallium/u_blitter: accelerate stencil-only copying
This doesn't seem to be used by anything yet, but better safe than sorry.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
12fd81f9e7 gallium/u_blitter: accelerate depth-stencil copying using shader stencil export
This fixes stencil buffer write transfers on r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
76db2c121c gallium: add util_format_stencil_only helper function
used for stencil sampler views.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a730838a42 gallium/u_blitter: minify depth0 when initializing last_layer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
91cf9fe988 gallium/u_gen_mipmap: accelerate depth texture mipmap generation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
13b0af721a mesa: remove assertions that do not allow compressed 2D_ARRAY textures
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Paul Berry
33202b4876 i965/msaa: Enable CMS layout on Gen7 for the formats that support it.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:50 -07:00
Paul Berry
4ebbc76621 i965/msaa: Add CMS support to blorp.
This patch updates the blorp engine to properly handle the case where
the surface being textured from uses Gen7's CMS MSAA layout.  The
following changes were necessary:

- Before reading color values from the surface, we need to read from
  the MCS buffer using the ld_mcs sampler message.  This is done by
  the mcs_fetch() function, and the result is stored in the mcs_data
  register.  This only needs to be done once per pixel, since the MCS
  value is shared between all samples belonging to a pixel.

- When reading color values from the surface, we need to use the
  ld2dms sampler message instead of the ld2dss message, and we need to
  provide the value read from the MCS buffer as an argument.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
754953693d i965/msaa: Add CMS-related sampler messages to brw_defines.h.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
7b3263af69 i965/msaa: Set SURFACE_STATE properly when CMS MSAA is in use.
When a buffer using Gen7's CMS MSAA layout is bound to a texture or a
render target, the SURFACE_STATE structure needs to point to the MCS
buffer and to indicate its pitch.  This patch updates the functions
that emit SURFACE_STATE to handle CMS layout properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
0ba813506d i965/msaa: Add CMS MSAA settings to brw_structs.h.
Previously the DWORD used to control the CMS MSAA layout was just a
pad value, because we didn't use it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
ccae1b1cd7 i965/msaa: Allocate MCS buffer when CMS MSAA is in use.
To implement Gen7's CMS MSAA layout, we need an extra buffer, the MCS
(Multisample Control Surface) buffer.  This patch introduces code for
allocating and deallocating the buffer, and storing a pointer to it in
the intel_mipmap_tree struct.

No functional change, since the CMS layout is not enabled yet.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
1bd4d456cd i965/msaa: Add an enum to describe MSAA layout.
From the Ivy Bridge PRM, Vol 1 Part 1, p112:

    There are three types of multisampled surface layouts designated
    as follows:
      - IMS Interleaved Multisampled Surface
      - CMS Compressed Mulitsampled Surface
      - UMS Uncompressed Multisampled Surface

Previously, the i965 driver only used IMS and UMS formats, and
distinguished beetween them using the boolean
intel_mipmap_tree::msaa_is_interleaved.  To facilitate adding support
for the CMS format, this patch replaces that boolean (and other
booleans derived from it) with an enum
INTEL_MSAA_LAYOUT_{IMS,CMS,UMS}.  It also updates the terminology used
in comments throughout the driver to match the IMS/CMS/UMS terminology
used in the PRM.  CMS layout is not yet used.

The enum has a fourth possible value, INTEL_MSAA_LAYOUT_NONE, which is
used for non-multisampled surfaces.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
67b0f7c7dd i965/msaa: Move {rt,tex}_interleaved into blorp program key.
On Gen6, MSAA buffers always use an interleaved layout and non-MSAA
buffers always use a non-interleaved layout, so it is not strictly
necessary to keep track of the layout of the texture and render target
surfaces in the blorp program key.  However, it is cleaner to do so,
since (a) it makes the blorp compiler less dependent on implicit
knowledge about how the GPU pipeline is configured, and (b) it paves
the way for implementing compressed multisampled surfaces in Gen7.

This patch won't cause any redundant compiles, because the layout of
the texture and render target surfaces depends on other parameters
that are already in the blorp program key.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Kristian Høgsberg
2adfce4a18 mapi: Move GL_NV_draw_buffers extension to es_EXT.xml
We don't generate public entrypoints for GLES extensions, so move the
GL_NV_draw_buffers definition from ARB_draw_buffers.xml to es_EXT.xml.
When the extension is defined in ARB_draw_buffers.xml, we end up with a
public entry point for it, but no prototype, which gives an error when
compiled with --disable-asm and --disable-shared-glapi.

Instead, just move the GLES extension to es_EXT.xml so this doesn't happen.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
e6a33570b7 egl: Add EGL_WAYLAND_PLANE_WL attribute
This lets us specify the plane to create the image for for multiplanar
wl_buffers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
1aaec8c609 wayland-drm: Add protocol to create planar buffers 2012-07-11 15:28:35 -04:00
Kristian Høgsberg
379eb47ea6 wayland-drm: Pass struct wl_drm_buffer to the driver
We're going to extend this to support multi-plane buffers, so pass this
to the driver so it can access the details.
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
95bc0527e9 intel: Implement __DRIimage::createSubImage and bump supported version to 5
We use the new miptree offset to pick out the sub-image when we bind
the EGLImage to a texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
02ebad900d intel: Add offset field to miptree
This lets us specify an offset into the bo where the miptree starts,
which will let us set up a texture for a single plane in a planar buffer.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
44a2b57f93 intel: Add support for new __DRIimage formats 2012-07-11 15:28:34 -04:00
Kristian Høgsberg
c029834808 __DRIimage: version 5, add new formats and createSubImage
The additions in version 5 enables creating EGLImages for different planes
of a YUV buffer.  createImageFromName is still used to create the containing
__DRIimage, and createSubImage can then be used no that __DRIimage to create
__DRIimages that correspond to the y, u, and v planes (__DRI_IMAGE_FORMAT_R8)
or the uv planes (__DRI_IMAGE_FORMAT_RG88) for formats such as NV12 where
the u and v components are interleaved.  Packed formats such as YUYV etc
doesn't require any special treatment, we just sample those as a regular
ARGB texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:34 -04:00
Tom Stellard
c0f7fe7b79 r600g/compute: Disable growing the memory pool
The code for growing the memory pool (which is used for storing all of
the global buffers) wasn't working.  There seem to be two separate issues
with the memory pool code.  The first was the way it was growing the pool.
When the memory pool needed more space, it would:

1. Copy the data from the memory pool's backing texture to system memory.
2. Delete the memory pool's texture
3. Create a bigger backing texture for the memory pool.
4. Copy the data from system memory into the bigger texture.

The copy operations didn't seem to be working, and I suspect that since
they were using fragment shaders to do the copy, that there might have
been a problem with the mixing of compute and 3D state.

The other issue is that the size of 1D textures is limited, and I was
having trouble getting 2D textures to work.

I think these problems will be easier to solve once more code is shared
between 3D and compute, which is why I decided to disable it for now
rather than continue searching for a fix.
2012-07-11 17:53:54 +00:00
Tom Stellard
49ae102ee3 radeon/llvm: Use multiclasses for floating point loads
The original strategy for handling floating point loads, which was to
lower (f32 load) to (f32 bitcast (i32 load)) wasn't really working.  The
main problem was that the DAG legalizer couldn't handle replacing a node
with two results (load) with a node with only one result (bitcast).
2012-07-11 17:47:20 +00:00
Tom Stellard
bbdf3af857 radeon/llvm: Don't set the IMM bit in SMRD instruction definitions.
The IMM bit is already being set in SICodeEmitter.
2012-07-11 17:47:20 +00:00
Tom Stellard
d36499aa62 r600g/compute: Add more debugging output 2012-07-11 17:46:59 +00:00
Eric Anholt
f9b3e257d1 i965: Revert the VBOs-in-system-memory hack.
It didn't change performance on Lightsmark or Nexuiz, which both used
DYNAMIC_DRAW buffers, but it was killing performance (40% CPU wasted pwriting
buffers) on a closed-source app we're looking at.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 09:20:21 -07:00
Eric Anholt
b5c037f6b1 Add emacs setup for the docs/devinfo.html comment wrapping recommendation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-11 09:20:21 -07:00
Ian Romanick
a8724d85f8 glx/dri2: Add support for GLX_ARB_create_context_robustness
Add the infrastructure required for this extension.  There is no
xserver support and no driver support yet.  Drivers can enable this be
advertising DRI2 version 4 and accepting the
__DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
__DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context.

Some additional Mesa infrastructure is needed before drivers can do
this.  The GL_ARB_robustness spec, which all Mesa drivers already
advertise, requires:

    "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset
    will result in the loss of all context state, requiring the
    recreation of all associated objects."

It is necessary to land this infrastructure now so that the related
infrastructure can land in the xserver.  The xserver has very long
release schedules, and the remaining Mesa parts should land long, long
before the next xserver merge window opens.

v2: Expose robustness as a DRI2 extension rather than bumping
__DRI_DRI2_VERSION.

v3: Add a comment explaining why dri2->base.version >= 3 is also
required for GLX_ARB_create_context_robustness.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 08:54:50 -07:00
Ian Romanick
de9ed51525 dri2: Hard-code the DRI2 version
This allows revising the dri_interface.h separately from adding driver
support.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Ian Romanick
2879f758b5 glapi: Apply Xorg indent rules to all files generated for the xserver
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Kenneth Graunke
a0698b000b docs: Update GL3.txt.
We neglected to list the deprecation model/forward compatible context
support.

inverse() has been done for a while.

None of us know what "highp change" means; GLSL 1.30 already added the
ability to recognize precision keywords, and it doesn't look like 1.40
has any new requirements there (precision keywords still have no meaning).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-10 16:53:49 -07:00
Chad Versace
551078bb62 mesa: Remove unneeded extern qualifiers
Remove 'extern' from the functions declared in texcompress_etc.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-10 16:51:19 -07:00
Vadim Girlin
3770847960 r600g: improve flushed depth texture handling v2
Use r600_resource_texture::flished_depth_texture for GPU access, and
allocate it in the VRAM. For transfers we'll allocate texture in the GTT
and store it in the r600_transfer::staging.

Improves performance when flushed depth texture is frequently used by the
GPU, e.g. in Lightsmark (~30%)

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-07-11 02:39:59 +04:00
Kenneth Graunke
860d5bdf98 i965: Add hardware context support.
With fixes and updates from Ben Widawsky and comments from Paul Berry.

v2: Use drm_intel_gem_context_destroy to destroy hardware context;
    remove useless initialization of hw_ctx, both suggested by Eric.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Acked-by: Paul Berry <stereotype441@gmail.com>
2012-07-10 15:09:58 -07:00
Ian Romanick
4fae5e32d5 mesa/test: Update name of GL_TIME_ELAPSED
4952caa caused the _EXT to fall off the name of this enum.  This is
fine.  Update the unit test to expect the new value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51956
2012-07-10 14:46:25 -07:00
Andreas Boll
40742fa686 docs/relnotes-8.0.4: fix html markup 2012-07-10 12:59:34 -07:00
Marek Olšák
67a8ee891b gallium/docs: document interface changes for timestamp query
the query type is already documented
2012-07-10 19:04:13 +02:00
Marek Olšák
a3fccafda9 identity: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
e66d90ec6b noop: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
642539e3f9 trace: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
a471d268ec galahad: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
768589e836 docs: update relnotes-8.1 and GL3 status 2012-07-10 19:04:12 +02:00
Marek Olšák
5ddcda060c softpipe: implement get_timestamp and expose ARB_timer_query
PIPE_QUERY_TIMESTAMP is already implemented and working.
2012-07-10 19:04:12 +02:00
Marek Olšák
21f78d2189 st/mesa: implement ARB_timer_query 2012-07-10 19:04:12 +02:00
Marek Olšák
bcc735aaca gallium: add QUERY_TIMESTAMP cap and get_timestamp screen function 2012-07-10 19:04:12 +02:00
Marek Olšák
d5a7866902 mesa: implement glGet(GL_TIMESTAMP) v2
This is adds a new driver function to retrieve the timestamp.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-10 19:04:12 +02:00
Marek Olšák
5094533040 mesa: add ARB_timer_query to the extension list
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
204777c5dc mesa: add QueryCounter display list support
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
f601dcdf70 mesa: implement TIMESTAMP query and glQueryCounter
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
4952caad2d glapi: add ARB_timer_query
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Ian Romanick
25fec2e9ca docs: Add 8.0.4 release notes
Also add news story.  Extra, extra!  Read all about it!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 09:05:39 -07:00
Eric Anholt
2d03f48a65 glsl: Add parsing for GLSL uniform blocks.
This doesn't do anything with the uniform block declarations yet, so
usage of those uniforms finds them to be undeclared.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:13:33 -07:00
Eric Anholt
912a429bc5 glsl: Don't hide the type of struct_declaration_list.
I've been trying to derive from this for UBO support, and the slightly
obfuscated types were putting me over the edge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:12:18 -07:00
Kenneth Graunke
532e99cbf2 glcpp: Add built-in #define for GL_ARB_uniform_buffer_object.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-09 11:11:59 -07:00
Vincent Lejeune
7fabb2b593 glsl: Parser handles "#extension GL_ARB_uniform_buffer_object"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:11:38 -07:00
Eric Anholt
f4fb6bf088 glsl: Reduce a bit of extra code in the merging of layout qualifiers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:05:33 -07:00
Eric Anholt
60a784d56e glsl: Take advantage of the layout qualifier flags union to clean up parsing.
The got_one variable was set iff one of the bits in flags.i was set.

v2: Fix incorrect dropping of the ARB_conservative_depth warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:04:45 -07:00
Tom Stellard
9b00edc79a r600g: Don't create a texture for the memory_pool during screen init
This fixes a segfault in r600_screen_create() introduced by
eb065f5d9d

Reported by tilman on irc.
2012-07-09 12:14:07 -04:00
Tom Stellard
76b44034b9 radeon/llvm: Rename namespace from AMDIL to AMDGPU 2012-07-09 13:43:11 +00:00
Tom Stellard
39323e8f79 r600g: Update number of gprs when adding a vertex instruction 2012-07-09 13:42:24 +00:00
Tom Stellard
da9c8a73ec r600g/compute: Use evergreen_cb() for binding RATs 2012-07-09 13:41:18 +00:00
Tom Stellard
960906d16b r600g: Add support for RATs in evergreen_cb() 2012-07-09 13:41:18 +00:00
Tom Stellard
eb065f5d9d r600g: Use a texture as the underlying resource for compute_memory_pool
This the first step towards being able to use evergreen_cb to bind RATs.
2012-07-09 13:41:18 +00:00
Tom Stellard
9d36441374 r600g: Add is_rat flag to r600_resource_texture 2012-07-09 13:41:18 +00:00
Tom Stellard
3d3194e93c r600g: Add r600_context_pipe_state_emit()
This function is used when dispatching compute shader in order to avoid
mixing compute and 3D registers in the context's dirty list.  This
allows the compute code to resuse 3D functions like evergreen_cb, which
return a struct r600_pipe_state and still have control over when and how
the register writes are emitted.
2012-07-09 13:41:17 +00:00
Tom Stellard
e00e1586dd r600g: Add pkt_flag parameter to r600_context_block_emit_dirty()
This allows the shader type bit to be set in the pm4 header when
emitting registers for compute shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
25145de03e r600g/compute: Move LOOP_CONST initialization to start_compute_cs atom 2012-07-09 13:41:17 +00:00
Tom Stellard
5016fe2d47 r600g: Add start_compute_cs atom to struct r600_context
The start_compute_cs atom initializes some config and context registers
to the values needed for running compute shaders.  When a compute shader
is dispatched, this atom is emitted after the start_cs_cmd atom, which
initializes registers that are common to both 3D and compute.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
38be0966c7 r600g: Add pkt_flag member to struct r600_command_buffer
Some packets require the shader type bit (bit 1) to be set when
used for compute shaders.  The pkt_flag will be initialized to
RADEON_CP_PACKET3_COMPUTE_MODE for any struct r600_command_buffer used
for dispatching compute shaders and it will be or'd against the result of
the PKT3 macro when adding a new packet to a struct r600_command buffer.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
7d0c17fe74 r600g: Only emit start_cs_cmd atom once for compute command streams 2012-07-09 13:41:17 +00:00
Marek Olšák
0a21b561c7 r600g: fix stencil texturing with Z32_FLOAT_S8X24_UINT 2012-07-09 13:58:00 +02:00
Marek Olšák
a460df9299 r600g: add assertions after translate_colorswap/colorformat/dbformat/texformat 2012-07-09 13:57:59 +02:00
Marek Olšák
c1e8c845ea r600g: inline r600_hw_copy_region 2012-07-09 13:57:59 +02:00
Marek Olšák
9974e9ac5d r600g: enable dual src blending on r7xx
No lockups here.
2012-07-09 13:57:59 +02:00
Marek Olšák
6657a7af61 r600g: use depth format from pipe_surface, not pipe_resource 2012-07-09 13:57:59 +02:00
Marek Olšák
b278aba423 r600g: use u_box_origin_2d helper function 2012-07-09 13:57:59 +02:00
Marek Olšák
1f50f463eb gallium/u_blitter: consolidate some state changes 2012-07-09 13:57:59 +02:00
Marek Olšák
22d032707e r600g: remove stray semicolon 2012-07-07 15:09:57 +02:00
Marek Olšák
461e9f99c7 docs: document ARB_blend_func_extended and EXT_texture_rg in relnotes-8.1
also sort the extensions
2012-07-07 15:09:57 +02:00
Eric Anholt
1e28f55ab7 i965/fs: Invalidate live intervals after copy propagation.
For copy propgation, we've dropped the use of a GRF in favor of a
(probably later) use of a different GRF.  This definitely requires
invalidating intervals.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
2343fe9a5d i965/fs: Invalidate live intervals in passes that remove an instruction.
Since live intervals are based on ip, removing an instruction trashes
the intervals unless we were to go do some surgery.  These happen to
usually remove a use of a grf, so it's time to recalculate, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 release branch.
2012-07-06 14:20:33 -07:00
Eric Anholt
25ca9cc823 i965/vs: Move the other two src_reg/dst_reg constructors to brw_vec4.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
b2f5d4c3ec i965/vs: Move class functions to brw_vec4.cpp.
This has less impact than for the FS (4k savings), because it was partially
done already, but makes things more consistent.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
Eric Anholt
fe27916ddf i965/fs: Move class functions from the header to .cpp files.
Cuts compile time for brw_fs.h changes from 2.7s to .7s and reduces
i965_dri.so size by 70k.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
José Fonseca
8b1f1900d1 galahad: Check that texture format is supported. 2012-07-06 20:38:41 +01:00
José Fonseca
ff8ddf399a galahad: More detailed resource checks. 2012-07-06 20:22:29 +01:00
José Fonseca
f8e13e6d69 galahad: Fix zealous warnings. 2012-07-06 20:12:56 +01:00
José Fonseca
7bd926af89 galahad: Enumerate all methods that are missing. 2012-07-06 19:13:44 +01:00
José Fonseca
3d2550be9c galahad: Implement render_condition. 2012-07-06 18:45:14 +01:00
José Fonseca
5b45775e41 galahad: Don't implement context methods that are not implemented by the underlying pipe driver. 2012-07-06 18:38:51 +01:00
José Fonseca
3cb994afca galahad: Use debug_printf.
stderr is not visible on windows.
2012-07-06 18:38:39 +01:00
José Fonseca
1abb070633 galahad: Silence creation messages.
Let galahad warnings be true warnings.
2012-07-06 18:37:48 +01:00
José Fonseca
d78dee1671 galahad: Use reference counting when destroying the wraped objects.
As the wrapped pipe driver may hold internal references.
2012-07-06 18:35:44 +01:00
José Fonseca
fe602da63f galahad: Point to the galahad objects from the galahad sampler view.
And not the wraped driver's objects.
2012-07-06 18:35:32 +01:00
José Fonseca
04d29afb8b galahad: Don't defer index buffer when it's NULL. 2012-07-06 17:02:39 +01:00
José Fonseca
232073b0d9 target-helpers: Enable debug helpers only on debug builds.
Some of these helpers use debug_get_option, which works also on releases.
2012-07-06 15:05:16 +01:00
Marek Olšák
c445b0f76d st/mesa: only expose ARB_shader_bit_encoding with GLSL 1.3
I don't think it's possible or even useful to use the extension with GLSL 1.2.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-06 00:45:38 +02:00
Kristian Høgsberg
5f5746a692 egl_dri2: Reorganize the EGLImage constructors to share more code
We factor out all the EGL book-keeping into dri2_create_image() and
simplify the wayland case by using dupImage.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
1bb15c0a08 intel: Share common __DRIimage allocation code
We have the same switch and allocation code in two places.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
454fc07dde intel: Just look up image->internal_format using _mesa_get_format_base_format
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
e408c17767 intel: Remove unused __DRIimage::data_type field
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:06 -04:00
Brian Paul
bbe92dc608 svga: whitespace fixes 2012-07-05 08:07:26 -06:00
Brian Paul
76a6801240 Revert "mesa: #define fprintf to be __mingw_fprintf() on Mingw32"
This reverts commit cbffaf20e9.

Use the PRIx64 macro in the fprintf() call instead, as suggested
by Dylan Noblesmith.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:26 -06:00
Brian Paul
df2d81ea59 mesa: use the PRIx64 macro for printing 64-bit hexadecimal values
We'll revert the #define fprintf __mingw_fprintf change next.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:25 -06:00
Brian Paul
1ab37a2284 svga: implement TGSI_OPCODE_ROUND
ROUND and TRUNC are implemented with one function to reduce code duplication.
Note: ROUND isn't actually used yet, but probably will be soon.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:03 -06:00
Brian Paul
d594f72e16 svga: fix CMP translation for vertex shaders
Converting CMP to SLT+LRP didn't work when src2 or src3 was Inf/NaN.
That's the case for GLSL sqrt(0).  sqrt(0) actually happens in many
piglit auto-generated tests that use the distance() function.

v2: remove debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
30f8575fde svga: properly implement TRUNC instruction
Was previously implemented with FLOOR.
Fixes quite a few piglit tests of float->int conversion, integer
division, etc.

v2: clean up left over debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
0bd3a75de9 svga: fix register collision issue in emit_conditional()
If the 'dst' register is the same as the 'pass' register we'll generate
invalid code.  Use a temporary register in that case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
9b3d87b092 svga: emit some debug messages when shader compilation fails 2012-07-05 07:59:20 -06:00
Eric Anholt
33526a2ffe intel: Fix a comment typo. 2012-07-04 13:59:14 -07:00
Gwenole Beauchesne
69f031cc19 mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-04 15:26:22 -04:00
Kristian Høgsberg
3ed8d42853 GLES2: upgrade gl2ext.h to version 18099
Redo this commit, and remove the inclusion of gl2ext.h
from src/mapi/glapi/glapi_priv.h.  The include was added in
8f3be33985 to fix a missing prototype for
glDrawBuffersNV and others, but it's not possible to include both
glext.h and gl2ext.h from the same file.

I don't see the missing prototype here (with or without shared glapi)
so I'm just removing the offending #include.

Also, since we're redoing this, update to the most recent gl2ext.2.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-04 15:26:22 -04:00
Olivier Galibert
e620f3e763 mesa/st: gl_ClipDistance must be interpolated in 3d space.
That old bug was hidden but the clipper always interpolating in 3d space
no matter what it should have been doing.  Now that the interpolation
has been fixed, the bug shows up.

Fixes fdo 51364.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-07-04 10:47:14 +01:00
Stuart Abercrombie
95ce454c8c gallium/util: Save and restore vertex buffer state in util_gen_mipmap.
Calling glGenerateMipmap could overwrite vertex buffer state, leading
 to incorrect rendering or crashes depending on the Gallium driver.

This was happening on WebGL Conformance test texture-size.

Before 784dd51198 this was covered up
by redundant vertex buffer validation.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-04 03:48:29 +02:00
Marek Olšák
567fcd2eb9 Revert "GLES2: upgrade gl2ext.h to version 16994."
This reverts commit 8818b88748.

I get a lot of errors like this one:

In file included from ../../../src/mapi/glapi/glapi_priv.h:49:0,
                 from glapi_dispatch.c:40:
../../../include/GLES2/gl2ext.h:1074:28: error: redefinition of typedef ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’
../../../include/GL/glext.h:10237:25: note: previous declaration of ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’ was here

This with a clean build (with git clean -fdX).

I don't get the errors on my other machine. I didn't investigate why,
a wild guess is that this depends on the version of gcc.
2012-07-04 01:40:05 +02:00
Marek Olšák
2668aaa557 Revert "mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x."
This reverts commit d1665388ce.
2012-07-04 01:39:52 +02:00
Gwenole Beauchesne
d1665388ce mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-03 16:23:38 -04:00
Gwenole Beauchesne
8818b88748 GLES2: upgrade gl2ext.h to version 16994. 2012-07-03 16:23:38 -04:00
Eric Anholt
dd4282e38f i965/fs: Allow copy propagation on uniforms.
This is a big win for savage2, hon and yofrankie.  62 new programs for
savage2/hon get 16-wide mode, along with one for humus demos and two
for tropics.  Even a few shaders from tropics see reductions of 15% or
more.

total instructions in shared programs: 216536 -> 207353 (-4.24%)
instructions in affected programs:     123941 -> 114758 (-7.41%)

In benchmarking Tropics, only a .040% +/- 034% performance improvement
was observed (n=90).  Rather disappointing, but I was primarily
motivated to do this patch by a regression in the number of 16-wide
shaders compiled after a GRF texturing on IVB patch I'm working on.
Hopefully this helps avoid that regression.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:10 -07:00
Eric Anholt
0c4630bae0 i965/fs: Allow copy propagation with source modifiers.
This shaves a few instructions off of a ton of programs.  For 12
shaders from tropics and sanctuary, it's enough reduction in register
pressure to get 16-wide mode.  7 shaders from heroes of newerth and
savage2 are hurt by about 1.1%, where copy propagation of negates ends
up preventing coalescing, but we could regain that by doing dataflow
analysis in our copy propagation.

No significant performance difference in tropics (n=11)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:04 -07:00
Eric Anholt
458f7f0141 i965/fs: Move copy propagation test out to a separate function.
It's going to get more complicated in a moment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:55:47 -07:00
Ian Romanick
5fb178ee43 glx/tests: Fix off-by-one error in allocating extension string buffer
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
2012-07-03 12:28:45 -07:00
Brian Paul
1853f467c6 glsl: fix unop/binop errors in comments 2012-07-03 09:42:59 -06:00
Paul Berry
f34764ea53 msaa: Make meta-ops save and restore state of GL_MULTISAMPLE.
The meta-ops _mesa_meta_Clear() and _mesa_meta_glsl_Clear() need to
ignore the state of GL_SAMPLE_ALPHA_TO_COVERAGE,
GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
and GL_SAMPLE_COVERAGE_INVERT when clearing multisampled buffers.  The
easiest way to accomplish this is to disable GL_MULTISAMPLE during the
clear meta-ops.

Note: this patch also causes GL_MULTISAMPLE to be disabled during
_mesa_meta_GenerateMipmap() and _mesa_meta_GetTexImage() (since those
two meta-ops use MESA_META_ALL).  Arguably this isn't strictly
necessary, since those meta-ops use their own non-MSAA fbo's, but it
shouldn't do any harm.

Fixes Piglit tests "EXT_framebuffer_multisample/clear {2,4}
{color,stencil}" on i965.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-02 14:09:27 -07:00
Paul Berry
8313f44409 i965/msaa: Fix centroid interpolation of unlit pixels.
From the Ivy Bridge PRM, Vol 2 Part 1 p280-281 (3DSTATE_WM:
Barycentric Interpolation Mode):

    "Errata: When Centroid Barycentric mode is required, HW may
    produce incorrect interpolation results when a 2X2 pixels have
    unlit pixels."

To work around this problem, after doing centroid interpolation, we
replace the centroid-interpolated values for unlit pixels with
non-centroid-interpolated values (which are interpolated at pixel
centers).  This produces correct rendering at the expense of a slight
increase in shader execution time.

I've conditioned the workaround with a runtime flag
(brw->needs_unlit_centroid_workaround) in the hopes that we won't need
it in future chip generations.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
{centroid-deriv,centroid-deriv-disabled}".  All MSAA interpolation
tests pass now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Paul Berry
3f929efa28 i965/fs: Add FS_OPCODE_MOV_DISPATCH_TO_FLAGS to fragment shader backend.
In order to compute centroid varyings correctly, the fragment shader
needs to be able to load the current pixel/sample mask into a flag
register.  This patch adds an opcode to the fragment shader back-end
to do this; the opcode gets translated into the instruction

mov(1)  f0<1>UW  g1.14<0,1,0>UW  { align1 WE_all }

Since this instruction clobbers f0, instruction scheduling has to
treat it the same as instructions that have a conditional modifier.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Jordan Justen
8aa78c104a i965: fix transform feedback with primitive restart
When querying GL_PRIMITIVES_GENERATED, if primitive restart
is also used, then take the software primitive restart
path so GL_PRIMITIVES_GENERATED is returned correctly.

GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN is also updated
since it will also affected by the same issue.

As noted in brw_primitive_restart.c, with further work we
should be able to move this situation back to a hardware
handled path.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:42:48 -07:00
Kenneth Graunke
14311ef3f2 i965: Re-enable rendering to SNORM formats.
Commit d73f6375f5 fixed the cause of the Piglit failure with
ARB_color_buffer_float fragment clamp modes.  Now that it's fixed,
there's no reason to leave snorm format rendering disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:23:37 -07:00
Kenneth Graunke
b1802a2115 glsl: Remove unused ir_loop_jump::loop pointer.
Commit 0c005bd7 intended to make ir_loop_jump::mode public, but also
accidentally added a new pointer to the enclosing loop.  Furthermore, it
tried to initialize the new field by adding "this->loop = loop;" to the
constructor, but since there is no loop parameter, this only initialized
the field to itself---so it will likely be a garbage pointer.

A lot of code, such as lower_jumps, allocates new loop jumps without
setting this field appropriately, so any uses would probably just crash.

Thankfully, there were none, so we can just delete the field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51574
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 11:08:59 -07:00
Kenneth Graunke
d73f6375f5 meta: Don't alter fragment color clamp in DrawPixels().
DrawPixels uses the MESA_META_CLAMP_FRAGMENT_COLOR flag to save/restore
the fragment color clamp mode.  This is unnecessary since it never
alters it.  It's also harmful: when the clamp mode is GL_FIXED_ONLY,
setting this flag causes _mesa_meta_begin to force it to GL_FALSE,
breaking clamping on SNORM formats.

DrawPixels should use the user-specified clamp mode and not change it.

Fixes Piglit's spec/ARB_color_buffer_float/GL_RGBA8_SNORM-drawpixels
test on i965/Sandybridge (with SNORM render targets re-enabled).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:08:48 -07:00
Marek Olšák
9f0f2f9512 mesa: use FLUSH_CURRENT and not FLUSH_VERTICES in _mesa_validate_*
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL calls FLUSH_VERTICES, which
is not what we want.

This fixes a breakage in classic drivers, introduced in:

  62b9716739
  vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

It should fix:
  https://bugs.freedesktop.org/show_bug.cgi?id=51629
  https://bugs.freedesktop.org/show_bug.cgi?id=51642

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 17:48:36 +02:00
Dylan Noblesmith
876889b355 mesa: point to Makefile.old in the srcdir
Gets out-of-tree builds slightly closer to working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:46 +00:00
Dylan Noblesmith
91ecba9d05 mesa: fix parser source gen for out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:39 +00:00
Dylan Noblesmith
261b1389eb mesa: fix api source gen for out-of-tree builds
Add $(srcdir) where needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:27 +00:00
Dylan Noblesmith
43bca86c1b glapi/gen: fix out of tree build
Add "-f $(srcdir)/gl_API.xml" to the arguments of all
the scripts that by default look for gl_API.xml in the
working directory when run with no arguments, and prepend
$(srcdir) to those scripts that are already using an
explicit -f argument.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:13:58 +00:00
José Fonseca
f5c41e16d7 gallium/tgsi: Don't declare temps individually when they are all similar.
tgsi_ureg was recently enhanced to support local temporaries, and as result
temps are declared individually.

This change avoids many TEMP register declarations on common shaders.

(And fixes performance regression due to mismatches against performance
sensitive shaders.)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 12:14:53 +01:00
José Fonseca
e75fe7ba08 gallivm: Cleanup the 4 x float -> 16 ub special path in lp_build_conv.
No behaviour change intended.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-02 12:13:52 +01:00
José Fonseca
63e0e4b8f5 gallium/util: Add ULL suffix to large constants.
As suggested by Andy Furniss: it looks like some old gcc versions
require it.
2012-07-02 12:12:42 +01:00
Tom Stellard
1d21bd057a clover: Handle NULL devs argument in clBuildProgram
If devs is NULL, then the kernel should be compiled for all devices
associated with the program.
2012-07-01 15:45:24 +02:00
Francisco Jerez
c6bb41c28b clover: Define non-templated copy constructor for clover::ref_ptr.
The templated copy constructor doesn't prevent the compiler from
emitting a default copy constructor, which leads to inconsistent
memory handling and was reported to cause segfaults when doing event
manipulation.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-01 15:37:30 +02:00
Brian Paul
db2b6ca504 llvmpipe: fix comment typo 2012-06-29 17:19:12 -06:00
Brian Paul
9dfe92019a st/mesa: use DEBUG_INCOMPLETE_FBO debug flag 2012-06-29 17:19:12 -06:00
Brian Paul
b186a9df32 mesa: remove some unused gl_dlist_state fields 2012-06-29 17:19:12 -06:00
Tom Stellard
ca8fa02308 clover: Add a function internalizer pass before LTO v2
The function internalizer pass marks non-kernel functions as internal,
which enables optimizations like function inlining and global dead-code
elimination.

v2:
  - Pass vector arguments by const reference
2012-06-29 18:46:18 +00:00
Tom Stellard
a31b2f7107 radeon/llvm: Enable vec4 loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
e17c586d08 radeon/llvm: Enable floating point stores on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
b66ef1f48c radeon/llvm: Handle floating point loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
c01199dfc0 radeon/llvm: Expand UDIV and UREM nodes 2012-06-29 18:46:18 +00:00
Tom Stellard
2c485cda20 radeon/llvm: Emit raw ISA for vertex fetch instructions 2012-06-29 18:46:18 +00:00
José Fonseca
16e0ebccb6 gallium/util: Truly disable INF/NAN tests on MSVC.
Thanks to Brian for spotting this.
2012-06-29 14:49:23 +01:00
José Fonseca
c9bada497c gallium/util: Disable INF/NAN tests on MSVC.
Somehow they are not recognized as constants.
2012-06-29 13:39:07 +01:00
José Fonseca
fa8dcb848f translate: Free elt8_func/elt16_func too.
These were leaking.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-06-29 12:21:08 +01:00
James Benton
6dd8e6f9cb util: Reimplement half <-> float conversions.
Removed u_half.py used to generate the table for previous method.

Previous implementation of float to half conversion was faulty for
denormalised and NaNs and would require extra logic to fix,
thus making the speedup of using tables irrelevant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:21:02 +01:00
James Benton
c8d3481cdb tests: Updated tests to properly handle NaN for half floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:59 +01:00
James Benton
60dca53833 util: Updated u_format_tests to rigidly test half-float boundary values.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:57 +01:00
James Benton
d069d8ef38 util: Added functions for checking NaN / Inf for double and half-floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:54 +01:00
James Benton
34075d4133 util: Added util_format_is_array.
This function checks whether a format description is in a simple array format.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:37 +01:00
Marek Olšák
fcebb157f0 vbo: optimize validation for glMultiDrawElements
Some parameters need to be checked only once.
check_valid_to_render needs to be called only once.

The validate function is based on the one for DrawElements.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
62b9716739 vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
d9eb1a1225 vbo: don't call twice _mesa_valid_to_render in DrawArraysInstancedBaseInstance
It's called in _mesa_validate_DrawArraysInstanced already.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
15ac66e331 mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffers
This is a cleanup for ARB_transform_feedback3, where
GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and
has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs.

Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes
this patch useful even without the extension.
I don't know of any hardware which can do more than 4.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
José Fonseca
638779e445 gallivm: Refactor lp_build_broadcast(_scalar) to share code.
Doesn't really change the generated assembly, but produces more compact IR,
and of course, makes code more consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 20:20:34 +01:00
Johannes Obermayr
bf679ce1dc gallivm: Fix potential buffer overflowing in strncat.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-28 11:47:23 +01:00
Marcin Slusarz
1906d2b46b nv50: dynamically allocate space for shader local storage
Fixes 21 piglit tests:
spec/glsl-1.10/execution/variable-indexing/
fs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-row-wr

spec/glsl-1.20/execution/variable-indexing/
fs-temp-array-mat3-index-col-row-rd
fs-temp-array-mat3-index-row-rd
fs-temp-array-mat4-col-row-wr
fs-temp-array-mat4-index-col-row-rd
fs-temp-array-mat4-index-col-row-wr
fs-temp-array-mat4-index-row-rd
fs-temp-array-mat4-index-row-wr
vs-temp-array-mat3-index-col-row-rd
vs-temp-array-mat3-index-col-row-wr
vs-temp-array-mat3-index-row-rd
vs-temp-array-mat3-index-row-wr
vs-temp-array-mat4-col-row-wr
vs-temp-array-mat4-index-col-row-rd
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-wr
vs-temp-array-mat4-index-row-rd
vs-temp-array-mat4-index-row-wr
vs-temp-array-mat4-index-wr

... and prevents a lot of GPU lockups
2012-06-28 00:01:02 +02:00
Marcin Slusarz
0fceaee4fd nv50: streamline screen_create error handling
Remove macro which changes control flow (it's evil).
Make all fail paths print (correct) error message.
2012-06-28 00:01:02 +02:00
Marcin Slusarz
96259b5128 nv50/ir: make colorful ir dump output optional 2012-06-28 00:01:02 +02:00
Brian Paul
9881bf6e69 mesa: more const qualifiers to match the latest glext.h
For some reason regular gcc on Linux didn't catch these but the mingw
compiler did (generated errors, not warnings).

v2: include the changes in src/mapi/ too
2012-06-27 15:37:10 -06:00
Brian Paul
827bdee7d1 glapi: add const qualifier to glShaderSourceARB() parameter
Fixes the es2 build with gcc.

Note: in glext.h the prototypes for glShaderSource() and glShaderSourceARB()
disagree:  only the former has the extra const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-27 15:37:10 -06:00
Jordan Justen
3588098ed8 i965: enable ARB_instanced_arrays extension
Set the step_rate value when drawing to implement
ARB_instanced_arrays for gen >= 4.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 10:35:14 -07:00
Brian Paul
8fb1e4a462 glsl: be more careful about counting varying vars in the linker
Previously, we were counting gl_FrontFacing, gl_FragCoord and gl_PointCoord
against the limit of varying variables.  This prevented some valid shaders
from linking.

The other potential solution to this is to have the driver advertise
more varying vars or set the GLSLSkipStrictMaxVaryingLimitCheck flag.
But the above-mentioned variables aren't conventional varying attributes
so it doesn't seem right to count them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 11:31:16 -06:00
Andreas Boll
d9d84068e7 docs/helpwanted: add some useful todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:19:21 -06:00
Brian Paul
098aa5f9ab softpipe: fix numFragsEmitted debug code 2012-06-27 07:50:57 -06:00
Brian Paul
81e2a238bc gallium: minor whitespace, comment changes 2012-06-27 07:50:57 -06:00
Brian Paul
51b0a0b33c mesa: update glext.h to version 81 2012-06-27 07:50:57 -06:00
Brian Paul
52dd8961eb mesa: update glxext.h to version 33 2012-06-27 07:50:57 -06:00
Brian Paul
8459f4a63a mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
2012-06-27 07:50:57 -06:00
Brian Paul
dcf1dafa9e mesa: look up enum name for glEnable/Disable errors 2012-06-27 07:50:56 -06:00
Brian Paul
86ccd9aaac mesa: move TEXGEN defines closer to gl_texgen struct 2012-06-27 07:50:56 -06:00
Brian Paul
4cb3579e52 mesa: rename ColorMaterialBitmask to _ColorMaterialBitmask
Since it's a derived field.
2012-06-27 07:50:56 -06:00
Brian Paul
b114ff3783 mesa: re-order, update comments on lighting-related structs 2012-06-27 07:50:56 -06:00
José Fonseca
d1c5ea9207 gallium/util: Fix parsing of options with underscore.
For example

  GALLIVM_DEBUG=no_brilinear

which was being parsed as two options, "no" and "brilinear".
2012-06-27 11:16:18 +01:00
James Benton
789436f1e0 gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.
Updated lp_build_printf to share common code.
Removed specific lp_build_print_vecX.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:16:18 +01:00
Stéphane Marchesin
45fc069600 i915g: Implement sRGB textures
Since we don't have them in hw we emulate them in the shader. Although not
recommended by the spec it is legit.

As a side effect we also get GL 2.1. I think this is as far as we can take
the i915.
2012-06-26 23:18:15 -07:00
Brian Paul
3bc39414ab svga: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Brian Paul
ac8613c298 llvmpipe: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Carl Worth
d8e61f8f86 glsl: glcpp: Extend testing of #line directives
The most recent commit adds support for comments and macro expansion
on #line directives. Add testing to verify the new features.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:55 -07:00
Carl Worth
aac78ce823 glsl: glcpp: Move handling of #line directives from lexer to parser.
The GLSL specification requires that #line directives be interpreted
after macro expansion. Our existing implementation of #line macros in
the lexer prevents conformance on this point.

Moving the handling of #line from the lexer to the parser gives us the
macro expansion we need. An additional benefit is that the
preprocessor also now supports comments on the same line as #line
directives.

Finally, the preprocessor now emits the (fully-macro-expanded) #line
directives into the output. This allows the full GLSL compiler to also
see and interpret these directives so it can also generate correct
line numbers in error messages.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:49 -07:00
Carl Worth
39f8c46eaa glsl: glcpp: Rename and document _glcpp_parser_expand_if
This function is currently used only in the expansion of #if lines,
but we will soon be using it more generally (for the expansion of
(_glcpp_parser_expand_and_lex_from) and some more documentation.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:21:16 -07:00
Carl Worth
1db463ce2e glsl: Consistently use length-based ralloc string functions for info_log.
Commit b823b99ec0 switched from using
functions such as ralloc_asprintf and ralloc_strcat to
ralloc_asprintf_rewrite_tail. This change maintains the string's
length as a aparamter that is updated by the ralloc functions (rather
than recomputing it with strlen over and over).

However, the change failed to updated two locations (glcpp_error and
glcpp_warning), with the result that the string's length wasn't
updated by these calls. Then, subsequent calls to other
ralloc_asprintf_rewrite_tail would overwrite the text appended by
glcpp_error.

This commit fixes the two missing updates, and restores line numbers
to the output of glcpp error messages, (as noticed by a glcpp unit
test case that has been failing since the above-mentioned commit).

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:53 -07:00
Carl Worth
c96b8302a3 glsl: glcpp: Allow "#if undefined-macro' to evaluate to false.
A strict reading of the GLSL specification would have this be an
error, but we've received reports from users who expect the
preprocessor to interepret undefined macros as 0. This is the standard
behavior of the rpeprocessor for C, and according to these user
reports is also the behavior of other OpenGL implementations.

So here's one of those cases where we can make our users happier by
ignoring the specification. And it's hard to imagine users who really,
really want to see an error for this case.

The two affected tests cases are updated to reflect the new behavior.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:03 -07:00
Jerome Glisse
b75f1d973c r600g: enable DUAL_EXPORT mode when possible on r6xx/r7xx
DUAL_EXPORT can be enabled on r6xx/r7xx when all CBs use 16-bit export
and there is no depth/stencil export.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
470d00c0e2 r600g: enable DUAL_EXPORT mode when possible
It seems DUAL_EXPORT on evergreen may be enabled when all CBs use 16-bit export
mode (EXPORT_4C_16BPC), also there should be at least one CB, and the PS
shouldn't export depth/stencil.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
0c47d9dcab r600g: avoid unnecessary shader exports v2
In some cases TGSI shader has more color outputs than the number of CBs,
so it seems we need to limit the number of color exports. This requires
different shader variants depending on the nr_cbufs, but on the other hand
we are doing less exports, which are very costly.

v2: fix various piglit regressions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
4acf71f01e r600g: cache shader variants instead of rebuilding v3
Shader variants are stored in the list, the key for lookup is based on the
states that require different hw shaders - currently it's rctx->two_side (all
gpus) and rctx->nr_cbufs (evergreen/cayman, when writes_all property is set).

v2:
 - use simple list instead of keymap as suggested by Marek on irc
 - call r600_adjust_gprs from r600_bind_vs_shader for r6xx/r7xx
   (r600_shader_select isn't used for vertex shaders currently)

v3:
 - fix call to r600_adjust_gprs - do it after updating current shader

Improves performance for some apps, e.g. FlightGear -
see https://bugs.freedesktop.org/show_bug.cgi?id=50360

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Brian Paul
55a89889ba svga: handle missing PIPE_CAP_x queries
And fix incorrect error message for a bad shader type/number.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 15:03:44 -06:00
Brian Paul
056e9b4511 llvmpipe: handle more PIPE_CAP_x queries
As with the previous commit for softpipe.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:44 -06:00
Brian Paul
7d23dcdacc softpipe: handle more PIPE_CAP_x queries
These all return zero.  Add a debug_printf() to catch the default case so
we don't accidently mishandle something important in the future.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
80efb524ee svga: return 1 for PIPE_CAP_MIXED_COLORBUFFER_FORMATS
This is actually required for GL_ARB_framebuffer_object, but the state
tracker doesn't currently check it.
Direct3D 9 allows mixed format color buffers with some restrictions.
Setting this allows Unigine Heaven 2.5 and 3.0 to run.  Tested both on
GL and D3D hosts.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
36b3ee2ffc glsl: fix comment typo 2012-06-26 10:01:03 -06:00
Olivier Galibert
27e94ba4ea u2f_emit: Fix type parameter in LLVM call.
The type is the destination type (i.e. float vector) and not the
source type.  Fixes piglit fs-{in,de}crement-uint.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 16:55:40 +01:00
Paul Berry
6c355cca91 i965/msaa: Set KILL_ENABLE when GL_ALPHA_TO_COVERAGE enabled.
i965 hardware needs to be informed of situations in which it's
possible for pixels (or samples) to be discarded for reasons other
than depth/stencil testing (e.g. due to an explicit "discard" in the
fragment shader).  One of these situations is when
GL_ALPHA_TO_COVERAGE is enabled, since that can cause samples to be
discarded by the color calculator when the pixel's alpha value is less
than 1.0.

Without this patch, GL_ALPHA_TO_COVERAGE does not take effect on depth
buffers.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
bc53e14d98 i965/msaa: Implement GL_SAMPLE_ALPHA_TO_{COVERAGE,ONE}.
This patch enables the multisampling parameters
GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_ALPHA_TO_ONE, which allow
the fragment shader's alpha output to be converted into a sample
coverage mask and ignored for blending.  i965 supports these
parameters through the BLEND_STATE structure.

The GL spec allows, but does not require, the implementation to dither
the conversion from alpha to a sample coverage mask, so that alpha
values that aren't a multiple of 1/num_samples result in the correct
proportion of samples being lit.  A bit exists in the BLEND_STATE
structure to enable this functionality, but according to the hardware
docs it must be disabled on Sandy Bridge (see the Sandy Bridge PRM,
Vol2, Part1, p379: AlphaToCoverage Dither Enable).  So it is enabled
for Gen7 only.

Fixes piglit tests
"EXT_framebuffer_multisample/sample-alpha-to-{coverage,one} {2,4}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
9ea60ce58f i965/msaa: Implement glSampleCoverage.
This patch enables glSampleCoverage() functionality, which allows the
client program to specify that only a portion of the samples be lit up
when performing multisampled rendering.  i965 supports
glSampleCoverage() through the 3DSTATE_SAMPLE_MASK command packet,
which allows the driver to specify a bitfield indicating which samples
to light up.

Fixes piglit tests "EXT_framebuffer_multisample/sample-coverage {2,4}
{inverted,non-inverted}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
José Fonseca
4bde1ba7fb st/wgl: Add a few more comments. 2012-06-26 10:15:36 +01:00
Marek Olšák
cc2cd8b356 r600g: don't disable streamout if it hasn't been started 2012-06-26 03:37:24 +02:00
Marek Olšák
496399d8e9 u_blitter: disable streamout before rendering
This fixes piglit EXT_transform_feedback tests:
- intervening-read output
- intervening-read prims_written
2012-06-26 03:37:23 +02:00
Chad Versace
cf0bbb30f6 i965/fs: Fix conversions float->bool, int->bool
Fixes gles2conform GL.equal.equal_bvec2_frag.

This fixes brw_fs_visitor's translation of ir_unop_f2b.  It used CMP to
convert the float to one of 0 or ~0. However, the convention in the
compiler is that true is represented by 1, not ~0. This patch adds an AND
to convert ~0 to 1.

By inspection, a similar problem existed with ir_unop_i2b, with a similar
fix.

[v2 kayden]: eliminate extra temporary register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49621
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-25 15:56:40 -07:00
Brian Paul
345ee593e9 st/wgl: 80-column wrapping 2012-06-25 16:10:01 -06:00
Andreas Boll
19534579cf docs/lists: add piglit mailing list
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
24eebf4f88 docs/helpwanted: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
f29f5e8695 docs/sourcetree: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
b347bb5dbc docs/devinfo: update release info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
398d8be3ab docs/systems: add some useful driver links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
297309ce23 docs: update some broken/old links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
dae9b0f1d8 docs: whitespace cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
ddb0557868 docs: escape html special char
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
a5447aab96 docs: add missing target attribute
target is needed for the frame based layout

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
d52419e0c3 docs/shading: use proper markup
use dl instead of ul

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Brian Paul
75e62024c3 docs: document the GALLIUM_LOG_FILE env var 2012-06-25 16:10:01 -06:00
Brian Paul
9ccf5bffe3 mesa: new MESA_LOG_FILE env var to log errors, warnings, etc., to a file
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 16:10:01 -06:00
Marek Olšák
0f530d2dff docs: update GL3.3 status 2012-06-25 23:53:49 +02:00
Marek Olšák
4891c5dc64 r600g: inline r600_blit_push_depth and use resource_copy_region
We are going to have a separate resource for depth texturing and transfers
and this is just a transfer thing.
2012-06-25 23:53:49 +02:00
Marek Olšák
da98bb6fc1 r600g: split flushed depth texture creation and flushing 2012-06-25 23:53:49 +02:00
Paul Berry
d1056541e2 i965/msaa: Add backend support for centroid interpolation.
This patch causes the fragment shader to be configured correctly (and
the correct code to be generated) for centroid interpolation.  This
required two changes: brw_compute_barycentric_interp_modes() needs to
determine when centroid barycentric coordinates need to be included in
the pixel shader thread payload, and
fs_visitor::emit_general_interpolation() needs to interpolate using
the correct set of barycentric coordinates.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
centroid-edges" on i965.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
cf0e7aa9f8 i965/fs: Refactor interpolation code to prepare for adding centroid support.
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
6d7ebb21f8 i965/msaa: Adapt clip setup for centroid noperspective interpolation.
To save time, we only instruct the clip stage of the pipeline to
compute noperspective barycentric coordinates if those coordinates are
needed by the fragment shader.  Previously, we would determine whether
the coordinates were needed by seeing whether the fragment shader used
the BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC interpolation mode.

However, with MSAA, it's possible that the fragment shader might use
BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC instead.  In the future,
when we support ARB_sample_shading, it might use
BRW_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC.

This patch modifies the upload_clip_state() functions to check for all
three possible noperspective interpolation modes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
bebb043811 glsl: Add IsCentroid bitfield to gl_fragment_program.
This bitfield tells the back-ends which of a fragment shader's inputs
require centroid interpolation.  It is only set for GLSL fragment
shaders, since assembly fragment shaders don't support centroid
interpolation.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Brian Paul
2a4af651e6 st/mesa: added some simple fbo debugging/helper code 2012-06-25 11:28:03 -06:00
Brian Paul
45df3eb1db llvmpipe: fix the LP_NO_RAST debug option
It was only no-oping the clear() function, not actual triangle
rasterization.  Move the no_rast field from lp_context down into
lp_rasterizer so it's accessible where it's needed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 08:14:33 -06:00
Vinson Lee
37d699a296 scons: Add glsl/glcpp to the include path.
Fixes this build failure on Solaris.

  Compiling build/sunos-debug/glsl/glcpp/glcpp-lex.c ...
"src/glsl/glcpp/glcpp-lex.l", line 30: cannot find include file: "glcpp-parse.h"

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-23 13:40:09 -07:00
Laurent Carlier
78ac9af580 automake: add missing inclusion of GL headers
Building fail when GL headers are not installed in the system,
so add inclusion of these headers.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-22 17:24:37 -06:00
Brian Paul
cbffaf20e9 mesa: #define fprintf to be __mingw_fprintf() on Mingw32
So that formats such as "%llx" are understood.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 17:24:37 -06:00
Brian Paul
fe68af6e0d svga: init pointer to NULL to silence MSVC warning 2012-06-22 17:24:37 -06:00
Tom Stellard
ea76f03310 clover: Add --with-clang-libdir option and verify CLANG_RESOURCE_DIR
$CLANG_RESOURCE_DIR is the directory that contains all resources
needed by clang to compile programs.  When clover uses clang to
compile kernels it needs to specify a resource dir, so that clang
can find its internal headers (e.g. stddef.h).

clang defines $CLANG_RESOURCE_DIR as $CLANG_LIBDIR/clang/$CLANG_VERSION

This patch adds the --with-clang-libdir option in order to accommodate
clang intalls to non-standard locations, and it also adds a check
to the configure script to verify that $CLANG_RESOURCE_DIR/include
contains the necessary header files.
2012-06-22 16:59:24 -04:00
Paul Berry
82d25963a8 i965: Compute dFdy() correctly for FBOs.
On i965, dFdx() and dFdy() are computed by taking advantage of the
fact that each consecutive set of 4 pixels dispatched to the fragment
shader always constitutes a contiguous 2x2 block of pixels in a fixed
arrangement known as a "sub-span".  So we calculate dFdx() by taking
the difference between the values computed for the left and right
halves of the sub-span, and we calculate dFdy() by taking the
difference between the values computed for the top and bottom halves
of the sub-span.

However, there's a subtlety when FBOs are in use: since FBOs use a
coordinate system where the origin is at the upper left, and window
system framebuffers use a coordinate system where the origin is at the
lower left, the computation of dFdy() needs to be negated for FBOs.

This patch modifies the fragment shader back-ends to negate the value
of dFdy() when an FBO is in use.  It also modifies the code that
populates the program key (brw_wm_populate_key() and
brw_fs_precompile()) so that they always record in the program key
whether we are rendering to an FBO or to a window system framebuffer;
this ensures that the fragment shader will get recompiled when
switching between FBO and non-FBO use.

This will result in unnecessary recompiles of fragment shaders that
don't use dFdy().  To fix that, we will need to adapt the GLSL and
NV_fragment_program front-ends to record whether or not a given shader
uses dFdy().  I plan to implement this in a future patch series; I've
left FIXME comments in the code as a reminder.

Fixes Piglit test "fbo-deriv".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 07:59:34 -07:00
Brian Paul
d988ea5e81 mesa: minor transform feedback comments 2012-06-22 08:48:45 -06:00
Brian Paul
09af5783b3 mesa: fix comments on UBO buffer binding functions
The old comments were for transform feedback.
2012-06-22 08:44:00 -06:00
Olivier Galibert
b8068afafa draw: Handle the case when there isn't a fragment shader.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-22 09:58:39 +01:00
Zack Rusin
af98c6b05b mesa: update the emacs indent files
dirvars package has been replaced by built-in functionality of
dir-locals. preserve the settings in the new infrastructure
2012-06-21 17:29:11 -04:00
Tom Stellard
ff2b417245 r600g: Unify SURFACE_SYNC packet emission for 3D and compute
Drop the compute specific evergreen_set_buffer_sync() function and
instead use the r600_surface_sync_command atom for emitting SURFACE_SYNC
packets.
2012-06-21 20:42:07 +00:00
Tom Stellard
ff08f1ec6f r600g: Enable reusing of compute state 2012-06-21 20:42:07 +00:00
Tom Stellard
5cd6ce939d r600g: Fix reading vtx instruction offset from bytestream 2012-06-21 20:42:07 +00:00
Tom Stellard
563a764110 radeon/llvm: Turn on the BitExtract peephole optimization
Thie BitExtract optimization folds a mask and shift operation together
into a single instruction (BFE_UINT).
2012-06-21 20:42:06 +00:00
Tom Stellard
c53c8d0555 radeon/llvm: Lower ROTL to BIT_ALIGN 2012-06-21 20:42:06 +00:00
Tom Stellard
cd287301ec radeon/llvm: Use the VLIW Scheduler for R600->NI
It's not optimal, but it's better than the register pressure scheduler
that was previously being used.  The VLIW scheduler currently ignores
all the complicated instruction groups restrictions and just tries to
fill the instruction groups with as many instructions as possible.
Though, it does know enough not to put two trans only instructions in
the same group.

We are able to ignore the instruction group restrictions in the LLVM
backend, because the finalizer in r600_asm.c will fix any illegal
instruction groups the backend generates.

Enabling the VLIW scheduler improved the run time for a sha1 compute
shader by about 50%.  I'm not sure what the impact will be for graphics
shaders.  I tested Lightsmark with the VLIW scheduler enabled and the
framerate was about the same, but it might help apps that use really
big shaders.
2012-06-21 20:42:06 +00:00
Brian Paul
b73cf49c91 mesa: set GL_ARB_uniform_buffer_object extension year to 2009 2012-06-21 13:08:34 -06:00
Eric Anholt
cb9f35d16f mesa: Add a comment explaining my thoughts on glBindBufferBase().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:18 -07:00
Eric Anholt
d103fead19 mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.
Fixes piglit ARB_uniform_buffer_object/getintegeri_v.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:10 -07:00
Eric Anholt
fb76ddc133 mesa: Add support for glBindBufferBase/Range on GL_UNIFORM_BUFFER.
Fixes piglits:
GL_ARB_uniform_buffer_object/bindbuffer-general-point.
GL_ARB_uniform_buffer_object/negative-bindbuffer-buffer
GL_ARB_uniform_buffer_object/negative-bindbuffer-index
GL_ARB_uniform_buffer_object/negative-bindbuffer-target
GL_ARB_uniform_buffer_object/negative-bindbufferrange-range

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:07 -07:00
Eric Anholt
b82c472156 mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.
The rest of the TFB implementation remains in transformfeedback.c, and
this will be shared with UBOs.

v2: Move the size/offset checks shared with UBOs to common code as
    well. (Kenneth's review)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:00 -07:00
Eric Anholt
9627660448 mesa: Move buffer object dispatch setup to bufferobj.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:58 -07:00
Eric Anholt
5527c2d220 mesa: Add indexed binding points for uniform buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:56 -07:00
Eric Anholt
c5c696e7fb mesa: Add support for the GL_UNIFORM_BUFFER general binding point.
Fixes piglit ARB_uniform_buffer_object/buffer-targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:54 -07:00
Eric Anholt
5426b1ade9 mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.
Fixes piglit GL_ARB_uniform_buffer_object/minmax.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:51 -07:00
Vincent Lejeune
3e17d38457 glapi: Add uniform buffer object API
v2: Fix a typo spotted by Eric Anholt.
v3: Fix missing "GL" on types, fix style, fix Studly_Caps extension name,
    drop commented code duplicated with GL3x.xml [anholt]

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:45 -07:00
Eric Anholt
37c3cbe053 dricore: Turn it into a normal library.
Our intention is still that it's not abi stable, so make the package
version number get included in the library name.  Now you can parallel
install dricore-using drivers from multiple mesa versions.  We can put
it into lib now that we're following library versioning rules
(assuming that ABIs don't change within a single Mesa point release).

LD_LIBRARY_PATH still doesn't work with a non-/, non-/usr prefix
because libtool uses rpath instead of runpath for nonstandard
prefixes.
2012-06-21 10:10:46 -07:00
Eric Anholt
4113ac6a0f automake: Convert Mesa built sources generation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
2d51ac84fd mesa: Move GL header installation to automake.
This cuts some cruft related to osmesa where we were being careful to
not install headers twice.
2012-06-21 10:10:46 -07:00
Eric Anholt
1bbd22ada0 automake: Move mesa subdirs processing to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
39785488e6 automake: Move .pc installation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
417c1a6421 automake: Move the master Mesa makefile to Makefile.old.
This will let me incrementally move stuff to automake without
converting libmesa.a all at once.
2012-06-21 10:10:46 -07:00
Eric Anholt
bd18a236de automake: Convert osmesa.pc to be generated by configure. 2012-06-21 10:10:43 -07:00
Eric Anholt
fa4cf4dc0c mesa: Convert gl.pc to be generated by configure.
This saves a step of mashing variables around in our Makefile.
2012-06-21 10:10:08 -07:00
Eric Anholt
2d4b77c7c6 automake: Convert src/mesa/drivers/x11/Makefile to automake.
The weird versioning of the libGL where the package version was sort
of expressed as a big integer is dropped.  libtool didn't like the 0
prefix, and it didn't really make sense anyway -- if you interpret it
as an integer version number, old Mesa 071200 was bigger than current
Mesa 08100.  Instead, just bump the minor version and drop the
patchlevel.
2012-06-21 10:09:17 -07:00
Eric Anholt
2fb0f770a4 automake: Convert src/gallium/Makefile to automake. 2012-06-21 10:08:26 -07:00
Eric Anholt
27383cbb0b automake: Convert src/mapi/glapi/gen to silent build. 2012-06-21 10:08:26 -07:00
Eric Anholt
3a70f7526a automake: Convert src/mapi/glapi/gen/Makefile to automake. 2012-06-21 10:08:24 -07:00
Eric Anholt
d59149d3f4 automake: Convert src/mesa/drivers/Makefile to automake. 2012-06-21 10:07:38 -07:00
Eric Anholt
9ff2709ca5 automake: Directly generate configs/current instead of symlinking from it. 2012-06-21 10:07:38 -07:00
Eric Anholt
95836b46e7 automake: Convert gen_matypes building to automake. 2012-06-21 10:07:36 -07:00
Eric Anholt
acf27121a5 make: Drop HOST_CC and HOST_CFLAGS.
Except for the deleted linux-cell target, these were just the target
cc/cflags.  The only usage was for gen_matypes, which wants the
target's structure packing, not the host, anyway.
2012-06-21 09:58:12 -07:00
Eric Anholt
e426949cf1 make: Fold ASM_CFLAGS into DEFINES.
Every place that uses ASM_FLAGS already uses DEFINES.  Not including
it in DEFINES is just a way to screw up potential users, as I've done
several times while working on the build system.
2012-06-21 09:58:12 -07:00
Eric Anholt
07b28af5b5 automake: Convert src/egl/Makefile to automake. 2012-06-21 09:58:12 -07:00
Eric Anholt
a4ff3342d2 automake: Don't warn on gmake portability issues.
Even pre-automake, we rely on gmake features for pattern
substitutions, and replacing those with reams more make code is not
interesting.  This will let us turn the old Makefiles using pattern
substitutions into automake without spewing warnings.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-06-21 09:57:52 -07:00
Marcin Slusarz
19fd04f5ea nv50: fix buffer reuse issues
1) We need to insert a barrier between consecutive transform feedback calls.
2) VBO cache needs to be flushed when TFB output is used as VBO draw input.

Fixes Piglit test EXT_transform_feedback/immediate-reuse.

Thanks to Christoph Bumiller for pointing out bugs in previous versions
of this patch.
2012-06-20 21:24:53 +02:00
Marcin Slusarz
7e63b613a5 st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array
gl_ClipDistance needs special treatment in form of lowering pass
which transforms gl_ClipDistance representation from float[] to
vec4[]. There are 2 implementations - at glsl linker level (enabled
by LowerClipDistance option) and at glsl_to_tgsi level (enabled
unconditionally for gallium drivers). Second implementation is
incomplete - it does not take into account transform feedback (see
commit 642e5b413e "mesa: Fix transform
feedback of unsubscripted gl_ClipDistance array" for details).

There are 2 possible fixes:
- adding transform feedback support into glsl_to_tgsi version
- ripping gl_ClipDistance support from glsl_to_tgsi and enabling
  gl_ClipDistance lowering on glsl linker side

This patch implements 2nd option. All it does is:
- reverts most of the commit 59be691638
  "st/mesa: add support for gl_ClipDistance"
- changes LowerClipDistance to true

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{2,3,4,5,6,7,8}]-no-subscript" at least on nv50
and evergreen cards.
2012-06-20 21:16:20 +02:00
Paul Berry
f2f05e50b1 glx/tests: Fix signed/unsigned comparison warnings. 2012-06-20 11:42:42 -07:00
Paul Berry
cde6544ad7 i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.
From the GL 3.0 spec (p.116):

    "Multisample rasterization is enabled or disabled by calling
    Enable or Disable with the symbolic constant MULTISAMPLE."

Elsewhere in the spec, where multisample rasterization is described
(sections 3.4.3, 3.5.4, and 3.6.6), the following text is consistently
used:

    "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is
    one, then..."

So, in other words, disabling GL_MULTISAMPLE should prevent
multisample rasterization from occurring, even if the draw framebuffer
is multisampled.  This patch implements that behaviour by setting the
WM and SF stage's "multisample rasterization mode" to
MSRAST_ON_PATTERN only when the draw framebuffer is multisampled *and*
GL_MULTISAMPLE is enabled.

Fixes piglit test spec/EXT_framebuffer_multisample/enable-flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Paul Berry
3b0279a693 i965/msaa: Disable unsupported formats.
Due to hardware limitations, MSAA is unsupported on Gen6 for formats
containing >64 bits of data per pixel.  From the Sandy Bridge PRM,
vol4 part1, p72 ("Surface Format"):

    If Number of Multisamples is set to a value other than
    MULTISAMPLECOUNT_1, this field cannot be set to the following
    formats:
    - any format with greater than 64 bits per element
    - any compressed texture format (BC*)
    - any YCRCB* format

Gen7 has a similar, but less stringent limitation: formats with >64
bits of data per pixel only support 4x MSAA.

This patch causes the unsupported formats to report
GL_FRAMEBUFFER_UNSUPPORTED.

Fixes piglit "multisample-formats" tests on Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Andreas Boll
3becf98424 mesa: remove obsolete confdiff.sh
this script is obsolete since
0cc216676c
2012-06-20 01:51:38 -07:00
Christian König
0f269c5e7b st/vdpau: use template size as default for source_rect.
Fixes alignment problems with flash player.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:38 +02:00
Christian König
d37c3c6ebe st/vdpau: clear Cb&Cr with 0.5f
That makes the output black in case of decoding errors.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:29 +02:00
Kenneth Graunke
2f8351a5ac i965: Don't set brw_wm_prog_key::iz_lookup on Gen6+.
Sandy Bridge and later don't use this field, so there's no point in
setting it.  It can only cause harmful state-based recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-19 17:36:48 -07:00
Olivier Galibert
c790c2c759 llvmpipe: Add vertex id support.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
46931ecf48 llvmpipe: Simplify and fix system variables fetch.
The system array values concept doesn't really because it expects the
system values to be fixed per call, which is wrong for gl_VertexID and
iffy for gl_SampleID.  So this patch does two things:

- kill the array, have emit_fetch_system_value directly pick the
  values it needs (only gl_InstanceID for now, as the previous code)

- correctly handle the expected type in emit_fetch_system_value

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
4625a9b1ad draw: fix flat shading and screen-space linear interpolation in clipper
This includes:
- picking up correctly which attributes are flatshaded and which are
  noperspective

- copying the flatshaded attributes when needed, including the
  non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
  instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
cfc5b30941 softpipe: Offset is not to be applied to the layer parameter of array texture fetches.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Brian Paul
fc855ed5d9 st/mesa: clamp glDrawPixels size to max texture size 2012-06-19 14:40:44 -06:00
Brian Paul
7f4786ad29 st/mesa: move st_validate_state() call earlier in st_DrawPixels() 2012-06-19 14:40:44 -06:00
Jerome Glisse
b4f0ab0b22 r600g: fix z/stencil texture creation v2
z or stencil texture should not be created with the z/stencil
flags for surface creation as they are intended to be bound
as texture.

v2: remove broken code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-19 15:03:36 -04:00
Török Edwin
988ad7831c radeon/llvm: Fix CR/LF in Processors.td
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:23 -04:00
Török Edwin
7c005d5687 radeon/llvm: Fix sin/cos codegen on R700
Based on https://bugs.freedesktop.org/show_bug.cgi?id=50317#c4

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50316
https://bugs.freedesktop.org/show_bug.cgi?id=50317

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:13 -04:00
Fredrik Höglund
4e943c375b docs: update GL3.txt for ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
c4c8c7a8f9 st/mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
af372129e5 gallium: Add PIPE_CAP_START_INSTANCE
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
ae5d7d5e89 mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Vinson Lee
ee99647e02 scons: Do not build svga if using Solaris Studio C compiler.
Solaris Studio C compiler does not support anonymous structs and
anonymous unions.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 16:37:46 -07:00
Kenneth Graunke
5b83bdc154 i965: Fix brw_swap_cmod() for LE/GE comparisons.
The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want
to simply exchange arguments, not negate the condition.  If equality was
part of the original comparison, it should remain part of the swapped
version.

This is the true cause of bug #50298.  It didn't manifest itself on
Sandybridge because we embed the conditional modifier in the IF
instruction rather than emitting a CMP.  All other platforms use CMP.

It also didn't manifest itself on the master branch because commit
be5f27a84d ("glsl: Refine the loop instruction counting.") papered over
the problem.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-18 15:25:31 -07:00
Brian Paul
6f7834ad36 docs: start release notes file for 8.1 2012-06-18 12:39:34 -06:00
Tom Stellard
7fab4b648b radeon/llvm: Update comment in AMDGPU.td 2012-06-18 18:30:36 -04:00
Tom Stellard
984ad0788c radeon/llvm: Remove unused AMDIL TableGen definitons 2012-06-18 18:30:36 -04:00
Tom Stellard
34ff22b75f radeon/llvm: Eliminate getRegClassFromType() function
We can use TargetLowering::getRegClassFor() instead.
2012-06-18 18:30:36 -04:00
Tom Stellard
440ab9ea02 radeon/llvm: Remove deadcode from AMDILISelLowering.cpp 2012-06-18 18:30:35 -04:00
Vinson Lee
cd62960a2e gallium: Add support for Solaris Studio C++ compiler.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 10:01:26 -07:00
James Benton
f34e2f484b llvmpipe: Implement cylindrical wrapping.
Tested against mesa demos cylwrap and dx9 DCT address.exe which now passes 100%.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 17:55:05 +01:00
Vinson Lee
d1acae2bdc st/glx: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 09:42:08 -07:00
Brian Paul
8ae93c68ea svga: fix synchronization bug between sampler views and surfaces
This fixes a bug where a sampler view was using stale texture/resource
data when the texture was modified through a surface (render to texture).
Bumping the texture and layer ages triggers sampler view revalidation.

Fixes piglit fbo-blit failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 10:22:59 -06:00
Kristian Høgsberg
2d7b2d7a87 gles2: Add GL_NV_read_buffer extension
This lets us select the front buffer for reading under GLES2.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:53:18 -04:00
Kristian Høgsberg
e841a2426e get.c: Rename EXTRA_VERSION_ES2 to EXTRA_API_ES2
This extra condition checks the API not the version of the API, so rename
to reflect that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:50:53 -04:00
Andreas Boll
1692d3ad94 docs/relnotes: comment out bug template
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
fb918727ef docs/relnotes: replace tbd with release date
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
b9fad90350 docs/relnotes: fix validation errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
207d52eb46 docs/relnotes: consolidate html header
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
José Fonseca
e48d26bf40 draw: Ensure that the vertex_header type size matches expectation.
This is failing sometimes, probably because TargetData keeps a structure layout
cache, which can becomes bogus, ever since the InvalidateStructLayoutInfo API
was removed in LLVM r135245.

This change merely makes the problem easier to diagnose (an assertion
failure instead of a random crash).
2012-06-18 12:06:23 +01:00
Marek Olšák
6e7756db14 r600g: enable streamout by default on r7xx and DRM 2.17.0
Now that it's in Linus's tree.

Has anyone had a chance to test streamout on Cayman recently?
2012-06-17 18:28:32 +02:00
Marek Olšák
7c3786d780 st/mesa: properly allocate MSAA renderbuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
c760283159 st/mesa: make unsupported renderbuffer formats always fail as FBO incomplete
instead of failing to allocate a renderbuffer.

This also fixes piglit/get-renderbuffer-internalformat with non-renderable
formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
e4b2e6b527 st/mesa: separate sw renderbuffer allocation from hw one
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:26 +02:00
Marek Olšák
a82227ce4a mesa: if AllocStorage doesn't choose a format, report FRAMEBUFFER_UNSUPPORTED
This allows drivers not to do any allocation in AllocStorage if the storage
cannot be allocated because of an unsupported internalformat + samples combo.

The little ugliness is that AllocStorage is expected to return TRUE in this
case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-16 14:20:26 +02:00
Stéphane Marchesin
841eee5d44 i915g: More ops commute.
This allows using the optimizations more broadly.
2012-06-15 20:22:26 -07:00
Marek Olšák
cb4d1d377d r600g: fix lockups with streamout on r7xx
This requires the latest streamout kernel patches.

Streamout is disabled by default on r7xx, so this patch is safe for regular
users.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
f01594be0e r600g: compute CS space for streamout correctly, add comments
SET_CONTEXT_REG was not counted in.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
bb07e25131 r600g: set SMX_ACTION_ENA to fix streamout cache flushes on some chipsets
It helps on R7xx.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:42:59 +02:00
Alexey Shvetsov
f56f03428d clover: Fix build with LLVM libs installed to non-standard directories
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-15 13:22:16 -04:00
Marek Olšák
5e7e7d96b3 st/mesa: don't do srgb->linear conversion in decompress_with_blit
This fixes piglit/getteximage-formats on r600g.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-15 18:54:14 +02:00
Paul Berry
4d9c3cbce9 glsl: Use ir_unop_f2u to convert floats to uints.
Fixes piglit tests
spec/glsl-1.30/execution/{vs,fs}-float-uint-conversion on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
9d57d483cb gallium: Add TGSI_OPCODE_F2U to gallivm backend.
Note: for the moment TGSI_OPCODE_F2U is implemented using
lp_build_itrunc() (the same function used to implement
TGSI_OPCODE_F2I).  In the long run, we should create an
lp_build_utrunc() function to do the proper conversion.  But this
should allow us to limp along with mostly correct behaviour for now.
2012-06-15 08:58:55 -07:00
Paul Berry
1be7661110 gallium: Add support for ir_unop_f2u to tgsi backend.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
fa584c50cf ir_to_mesa: Add support for ir_unop_f2u to ir_to_mesa backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
11a7b93592 i965: Add support for ir_unop_f2u to i965 backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
613a8170ae glsl: Add support for ir_unop_f2u to constant folding.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
8e31f961e6 glsl: Add unary operation ir_unop_f2u.
Previously, we performed conversions from float->uint by a two step
process: float->int->uint.  However, on platforms that use saturating
conversions (e.g. i965), this didn't work, because if the source value
was larger than the maximum representable int (0x7fffffff), then
converting it to an int would clamp it to 0x7fffffff.

This patch just adds the new opcode; further patches will adapt
optimization passes and back-ends to use it, and then finally the
ast_to_hir logic will be modified to emit the new opcode.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
75f409d75c i965/blorp: Implement source clipping.
This patch modifies blorp blits (which are used for MSAA) to properly
account for clipping of source coordinates.  Previously, if we
detected the possibility of source clipping, we would fall back to the
blit meta-op, which doesn't support MSAA and is very slow for depth
and stencil buffers.

Fixes piglit tests
"EXT_framebuffer_multisample/clip-and-scissor-blit" on i965/Gen6+.

Also substantially speeds up the Humble Bundle V game "Psychonauts" on
Gen6+ (without this patch, the game's depth buffer blits use the slow
blit meta-op).

Reviewed-by: Carl Worth <cworth@cworth.org>
2012-06-15 08:58:54 -07:00
Brian Paul
4d9f263d7c scons: add st_atom_array.c to the build 2012-06-15 09:31:33 -06:00
Christian König
92af184690 winsys/radeon: enable IB submission to compute rings v2
This allows to submit things to the compute only
rings on cayman+

v2: rebased on current master and actually make use
    of the new flag in evergreen_compute.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 09:52:38 +02:00
Marek Olšák
b4753dafcc st/mesa: atomize vertex array state
This moves the state validation to where all the other states are validated.
2012-06-15 03:15:50 +02:00
Maarten Lankhorst
6bb0151f1f winsys/radeon: Remove unnecessary pipe_thread_destroy in radeon_drm_cs_destroy
Fixes crash bug introduced with 210ddf0819 fd.o #49198
pthread_detach after a pthread_join is unneeded.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 03:01:23 +02:00
Marcin Slusarz
fc782bcbf0 nv50,nvc0: fix stream output target buffer leak
It manifests at exit as:
"WARNING: destroying GPU memory cache with some buffers still in use"
2012-06-14 23:38:28 +02:00
Christoph Bumiller
169a0ae40a nv50: disable stream output before reconfiguring it
If we don't, the GPU will just throw an ILLEGAL_OPERATION error.
2012-06-14 23:30:49 +02:00
Christoph Bumiller
ef51ce522b nv50/ir: handle NEG,ABS modifiers for short RCP encoding 2012-06-14 23:25:48 +02:00
Brian Paul
f677954e07 st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output
When drawing a depth image the fragment shader also needs to emit the
current raster color.

The new piglit drawpix-z test exercises this.

NOTE: This is a candiate for the 8.0 branch.
2012-06-14 14:37:31 -06:00
Brian Paul
8031aa134e docs: add info about shortlog_mesa.sh script 2012-06-14 14:37:31 -06:00
Paul Berry
4b7b4c46c5 glx/tests and mesa/tests: Update .gitignore files.
This patch updates .gitignore files to account for the new build
artifacts introduced by the following commits:

ae376f0 glx/tests: Rename test as glx-test
8fecdcc mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
a29ad2b mesa/tests: Add tests for the generated dispatch table
2012-06-14 10:08:57 -07:00
Christian König
eb024c7488 st/vdpau: fix YCbCr down/up-loads for buffers larger than requested
When the video buffer turns out to be larger than
requested by the application we shouldn't upload
or download more data into / from it original requested.

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

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-14 17:54:04 +02:00
Alexander von Gluck IV
cb3054c849 scons: Fix Haiku binary optimizations
Haiku targets the Pentium or higher processor.
To ensure compatibility we can do march 586 and
mtune 686. Mesa will still use sse however if
the cpu supports it (and the stack is properly
aligned). These flags only effect the internal
compiler optimizations.
2012-06-14 08:08:17 -07:00
Andreas Boll
c1dcf9665c mesa: fix html in shortlog_mesa.sh script
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:25:42 -06:00
Brian Paul
51c9c67a2f mesa: added Ian's shortlog_mesa.sh script in bin/ 2012-06-14 08:22:54 -06:00
Brian Paul
5234b8902c svga: make svga_surface_needs_propagation() surface const 2012-06-14 08:20:40 -06:00
Brian Paul
92b65637ab svga: add svga_surface_const() cast wrapper 2012-06-14 08:20:40 -06:00
Brian Paul
bffb3997c3 svga: fix comment typo 2012-06-14 08:20:40 -06:00
Aaron Watry
fc3bac8a40 rbug: fix make process on Linux Mint 13 x64.
Previously, rbug_*.c would fail to compile with incomplete prototype
errors when make was run from the command line on my machine. My IDE
always built fine, and still does after this patch (Netbeans 7.1.2).

Most of the includes from files in gallium/auxiliary/rbug/* were
assuming an rbug/ subdirectory, while the headers are actually in the
same directory as the .c files.

The build error was also previously a problem for me on Ubuntu 11.10
and Mint 12.

Fixes build for the following configuration: ./autogen.sh
--enable-debug --enable-texture-float --with-gallium-drivers=r600
--with-dri-drivers=radeon --enable-r600-llvm-compiler

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:14:59 -06:00
José Fonseca
93a42d1314 windows/gdi: Remove GL_NV_register_combiners and GL_NV_vertex_array_range exports 2012-06-14 12:02:03 +01:00
Ian Romanick
4bfdc83135 glsl: Fix pi/2 constant in acos built-in function
In single precision, 1.5707963 becomes 1.5707962513 which is too
small.  However, 1.5707964 becomes 1.5707963705 which is just right.
The value 1.5707964 is already used in asin.ir.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-06-13 18:26:11 -07:00
Ian Romanick
f18d3fe0cb glapi: Remove GL_NV_vertex_array_range from the dispatch table
There is no GLX protocol for these functions.  Open-source Linux
driver have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
69d1851757 glapi: Remove GL_NV_fence from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
6db7cf29b5 glapi: Remove GL_NV_register_combiners from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
a6002909a3 glapi: Remove GL_APPLE_texture_range from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
e62c4c765c glapi: Remove GL_SGIX_pixel_texture from the dispatch table
There is no GLX protocol for this function.  Open-source Linux driver
have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for this function in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
933714aabe glapi: Remove GL_SGIS_pixel_texture from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
a29ad2b421 mesa/tests: Add tests for the generated dispatch table
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:53 -07:00
Ian Romanick
8fecdcc587 mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:14:22 -07:00
Ian Romanick
e08f9080ff glapi: Add missing GL_EXT_texture_sRGB_decode enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
1c25984b23 glapi: Add missing GL_EXT_framebuffer_sRGB enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
75c516c959 glapi: Add missing GL_EXT_packed_float enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
ffbccb8cef glapi: Add missing framebuffer sRGB enum
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2d8d85d7fb glapi: Add uniform buffer object enums
These are from OpenGL 3.1 and ARB_uniform_buffer_object.  I only added
them to 3.1 because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
c5071825b0 glapi: Add missing enums for GL_NV_fragment_program
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2485a1332e glapi: Add missing enums for GL_ARB_occlusion_query2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
22cdd7d817 glapi: Remove extraneous GL_ from TEXTURE_IMMUTABLE_FORMAT
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
21af1e9a0e glapi: Add missing enums for GL_ATI_fragment_shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
502449d71f 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>
2012-06-13 11:50:25 -07:00
Ian Romanick
a4a0c1f09d 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>
2012-06-13 11:50:25 -07:00
Ian Romanick
cc1e74bd19 glapi: Add missing _NV extension on COMBINE4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
78b30938cc 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>
2012-06-13 11:50:25 -07:00
Ian Romanick
8fcec14417 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>
2012-06-13 11:50:25 -07:00
Ian Romanick
3c22f79412 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>
2012-06-13 11:50:24 -07:00
Ian Romanick
4c270f9c6b 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>
2012-06-13 11:50:24 -07:00
Ian Romanick
ae376f0567 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>
2012-06-13 11:50:24 -07:00
Ian Romanick
2e8c866f10 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>
2012-06-13 11:50:24 -07:00
Brian Paul
f68ab0398b util: add some comments, fix indentation 2012-06-13 08:52:40 -06:00
Matt Turner
ae419a0159 glsl: Transform dot product by a basis vector into a swizzle
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Matt Turner
9aa3fbcc2e 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>
2012-06-12 18:51:25 -04:00
Matt Turner
d7bef19c7f glsl: Check for zero vectors in ir_binop_dot
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Brian Paul
82ce93a8fd mesa: move variable declaration out of loop to fix MSVC build 2012-06-12 16:31:36 -06:00
Stéphane Marchesin
a74c4fb89d mesa: Fix bool-int mismatch
Also include stdbool for windows.
2012-06-12 15:22:48 -07:00
Antoine Labour
3c9fab8822 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.
2012-06-12 14:42:22 -07:00
Antoine Labour
e2e9b4b10f 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.
2012-06-12 14:42:22 -07:00
Antoine Labour
53feb8ecdc 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.
2012-06-12 14:42:22 -07:00
Stéphane Marchesin
0256edd709 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.
2012-06-12 14:42:22 -07:00
Michel Dänzer
1657dec72d radeonsi: Don't always re-compile shaders after they're bound. 2012-06-12 20:18:24 +02:00
Dave Airlie
6d289390ec st/xorg: Fix crash on startup.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:28 +02:00
Michel Dänzer
90c6eacdb4 radeonsi: Use linear instead of constant interpolation for now.
Constant interpolation still hangs the GPU for some reason.
2012-06-12 18:48:28 +02:00
Thomas Stellard
4c418cf1a3 radeonsi: Handle SUB_f32.
Signed-off-by: Thomas Stellard <tom.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:16 +02:00
Michel Dänzer
4c4ef9c29a radeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1. 2012-06-12 18:33:54 +02:00
Eric Anholt
7b11051a28 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
2012-06-12 08:10:41 -07:00
Andreas Boll
fd64b39727 docs: whitespaces cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
5dc59455f9 docs: remove some superfluous <p> tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
8155ed37a1 docs: remove unused table styles
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
908f788503 docs: remove unused anchor links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
210a27d8c3 docs: prefer lowercase html tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
cc4188895b docs: use id instead of <a name>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
f85d23cea4 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>
2012-06-12 08:03:30 -06:00
Andreas Boll
2d7f319a0a 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>
2012-06-12 08:03:30 -06:00
Andreas Boll
df2be226d9 docs: fix html end/start tags
for more well-formed html

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
703a662c15 docs: escape special html chars
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:29 -06:00
Andreas Boll
ecd5c7ceb8 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>
2012-06-12 08:03:29 -06:00
Kenneth Graunke
45c21f852e 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>
2012-06-11 13:30:32 -07:00
Kenneth Graunke
bbb67c3efc 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>
2012-06-11 13:28:23 -07:00
Kenneth Graunke
a75e704326 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>
2012-06-11 13:27:36 -07:00
Kenneth Graunke
4a5d020ee3 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>
2012-06-11 13:27:36 -07:00
José Fonseca
ea606ee7b4 scons: Fix scons build. 2012-06-11 19:38:07 +01:00
Brad King
f3cdcb839f 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>
2012-06-11 09:28:00 -07:00
Eric Anholt
337d9c955b 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>
2012-06-11 09:28:00 -07:00
Eric Anholt
279efce8bb 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.
2012-06-11 09:28:00 -07:00
Eric Anholt
446faee094 automake: Add a prefix variable for libglsl sources.
See e86c40a84d for reasoning.  In the
process I did s/:=/=/ to shut up automake about nonportable make syntax.
2012-06-11 09:28:00 -07:00
Eric Anholt
7edbf4b323 automake: Convert src/Makefile to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
07abd913b6 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>
2012-06-11 09:28:00 -07:00
Eric Anholt
743e505315 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>
2012-06-11 09:28:00 -07:00
Eric Anholt
4038dda6cd mesa: Move the version information right into configure.ac.
Nothing else called version.mk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
0cc216676c 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>
2012-06-11 09:28:00 -07:00
Tapani Pälli
d5c1801a01 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>
2012-06-11 09:27:59 -07:00
Michael Karcher
e2c08e824b 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>
2012-06-10 16:33:42 +02:00
Kenneth Graunke
306c9f0c57 mesa: Fix "glCopyBuffserSubData" typos in error messages and comments.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 22:04:34 -07:00
Eric Anholt
a018747ac8 glsl: Clean up warnings about deleting classes without virtual destructors.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 12:42:38 -07:00
Marcin Slusarz
ea055e19c2 glsl: fix deref_hash memory leak in constant_expression_value
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 21:00:40 +02:00
Andreas Boll
ca9977d5c6 glcpp: .gitignore cleanup
*.o, *.lo and *~ are already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 11:18:55 -07:00
Andreas Boll
6224e90247 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>
2012-06-08 11:18:38 -07:00
Roland Scheidegger
dfbb18bdb5 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>
2012-06-08 17:46:57 +01:00
Kenneth Graunke
529476b5e4 i965: Add forgotten bitcast operations in brw_fs_channel_expressions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:22:11 -07:00
Paul Berry
9fd0e76a19 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>
2012-06-07 11:03:15 -07:00
Paul Berry
530bda2aac 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>
2012-06-07 11:03:15 -07:00
Paul Berry
9dbd0b6778 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>
2012-06-07 11:03:15 -07:00
Paul Berry
040d015734 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>
2012-06-07 11:03:15 -07:00
Kenneth Graunke
05790746df i965: Enable the GL_ARB_shader_bit_encode extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:17:21 -07:00
Olivier Galibert
a83be8b6d7 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>
2012-06-07 00:17:14 -07:00
Olivier Galibert
e16b0a51be 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>
2012-06-07 00:06:18 -07:00
Olivier Galibert
abe9767553 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>
2012-06-07 00:06:18 -07:00
Olivier Galibert
1b8a3aad09 glsl: Bitwise conversion operator support in ir_validate.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
4fab150559 glsl: Bitwise conversion operator support in ir_expression.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:17 -07:00
Olivier Galibert
500dcbb1aa 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>
2012-06-07 00:06:17 -07:00
Olivier Galibert
199771bc32 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>
2012-06-07 00:06:00 -07:00
Kenneth Graunke
f8d40deea5 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>
2012-06-07 00:01:40 -07:00
Kenneth Graunke
3603fdcebf 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>
2012-06-07 00:01:40 -07:00
Tom Stellard
5f3f63b76d radeon/llvm: Emulate RECIP_UINT instruction on Cayman 2012-06-06 20:51:00 -04:00
Tom Stellard
0c9f5f22d5 radeon/llvm: Remove some duplicate code in the R600 CodeEmitter 2012-06-06 20:51:00 -04:00
Tom Stellard
9c46cb2368 radeon/llvm: Fix MULLO* instructions on Cayman
On Cayman, the MULLO* instructions must fill all slots in an
instruction group.
2012-06-06 20:50:36 -04:00
Tom Stellard
0c4b19ac63 r600g: Compute support for Cayman 2012-06-06 10:49:36 -04:00
Dave Airlie
2bb2e6a6e3 xorg: port to new compat API.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-06 15:22:50 +01:00
Brian Paul
ec19bdd16c mesa: consolidate internal glCompressedTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e8fdd0e0d5 mesa: consolidate internal glCompressedTexImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
cd9ab2584f mesa: consolidate internal glCopyTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e42d00b3f4 mesa: consolidate internal glTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:55:59 -06:00
Brian Paul
8f5fffe75d 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>
2012-06-06 07:55:59 -06:00
Brian Paul
3a62e8bcac 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.
2012-06-06 07:55:59 -06:00
Brian Paul
adc58e96d0 docs: remove documentation of old Makefile system
It's going away in the near future.
2012-06-06 07:55:59 -06:00
Tom Stellard
d4942eb9fa 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.
2012-06-06 13:46:04 -04:00
Tom Stellard
edceed1b9a radeon/llvm: Remove AMDIL MOVE* instructions 2012-06-06 13:46:04 -04:00
Tom Stellard
f81e4663a7 radeon/llvm: Add isMov() to AMDILInstrInfo
This enables the CFGStructurizer to work without the AMDIL::MOV*
instructions.
2012-06-06 13:46:04 -04:00
Tom Stellard
1777c99bff radeon/llvm: Remove deadcode from the AMDILISelLowering class 2012-06-06 13:46:03 -04:00
Tom Stellard
8cc9b463de 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.
2012-06-06 13:46:03 -04:00
Tom Stellard
de7366701d radeon/llvm: Remove AMDIL VCREATE* instructions
This obsoletes the AMDGPULowerInstruction pass.
2012-06-06 13:46:03 -04:00
Tom Stellard
8d53ddb375 radeon/llvm: Remove AMDIL LOADCONST* instructions
This obsoletes the R600LowerInstruction and SIPropagateImmReads passes.
2012-06-06 13:46:03 -04:00
Marcin Slusarz
17e047242e nouveau: fix scratch buffer leak
...and create common function for destroying nouveau_context
2012-06-05 23:58:43 +02:00
Marcin Slusarz
3232a86efe nv50: fix nv50_stream_output_state leak 2012-06-05 23:58:43 +02:00
Marcin Slusarz
cfa7cb991c nv50: fix symbol table memory leak 2012-06-05 23:58:43 +02:00
Kenneth Graunke
2f18698220 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>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
cb18472eca i965/vs: Fix texelFetchOffset() on pre-Gen7.
Commit 4650aea7a5 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
217b62bf00 i965/fs: Fix texelFetchOffset() on pre-Gen7.
Commit f41ecade7b fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
7fde071f04 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>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
3edd2ba22b 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>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
05b086ce93 mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.

Now you can unbind your buffers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
cb8ed93dd0 mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
According to the GL 3.1 spec, section 2.9 ("Buffer Objects"):
"If a buffer object is deleted while it is bound, all bindings to that
 object in the current context (i.e. in the thread that called
 DeleteBuffers) are reset to zero."

The code already checked for a number of cases, but neglected these
newer binding points.

+21 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>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
25edfbfccf glsl/builtins: Fix textureGrad() for Array samplers.
We were incorrectly assuming that the coordinate's dimensionality is
equal to the gradient's dimensionality.  For array types, the coordinate
has one more component.

Fixes 12 subcases of oglconform's glsl-bif-tex-grad test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:33 -07:00
Kristian Høgsberg
2c4f6ceeb4 configure.ac: Fail if egl x11 platform dependencies are not available
Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available
we just silently fail and disables building the EGL DRI2 driver.

This commit cleans up the EGL platfrom checking and fails if a selected
platform can't find its required dependencies.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-05 14:34:33 -04:00
Alex Deucher
75f9d24ac4 r600g: add new Trinity PCI ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:16:42 -04:00
Alex Deucher
6ce298f9ce r600g: add new Sumo, Palm, BTC pci ids
Note this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:15:16 -04:00
Alex Deucher
01b7eb7c74 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:12:21 -04:00
Paul Berry
555e00fdc3 Fix .gitignore for ralloc-test
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-04 18:11:43 -07:00
Vinson Lee
105f307d90 st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fix uninitialized scalar field defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-06-02 13:18:40 -07:00
Kenneth Graunke
adbfc4a09a i965: Implement texture buffer objects on Gen6.
Commit a07cf3397e added support for TBOs
on Gen7, but missed Gen6.

Passes piglit -t texture_buffer and oglconform's buffermapping
basic.read.texture tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Kenneth Graunke
608c3d2083 mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE,
TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on
glPopAttrib(GL_TEXTURE_BIT).

Makes a number of oglconform tests happier.

v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture
    extensions, as suggested by Brian.  I'm not sure that any
    implementations still remain that don't support those, but why not?

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: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Eric Anholt
775ba11dcd automake: Connect the libdricore target to make clean.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 16:25:39 -07:00
Tapani Pälli
a9cfd95c24 automake: use -m32 in CCASFLAGS when using --enable-32-bit
this fixes libdricore directory build with --enable-32-bit on a x86_64 system

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-01 16:25:39 -07:00
Tom Stellard
0ebf2318b3 radeon/llvm: Fix VTX_READ patterns
The VTX_READ instructions were using the ADDRParam ComplexPattern which
allows a load instruction's offset to be a register, but VTX_READ
instructions can only handle an immediate offset.

Also, the load_param pattern fragment had an erroneous return true;
statement that was causing it to match the wrong load instructions.
2012-06-01 16:52:26 -04:00
Tom Stellard
c108831d44 radeon/llvm: Emit 2 bytes for vertex fetch offsets 2012-06-01 16:52:26 -04:00
Tom Stellard
85a68814ee radeon/llvm: Only use indirect (vertex fetch) parameters for kernels
Kernel parameters can only be retrieved via vertex fetchs.  Direct
parameters (i.e parameters stored in the constant buffer) are not
supported yet.
2012-06-01 16:52:26 -04:00
Kenneth Graunke
fb79ecb62d intel: Change vendor string to "Intel Open Source Technology Center".
Tungsten Graphics has not existed for several years, and the majority of
ongoing development and support is done by Intel.  I chose to include
"Open Source Technology Center" to distinguish it from, say, the closed
source Windows OpenGL driver.

The one downside to this patch is that applications that pattern match
against "Intel" may start applying workarounds meant for the Windows
driver.  However, it does seem like the right thing to do.

This does change oglconform behavior.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 14:24:57 -07:00
Ian Romanick
adfe531841 glsl: Remove spurious printf messages
These look like debug messages from the switch-statement development.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-01 12:27:04 -07:00
Tom Stellard
d6c2d3722d radeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions
Add some hooks to the R600,SI InstrInfo and RegisterInfo classes, so
that the CFGStructurizer pass can run without any relying on AMDIL
instructions.
2012-06-01 11:28:11 -04:00
Tom Stellard
65917004d9 radeon/llvm: Change prefix on tablegen files to AMDGPU 2012-06-01 11:28:11 -04:00
Tom Stellard
afea59bf65 radeon/llvm: Remove deadcode from the R600LowerInstructions pass 2012-06-01 11:28:10 -04:00
Tom Stellard
883a0af53a radeon/llvm: Remove AMDIL GLOBALSTORE* instructions 2012-06-01 11:28:10 -04:00
Tom Stellard
f2781271c7 radeon/llvm: Remove AMDIL GLOBALLOAD* instructions 2012-06-01 11:28:10 -04:00
Adam Rak
6a829a1b72 r600g: compute support for evergreen
Tom Stellard:
  - Updated for gallium interface changes
  - Fixed a few bugs:
    + Set the loop counter
    + Calculate the correct number of pipes
  - Added hooks into the LLVM compiler
2012-06-01 11:28:10 -04:00
Tom Stellard
46a13b3b11 clover: Add function for building a clover::module for non-TGSI targets v6
v2:
  -Separate IR type and LLVM triple
  -Do the OpenCL C->LLVM IR and linking steps for all PIPE_SHADER_IR
   types.

v3:
  - Coding style fixes
  - Removed compatibility code for LLVM < 3.1
  - Split build_module_llvm() into three functions:
    compile(), link(), and build_module_llvm()

v4:
  - Use struct pipe_compute_program

v5:
  - Don't malloc memory for struct pipe_llvm_program

v6:
  - Fix serialization of llvm bytecode

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
f2606413ec gallium: Add struct pipe_llvm_program_header v3
This structure is used as a header that precedes LLVM bytecode programs
that are passed to the drivers.

v2:
  - s/pipe_compute_program/pipe_llvm_program/

v3:
  - Rename to struct pipe_llvm_program_header
  - Drop the char * prog member

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
741463e18d clover: Remove target argument from compile_program_tgsi()
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
d724190bce clover: Add constructors to some of the module classes v3
This is for the llvm code that can't use extended initializers.

v2:
  - Use const references for vector arguments
  - Move constructor defs before data members
  - Initialize all values in the default constructors

v3:
  - Fix typo
2012-06-01 11:28:09 -04:00
Tom Stellard
5cc08efe8f clover: Add necessary flags to libclllvm_la_CXXFLAGS
$(LLVM_CFLAGS) for LLVM defines
-DLIBCLC_PATH for libclc path
-DCLANG_RESOURCE_DIR for clang includes
$(DEFINES) for -DHAVE_LLVM
2012-06-01 11:28:09 -04:00
Tom Stellard
7a6b5d42d8 clover: Link to the necessary LLVM and Clang libs 2012-06-01 11:28:09 -04:00
Tom Stellard
d416780f39 configure.ac: Add variables LLVM_CPPFLAGS and LLVM_LIBDIR 2012-06-01 11:28:09 -04:00
Tom Stellard
c79e7668b2 configure.ac: Add option for libclc path 2012-06-01 11:28:09 -04:00
Tom Stellard
613323b256 clover: Add a function for retrieving a device's preferred ir v3
A device now has two function for getting information about the IR
it needs to return.

ir_format() => returns the preferred IR
ir_target() => returns the triple for the target that is understood by
                 clang/llvm.

v2:
  - renamed ir_target() to ir_format()
  - renamed llvm_triple() to ir_target()

v3:
  - Remove unnecessary include
  - Do proper conversion from std::vector<char> to std::string

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:09 -04:00
Francisco Jerez
c4c51153bc gallium/compute: Add PIPE_COMPUTE_CAP_IR_TARGET v4
v2: Tom Stellard
  - Update CAP description

v3: Tom Stellard
  - TGSI targets should pass an empty string for this CAP.

v4: Tom Stellard
  - TGSI targets can ignore this CAP.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:27:53 -04:00
Tom Stellard
1d118a2a76 gallium: Add PIPE_SHADER_IR_LLVM to enum pipe_shader_ir v2
v2:
  - s/PIPE_SHADER_IR_LLVM_R600/PIPE_SHADER_IR_LLVM/

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Tom Stellard
d85e512374 configure.ac: Add HAVE_OPENCL AM_CONDITIONAL v2
v2:
  - Drop HAVE_OPENCL variable for non-automake builds
  - s/HAVE_OPENCL/HAVE_GALLIUM_COMPUTE

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Brian Paul
091a61a8d5 scons: generate the glapitable.h file too 2012-06-01 08:27:21 -06:00
Brian Paul
8009fca501 svga: fix saturated TEX instructions
TEX instructions can't do saturation.  Do the TEX into a temp reg w/out
saturation, then do a MOV_SAT.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-31 12:54:04 -06:00
Brian Paul
dff36e900c scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
2012-05-31 09:40:35 -06:00
Brian Paul
185ed21058 draw: simplify index buffer specification
Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with
draw_set_indexes() which simply takes a pointer and an index size.
2012-05-31 09:40:35 -06:00
Kenneth Graunke
151bf6e6cf glsl/tests: Plumb $(PYTHON2) and $(PYTHON_FLAGS) into optimization-test.
Some distributions (like Arch Linux) make /usr/bin/python Python 3,
rather than Python 2.  Since compare_ir uses /usr/bin/env python,
such systems will fail to run optimization-test, causing 'make check' to
always fail.

Automake's TESTS_ENVIRONMENT variable provides a mechanism to run
programs or set environment variables in the test environment.
Ideally, I think we would want to use AM_TESTS_ENVIRONMENT, since
TESTS_ENVIRONMENT is supposed to be user-overridable.  However, it isn't
supported using the default/serial test runner.

Fixes 'make check' on Arch Linux and Gentoo.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
a44ccdc876 ralloc: Add some basic unit tests.
I started writing unit tests for a new piece of code, and discovered
they all failed due to a bug in ralloc.  Clearly it needs a test suite.

v2: Rename to 'ralloc-test' and fix copyright date.  (idr review)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
1559b2e2d7 ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.
If an object is allocated out of the NULL context, info->parent will be
NULL.  Using the PTR_FROM_HEADER macro would be incorrect: it would say
that ralloc_parent(ralloc_context(NULL)) == sizeof(ralloc_header).

Fixes the new "null_parent" unit test.

NOTE: This is a candidate for the 7.9, 7.10, 7.11, and 8.0 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:40 -07:00
Kenneth Graunke
2224fb6047 automake: Check for 'indent' and fall back to 'cat' if not found.
The glapi generator code uses indent to produce more readable code.
However, we don't want to make GNU indent a hard build dependency; check
for it in configure.ac and fall back to 'cat' if it's not available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50484
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
2012-05-30 13:39:30 -07:00
Oliver McFadden
ff3eef1aff mesa: don't compile integer clear shaders for unsupported APIs
Discovered while running the Khronos conformance test suite and
receiving "implementation error: meta program compile failed."

This bug was recently introduced by the i965 clear patch set and would
only be detected while using the ES2 API and only on gen6+ hardware.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 15:20:34 +03:00
Paul Berry
47b64c9290 i965/blorp: Implement destination clipping and scissoring
This patch implements clipping and scissoring of the destination rect
for blits that use the blorp engine (e.g. MSAA blits).
2012-05-29 15:35:35 -07:00
Eric Anholt
6a15790632 mesa: Clean up some dricore-related detritus in the old Makefile.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:51 -07:00
Eric Anholt
f9d1562f35 automake: Convert dricore building to automake.
This is performed in a subdirectory to avoid needing to convert all of
src/mesa/Makefile in one go.

I can now cherry-pick a commit containing glapi XML changes, do "(cd
src/mapi/glapi/gen && make) && make", and get a working driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:48 -07:00
Eric Anholt
e86c40a84d automake: Add a prefix variable to the common sources lists.
In order to do the minimal change for libdricore conversion to
automake, I need to put its Makefile.am in a subdirectory.  Automake
gets whiny/broken if you use GNU make features like "addprefix" or
"$(FILES:%=../%)" to munge your *_SOURCES.  So, use a plain old
variable to be able to substitute in that "../"

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:45 -07:00
Eric Anholt
7d7fe1b037 automake: Rename variables in sources.mak to be automake compatible.
*_SOURCES is reserved for files lists for particular automake targets.
 Also, "-" in the variable names is not allowed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:42 -07:00
Eric Anholt
b284d4773b mesa: Remove generated source files during make clean.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:40 -07:00
Eric Anholt
79273b1a7a glapi: Enable silent rules for generation when used from automake.
This variable won't be set when called from non-automake makefiles,
but it cleans up shared-glapi's output.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:37 -07:00
Eric Anholt
559d592448 shared-glapi: Don't forget to clean our built file.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:33 -07:00
Eric Anholt
26eaee3245 mesa: Restore installing of libGL for non-dri builds.
Reported-by: Sven Joachim <svenjoac@gmx.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:30 -07:00
Eric Anholt
0ce0f7c0c8 mesa: Remove the generated glapi from source control, and just build it.
Mesa already always depends on python to build.  The checked in
changes are not reviewed (because any trivial change rewrites the
world).  We also have been pushing commits between xml change and
regen where at-build-time xml-generated code disagrees with committed
xml-generated code.  And worst of all, sometimes we ("I") check in
*stale* xml-generated code.

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-29 11:51:57 -07:00
Kurt Roeckx
f92b2e5e90 i830: Fix crash for GL_STENCIL_TEST in i830Enable()
commit 87f12bb2d9 tried to fix rb->mt
being NULL, but change this case wrong.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 11:33:02 -07:00
Marcin Slusarz
8924133627 nv50: hook up forgotten short constant buffer upload method
Fixes crash in xorg st.
2012-05-29 20:24:45 +02:00
Tom Stellard
83169900fb radeon/llvm: Update and fix some comments 2012-05-29 11:59:01 -04:00
Tom Stellard
89ece086bc radeonsi: Remove use.sgpr* intrinsics, use load instructions instead
We now model loading uses sgpr values with LLVM IR load instructions that
use the USER_SGPR address space.

The definition of the sgpr parameter to the use_sgpr() helper function
in radeonsi_shader.c has changed so that you can pass raw sgpr values
rather than having to divide the sgpr value you want to use by the dword
width of the type you want to load.
2012-05-29 11:55:53 -04:00
Tom Stellard
467f51613e radeonsi: Handle TGSI CONST registers
We now emit LLVM load instructions for TGSI CONST register reads,
which are lowered in the backend to S_LOAD_DWORD* instructions.
2012-05-29 11:55:52 -04:00
Tom Stellard
32b83e0366 radeon/llvm: Remove AMDILIntrinsicInfo::GetDeclaration fuction body
This function was causing compile errors in the tablegen'd code for
some intrinsic definitions.  I don't think we really need this function,
so I'm removing the function body just as a temporary solution.  I'll
look into removing the entire AMDILIntrinsicInfo class later.
2012-05-29 11:55:52 -04:00
Tom Stellard
49fb99bd13 radeon/llvm: Remove AMDILTargetMachine 2012-05-29 11:55:52 -04:00
Christoph Bumiller
94a25b216b nouveau: unreference fences on resource destruction 2012-05-29 17:00:20 +02:00
Christoph Bumiller
1a21e36b68 nvc0: optimize blend cso by checking which by-RT data actually differs
Can save about 200 bytes of command buffer space.
2012-05-29 17:00:18 +02:00
Christoph Bumiller
f09ee76c98 nvc0: don't upload UCPs if the shader doesn't use them 2012-05-29 17:00:15 +02:00
Christoph Bumiller
79eed0d224 nvc0/ir: allow 64-bit constant loads on nve4
Looks like only 128-bit access doesn't work.
2012-05-29 17:00:10 +02:00
Christoph Bumiller
40c224a573 nvc0/ir: fix texture barrier insertion to prevent WAW hazards
Fixes, for instance, object highlighting in Diablo 3 (wine).
2012-05-29 15:01:41 +02:00
Christoph Bumiller
0d818cdacc nvc0/ir: TEX doesn't support JOIN modifier either 2012-05-29 15:01:41 +02:00
Christoph Bumiller
f80c2874ec gallium: add st_api feature mask to prevent advertising MS visuals
v2: use a define for the maximum sample count
v3: also test odd sample counts (r300 supports MS3)

While multisample renderbuffers are supported by mesa, MS visuals
are not, so we need a way to tell dri/st not to advertise them even
if the gallium driver does support multisampled surfaces.

Otherwise applications selecting these non-functional visuals would
run into trouble ...

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-29 15:01:41 +02:00
Roy Spliet
6404095fba nv30: Fix generic passing to fragment program in NV34. 2012-05-25 22:42:54 +02:00
Christoph Bumiller
384ef28cb3 nv30: handle user index buffers 2012-05-25 22:42:54 +02:00
Tom Stellard
704eac0916 radeon/llvm: Use a custom inserter for MASK_WRITE 2012-05-25 15:40:59 -04:00
Tom Stellard
4863477e22 radeon/llvm: Use tablegen pattern to lower bitconvert 2012-05-25 15:40:59 -04:00
Tom Stellard
667cdba211 radeon/llvm: Use a custom inserter to lower FNEG 2012-05-25 15:40:58 -04:00
Tom Stellard
d784bc7740 radeon/llvm: Use a custom inserter to lower CLAMP 2012-05-25 15:40:58 -04:00
Tom Stellard
17f8528923 radeon/llvm: Use a custom inserter to lower FABS 2012-05-25 15:40:58 -04:00
Kai Wasserbäch
2df2c31087 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50318

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2012-05-25 20:41:01 +02:00
Brian Paul
1609efb418 draw: fix primitive restart bug by using the index buffer offset
The code which scans the index buffer for restart indexes wasn't adding
the index buffer offset so we were always starting at offset=0.  The
offset is usually zero so it wasn't noticed before.

Fixes a failure in the piglit primitive-restart test when testing
vertex data + index data in a single VBO.

NOTE: This is a candidate for the 8.0 branch.
2012-05-25 10:02:22 -06:00
Brian Paul
93ea5cd80b svga: remove the special zero-stride vertex array code
This code actually hasn't been needed for some time now.  We can just
treat a zero-stride vertex array like any other non-zero-stride array.
2012-05-25 10:02:22 -06:00
Brian Paul
dcb4ec5ae1 gallium/docs: beef up the docs related to color clamping
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-25 10:02:22 -06:00
Brian Paul
9c85687439 util: add GALLIUM_LOG_FILE option for logging output to a file
Useful for logging different runs to files and diffing, etc.
2012-05-25 10:02:21 -06:00
Paul Berry
ab014adaed i965/msaa: Enable 4x MSAA on Gen7.
Basic 4x MSAA support now works on Gen7.  This patch enables it.

As with Gen6, MSAA support is still fairly preliminary.  In
particular, the following are not yet supported:
- 8x oversampling (Gen7 has hardware support for this, but we do not
  yet expose it).
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centrold interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
4725ba03ca i965/msaa: Implement manual blending operation for Gen7.
On Gen6, the blending necessary to blit an MSAA surface to a non-MSAA
surface could be accomplished with a single texturing operation.  On
Gen7, the WM program must fetch each sample and blend them together
manually.  From the Bspec (Shared Functions/Messages/Initiating
Message/Message Types/sample):

    [DevIVB+]:Number of Multisamples on the associated surface must be
    MULTISAMPLECOUNT_1.

This patch implements the manual blend operation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
8b1f467cce i965/msaa: Modify blorp code to account for Gen7 MSAA layouts.
Since blorp uses color textures and render targets to do all its work
(even when blitting stencil and depth data), it always has to
configure the Gen7 GPU to use the new "sliced" MSAA layout.  However,
when blitting stencil or depth data, the actual MSAA layout is
interleaved (as in Gen6).  Therefore, blorp has to do extra coordinate
transformation work to account for the interleaving manually.

This patch causes blorp to perform the necessary extra coordinate
transformations.

It also modifies the blorp SURFACE_STATE setup code for Gen7, so that
it does not try to correct the surface width and height to account for
MSAA, since "sliced" MSAA layout doesn't affect the surface width or
height.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
31f3dfd59b i965/msaa: Validate Gen7 surface state constraints.
When a Gen7 SURFACE_STATE is configured for MSAA, a number of
additional constaints come in to play.  This patch adds a function
gen7_check_surface_setup() which verifies that all of those
constraints are met.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
455ac56272 i965/msaa: Properly handle sliced layout for Gen7.
Starting in Gen7, there are two possible layouts for MSAA surfaces:

- Interleaved, in which additional samples are accommodated by scaling
  up the width and height of the surface.  This is the only layout
  available in Gen6.  On Gen7 it is used for depth and stencil
  surfaces only.

- Sliced, in which the surface is stored as a 2D array, with array
  slice n containing all pixel data for sample n.  On Gen7 this layout
  is used for color surfaces.

The "Sliced" layout has an additional requirement: it must be used in
ARYSPC_LOD0 mode, which means that the surface doesn't leave any extra
room between array slices for miplevels other than 0.

This patch modifies the surface allocation functions to use the
correct layout when allocating MSAA surfaces in Gen7, and to set the
array offsets properly when using ARYSPC_LOD0 mode.  It also modifies
the code that populates SURFACE_STATE structures to ensure that
ARYSPC_LOD0 mode is selected in the appropriate circumstances.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
0e11b2c5af i965/msaa: Add defines for Gen7.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
b08545199a i965/blorp: Enable blorp blits on Gen7.
Gen7 support for blorp (blits using the render bath) now works for
non-MSAA purposes.  This patch enables it.

Since blorp operations re-use the logic for HiZ ops, this required
adding a case to the switch statement in gen7_blorp_emit_wm_config(),
to allow for the case where no HiZ op is being performed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
1c73c705fa i965/blorp: Implement proper texel fetch messages for Gen7.
On Gen6, texel fetch is always accomplished using the SAMPLE_LD
message, which accepts arguments (u, v, r, lod, si).  On Gen7, there
are two* texel fetch messages: SAMPLE_LD for non-MSAA surfaces, taking
arguments (u, lod, v), and SAMPLE_LD2DSS for MSAA surfaces, taking
arguments (si, u, v).

*Technically, there are other texel fetch messages, but they are used
for "compressed" MSAA surfaces, which we don't yet support.

This patch adds the proper message types and argument orderings for
Gen7.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f2cdfa4c85 i965/blorp: Use 16 pixel dispatch on Gen7.
Gen7 hardware requires us to enable at least one WM dispatch mode,
even if there is no program being dispatched to.  When this code was
only used for HiZ operations (which don't use a WM program), we used
32-pixel dispatch, because it didn't matter.  But blit programs are
compiled for 16-pixel dispatch.  So just enable 16-wide dispatch
unconditionally.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Enable 16-wide dispatch unconditionally rather than add the
unnecessary complication of using 32-wide dispatch when there is no WM
program.
2012-05-25 08:45:11 -07:00
Paul Berry
f7df7917e0 i965/blorp: Allocate space for push constants on Gen7.
On Gen7, push constants for shader programs are stored in the URB, so
blorp code needs to set aside space for them.  This was previously
unnecessary because blorp code was based on HiZ operations, which
don't require any shaders.

This patch adds a call from gen7_blorp_exec() to
gen7_allocate_push_constants(), to ensure that push constants are
assigned the correct location in the URB.  It also extracts a new
function gen7_emit_urb_state() from gen7_upload_urb(), which is
re-used by gen7_blorp_emit_urb_config() to ensure that the URB regions
used by all the pipeline stages leave room for the push constants.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
de9752a4e5 i965/blorp: Set the dynamic state upper bound.
We know from previous bug fixes (commits
c25e5300cb and
b2ace06cbb) that texture border color
doesn't work if the dynamic state upper bound is set to 0.  Although
the blorp engine doesn't make use of texture borders, it seems like we
ought to err on the safe side and set this value properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f77959b2c9 i965/blorp: Factor gen6_blorp_emit_batch_head into separate functions.
This patch separates out the portions of gen6_blorp_emit_batch_head()
that emit 3DSTATE_MULTISAMPLE, 3DSTATE_SAMPLE_MASK, and
STATE_BASE_ADDRESS.  This paves the way for making the blorp code work
on Gen7, where additional command packets
(3DSTATE_PUSH_CONSTANT_ALLOC_VS and 3DSTATE_PUSH_CONSTANT_ALLOC_PS)
need to be emitted before 3DSTATE_MULTISAMPLE.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
34a5f12e35 i965/blorp: Use MSDISPMODE_PERSAMPLE rendering when necessary
This patch modifies the "blorp" WM program so that it can be run in
MSDISPMODE_PERSAMPLE (which means that every single sample of a
multisampled render target is dispatched to the WM program, not just
every pixel).

Previously we were using the ugly hack of configuring multisampled
destination surfaces as single-sampled, and generating sample indices
other than zero by swizzling the pixel coordinates in the WM program.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Paul Berry
233c207e9e i965/blorp: Emit sample index in SAMPLE_LD message when necessary
This patch modifies the function brw_blorp_blit_program::texel_fetch()
to emit the SI (sample index) argument to the SAMPLE_LD message when
reading from a sample index other than zero.

Previously we were using the ugly hack of configuring multisampled
source surfaces as single-sampled, and accessing sample indices other
than zero by swizzling the texture coordinates in the WM program.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
665dc82bdc i965/blorp: Generalize sampling code in preparation for Gen7
This patch generalizes the function
brw_blorp_blit_program::texture_lookup() so that it prepares the
arguments to the sampler message based on a caller-provided array
rather than assuming the argument order is always (u, v).

This paves the way for the messages we will need to use in Gen7, which
use argument orders (u, lod, v) and (si, u, v) (si=sample index).

It will also will allow us to read from arbitrary sample indices on
Gen6, by supplying the arguments (u, v, r, lod, si) to the SAMPLE_LD
message instead of just (u, v).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
52fcc36f11 i965/msaa: Expand odd-sized MSAA surfaces to account for interleaving pattern.
Gen6 MSAA buffers (and Gen7 MSAA depth/stencil buffers) interleave
MSAA samples in a complex pattern that repeats every 2x2 pixel block.
Therefore, when allocating an MSAA buffer, we need to make sure to
allocate an integer number of 2x2 blocks; if we don't, then some of
the samples in the last row and column will be cut off.

Fixes piglit tests "EXT_framebuffer_multisample/unaligned-blit {2,4}
color msaa" on i965/Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Thomas Gstädtner
93594f38be gallium/targets: pass ldflags parameter to MKLIB
Without passing the -ldflags parameter before $(LDFLAGS) in some cases
flags will be passed to MKLIB which it does not understand.
This might be -m64, -m32 or similar.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Thomas Gstädtner <thomas@gstaedtner.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-25 09:36:24 -06:00
Vadim Girlin
a1a0974401 Revert "r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen"
This reverts commit 60bf0f05b4.

It seems round_mode behaves differently in some cases depending on  the
instruction/slot. Reverting it for now.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:28:08 +04:00
Vadim Girlin
1c5c4243c9 radeon/llvm: add FLT_TO_UINT, UINT_TO_FLT instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:46 +04:00
Vadim Girlin
5a1b59b4e6 radeon/llvm: prepare to revert the round mode state to default
Use TRUNC before FLT_TO_INT on evergreen/cayman.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:33 +04:00
Vadim Girlin
7fa7c608cb radeon/llvm: fix sampler index in llvm_emit_tex
Sampler index isn't a second source operand for some tgsi texture
instructions. Let's assume it's always the last.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:23 +04:00
Vadim Girlin
029776753b radeon/llvm: fix opcode for RECIP_UINT_r600
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50312

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:23:06 +04:00
Vadim Girlin
6806f81fb4 radeon/llvm/loader: convert hardcoded gpu name to option
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:38 +04:00
Vadim Girlin
482041a538 r600g: add RECIP_INT, PRED_SETE_INT to r600_bytecode_get_num_operands
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50315

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:12 +04:00
Vinson Lee
35f302d97e i915g: Check for geometry shader earlier in i915_set_constant_buffer.
Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:50:07 -07:00
Vinson Lee
5cf693266f scons: Fix SCons build infrastructure for FreeBSD.
This patch gets the FreeBSD SCons build working again. The build still
fails though.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:49:40 -07:00
Tom Stellard
33e7db9a1d radeon/llvm: Lower UDIV using the Selection DAG 2012-05-24 14:12:32 -04:00
Tom Stellard
d088da917b radeon/llvm: Remove auto-generated AMDIL->ISA conversion code 2012-05-24 14:12:32 -04:00
Tom Stellard
662ccbfc21 radeon/llvm: Remove AMDIL instructions MULHI, SMUL 2012-05-24 14:12:32 -04:00
Tom Stellard
177b420283 radeon/llvm: Remove AMDIL bitshift instructions (SHL, SHR, USHR) 2012-05-24 14:12:32 -04:00
Tom Stellard
9d41a401dc radeon/llvm: Remove AMDIL FTOI and ITOF instructions 2012-05-24 14:12:32 -04:00
Tom Stellard
a8ba697c1e radeon/llvm: Remove AMDIL EXP* instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
dd9927eb36 radeon/llvm: Remove AMDIL ADD instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
1404e6b9fc radeon/llvm: Remove AMDIL binary instrutions (OR, AND, XOR, NOT) 2012-05-24 14:12:31 -04:00
Tom Stellard
3059c075a7 radeon/llvm: Remove AMDILMachinePeephole pass 2012-05-24 14:12:31 -04:00
Tom Stellard
e9d8901a80 radeon/llvm: Remove AMDIL CMP instructions and associated lowering code 2012-05-24 14:12:31 -04:00
Tom Stellard
ea00632fe0 radeon/llvm: Remove AMDIL ROUND_NEAREST instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
0bfa3b3e96 radeon/llvm: Remove AMDIL ROUND_POSINF instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
d4984f3463 radeon/llvm: Add custom SDNode for FRACT 2012-05-24 14:12:30 -04:00
Tom Stellard
5523502ff9 radeon/llvm: Use -1 as true value for SET* integer instructions 2012-05-24 14:12:30 -04:00
Tom Stellard
86dfae1103 radeon/llvm: Handle SETGE_INT, SETGE_UINT, and SETGT_UINT opcodes
Support for these was inadvertently dropped in commit
cee23ab246
2012-05-24 14:12:30 -04:00
Tom Stellard
cc7a6d2691 radeon/llvm: Avoid error with SI in EmitInstrWithCustomInserter()
We need to return immediately after inserting instructions that require
S_WAITCNT so that the parent class' custom inserter won't try to insert
them again.
2012-05-24 14:12:30 -04:00
Vinson Lee
0f6a3a7de3 tgsi: Initialize Padding struct fields.
Fix uninitialized scalar variable defects report by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 21:58:37 -07:00
Kenneth Graunke
88128516d4 i965: Gut the separate OpenGL ES extension enabling.
We should just set the bits of functionality that we support; the
GL/ES1/ES2 flags in extensions.c will take care of advertising the
appropriate extensions for the current API.

This enables the GL_EXT_texture_compression_dxt1 extension on ES1/ES2
when libtxc_dxtn is installed or the force_s3tc driconf option is set.
The main extension code set this up properly, but the ES-specific code
failed to do so.

Otherwise, the extension strings reported by es1_info, es2_info, and
glxinfo all remain the same.

This patch manually disables the ARB_framebuffer_object bit on ES
to preserve the behavior of 1c0f5d8324.

v2: Rebase, fix the i915 Makefile, and unconditionally set the
    OES_draw_texture bit as core Mesa will only apply it to ES1 now.

Tested-by: Daniel Charles <daniel.charles@intel.com> [v1]
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 17:17:54 -07:00
Kenneth Graunke
d4667516b6 mesa: Remove the OES_draw_texture extension from ES2.
This extension appears to be written against ES 1.0.
In ES 2.0, you really want to be using FBOs instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 17:03:35 -07:00
Jordan Justen
dc50145253 i965: use cut index to handle primitive restart when possible
If the primitive restart index and the primitive type can
be handled by the cut index feature, then use the hardware
to handle the primitive restart feature.

The VBO module's software handling of primitive restart is
used as a fall back.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
f9389fbfb2 i965: add flag to enable cut_index
When brw->prim_restart.enable_cut_index is set, the cut index
will be enabled when uploading index_buffer commands.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
df7d1323de i965: create code path to handle primitive restart in hardware
For newer hardware we disable the VBO module's software handling
of primitive restart. We now handle primitive restarts in
brw_handle_primitive_restart.

The initial version of brw_handle_primitive_restart simply calls
vbo_sw_primitive_restart, and therefore still uses the VBO
module software primitive restart support.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Paul Berry
9f6932cb83 glsl/tests: Add .gitignore for uniform initialization unit test.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 14:24:33 -07:00
Paul Berry
aa173e16a0 glsl/constant propagation: kill whole var if LHS involves array indexing.
When considering which components of a variable were killed by an
assignment, constant propagation would previously just use the write
mask of the assignment.  This worked if the LHS of the assignment was
simple, e.g.:

v.xy = ...; // (assign (xy) (var_ref v) ...)

But it did the wrong thing if the LHS of the assignment involved an
array indexing operator, since in this case the write mask is always
(x):

v[i] = ...; // (assign (x) (deref_array (var_ref v) (var_ref i)) ...)

In general, we can't predict which vector component will be selected
by array indexing, so the only safe thing to do in this case is to
kill the entire variable.

Fixes piglit tests {fs,vs}-vector-indexing-kills-all-channels.shader_test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-23 14:21:48 -07:00
Ian Romanick
b45052b3f7 glsl/tests: Add test for uniform initialization by the linker
v2: Put unit tests in src/glsl/tests rather than tests/glsl.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
49da2590c2 mesa: Use initializers to configure samplers
Now that the linker handles initializers of samplers just like any
other uniform, a bunch of this annoying code is unnecessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
75dac69262 ir_to_mesa: Don't set initial uniform values again
This work is now done by the linker, so we don't need to keep doing it
here.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
c343b980d6 ir_to_mesa: Propagate initial values in _mesa_associate_uniform_storage
The linker may have set initial values for uniforms.  Propagate these
values to the driver's backing storage when it is first associated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
76027f5b5c glsl: Propagate sampler uniform initializers to gl_shader_program::SamplerUnits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:07 -07:00
Ian Romanick
b610881317 glsl: Initialize samplers to 0, propagate sampler values to the gl_program
The spec requires that samplers be initialized to 0.  Since this
differs from the 1-to-1 mapping of samplers to texture units assumed
by ARB assembly shaders (and the gl_program structure), be sure to
propagate this date from the gl_shader_program to the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
CC: Vadim Girlin <vadimgirlin@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
2012-05-23 11:42:07 -07:00
Ian Romanick
a2e623054b glsl: Set initial values for uniforms in the linker
v2: Fix handling of arrays-of-structure.  Thanks to Eric Anholt for
pointing this out.

v3: Minor comment change based on feedback from Ken.

Fixes piglit glsl-1.20/execution/uniform-initializer/fs-structure-array
and glsl-1.20/execution/uniform-initializer/vs-structure-array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:41:49 -07:00
Eric Anholt
29362875f2 i965/gen6+: Add support for GL_ARB_blend_func_extended.
v2: Add support for gen6, and don't turn it on if blending is
    disabled. (fixes GPU hang), and note it in docs/GL3.txt

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 10:46:15 -07:00
Eric Anholt
175ad8050e mesa: Keep a computed value for dual source blend func with each buffer.
The i965 driver needed this as well for hardware setup, so instead of
duplicating the logic, just save it off.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-23 10:45:43 -07:00
Eric Anholt
68216f3581 i965/gen6+: Add support for fast depth clears.
Improves citybench high-res performance 3.0% +- 0.4%, n=10.  Improves
Lightsmark 1024x768 performance 0.74% +/- 0.20% (n=78).  No
significant difference on openarena (n=5, didn't fast clear) or nexuiz
(n=3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:40:11 -07:00
Eric Anholt
5b248e5982 i965/gen6: Add CC viewport state setup to blorp code.
While it doesn't have the same warning in the simulator as in gen7,
let's emit it out of paranoia.  We wouldn't want our resolves of some
previous clear to get clamped to some current clamping value.

Suggested-by: pretty much everyone
2012-05-23 10:39:45 -07:00
Eric Anholt
39a91be20d i965/gen7: Add CC viewport setup to blorp code.
When doing fast clears, a fulsim warning said that the batch was being
emitted without the viewport set up.  While the fast clear pass I was
looking at doesn't use the clear value, the later resolves which also
didn't set up the vieport would trigger the same.  It's not obvious
from the error message whether it meant "fast clear value gets clamped
to something you haven't defined" or "fast clear value doesn't get
clamped, and I saw it was out of the current (uninitialized) range,
and you probably wanted it clamped to that (uninitialized) range".  Be
paranoid and assume the first case.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
54308f78a2 i965: Drop a layer of indirection in doing HiZ resolves.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
072634da4a i965: Replace intel_need_resolve with the hiz ops it maps to.
Having this enum separate caused us to need a bunch of helper
functions to translate to the op to be executed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
5b226ad603 i965: Add an interface for doing hiz ops from C code.
This required moving gen6_hiz_op, and I put it in intel_resolve_map.h
for the next commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
7da9795070 i965: Rename the clear function for this driver.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
3e1656567c i965: Simplify the remaining clear logic by relying on the meta clear.
The GLSL clear path doesn't need any buffer presence checks, since
those are already handled in the normal drawing path code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
7c3e88f1fc i965: Switch blit color clears to tri clears on gen4/5.
Our understanding is that the 3D engine is supposed to be faster
anyway.  We used to have more overhead in our tri clear path than we
do today, which would have led to this choice.  But given that we
almost always see a depth clear along with a color clear, the path was
hardly exercised anyway.

Also, the color mask logic was broken in the presence of
GL_EXT_draw_buffers2's per-buffer colormask.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
fa15b0f3f0 i965: Remove dead logic for non-tri depth/stencil clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
a3967ff441 i965: We always have GLSL, so always use it for tri clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
03c9044c2e i915: Drop gen4+ code from the forked clear code.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
11892ea986 intel: Fork the intel_clear.c file between i915 and i965.
This logic is wasted on i965 when we want to just always do GLSL tri
clears.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Vadim Girlin
c91b4edff9 st/mesa: set stObj->lastLevel in guess_and_alloc_texture
Fixes lockups/asserts with depthstencil-render-miplevels tests and r600g.
Should also fix https://bugs.freedesktop.org/show_bug.cgi?id=50033

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 06:07:00 +04:00
Paul Berry
ea8e854b2c i965: Completely annotate the batch bo when aub dumping.
Previously, when the environment variable INTEL_DEBUG=aub was set,
mesa would simply instruct DRM to start dumping data to an .aub file,
but we would not provide DRM with any information about the format of
the data in various buffers.  As a result, a lot of the data in the
generate .aub file would be unannotated, making further data analysis
difficult.

This patch causes the entire contents of each batch buffer to be
annotated using the data in brw->state_batch_list (which was
previously used only to annotate the output of INTEL_DEBUG=bat).  This
includes data that was allocated by brw_state_batch, such as binding
tables, surface and sampler states, depth/stencil state, and so on.

The new annotation mechanism requires DRM version 2.4.34.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-22 15:19:00 -07:00
Paul Berry
1b87a93983 intel: When AUB dumping, flush before emitting final bitmap command.
When we are generating an AUB dump, we make a final call to
aub_dump_bmp() as the context is being destroyed, to ensure that any
rendering performed before the application exits can be seen during a
simulation run.  However, we were doing this before flushing the batch
buffer; as a result simulation runs would not always see the effect of
all rendering commands.

This patch flushes the batch buffer just before making the final call
to aub_dump_bmp(), to ensure that all rendering is properly captured
in the final bitmap.
2012-05-22 15:19:00 -07:00
José Fonseca
7a75e7d6e8 llvmpipe: Fix alpha testing precision on rgba8 formats.
This is a long standing problem, that recently surfaced with the change
to enable perspective correct color interpolation.

A fix for all possible formats is left to the future.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-22 19:23:49 +01:00
Vinson Lee
e4fb332af1 scons: Do not build glx and egl on Cygwin.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-22 10:15:14 -07:00
Christoph Bumiller
89155ba71d nv30: check for NULL vertex buffers in prevalidate_vbufs 2012-05-22 15:22:10 +02:00
Christoph Bumiller
a054fd8268 nv50: make unaligned index buffer offsets work again
Messed up in ef7bb28129.
2012-05-22 12:50:12 +02:00
Christoph Bumiller
91fb5e0394 nvc0: don't set NEW_IDXBUF in nvc0_switch_pipe_context if none is bound 2012-05-22 12:45:19 +02:00
James Benton
8a933e36d1 llvmpipe: Added a error counter to lp_test_conv.
Useful for keeping track of progress when fixing errors!

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:53 +01:00
James Benton
383c1b649b llvmpipe: Changed known failures in lp_test_conv.
To comply with the recent fixes to lp_bld_conv.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:51 +01:00
James Benton
4203a0b034 llvmpipe: Added fixed point types tests to lp_test_conv.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:49 +01:00
James Benton
a3d4af0c00 gallivm: Fixed erroneous optimisation in lp_build_min/max.
Previously assumed normalised was 0 to 1, but it can be -1 to 1
if type is signed.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:47 +01:00
James Benton
fdeb0394cb gallivm: Compensate for lp_const_offset in lp_build_conv.
Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
Tested using lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:46 +01:00
James Benton
f89b1f4ba4 gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:44 +01:00
Brian Paul
c286278481 docs: add link to 8.0.3 release notes 2012-05-21 09:26:04 -06:00
Paul Seidler
a0dffe8701 tests: include mesa headers
else they will fail for fresh installs

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:42:19 -06:00
Lukas Rössler
6178b653c7 glu: fix two Clang warnings
This patch removes two Clang warnings in GLU:

The first one seems to be an actual bug in mapdesc.cc: Clang complains
that sizeof(dest) will return the size of REAL*[MAXCOORDS], instead of
the intended REAL[MAXCOORDS][MAXCOORDS]. The second one is just
cosmetic because Clang doesn't like extra parentheses.

NOTE: This is a candidate for the 8.0 branch

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:29:23 -06:00
Homer Hsing
ed9d1bef81 docs: fix a typo
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:07:20 -06:00
ojab
3d2bf91cc1 Filter out -Wcovered-switch-default from LLVM_CFLAGS
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 08:37:06 +01:00
Tom Stellard
cee23ab246 radeon/llvm: Handle selectcc DAG node
R600 can now select instructions from the selectcc DAG node, which is
typically lowered to one of the SET* instructions.
2012-05-20 16:27:31 -04:00
Brian Paul
239792fb22 st/mesa: use pipe_sampler_view_release() in st_destroy_context_priv()
Fixes another case of sampler views being created by one context,
shared by another, then deleted by the first, leaving a dangling
pipe context pointer.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c9cb9cf050 mesa: use F_TO_I() instead of IROUND()
Use it where performance matters more and the exact method of float->int
conversion/rounding isn't terribly important.  There should no net change
here since F_TO_I() is the new name of the old IROUND() function.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
699c1894ee mesa: reimplement IROUND(), add F_TO_I()
The different implementations of IROUND() behaved differently and in
the case of fistp, depended on the current x86 FPU rounding mode.
This caused some tests like piglit roundmode-pixelstore and
roundmode-getintegerv to fail on 32-bit x86 but pass on 64-bit x86.

Now IROUND() always rounds to the nearest integer (away from zero).
The new F_TO_I function converts a float to an int by whatever means
is fastest.  We'll use this where we're more concerned with performance
and not too worried to how the conversion is done.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
31d59c78f0 mesa: fix Z32_FLOAT -> uint conversion functions
The IROUND converted all arguments to 0 or 1.  That's not what we wanted.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c3991e1c57 st/mesa: remove unused pipe variable 2012-05-19 08:28:57 -06:00
Brian Paul
bd302f36c4 svga: whitespace, comments, formatting clean-ups 2012-05-19 08:28:57 -06:00
Brian Paul
6792969cbc st/mesa: added st_print_current_vertex_program(), for debugging 2012-05-19 08:28:56 -06:00
Brian Paul
2786343896 svga: return PIPE_OK instead of 0
And fix the emit_rss() function's return type.
2012-05-19 08:28:56 -06:00
Brian Paul
fc71e0b4a8 svga: fix zero-stride vertex array bug
For zero-stride vertex arrays, the svga driver copies the value into
the constant value and uses that value in the shader.  The recent
gallium-userbuf changes caused a regression in this.  An example
symptom was per-primitive glColor3f() calls getting ignored.

Where we copied the vertex value from the vertex buffer to the
constant buffer we neglected to take into account the
pipe_vertex_buffer::buffer_offset field.  Adding that value to the
source offset fixes the problem.  Actually, it looks like we should
have been doing this all along, but it never was an issue before for
some reason.
2012-05-19 08:28:56 -06:00
Brian Paul
0161691f35 mesa: add GLSL_REPORT_ERRORS debug flag
If the MESA_GLSL env var contains "errors", GLSL compilation and
link errors will be reported to stderr.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-19 08:28:56 -06:00
Brian Paul
1c333745f3 mesa: add some comments on shaderapi.c functions 2012-05-19 08:28:56 -06:00
Vinson Lee
315140969d mesa: Remove undefinition of _P symbol.
IRIX isn't used anymore.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-18 23:24:33 -07:00
Ian Romanick
0c6f4cd335 Import release notes for 8.0.3, add news item
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-18 16:27:17 -07:00
Jeremy Huddleston
27b821bc95 darwin: Address a build failure on Leopard and earlier OS versions
<https://trac.macports.org/ticket/34499>

Regression-from: 51691f0767
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-18 11:32:40 -07:00
Michel Dänzer
d59b2c4b53 radeonsi: Only honour point related rasterizer state when rendering points.
Avoids hangs when not rendering points.
2012-05-18 18:13:56 +02:00
Michel Dänzer
dd9d619459 radeonsi: Fix parameter cache offsets for fragment shader inputs. 2012-05-18 15:01:10 +02:00
Vinson Lee
e8a86d36f3 gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.
Fix uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-17 21:59:08 -07:00
Tom Stellard
c20e741799 radeon/llvm: Fix segfault while lowering lrp intrinsic 2012-05-17 20:42:16 -04:00
Tom Stellard
7e3cd8df18 radeon/llvm: Add DAG nodes for MIN instructions
Also, remove the AMDIL MIN* instruction defs.
2012-05-17 20:42:16 -04:00
José Fonseca
3f7a5ffac7 llvmpipe: Avoid adding floating point zero to flat inputs.
Which could clobber integer inputs, if the addition is not optimized away
(e.g., if optimizations are disabled for debugging purposes).
2012-05-18 01:03:13 +01:00
José Fonseca
00eb74b275 Fix fetching integer inputs. 2012-05-18 00:55:13 +01:00
Olivier Galibert
5d10d75727 llvmpipe: Implement TXQ.
Piglits test for fragment shaders pass, vertex shaders fail.  The
actual failure seems to be in the interpolators, and not the
textureSize query.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:27:28 +01:00
Olivier Galibert
1ec421823b llvmpipe: Don't mess with the provoking vertex when inverting a triangle.
Fixes a bunch of piglit tests related to flat interpolation of floats.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:07:18 +01:00
Tom Stellard
c6c8a05c50 radeon/llvm: Lower lrp intrinsic during ISel 2012-05-17 14:48:10 -04:00
Tom Stellard
ef8e66bc16 radeon/llvm: Remove AMDIL MAD instruction defs 2012-05-17 14:48:10 -04:00
Tom Stellard
d07473fcf4 radeon/llvm: Remove AMDIL MUL_IEEE* instructions 2012-05-17 14:48:10 -04:00
Tom Stellard
5187948bc2 r600g: Handle MUL_IEEE in r600_bytecode_get_num_operands 2012-05-17 14:48:09 -04:00
Tom Stellard
1fe70c6ae1 radeon/llvm: Expand fsub during ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
9916f2d2af radeon/llvm: Remove AMDIL floating-point ADD instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
91484de22d radeon/llvm: Remove AMDIL CMOVLOG* instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
9a020092ae radeon/llvm: Move lowering of ABS_i32 to ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
89b945591b radeon/llvm: Remove sub patterns from AMDILInstrPatterns.td 2012-05-17 14:48:09 -04:00
Tom Stellard
431bb79a41 radeon/llvm: Add custom SDNodes for MAX
We now lower the various intrinsics for max to SDNodes and then use
tablegen patterns to lower the SDNodes to instructions.
2012-05-17 14:48:09 -04:00
Jordan Justen
602913192d state_tracker: remove sw_primitive_restart from st_context
The VBO module now can handle primitive restart in software
if required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
eef193560e state_tracker: remove software handling of primitive restart
The VBO module now can handle primitive restart in software
if required. Therefore this support is no londer required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
f16b39f05c state_tracker: set PrimitiveRestartInSoftware if needed
If the PIPE_CAP_PRIMITIVE_RESTART screen param is not set, then enable
PrimitiveRestartInSoftware to enable software primitive restart
support in the VBO module.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
862667b6d9 vbo: use software primitive restart in the VBO module
When PrimitiveRestartInSoftware is set, the VBO module will handle
primitive restart scenarios before calling the vbo->draw_prims
drawing function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
fc22fde9d8 mesa: add PrimitiveRestartInSoftware to gl_context.Const
If set, then the VBO module will handle all primitive
restart scenarios before calling the driver draw_prims.

Software primitive restart support is disabled by default.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
bc8e0f5b0f vbo: add software primitive restart support
vbo_sw_primitive_restart implements primitive restart in software
by splitting primitive draws apart.

This is based on similar support in mesa/state_tracker/st_draw.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Eric Anholt
5a827d9a2b mesa: Check for framebuffer completeness before looking at the rb.
Otherwise, an incomplete framebuffer could have a NULL
_ColorReadBuffer and we'd deref that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
8b7ba92605 mesa: Fix assertion failure when a cube face is not present.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
aa5ec13775 glsl: Drop the extra NULL specifiction on ir_assignment constructors.
It's an implied argument, and I don't think being explicit about it
helps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
9c4e9ce051 glsl: Fix assertion failure on handling switch on uint expressions.
Fixes piglit glsl-1.30/execution/switch/fs-uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
bbbc7c7d56 glsl: Reject non-scalar switch expressions.
The comment quotes spec saying that only scalar integers are allowed,
but we only checked for integer.

Fixes piglit switch-expression-const-ivec2.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5d6ea16dfe glsl: Let the constructor figure out the types of switch-related expressions.
I noticed this while unindenting the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5462f3679a glsl: Fix indentation of switch code.
I managed to completely trash it in 22d81f15.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
aa02884c4f i965/vs: Fix up swizzle for dereference_array of matrices.
Fixes assertion failure in piglit:
vs-mat2-struct-assignment.shader_test
vs-mat2-array-assignment.shader_test

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
ef691885c9 mesa: Throw error on glGetActiveUniform inside Begin/End.
Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
05c200bac0 glsl: Improve the local dead code optimization to eliminate unused channels.
Total instructions: 261582 -> 261316
135/2147 programs affected (6.3%)
36752 -> 36486 instructions in affected programs (0.7% reduction)

This excludes a tropics shader that now gets 16-wide mode and throws
off the numbers.  5 shaders are hurt: two extra MOVs in 4 tropics
shaders it looks like because we don't split register names according
to independent webs, and one gstreamer shader where it looks like
try_rewrite_rhs_to_dst() is falling on its face.

This should also help avoid a regression in VSes from idr's ARB
programs to GLSL work.
2012-05-17 10:05:23 -07:00
Eric Anholt
f220f73b9c i965/fs: Do more register coalescing by using the interference graph.
By using the live variables code for determining interference, we can
handle coalescing in the presence of control flow, which the other
register coalescing path couldn't.

Total instructions: 207184 -> 206990
74/1246 programs affected (5.9%)
33993 -> 33799 instructions in affected programs (0.6% reduction)

There is a newerth shader that loses out, because of some extra MOVs
that now get their dead-code nature obscured by coalescing.  This
should be fixed by doing better at dead code elimination.
2012-05-17 10:05:23 -07:00
Christoph Bumiller
1befacc764 nouveau: place static buffers in VRAM if preferred by the driver 2012-05-17 15:24:58 +02:00
Christoph Bumiller
717f55d79d nv50/ir: fix reversed order of lane ops in quadops 2012-05-17 15:24:58 +02:00
Christoph Bumiller
e6caafd9d7 nv50,nvc0: handle user vertex buffers
And restructure VBO validation a little in the process.
2012-05-17 15:24:58 +02:00
Christoph Bumiller
ef7bb28129 nv50,nvc0: handle user index buffers 2012-05-17 15:24:58 +02:00
Christoph Bumiller
fcb2868210 nv50,nvc0: handle user constbufs without wrapping them in a resource 2012-05-17 15:24:58 +02:00
Christoph Bumiller
07323a80a2 st/mesa: set PIPE_BIND_STREAM_OUTPUT for TFB target in st_bufferobj_data 2012-05-17 15:24:58 +02:00
Jeremy Huddleston
d65bd195ec darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:30 -07:00
Jeremy Huddleston
a73a800b32 darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:29 -07:00
Michel Dänzer
7446a0407d gallium/radeon: Fix r300g tiling breakage.
Commit 11f056a3f0 broke the r300g build. Fix it
up, and reinstate some code which isn't needed by r600g and radeonsi but is
by r300g.
2012-05-16 23:52:19 +02:00
Francisco Jerez
03e3bc4ba5 gallium/auxiliary/pipe-loader: Fix usage of anonymous union.
Anonymous unions aren't part of the C99 standard.  Fixes build on GCC
versions older than 4.6.

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

Reported-by: Michael Lange <michaell@gmx.org>
2012-05-16 18:51:35 +02:00
Michel Dänzer
88a2e2388b radeonsi: Initial tiling support.
Largely based on the corresponding Evergreen support in r600g.
2012-05-16 18:30:50 +02:00
Michel Dänzer
11f056a3f0 r600g: Set tiling information for BOs being shared.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48747
2012-05-16 18:30:45 +02:00
Michel Dänzer
76d6a64de3 st/xorg: Better handling of EXA copies.
Always use the resource_copy_region hook. If a source and destination rectangle
overlap, copy to/from a temporary pixmap.
2012-05-16 18:30:39 +02:00
Michel Dänzer
0201c7d0af radeonsi: Bump MAX_DRAW_CS_DWORDS.
I missed this when updating si_context_draw().
2012-05-16 18:30:07 +02:00
José Fonseca
9af1ba565d draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.
Starting with LLVM 3.0, named structures are meant not for debugging, but
for recursive data types, previously also known as opaque types.

The recursive nature of these types leads to several memory management
difficulties.  Given that we don't actually need recursive types, avoid
them altogether.

This is an attempt to address fdo bugs 41791 and 44466. The issue is
somewhat random so there's no easy way to check how effective this is.
2012-05-16 15:00:23 +01:00
Olivier Galibert
982df3c1a5 llvmpipe: Color slot interpolation can be flat or perspective, not linear.
Fixes a bunch of glsl 1.10 interpolation piglit tests.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-16 13:12:04 +01:00
Homer Hsing
4050756804 configure.ac: Fix typos in the r600-llvm-compiler option
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 19:02:27 -04:00
José Fonseca
563489e5c9 gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.
Trivial.
2012-05-15 23:48:24 +01:00
Paul Berry
6335e0b073 i965/blorp: Move exec() out of brw_blorp_params.
No functional change.  This patch replaces the
brw_blorp_params::exec() method with a global function
brw_blorp_exec() that performs the operation described by the params
data structure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-15 15:15:26 -07:00
Paul Berry
19e9b24626 i965/gen6: Initial implementation of MSAA.
This patch enables MSAA for Gen6, by modifying intel_mipmap_tree to
understand multisampled buffers, adapting the rendering pipeline setup
to enable multisampled rendering, and adding multisample resolve
operations to brw_blorp_blit.cpp. Some preparation work is also
included for Gen7, but it is not yet enabled.

MSAA support is still fairly preliminary.  In particular, the
following are not yet supported:
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centroid interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Fixes piglit tests "EXT_framebuffer_multisample/accuracy" on
i965/Gen6.

v2:
- In intel_alloc_renderbuffer_storage(), quantize the requested number
  of samples to the next higher sample count supported by the
  hardware.  This ensures that a query of GL_SAMPLES will return the
  correct value.  It also ensures that MSAA is fully disabled on Gen7
  for now (since Gen7 MSAA support doesn't work yet).
- When reading from a non-MSAA surface, ensure that s_is_zero is true
  so that we won't try to read from a nonexistent sample.
2012-05-15 15:09:23 -07:00
Paul Berry
506d70be21 i965/gen6+: Add code to perform blits on the render path ("blorp").
This patch expands the "blorp" component to be able to perform blits
as well as HiZ resolves.  The new blitting code is located in
brw_blorp_blit.cpp.  This includes the necessary fragment shader code
to look up pixels in the source buffer (which is configured as a
texture) and output them to the destination buffer (which is
configured as the render target).

Most of the time the fragment shader code is simple and
straightforward, since it merely has to apply a coordinate offset,
read from the texture, and write to the render target.  However, in
the case of blitting stencil buffers, things are more complicated,
since the GPU stores stencil data using W tiling, and W tiling is not
supported for textures or render targets.  So, we set up the stencil
buffers as Y tiled, and emit fragment shader code that adjusts the
coordinates to account for the difference between W and Y tiling.
Furthermore, since a rectangular region in W tiling does not
necessarily correspond to a rectangular region in Y tiling, we widen
the rectangle primitive to the nearest tile boundary and have the
fragment shader "kill" any pixels that don't fall inside the actual
desired destination rectangle.

All of this is a necessary prerequisite for implementing MSAA, since
we'll need to be able to blit between multisample color, depth, and
stencil buffers and their non-multisampled counterparts, and none of
the existing blitting mechanisms support multisampling.

In addition, the new blitting code should speed up operations where we
previously fell back to software rasterization, such as blitting of
stencil buffers.  The current fallback sequence is: first we try to do
a blit using the hardware blitting engine.  If that fails we try to do
a blit using the render path.  If that also fails then we do the blit
using a meta-op (which may or may not fall back to software
rasterization).

Note that blitting using the render path has some limitations at the
moment: it only supports a few formats, and it doesn't support
clipping or scissoring.  These limitations will be addressed in future
patch series.

v2:
- Add the code that configures the WM program to
  gen{6,7}_emit_wm_config() and gen7_emit_ps_config() rather than
  creating separate ...enable() functions.
- Call intel_prepare_render before determining which miptrees we are
  blitting from/to, because it may cause miptrees to be reallocated.
- Allow the blit to mirror X and/or Y coordinates.
- Disable blorp blits on Gen7 for now, since they aren't working yet.
2012-05-15 15:09:23 -07:00
Paul Berry
36e3413418 i965: Expose surface setup internals for use by blits.
This patch exposes the functions brw_get_surface_tiling_bits and
gen7_set_surface_tiling, so that they can be re-used when setting up
surface states in gen6_blorp.cpp and gen7_blorp.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Paul Berry
586b389474 i965: split gen{6,7}_blorp_exec functions into manageable chunks.
This patch splits up the gen6_blorp_exec and gen7_blorp_exec
functions, which were very long, into simple component functions.
With a few exceptions, there is one function per state packet.

This will allow blit functionality to be added without significantly
complicating the code.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Rename the functions gen{6,7}_emit_wm_disable() to
gen{6,7}_emit_wm_config() (since the WM is not actually disabled
during HiZ ops; it simply doesn't have a program).  Also, on gen7,
split out the configration of 3DSTATE_PS to a separate function
gen7_emit_ps_config().
2012-05-15 15:09:22 -07:00
Paul Berry
2c5510b71b i965: Parameterize HiZ code to prepare for adding blitting.
This patch groups together the parameters used by the HiZ functions
into a new data structure, brw_hiz_resolve_params, rather than passing
each parameter individually between the HiZ functions.  This data
structure is a subclass of brw_blorp_params, which represents the
parameters of a general-purpose blit or resolve operation.  A future
patch will add another subclass for blits.

In addition, this patch generalizes the (width, height) parameters to
a full rect (x0, y0, x1, y1), since blitting operations will need to
be able to operate on arbitrary rectangles.  Also, it renames several
of the HiZ functions to reflect the expanded role they will serve.

v2: Rename brw_hiz_resolve_params to brw_hiz_op_params.  Move
gen{6,7}_blorp_exec() functions back into gen{6,7}_blorp.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Kenneth Graunke
610910a66d i965: Implement guardband clipping on Ivybridge.
Improves performance in Citybench:
- 320x240: 9.19589% +/- 0.557621%
- 1280x480: 3.90797% +/- 0.774429%

No apparent difference in OpenArena.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
Kenneth Graunke
85cd30406f i965: Implement guardband clipping on Sandybridge.
Improves performance in Citybench:
- 320x240:  19.8008% +/- 0.937818%
- 1280x480: 6.53856% +/- 0.859083%

No apparent difference in OpenArena nor Xonotic.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
José Fonseca
5994a641d8 llvmpipe: Add a test for lp_build_sgn.
Only floating point though, but better than nothing.
2012-05-15 22:39:25 +01:00
José Fonseca
9fb4eef6a1 gallivm: Fix lp_build_sgn for normalized/fixed-point integers.
These types got broken with the recent commit that fixed lp_build_sgn
for negative integers.
2012-05-15 22:39:24 +01:00
José Fonseca
c95cea50a9 gallivm: Fix lp_build_const_xxx for negative integers.
Do proper rounding.

Thanks to Olivier Galibert for investigating this.
2012-05-15 22:39:24 +01:00
Brian Paul
1459c18f45 svga: fix FBO / viewport bugs
When drawing to a FBO, the viewport wasn't always set correctly.  It
was fine in the usual case of the viewport dims matching the surface
dims but broken otherwise.  In particular, this was happening because
the viewport scale is negative for FBO rendering.

The piglit fbo-viewport test exercises this.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-15 14:56:54 -06:00
Vadim Girlin
4a8d47c264 radeon/llvm: add support for texture offsets, fix TEX_LD
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:20 +04:00
Vadim Girlin
fa5a963dd6 radeon/llvm: add SET_GRADIENTS*, fix SAMPLE_G
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:06 +04:00
Vadim Girlin
b655f78b25 radeon/llvm: increase const regs count
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:26 +04:00
Vadim Girlin
12a2374da3 radeon/llvm: use IntrNoMem property for intrinsics where possible
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:16 +04:00
Vadim Girlin
63a8595271 radeon/llvm: use correct intrinsic for CEIL
Should be round_posinf instead of round_neginf.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:06 +04:00
Vadim Girlin
0298238bdd radeon/llvm: improve ABS_i32 lowering
We can save one instruction by lowering it to:
  SUB_INT tmp, 0, src
  MAX_INT dst, src, tmp

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:53 +04:00
Vadim Girlin
76e4898ba3 radeon/llvm: fix BUILD_VECTOR lowering for replicated value
We expect that all elements will be assigned even if they are equal

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:38 +04:00
Vadim Girlin
4b8db65dbf radeon/llvm: add names for AMDGPU* passes
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:22 +04:00
Vadim Girlin
76ba7e2205 radeon/llvm: add generated files to .gitignore
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:02 +04:00
Paul Berry
821c34ecd9 Add .gitignore files for recently-added gallium projects
This patch adds .gitignore files to ignore the makefiles generated by
the gallium pipe loader and the clover OpenCL state tracker.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-15 07:39:05 -07:00
José Fonseca
e88f9b9546 glsl: Fix lower_discard_flow prototype mismatch.
Should fix MSVC link failure.
2012-05-15 12:27:15 +01:00
Eric Anholt
9e9ae280e2 Revert "i965/fs: Jump from discard statements to the end of the program when done."
This reverts commit 31866308fc.

Fixes piglit glsl-fs-discard-exit-3 and unigine tropics rendering.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:53 -07:00
Eric Anholt
3de1395fa5 glsl: Implement the GLSL 1.30+ discard control flow rule in GLSL IR.
Previously, I tried implementing this in the i965 driver, but did so
in a way that violated the intent of the spec, and broke Tropics.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:51 -07:00
Eric Anholt
e21b9f1f19 glsl: Remove the opt_discard_simplification pass.
This conflicts with the GLSL 1.30+ rules for derivatives after a
discard has occurred.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:44 -07:00
Eric Anholt
f42cdc7984 i965/fs: Remove the requirement of no dead code for interference checks.
This will be convenient when I want to comment out optimization code
to see the raw program being optimized, but more importantly will let
the interference check be used during optimization.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
d7787adda8 i965/fs: Add support for copy propagation.
We could do more by handling abs/negate and non-GRF sources, but this is
a good start.  Improves tropics performance 0.30% +/- .17% (n=43).

shader-db results:
Total instructions: 208032 -> 207184
60/1246 programs affected (4.8%)
23286 -> 22438 instructions in affected programs (3.6% reduction)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
f7a71e2570 i965/fs: When doing no work for live interval calculation, do no allocation.
When I had a bug causing the backend to never finish optimizing, it
also sent me deep into swap.  This avoids extra memory allocation per
trip through optimization, and thus may reduce the peak memory
allocation of the driver even in the success case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:51:00 -07:00
Eric Anholt
206eca631b i965/gen7: Set tile_x/y to 0 in the no-stencil case.
Fixes compiler warnings.
2012-05-14 16:51:00 -07:00
Eric Anholt
1e188f2dae intel: Fix signed/unsigned comparison warnings. 2012-05-14 16:51:00 -07:00
Eric Anholt
1c1040dcf0 intel: Fix compile warning from 7b6424143d 2012-05-14 16:51:00 -07:00
Eric Anholt
cdca6e3c9f intel: Fix compiler warning from 3cd7bee48f 2012-05-14 16:51:00 -07:00
Kenneth Graunke
a4e9b5a768 i965/fs: Add a local common subexpression elimination pass.
Total instructions: 18210 -> 17836
49/163 programs affected (30.1%)
12888 -> 12514 instructions in affected programs (2.9% reduction)

This reduces Lightsmark's "Scale down filter" shader from 395
instructions to 283, a whopping 28%.  It also reduces register pressure
significantly: the SIMD8 program now uses 29 registers instead of 101,
giving us more than enough room for a SIMD16 program.

v2: Add && !inst->conditional_mod to the "skip some instructions" check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:13:55 -07:00
Kenneth Graunke
d1029f9988 i965/fs: Use a const reference in fs_reg::equals instead of a pointer.
This lets you omit some ampersands and is more idiomatic C++.  Using
const also marks the function as not altering either register (which
was obvious, but nice to enforce).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:12:46 -07:00
Oliver McFadden
bf78806133 mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:44 +03:00
Oliver McFadden
60e8a49440 mesa: GLES specifies restrictions on uniform matrix transpose.
GL_INVALID_VALUE is generated if transpose is not GL_FALSE.

http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:43 +03:00
Michel Dänzer
8969de7e98 radeonsi: Keep around copies of original sampler states.
Fixes crashes when restoring sampler states after blits.
2012-05-14 17:56:03 +02:00
Michel Dänzer
1deb2be2b7 radeonsi: Flesh out shader interpolation related code.
Handle perspective interpolation and ceontroid vs. center.
2012-05-14 17:56:03 +02:00
Michel Dänzer
de52a56a0e radeonsi: Add proper SI family names. 2012-05-14 17:56:02 +02:00
Michel Dänzer
23e4fe2a53 radeonsi: Separate states for samplers and sampler views.
And reset nregs on updates. Prevents eventual assertion failure.
2012-05-14 17:56:02 +02:00
Michel Dänzer
36abadd0db radeonsi: Fixups for drawing with an index buffer.
Mostly using the DRAW_INDEX_2 type 3 packet instead of DRAW_INDEX, which is
no longer supported on SI.
2012-05-14 17:56:02 +02:00
Vinson Lee
599140119e vl: Initialize pipe_vertex_buffer.user_buffer fields.
Fix uninitialized scalar variable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-14 08:44:16 -07:00
James Benton
24678700ed llvmpipe: Calculate fixed point coordinates for triangle setup earlier.
This allows us to calculate the triangle's area using fixed point,
previously it was cacluated in floating point space. It was possible
that a triangle which had negative area in floating point space had
a positive area in fixed point space.

Fixes fdo 40920.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 16:07:49 +01:00
Tom Stellard
ec201667bf radeon/llvm: Coding style fixes for R600CodeEmitter.cpp 2012-05-14 10:40:58 -04:00
Tom Stellard
224e187f98 radeon/llvm: Lower bitcast instructions to copies 2012-05-14 10:40:58 -04:00
Marek Olšák
ed9955dc29 radeonsi: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
05ea705c7c r600g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
b2d6386086 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap (EG) 2012-05-12 23:13:45 +02:00
Marek Olšák
b496136af8 gallium: remove user_buffer_create from the interface
Nothing uses it now.
2012-05-12 23:13:45 +02:00
Marek Olšák
1a840cc592 gallium/graw: stop using user_buffer_create
This is compile-tested.
2012-05-12 23:13:45 +02:00
Marek Olšák
685a28fd8a gallium/util: remove unused parameter nr_vertex_buffers in util_draw_max_index 2012-05-12 23:13:45 +02:00
Francisco Jerez
b70736fa82 clover: Fix build on i386. 2012-05-12 19:43:06 +02:00
Francisco Jerez
fcab4d4a34 clover: Check the total work-group size provided to clEnqueueNDRangeKernel. 2012-05-12 19:43:01 +02:00
Christoph Bumiller
5c9bccc97e clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK
This is not necessarily the product of MAX_BLOCK_SIZE[i].

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-12 19:33:48 +02:00
Francisco Jerez
ec848d2730 r600g: Handle compute caps. 2012-05-12 19:17:18 +02:00
Francisco Jerez
4065639310 r300g: Handle compute caps. 2012-05-12 19:17:13 +02:00
José Fonseca
f96540847e auxiliary/util: Ensure pipe_constant_buffer::user_buffer is initialized. 2012-05-12 17:23:52 +01:00
José Fonseca
7b49d4f05d scons: Fix missing gbm symbols in st/egl. 2012-05-12 17:10:32 +01:00
José Fonseca
96e73cc4ae targets/egl-static: Fix some missing symbols. 2012-05-12 17:10:32 +01:00
José Fonseca
fd687e06f0 trace: Fix pipe_context::clear dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
b275bed549 trace: Fix pipe_shader_state dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
e9efcd99d1 scons: Link r600_drm.so against libdrm-radeon 2012-05-12 17:10:31 +01:00
José Fonseca
9a23a69f45 trace: Match NULL context members. 2012-05-12 17:10:31 +01:00
Marek Olšák
7c799f8f6b gallium/docs: remove documentation of redefine_user_buffer 2012-05-12 13:09:19 +02:00
Michel Dänzer
74b9ef83cf radeonsi: Fixed point vertex formats aren't supported. 2012-05-12 12:27:10 +02:00
Michel Dänzer
24bc382010 radeonsi: Fixups for recent build infrastructure changes.
In particular for the pipe loader changes.
2012-05-12 12:12:21 +02:00
Dave Airlie
31a25dac98 r600g: setup COLOR1 for possible dual-src in the framebuffer bind
As pointed out by Marek, if we have only one cb, we may as well add this
single register write here rather than adding it in the draw loop.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-12 08:25:21 +01:00
Roy Spliet
e253ead78e nv30: Silence pipe_cap warnings
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:48 +10:00
Roy Spliet
897d235132 nv30/shader: SSG, LIT only requires one source register
Fixes crashing due to assertion error

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Ben Skeggs
6660041483 nouveau/vieux: finish != flush, how about we do that..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Marek Olšák
9d6b46b1cd r300g/swtcl: move vertex buffer updates into set_vertex_buffers 2012-05-12 00:50:53 +02:00
Marek Olšák
735d0d93a7 r300g/swtcl: move index buffer updates from swtcl_draw_vbo into set_index_buffer 2012-05-12 00:50:53 +02:00
Marek Olšák
21b012d3b0 r300g/swtcl: malloc vertex and index buffers (don't use radeon DRM to get them)
Vertex and index buffers are never used by hardware, only by Draw.
SWTCL chipsets usually have very little memory, so this might help
with stability and reliability.
2012-05-12 00:50:53 +02:00
Marek Olšák
8a963d122d r300g/swtcl: don't do stuff which is only for HWTCL 2012-05-12 00:50:52 +02:00
Marek Olšák
f808984f43 r300g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-12 00:50:52 +02:00
Marek Olšák
4fd60ad6da r300g: remove user_buffer_create 2012-05-12 00:50:52 +02:00
Marek Olšák
bdba35befa r300g: fix breakage after gallium-userbuf merge 2012-05-12 00:50:52 +02:00
Brian Paul
550de24c17 llvmpipe: add cast to silence warning 2012-05-11 16:16:11 -06:00
Andreas Betz
9d6e908f14 vega: fix 565 color unpacking bug
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-11 16:13:14 -06:00
Brian Paul
93bcf7825d mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags
Instead of having to hack the code to enable these debugging options,
set them through the MESA_DEBUG env var.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-11 16:13:14 -06:00
Brian Paul
014306578b mesa: implement DEBUG_ALWAYS_FLUSH debug option
This flag has been around for a while but it wasn't actually used anywhere.

Now, setting this flag causes a glFlush() to be issued after each
drawing call (including glBegin/End, glDrawElements, glDrawArrays,
glDrawPixels, glCopyPixels and glBitmap).
2012-05-11 16:13:14 -06:00
Brian Paul
da35c2b38c mesa: define DEBUG_SILENT flag, use in output_if_debug() 2012-05-11 16:13:14 -06:00
Brian Paul
88cd47187c mesa: clean-up the debug/verbose flag setup code
Split the verbose and debug flag setup code into separate functions.
2012-05-11 16:13:14 -06:00
Brian Paul
443195bdf8 mesa: do FLUSH_VERTICES() in _mesa_flush/finish()
This was being done in the _mesa_Flush/Finish() calls but if there
was an internal call to _mesa_flush/finish() the FLUSH_VERTICES()
wouldn't happen.  Looks like only the intel and radeon drivers made
such calls in MakeCurrent().
2012-05-11 16:13:14 -06:00
Brian Paul
1bc16bf98a mesa: fix glMaterial / dlist bug
When glColorMaterial() is used to latch glColor commands to a material
attribute, glMaterial calls to change that material should become no-ops.
This failed to work properly when the glMaterial call was inside a
display list.

This removes the Material function from the vbo_attrib_tmp.h template
file.  We have separate/different implementations for the "save" and
"exec" cases now.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Brian Paul
f272490546 mesa: fix/add error check in _mesa_ColorMaterial()
_mesa_material_bitmask() will record a GL error and return 0 if
face or mode are illegal.  Return early in that case.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Tom Stellard
bcfc97dbf4 radeon/llvm: More comments and cleanups 2012-05-11 15:09:52 -04:00
José Fonseca
23c0d469e5 gallivm: Fix copy'n'paste typo bug translating CEIL opcode.
Trivial.
2012-05-11 16:44:42 +01:00
Marek Olšák
d3bab0c7be r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE 2012-05-11 17:36:11 +02:00
Marek Olšák
7435c04398 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2012-05-11 16:42:20 +02:00
Marek Olšák
bb4c5d72d7 Merge branch 'gallium-userbuf'
Conflicts:
	src/gallium/docs/source/screen.rst
	src/gallium/drivers/nv50/nv50_state.c
	src/gallium/include/pipe/p_defines.h
	src/mesa/state_tracker/st_draw.c
2012-05-11 16:38:13 +02:00
Tom Stellard
4d11a6a0c7 radeon/llvm: Fix Evergreen/Cayman tablegen predicates
Some Evergreen/Cayman instructions were being enabled for SI.
2012-05-11 09:43:47 -04:00
José Fonseca
96956dc507 gallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/
For consistency.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:37:00 +01:00
José Fonseca
223831ca14 gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.
Some code relies on the existing of an invalid texture target. It seems
safer to bring it back than to deal with unintended consequences.

This partially reverts commit a4ebb04214.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:36:20 +01:00
James Benton
11aa82cc0b llvmpipe: Fix triangle bounding box calculation to be correctly inclusive or exclusive
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:23 +01:00
James Benton
0c8a8a35e1 llvmpipe: Change triangle rasterization comparison from < 0 to <= 0
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:21 +01:00
Francisco Jerez
60e7b08101 clover: Implement CL_MEM_COPY_HOST_PTR. 2012-05-11 12:39:44 +02:00
Alexey Shvetsov
19eae45e01 gallium/targets/pipe-loader: Prepend DESTDIR to the installation directory.
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2012-05-11 12:39:44 +02:00
Tom Stellard
79d77b38b8 clover: Assorted build fixes.
Contains the following patches squashed in:

commit 9fff1dc0875f7c9591550fa3ebbe1ba7a18483fa
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:20:03 2012 +0100

    configure.ac: Build gallium loader when OpenCL is enabled

commit 542111cb02957418c6a285cb6ef2924e49adc66e
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:30:29 2012 +0100

    configure.ac: Add sw/null to GALLIUM_WINSYS_DIRS for gallium loader

commit 876f8de46062dde76b6075be3b6628f969b16648
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Thu Feb 9 11:26:05 2012 -0500

    configure.ac: Require gcc > 4.6.0 for clover

commit 99049d50fa3d9a23297ae658189c19c89dca1766
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:32:06 2012 +0100

    configure.ac: Require Gallium drm loader when gallium loader is enabled

    No longer silently exclude this when building OpenCL drivers
    for nouveau and r600.
2012-05-11 12:39:44 +02:00
Francisco Jerez
c6db1b3396 clover: Import OpenCL state tracker. 2012-05-11 12:39:44 +02:00
Francisco Jerez
309a186987 gallium/tests/trivial: Import compute unit tests.
Add a test program that tries to exercise some of the language
features commonly used by compute programs at the Gallium API level:

   - Correctness of the values returned by the grid parameters.
   - Proper functioning of resource LOADs and STOREs.
   - Subroutine calls.
   - Argument passing to the compute parameter through the INPUT
     memory space.
   - Mapping of buffer objects to the GLOBAL memory space.
   - Proper functioning of the PRIVATE and LOCAL memory spaces.
   - Texture sampling and constant buffers.
   - Support for multiple kernels in the same program.
   - Indirect resource indexing.
   - Formatted resource loads and stores (i.e. with channel conversion
     and scaling) using several different formats.
   - Proper functioning of work-group barriers.
   - Atomicity and semantics of the atomic opcodes.

As of now all of them seem to pass on my nvA8.
2012-05-11 12:39:44 +02:00
Francisco Jerez
b52a0f2281 gallium/gbm: Switch to auxiliary/pipe-loader.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
66f7fd99fa gallium/tests/trivial: Switch to the pipe loader.
It simplifies things slightly, and besides, it makes possible to
execute the trivial tests on a hardware device instead of being
limited to software rendering.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
317be33d73 gallium: Add "pipe-loader" target.
This target generates pipe driver modules intended to be consumed by
auxiliary/pipe-loader.  Most of it was taken from the "gbm" target --
the duplicated code will be replaced with references to this target in
a future commit.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:43 +02:00
Francisco Jerez
e136453062 gallium: Add pipe loader for device enumeration and driver multiplexing.
The goal is to have a uniform interface to create winsys and
pipe_screen instances for any driver, exposing the device enumeration
capabilities that might be supported by the operating system (for now
there's a "drm" back-end using udev and a "sw" back-end that always
returns the same built-in devices).

The typical use case of this library will be:
>
> struct pipe_loader_device devs[n];
> struct pipe_screen *screen;
>
> pipe_loader_probe(&devs, n);
>[pick some device from the array...]
>
> screen = pipe_loader_create_screen(dev, library_search_path);
>[do something with screen...]
>
> screen->destroy(screen);
> pipe_loader_release(&devs, N);
>

A part of the code was taken from targets/gbm/pipe_loader.c, which
will be removed and replaced with calls into this library by a future
commit.
2012-05-11 12:39:43 +02:00
Francisco Jerez
2faf01c840 gallium/tgsi/text: Replace open-coded integer parsing with parse_int(). 2012-05-11 12:39:43 +02:00
Francisco Jerez
40123dae43 gallium/tgsi/text: Parse immediates of non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
e9072863b1 gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
a426b0d5bc gallium/tgsi/text: Make label parsing optional for branch instructions.
Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no
longer require a label argument, make it optional for them.
2012-05-11 12:39:43 +02:00
Francisco Jerez
49468a1b2a st/mesa: Use local temporary registers.
Local makes more sense in most places because non-inline function
calls are unimplemented anyway.
2012-05-11 12:39:42 +02:00
Francisco Jerez
b52e374ad3 gallium/tgsi/ureg: Support local temporary emission. 2012-05-11 12:39:42 +02:00
Francisco Jerez
1b8aecc797 gallium/tgsi/ureg: Lift the restriction on releasing temporaries over UREG_MAX_TEMP. 2012-05-11 12:39:42 +02:00
Francisco Jerez
0a62af3bcc gallium/util: Define util_strchrnul.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
57c048f291 gallium/compute: Drop TGSI dependency.
Add a shader cap for specifying the preferred shader representation.
Right now the only supported value is TGSI, other enum values will be
added as they are needed.

This is mainly to accommodate AMD's LLVM compiler back-end by letting
it bypass the TGSI representation for compute programs.  Other drivers
will keep using the common TGSI instruction set.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
2644952bd4 gallium/tgsi: Introduce the "LOCAL" register declaration modifier.
This change will be useful to implement function parameter passing on
top of TGSI.  As we don't have a proper stack, a register-based
calling convention will be used instead, which isn't necessarily a bad
thing given that GPUs often have plenty of registers to spare.

Using the same register space for local temporaries and
inter-procedural communication caused some inefficiencies, because in
some cases the register allocator would lose the freedom to merge
temporary values together into the same physical register, leading to
suboptimal register (and sometimes, as a side effect, instruction)
usage.

The LOCAL declaration modifier specifies that the value isn't intended
for parameter passing and as a result the compiler doesn't have to
give any guarantees of it being preserved across function boundaries.

Ignoring the LOCAL flag doesn't change the semantics of a valid
program in any way, because local variables are just supposed to get a
more relaxed treatment.  IOW, this should be a backwards-compatible
change.
2012-05-11 12:39:41 +02:00
Francisco Jerez
c2d31a83a8 gallium/tgsi: Add support for atomic opcodes. 2012-05-11 12:39:41 +02:00
Francisco Jerez
9e550c3423 gallium/tgsi: Add support for barriers. 2012-05-11 12:39:41 +02:00
Francisco Jerez
581ddbcf93 gallium/tgsi: Define system values used to query the compute grid parameters. 2012-05-11 12:39:41 +02:00
Francisco Jerez
b8e808f1ef gallium/tgsi: Add resource write-back support.
Define a new STORE opcode with a role dual to the LOAD opcode, and add
flags to specify that a shader resource is intended for writing.
2012-05-11 12:39:41 +02:00
Francisco Jerez
82c90b2da8 gallium/tgsi: Add support for raw resources.
Normal resource access (e.g. the LOAD TGSI opcode) is supposed to
perform a series of conversions to turn the texture data as it's found
in memory into the target data type.

In compute programs it's often the case that we only want to access
the raw bits as they're stored in some buffer object, and any kind of
channel conversion and scaling is harmful or inefficient, especially
in implementations that lack proper hardware support to take care of
it -- in those cases the conversion has to be implemented in software
and it's likely to result in a performance hit even if the pipe_buffer
and declaration data types are set up in a way that would just pass
the data through.

Add a declaration flag that marks a resource as typeless.  No channel
conversion will be performed in that case, and the X coordinate of the
address vector will be interpreted in byte units instead of elements
for obvious reasons.

This is similar to D3D11's ByteAddressBuffer, and will be used to
implement OpenCL's constant arguments.  The remaining four compute
memory spaces can also be understood as raw resources.
2012-05-11 12:39:41 +02:00
Francisco Jerez
a4ebb04214 gallium/tgsi: Define the TGSI_BUFFER texture target.
This texture type was already referred to by the documentation but it
was never defined.  Define it as 0 to match the pipe_texture_target
enumeration values.
2012-05-11 12:39:40 +02:00
Francisco Jerez
63428372ca gallium/tgsi: Introduce the compute processor. 2012-05-11 12:39:40 +02:00
Francisco Jerez
1279923d72 gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.
Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration
to a separate token -- they only make sense for FS inputs and we need
room for other flags in the top-level declaration token.
2012-05-11 12:39:40 +02:00
Francisco Jerez
5f55cbc7d9 gallium: Add context hooks for binding shader resources. 2012-05-11 12:39:40 +02:00
Francisco Jerez
a5f44cc8c2 gallium/tgsi: Split sampler views from shader resources.
This commit splits the current concept of resource into "sampler
views" and "shader resources":

"Sampler views" are textures or buffers that are bound to a given
shader stage and can be read from in conjunction with a sampler
object.  They are analogous to OpenGL texture objects or Direct3D
SRVs.

"Shader resources" are textures or buffers that can be read and
written from a shader.  There's no support for floating point
coordinates, address wrap modes or filtering, and, unlike sampler
views, shader resources are global for the whole graphics pipeline.
They are analogous to OpenGL image objects (as in
ARB_shader_image_load_store) or Direct3D UAVs.

Most hardware is likely to implement shader resources and sampler
views as separate objects, so, having the distinction at the API level
simplifies things slightly for the driver.

This patch introduces the SVIEW register file with a declaration token
and syntax analogous to the already existing RES register file.  After
this change, the SAMPLE_* opcodes no longer accept a resource as
input, but rather a SVIEW object.  To preserve the functionality of
reading from a sampler view with integer coordinates, the
SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS)
but take a SVIEW register instead of a RES register as argument.
2012-05-11 12:39:39 +02:00
Francisco Jerez
d9d82dcd00 gallium: Basic compute interface.
Define an interface that exposes the minimal functionality required to
implement some of the popular compute APIs.  This commit adds entry
points to set the grid layout and other state required to keep track
of the usual address spaces employed in compute APIs, to bind a
compute program, and execute it on the device.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-11 12:39:39 +02:00
Michel Dänzer
c2f1fbf912 radeonsi: Properly translate vertex format swizzle.
egltri_screen works correctly!
2012-05-11 11:54:58 +02:00
Tom Stellard
03d9c24c04 radeon/llvm: Remove AMDILMCCodeEmitter.cpp 2012-05-10 15:54:43 -04:00
Tom Stellard
628e5b208a radeon/llvm: Remove SILowerShaderInstructions.cpp 2012-05-10 15:41:32 -04:00
Tom Stellard
f8e9c29020 radeonsi/llvm: Move lowering of RETURN to ConvertToISA pass 2012-05-10 15:41:32 -04:00
Tom Stellard
fa63f97652 radeon/llvm: Add some comments 2012-05-10 15:41:31 -04:00
Tom Stellard
92faa21d29 radeon/llvm: Move util functions into AMDGPU namespace 2012-05-10 15:41:31 -04:00
Paul Berry
c569182461 i965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h
This patch renames the gen6_hiz.h and gen7_hiz.h files to correspond
to the renames of the corresponding .cpp files (see previous commit).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
ea1274c9a6 i965/hiz: Convert gen{6,7}_hiz.c to C++
This patch converts the files gen6_hiz.c and gen7_hiz.c to C++, in
preparation for expanding the HiZ code to support arbitrary blits.

The new files are called gen6_blorp.cpp and gen7_blorp.cpp to reflect
the expanded role that this code will serve--"blorp" stands for "BLit
Or Resolve Pass".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
20b153b9ca i965/hiz: Make void pointer type casts explicit
Previous to this patch, gen6_hiz.c contained two implicit type casts
from void * to a a non-void pointer type.  This is allowed in C but
not in C++.  This patch makes the type casts explicit, so that
gen6_hiz.c can be converted into a C++ file.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
f28a7d0e77 intel: Work around differences between C and C++ scoping rules.
In C++, if a struct is defined inside another struct, or its name is
first seen inside a struct or function, the struct is nested inside
the namespace of the struct or function it appears in.  In C, all
structs are visible from toplevel.

This patch explicitly moves the decalartions of intel_batchbuffer to
toplevel, so that it does not get nested inside a namespace when
header files are included from C++.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
434fc8bde4 intel: Add extern "C" declarations to headers
These declarations are necessary to allow C++ code to call C code
without causing unresolved symbols (which would make the driver fail
to load).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Tom Stellard
b0bb125736 radeon/llvm: Auto-encode RAT_WRITE_CACHELESS_eg 2012-05-10 11:52:00 -04:00
Tom Stellard
fa3747ff2c radeon/llvm: Delete all instructions that have been custom lowered 2012-05-10 11:34:32 -04:00
Michel Dänzer
839cbd7853 radeonsi: Set NONE format for unused vertex shader position export slots. 2012-05-10 13:54:39 +02:00
Michel Dänzer
8f45cea81f radeonsi: Eliminate one more magic number for texture image resources. 2012-05-10 13:54:27 +02:00
Michel Dänzer
36d2914a19 radeonsi: Fix vertex buffer resource for stride 0. 2012-05-10 13:54:27 +02:00
Tom Stellard
788fd04dac radeon/llvm: Remove AMDGPUConstants.pm 2012-05-09 12:49:44 -04:00
Tom Stellard
c2e081030e radeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const 2012-05-09 12:49:44 -04:00
Tom Stellard
d0403cafd4 radeon/llvm: Make sure the LOAD_CONST def uses the isSI predicate 2012-05-09 12:49:44 -04:00
Brian Paul
a1c5513c17 svga: implement CEIL opcode translation
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-09 10:53:15 -06:00
Christoph Bumiller
f7665ca4fc glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
The implementation using FLR was buggy, the second negation could
get lost.
2012-05-09 17:13:14 +02:00
Christoph Bumiller
6ae12bac59 gallium/drivers: handle TGSI_OPCODE_CEIL 2012-05-09 17:09:30 +02:00
Kai Wasserbäch
8c98635d4f r600g: Handle TGSI_OPCODE_CEIL (v2)
v2: Enabled CEIL on Cayman too.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-09 09:40:16 -04:00
Dave Airlie
729d914824 gallivm: implement iabs/issg opcode.
Reimplemented by Olivier Galibert <galibert@pobox.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-09 08:26:55 +01:00
Yuanhan Liu
f939776cb2 i965: fix wrong cube/3D texture layout
Fix wrong cube/3D texture layout for the tailing levels whose width or
height is smaller than the align unit.

From 965 B-spec http://intellinuxgraphics.org/VOL_1_graphics_core.pdf at
page 135:
   All of the LOD=0 q-planes are stacked vertically, then below that,
   the LOD=1 qplanes are stacked two-wide, then the LOD=2 qplanes are
   stacked four-wide below that, and so on.

Thus we should always inrease pack_x_nr, which results to the pitch of LODn
may greater than the pitch of LOD0. So we should refactor mt->total_width
when needed.

This would fix the following webgl test case on all gen4 platforms:
  conformance/textures/texture-size-cube-maps.html

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-05-09 15:13:56 +08:00
Tom Stellard
5aaaa6a426 radeon/llvm: Remove AMDILUtilityFunctions.cpp 2012-05-08 15:47:46 -04:00
Tom Stellard
21ab46eae8 radeon/llvm: Remove some unused functions from AMDILInstrInfo 2012-05-08 15:47:46 -04:00
Tom Stellard
f903da7335 radeon/llvm: Add some comments and fix coding style 2012-05-08 15:47:46 -04:00
Tom Stellard
a8d82c44f7 radeon/llvm: Remove the EXPORT_REG instruction 2012-05-08 15:47:46 -04:00
Tom Stellard
8a4c25dd7e radeon/llvm: Use a custom inserter to lower RESERVE_REG 2012-05-08 15:47:46 -04:00
Tom Stellard
94e797d0fa radeon/llvm: Use a custom inserter to lower STORE_OUTPUT 2012-05-08 15:47:46 -04:00
Tom Stellard
4226433625 radeon/llvm: Remove AMDGPULowerShaderInstructions class
It is no longer used.
2012-05-08 15:47:46 -04:00
Tom Stellard
ad385c402e radeon/llvm: Use a custom inserter to lower LOAD_INPUT 2012-05-08 15:47:45 -04:00
Tom Stellard
52a7f212d3 radeon/llvm: Remove the ReorderPreloadInstructions pass 2012-05-08 15:47:45 -04:00
Tom Stellard
e042b3aeed radeon/llvm: Remove old comment from AMDIL.h 2012-05-08 15:47:45 -04:00
Paul Berry
e19741c4d8 Add bin/compile to .gitignore
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 13:10:00 -07:00
Olivier Galibert
363c14ae0c glsl: Change built-in constant expression evaluation to run the IR.
This removes code duplication with
ir_expression::constant_expression_value and builtins/ir/*.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
2ff7b121ca glsl: Add an origin pointer in the function signature object.
This points to the object with the function body, allowing us to map
from a built-in prototype to the actual body with IR code to execute.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
8ec01ba2ff glsl: Add methods to copy parts of one ir_constant into another.
- copy_masked_offset copies part of a constant into another,
  assign-like.

- copy_offset copies a constant into (a subset of) another,
  funcall-return like.

These methods are to be used to trace through assignments and function
calls when computing a constant expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:50 -07:00
Olivier Galibert
a270e86d38 glsl: Add a constant_referenced method to ir_dereference*
The method is used to get a reference to an ir_constant * within the
context of evaluating an assignment when calculating a
constant_expression_value.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:47 -07:00
Olivier Galibert
6e4852a3a5 glsl: Add a variable context to constant_expression_value().
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:46 -07:00
Olivier Galibert
27a198388e glsl: Extend ir_constant::zero to handle more types.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:38 -07:00
Kenneth Graunke
f72e9b2041 glsl: Fix broken constant expression handling for <, <=, >, and >=.
We were looping over all the vector components, but only dealing with
the first one.  This was masked by the fact that constant expression
handling on built-ins went through custom code for the lessThan()
/function/ rather than the ir_binop_less expression operator.

NOTE: This is a candidate for all release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:28:44 -07:00
Brian Paul
c55ebc3e3e vbo: add some comments 2012-05-08 12:12:03 -06:00
Brian Paul
ad5e3609d4 mesa: remove needless casts in save_EdgeFlag() 2012-05-08 12:12:03 -06:00
Brian Paul
2428de1c50 mesa: minor clean-ups in dlist material code 2012-05-08 12:12:03 -06:00
Brian Paul
b13ecbadea mesa: fix error strings in dlist code 2012-05-08 12:12:03 -06:00
Marek Olšák
c5e473fbe2 mesa: add gl_context::NewDriverState and use it for vertex arrays
The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use
the same flag to notify the driver. Since we've run out of bits in NewState
and NewState is for core Mesa anyway, we need to find another way.

This patch is the first to start decoupling the state flags meant only
for core Mesa and those only for drivers.

The idea is to have two flag sets:
- gl_context::NewState - used by core Mesa only
- gl_context::NewDriverState - used by drivers only (the flags are defined
                               by the driver and opaque to core Mesa)

It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module
that the user changed vertex arrays, and the vbo module in turn sets
a driver-specific flag to notify the driver that it should update its vertex
array bindings.

The driver decides which bits of NewDriverState should be set and stores them
in gl_context::DriverFlags. Then, Core Mesa can do this:
ctx->NewDriverState |= ctx->DriverFlags.NewArray;

This patch implements this behavior and adapts st/mesa.
DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS.

Core Mesa only sets NewDriverState. It's the driver's responsibility to read
it whenever it wants and reset it to 0.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
50f7e75f9e mesa: move gl_client_array*[] from vbo_draw_func into gl_context
In the future we'd like to treat vertex arrays as a state and
not as a parameter to the draw function. This is the first step
towards that goal. Part of the goal is to avoid array re-validation
for every draw call.

This commit adds:
const struct gl_client_array **gl_context::Array::_DrawArrays.

The pointer is changed in:
* vbo_draw_method
* vbo_rebase_prims - unused by gallium
* vbo_split_prims - unused by gallium
* st_RasterPos

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
a7ac9c9c7d vbo: move vbo_draw_method into vbo_context.h
I'll need vbo_context in that function soon.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Vadim Girlin
d6aa7cd7f8 radeon/llvm: add suport for cube textures
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e98e209528 radeon/llvm: add support for CUBE ALU instruction
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
996fa375ec radeon/llvm: add support for some ALU instructions
Add support for IABS, NOT, AND, XOR, OR, UADD, UDIV, IDIV, MOD, UMOD, INEG,
I2F, U2F, F2U, F2I, USEQ, USGE, USLT, USNE, ISGE, ISLT, ROUND, MIN, MAX,
IMIN, IMAX, UMIN, UMAX

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e9be193430 radeon/llvm: add missing cases for BREAK/CONTINUE
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e740b60845 radeon/llvm: add support for AHSR/LSHR/LSHL instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
95ed0e9b6b radeon/llvm: add support for TXQ/TXF/DDX/DDY instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
d8a1204854 radeon/llvm: add support for VertexID, InstanceID
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e3e7ae732c radeon/llvm: fix live-in handling for inputs
Set the input registers as live-in for entry basic block.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
757f471ba9 radeon/llvm: add support for v4i32
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
06db74a753 radeon/llvm: fix ABS_i32 instruction lowering
Swap source operands.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
3a6a1cd75f radeon/llvm: use integer comparison for IF
Replacing "float equal to 1.0f" with "int not equal to 0".
This should help for further optimization of boolean computations.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
2a88dfc521 radeon/llvm: use bitcasts for integers
We're using float as default type, so basically for every instruction that
wants other types for dst/src operands we need to perform the bitcast
to/from default float. Currently bitcast produces no-op MOV instruction,
will be eliminated later.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:21 +04:00
Tom Stellard
3f8c37967a r600g: Fix out of tree builds that use the LLVM backend
https://bugs.freedesktop.org/show_bug.cgi?id=49567
2012-05-07 15:05:25 -04:00
Tom Stellard
c425c3823f radeon/llvm: Remove references to DebugFlag and isCurrentDebugType()
These weren't being used at all and they were causing build failures
when LLVM was built with NDEBUG defined and mesa was not.

https://bugs.freedesktop.org/show_bug.cgi?id=49110
2012-05-07 14:01:53 -04:00
Paul Berry
714b4f6184 i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen7, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:33 -07:00
Paul Berry
a683012a80 i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:04 -07:00
Paul Berry
b9819a027d fbo: Only reuse depth/stencil attachments if the parameters match.
When the user attaches a texture to one of the depth/stencil
attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we
check to see if the same texture is also attached to the other
attachment point, and if so, we re-use the existing texture
attachment.  This is necessary to ensure that if the user later
queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not
receive an error.

If, however, the user attaches buffers to the two different attachment
points using different parameters (e.g. a different miplevel), then we
can't re-use the existing texture attachment, because it is pointing
to the wrong part of the texture.  This might occur as a transitory
condition if, for example, if the user attached miplevel zero of a
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to
it, and then later attempted to attach miplevel one of the same
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT.

This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and
GL_DEPTH_ATTACHMENT use the same attachment parameters before
attempting to share the texture attachment.

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 depth_stencil_shared"
and "texturing/depthstencil-render-miplevels 1024
stencil_depth_shared".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 10:48:53 -07:00
Paul Berry
3ec0e55b63 i965: Fix mipmap offsets for HiZ and separate stencil buffers.
When rendering to a miplevel other than 0 within a color, depth,
stencil, or HiZ buffer, we need to tell the GPU to render to an offset
within the buffer, so that the data is written into the correct
miplevel.  We do this using a coarse offset (in pages), and a fine
adjustment (the so-called "tile_x" and "tile_y" values, which are
measured in pixels).

We have always computed the coarse offset and fine adjustment using
intel_renderbuffer_tile_offsets() function.  This worked fine for
color and combined depth/stencil buffers, but failed to work properly
when HiZ and separate stencil were in use.  It failed to work because
there is only one set of fine adjustment controls shared by the HiZ,
depth, and stencil buffers, so we need to choose tile_x and tile_y
values that are compatible with the tiling of all three buffers, and
then compute separate coarse offsets for each buffer.

This patch fixes the HiZ and separate stencil case by replacing the
call to intel_renderbuffer_tile_offsets() with calls to two functions:
intel_region_get_tile_masks(), which determines how much of the
adjustment can be performed using offsets and how much can be
performed using tile_x and tile_y, and
intel_region_get_aligned_offset(), which computes the coarse offset.

intel_region_get_tile_offsets() is still used for color renderbuffers,
so to avoid code duplication, I've re-worked it to use
intel_region_get_tile_masks() and intel_region_get_aligned_offset().

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 X" where X is one of
(depth, depth_and_stencil, depth_stencil_single_binding, depth_x,
depth_x_and_stencil, stencil, stencil_and_depth, stencil_and_depth_x).

On i965 Gen7, the variants of
"texturing/depthstencil-render-miplevels" that contain a stencil
buffer still fail, due to another problem: Gen7 seems to ignore the 3
LSB's of the tile_y adjustment (and possibly also tile_x).

v2: Removed spurious comments.  Added assertions to check
preconditions of intel_region_get_aligned_offset().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-07 10:47:49 -07:00
Chad Versace
1c0f5d8324 intel: Disable ARB_framebuffer_object in ES contexts
This patch removes ARB_framebuffer_object from the GLES1 and GLES2
extension lists in intel_extensions_es.c.

Fixes a crash in the Android browser on Ice Cream Sandwich.

The Android browser crashed because it did the following, which is legal
in GLES2 but not in ARB_framebuffer_object.
    glGenFramebuffers(1, &fb);
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // render render render...
    glDeleteFramebuffers(1, &fb);
    // go do other stuff...
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // This bind unexpectedly failed, and the app panics.

The semantics of glBindFramebuffer specified by ARB_framebuffer_object (a
desktop GL extension) and GLES2 specs are incompatible. The ideal solution
to fix this is to create separate API entry points for glBindFramebuffer,
one for GL and the other for GLES2. But, until that work is complete,
disabling ARB_framebuffer_object in GLES2 contexts safely fixes the problem.

Likewise, the semantics of glBindFramebuffer in ARB_framebuffer_object and
of glBindFramebufferOES in OES_framebuffer_object (a GLES1 extension) are
incompatible. Even though the functions have different names, the semantic
difference still results in a bug because both API calls are implemented
by a single function, _mesa_BindFramebufferEXT, which handles the semantic
difference incorrectly. Again, disabling ARB_framebuffer_object in GLES1
contexts safely fixes this problem.

According to the ARB_framebuffer_object spec, the extension is an
amalgamation of
    EXT_framebuffer_object
    EXT_framebuffer_blit
    EXT_packed_depth_stencil
    EXT_framebuffer_multisample
By disabling this extension, however, no functionality is removed from
GLES1 and GLES2 contexts because 1) the first three extensions are
explicitly enabled in Intel's ES extension lists and 2) no functionality
of the last extension is exposed in an ES context.

Note: This is a candidate for the 8.0 branch.
See-also: http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg21006.html
CC: Charles Johnson <charles.f.johnson@intel.com>
CC: Sean Kelley <sean.v.kelley@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 08:38:12 -07:00
Brian Paul
64c510bb72 mesa: bump version to 8.1.0 in configs/default 2012-05-07 07:30:04 -06:00
Marcin Slusarz
ecc7e5e85b nv50: handle VP without inputs 2012-05-07 14:05:35 +02:00
Christoph Bumiller
c19672f90a nvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc 2012-05-06 22:03:06 +02:00
Christoph Bumiller
28d6a268af nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs 2012-05-06 22:03:06 +02:00
Christoph Bumiller
38a20281fc nvc0/ir: fix lowering of textureGrad 2012-05-06 22:03:06 +02:00
Christoph Bumiller
9dfac63ae0 nouveau: fix nouveau_scratch_runout_release bo count underflow 2012-05-06 22:03:06 +02:00
Jordan Justen
5795d3b5ae mesa: Add primitive restart support to glArrayElement
When primitive restart is enabled, and glArrayElement is called
with the restart index value, then call glPrimitiveRestartNV.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul<brianp@vmware.com>
2012-05-05 20:35:08 -07:00
Baldo Davide
0ad0bc5af5 auxiliary/os: Add missing signal.h include.
The signal.h include was missed in the commit
bc16c73407 which leads to broken
compilations under Linux.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-05 04:51:32 +01:00
Kenneth Graunke
3cd7bee48f intel: Remove pointless software fallback for glBitmap on Gen6.
We already have a meta path below that works just fine; no apparent
regressions in oglconform.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46834
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-04 17:19:43 -07:00
Eric Anholt
4595288ba8 glsl: Fix regression in function out-parameter lvalue detection.
When doing the var->assigned change in
f2475ca424, I overzealously indented the
second block of code into the "if (var)" test.  Revert these blocks to
the way they were before, just taking advantage of "var" to avoid
re-calling variable_referenced().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49066
2012-05-04 14:00:32 -07:00
Eric Anholt
3362c7d9b6 mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE. 2012-05-04 14:00:32 -07:00
Eric Anholt
dc42910e98 i965/fs: Fix regression in comparison handling from ANDs change.
I had fixed up the logic ops for delayed ANDing, but not equality
comparisons on bools.  Fixes new piglit fs-bool-less-compare-true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
2012-05-04 14:00:32 -07:00
Eric Anholt
b2ee5a08ba glsl: Don't consider unused FS out variables as being statically assigned.
I only considered var->assigned for FragColor and FragData, but
ignored when it was false for out vars.  Fixes piglit
write-gl_FragColor-and-not-user-output.frag

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49068
2012-05-04 14:00:32 -07:00
Eric Anholt
fcd57280ae i965: Add a comment about the state flag for sRGBEnabled.
I thought this might be _NEW_COLOR, but it isn't.
2012-05-04 14:00:32 -07:00
Eric Anholt
b7406404ab intel: Return success when asked to allocate a 0-width/height renderbuffer.
It seems silly that GL lets you allocate these given that they're
framebuffer attachment incomplete, but the webgl conformance tests
actually go looking to see if the getters on 0-width/height
depth/stencil renderbuffers return good values.  By failing out here,
they all got smashed to 0, which turned out to be correct for all the
getters they tested except for GL_RENDERBUFFER_INTERNAL_FORMAT.  Now,
by succeeding but not making a miptree, that one also returns the
expected value.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Eric Anholt
6508b0b9b0 glsl: Always copy the index when cloning a variable.
The index is also used for GL_ARB_blend_func_extended.  Cloning in
i965 was dropping a non-ARB_explicit_attrib_location index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-04 14:00:32 -07:00
Eric Anholt
b7932e183c i965: Add support for GL_ARB_draw_buffers_blend.
Tested with piglit fbo-draw-buffers-blend and intel oglconform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Christoph Bumiller
9ef549d7cd nv50: fix typo causing NULL-deref in nv50_resource_resolve
Introduced in b328949a37.
2012-05-04 18:00:46 +02:00
Christoph Bumiller
dffc2fb4e6 nv50/ir: move expansion of IMUL to later stage and handle memory operands 2012-05-04 18:00:40 +02:00
Christoph Bumiller
02fac29305 nv50: implement stream output 2012-05-04 18:00:07 +02:00
Christoph Bumiller
8a44ecdae8 nv50: enable array textures 2012-05-04 18:00:03 +02:00
Brian Paul
c66dc0ea8e svga: specify 4-byte aligned vertex elements
We haven't found a case where this is needed, but it would be prudent
for some hosts, per Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-04 08:12:53 -06:00
Brian Paul
e039fd079b gallivm: fix comment typo 2012-05-04 08:07:58 -06:00
Brian Paul
a0c380a744 docs: another viewperf bug 2012-05-04 08:07:58 -06:00
Brian Paul
a36581ccc0 mesa: do more teximage error checking for generic compressed formats
When glTexImage or glCopyTexImage is called with internalFormat being a
generic compressed format (like GL_COMPRESSED_RGB) we need to do the same
error checks as for specific compressed formats.  In particular, check if
the texture target is compatible with the format.  None of the texture
compression formats we support so far work with GL_TEXTURE_1D, for example.

See also https://bugs.freedesktop.org/show_bug.cgi?id=49124

NOTE: This is a candidate for the 8.0 branch.
2012-05-04 08:07:58 -06:00
Vinson Lee
5cc4b4aaf4 scons: Do not build EGL on Solaris.
The current EGL headers do not support Solaris.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-03 22:58:35 -07:00
Jeremy Huddleston
51691f0767 darwin: Use ASL for logging
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:34 -07:00
Jeremy Huddleston
cf5db0a418 darwin: Make reported errors more user-friendly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Jeremy Huddleston
244dc05214 darwin: Fix an error message
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Robert Hooker
c384c5d4d7 egl_dri2: Fix out of tree builds with the wayland backend enabled
Otherwise it fails like so:

  CC     egl_dri2.lo
In file included from egl_dri2.h:40:0,
                 from egl_dri2.c:42:
../../../../../../src/egl/wayland/wayland-drm/wayland-drm.h:8:41:
fatal error: wayland-drm-server-protocol.h: No such file or directory
compilation terminated.
2012-05-03 11:45:59 -04:00
Kristian Høgsberg
4fddb2ba21 gbm: Add gbm_bo_write entry point
This new gbm entry point allows writing data into a gbm bo.  The bo has
to be created with the GBM_BO_USE_WRITE flag, and it's only required to
work for GBM_BO_USE_CURSOR_64X64 bos.

The gbm API is designed to be the glue layer between EGL and KMS, but there
was never a mechanism initialize a buffer suitable for use with KMS
hw cursors.  The hw cursor bo is typically not compatible with anything EGL
can render to, and thus there's no way to get data into such a bo.

gbm_bo_write() fills that gap while staying out of the efficient
cpu->gpu pixel transfer business.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2012-05-03 10:57:32 -04:00
Tom Stellard
b4789860c4 r600g/llvm: Mask write of pred_inst in llvm_if() 2012-05-03 09:20:24 -04:00
Tom Stellard
9e522bd201 r600g/llvm: Lower ULT A, B, C to SETGT_UINT A, C, B 2012-05-03 09:20:23 -04:00
Tom Stellard
a2e08a40f5 r600g: Print integer values of literal constants in shader dumps 2012-05-03 09:20:23 -04:00
Tom Stellard
18617d7423 r600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream 2012-05-03 09:20:23 -04:00
Tom Stellard
ddb4dac133 r600g/llvm: Don't duplicate R600 intrinsics installed by LLVM
At this point, in order for OpenCL to work correctly with r600g, OpenCL
specific intrinsics need to be defined in the LLVM tree.  So, we need
to check for these intrinsics in the LLVM include directory to make sure
not to re-define them.
2012-05-03 09:20:17 -04:00
Tom Stellard
1bd3dafeca r600g: Fix the evergreen offset/end register definitions 2012-05-02 15:59:57 -04:00
Dylan Noblesmith
d5a10dba64 glsl: report errors via GL_ARB_debug_output
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:23 +00:00
Dylan Noblesmith
8c99906cf5 glsl: add gl_context member
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
58fee81c78 mesa: add _mesa_shader_debug()
This should be the one entrypoint libglsl needs
for GL_ARB_debug_output.

v2: added comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
48e8a010ae glsl: consolidate error/warning code
And lay the groundwork for GL_ARB_debug_output.

v2: Add descriptive comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Tom Stellard
c8fb30abf1 radeon/llvm: Fix MachineInstr dump 2012-05-02 11:53:13 -04:00
Adam Rak
4731f1f52d r600g: fixed the bug with VTX fetches in TEX clauses for evergreen
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
d0f6274489 winsys/radeon: Get max_pipes from the kernel
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
e42df8e10a r600g: Add support for reading vertex fetches from bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
6f50f939ef r600g: Add support for reading native instructions from the LLVM bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
94a6a36379 r600g: Add FC_NATIVE instruction
This is a pseudo instruction that enables the LLVM backend to encode
instructions and pass it through r600_bytecode_build()

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Dave Airlie
4a26454e97 r600g: bypass alpha for integer types (v2)
This moves the alpha test control to derived state and disables alpha
testing for integer fbs.

fbo-blending test in piglit gets further when we do this (not a pass
but less fail).

v2: drop the fb_sx_alpha_test_control

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-02 12:06:22 +01:00
José Fonseca
494619ebac gallivm: Use debug_printf in lp_build_printf.
So that its output can be seen on GUI window apps.

Tested-by: James Benton <jbenton@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
9ad2cb1885 gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().
Brittle, complex, and unecesary. Just use function pointer constant.
2012-05-02 10:24:34 +01:00
José Fonseca
6cd76b800b gallivm: Add a lp_build_const_func_pointer() helper.
To be reused in all places where we want to call C code.
2012-05-02 10:24:34 +01:00
José Fonseca
0005bd9da2 gallivm: Cleanup/simplify lp_build_const_string_variable.
- Move to lp_bld_const where it belongs
- Rename to lp_build_const_string
- take the length from the argument (and don't count the zero terminator twice)
- bitcast the constant to generic i8 *
2012-05-02 10:24:34 +01:00
James Benton
c23fd547c0 gallivm: Added lp_build_const_mask_aos_swizzled
Allows the creation of const aos masks which have the mask swizzled
to match the correct format.

Updated existing mask creation code to use the swizzled version where
necessary (tgsi register masks and llvmpipe aos blending).

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
7d1f414103 gallivm: Move loop var declaration to beginning of scope. 2012-05-02 10:24:33 +01:00
James Benton
f64fe7d333 gallivm: added a debug function which allows llvm to print vectors of 16 unsigned ints
This is useful for debugging the linear llvm path as it handles pixels in this format

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:33 +01:00
James Benton
16b081f1b0 llvmpipe: add masking support to aos blend
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:52 +01:00
James Benton
9bc58d941a llvmpipe: Check when a shader does not satisfy 0 < imm < 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:21 +01:00
James Benton
c426e63aa0 gallivm: fixed memory leak in lp_build_tgsi_aos
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 10:13:00 +01:00
James Benton
0b0f4628d6 llvmpipe: Added support for color masks in AoS blending.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:12:48 +01:00
James Benton
85d09d1c61 gallivm: added aligned pointer get/set 2012-05-02 10:12:48 +01:00
James Benton
630fa26886 gallivm: llvm c-style for loops, allows us to create loops with conditions on entry, rather than condition check on loop 2012-05-02 10:12:48 +01:00
Viktor Novotný
83a02427e5 dri/nv10-nv20: Add support for S3TC
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:14:29 +02:00
Viktor Novotný
6d5efe96ee dri/nouveau: Add general support for compressed formats.
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:13:42 +02:00
Kenneth Graunke
b389b608d8 glsl: Remove some completed tasks from the old "TODO" file. 2012-05-01 14:46:43 -07:00
Tom Stellard
d742d812d8 radeon/llvm: Fix build for updated LLVM 3.1 release branch 2012-05-01 16:42:58 -04:00
Brian Paul
07f5dabc01 softpipe: use any_swizzle() helper in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
b5e44c2cfb softpipe: whitespace, comment clean-ups in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
92d899303a softpipe: implement coord clamping for texel fetches (TXF)
The GL spec says out of bounds fetches produce undefined results.
Use clamping to avoid failed assertions or crashes.

Fixes failed assertion in https://bugs.freedesktop.org/show_bug.cgi?id=49125
but the test still fails.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
7b610d5516 xlib: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
4433b0302d intel: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
264b584294 nouveau: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
47941bfaea radeon: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-05-01 11:39:34 -06:00
Tom Stellard
ff10dbf35f radeon/llvm: Add subtarget feature: DumpCode
With this feature enabled, the LLVM backend will dump the MachineIntrs
prior to emitting code.  The mesa env variable R600_DUMP_SHADERS will enable
this feature in the backend.
2012-05-01 13:12:27 -04:00
Brian Paul
8dd3e341b3 svga: check for and skip null vertex buffer pointers
Fixes regressions with google earth and other things.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-01 08:14:23 -06:00
Brian Paul
b5752e16e8 softpipe: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Brian Paul
6e588dff57 svga: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Vinson Lee
2d75a1e25e glsl: Initialize member variable in ir_copy_propagation_elements_visitor.
Fix uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-30 22:28:05 -07:00
Marek Olšák
96863baa42 u_vbuf: set user buffer pointer for drivers which support user buffers
It's not common to end up in u_vbuf and at the same time support user buffers
in a driver, but such a combination should work.
2012-05-01 00:19:45 +02:00
Dragomir Ivanov
7bf3fe851c r600g/llvm: Remove unnecessary dynamic casts
When the result of dynamic_cast is not checked, it can be replaced with
static_cast

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Dragomir Ivanov
7ed04fa7d8 r600g/llvm: Add pattern for llvm.AMDGPU.kill v2
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Tom Stellard
4da1fcacf1 r600g/llvm: Fix handling of MASK_WRITE instructions
We can't delete MASK_WRITE instructions from the program, because this
will cause instructions being masked by MASK_WRITE to be marked dead and
then deleted in the dce pass.
2012-04-30 16:43:34 -04:00
Tom Stellard
77d2780cbc radeon/llvm: Use a custom emit function for TGSI_OPCODE_KIL 2012-04-30 16:43:34 -04:00
Marek Olšák
8c5ff5a41f st/mesa: unmap upload buffer after uploading indices and constants 2012-04-30 20:56:25 +02:00
Sean V Kelley
fd0082c47e i965: Support Android RGBX8888 format for EGL generated images
Enabled MESA_FORMAT_RGBX8888_REV for RGBX.  Android software
requires RGBX8888 format to be supported for software rendering.
That requires EGL to be capable of generating images from this
format.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
Sean V Kelley
81f95ce13d egl/android: Add support for RGBX_8888 used in Android native buffers
Add new format __DRI_IMAGE_FORMAT_XBGR8888 to __DRI_IMAGE.
HAL_PIXEL_FORMAT_RGBX_8888 now maps to __DRI_IMAGE_FORMAT_XBGR8888.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
David Herrmann
1de377bd30 egl-fbdev: Fix compile-error by including errno.h
We use errno and EINVAL so include errno.h.

This patch introduced this bug:
http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/state_trackers/egl/fbdev/native_fbdev.c?id=b60120608f6ddf4098bc324363197c979ee04cb7

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: Chia-I Wu <olv@lunarg.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-04-30 13:27:05 -04:00
Ander Conselvan de Oliveira
249817e928 intel: set dri_format field for all images
Only images created with intel_create_image() had the field properly
set. Set it also on intel_dup_image(), intel_create_image_from_name()
and intel_create_image_from_renderbuffer().
2012-04-30 13:18:16 -04:00
Ander Conselvan de Oliveira
fc7d224e29 intel: properly return the image format on intel_query_image 2012-04-30 13:13:34 -04:00
Ander Conselvan de Oliveira
6c84f2992f gbm: add gbm_bo_get_device() function 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
55aab92495 gbm: update documentation to reflect current behavior 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
310d8d189d gbm: add gbm_bo_get/set_user_data()
This allows the user to associate some data to a gbm_bo and get a
callback when the bo is destroyed.
2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
f641c57cfa gbm: remove unused fields from gbm_dri_surface 2012-04-30 13:09:39 -04:00
Brian Paul
a53394ba66 svga: add cases for recently added PIPE_CAP queries 2012-04-30 10:38:05 -06:00
Dylan Noblesmith
18bb6852b2 mesa: reject immutable textures in glEGLImageTargetTexture2DOES()
GL_ARB_texture_storage says:

    The commands eglBindTexImage, wglBindTexImageARB, glXBindTexImageEXT or
    EGLImageTargetTexture2DOES are not permitted on an immutable-format
    texture.
    They will generate the following errors:
      - EGLImageTargetTexture2DOES: INVALID_OPERATION
      - eglBindTexImage: EGL_BAD_MATCH
      - wglBindTexImage: ERROR_INVALID_OPERATION
      - glXBindTexImageEXT: BadMatch

Fixing the EGL and GLX cases requires extending the DRI interface,
since setTexBuffer2 doesn't currently return any error information.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-30 14:52:47 +00:00
José Fonseca
4c23acb269 scons: Fix build without llvm.
radeonsi depends on llvm, so it must be disabled if llvm support is not enabled.
2012-04-30 07:47:01 +01:00
Marek Olšák
3ed72dd31d st/xorg: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
889c9a566c st/xa: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
fa20733a62 st/vega: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
0279d15c99 st/vega: use cso_draw_arrays 2012-04-30 01:18:49 +02:00
Marek Olšák
46fe17930e cso: cso_context should install u_vbuf by itself and not st/mesa
so that it's installed in the other state trackers too
2012-04-30 01:18:49 +02:00
Marek Olšák
f656607c35 st/xorg: fix compilation - wrong libkms include file 2012-04-30 01:18:49 +02:00
Marek Olšák
3b5f4b173b gallium/util: stop using user buffers in util_draw_texquad 2012-04-30 01:18:49 +02:00
Marek Olšák
3ac0683d63 gallium: remove pipe_resource::user_ptr
It's unused now.
2012-04-30 01:18:49 +02:00
Marek Olšák
65d451d9fa radeonsi: don't create temporary user buffer for r600_upload_const_buffer 2012-04-30 01:18:48 +02:00
Marek Olšák
0b7d48cbad gallium: add void *user_buffer to pipe_constant_buffer
This reduces CPU overhead when updating constants.
2012-04-30 01:18:48 +02:00
Marek Olšák
01bf5569c4 st/mesa: reorder code in draw_vbo 2012-04-30 01:18:47 +02:00
Marek Olšák
944b97990b st/mesa: remove more unnecessary code in draw_vbo
The variables set here are not used anywhere.
2012-04-30 01:16:03 +02:00
Marek Olšák
bf469f4edc gallium: add void *user_buffer in pipe_index_buffer
Adapted drivers: i915, llvmpipe, r300, r600, radeonsi, softpipe.

User index buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:28 +02:00
Marek Olšák
43995c9470 gallium: remove pipe_context::redefine_user_buffer 2012-04-30 01:14:28 +02:00
Marek Olšák
4552fd50d9 gallium: add void *user_buffer in pipe_vertex_buffer
This reduces CPU overhead in st_draw_vbo and removes a lot of unnecessary code
in that function which was required only to comply with the gallium interface,
but wasn't any useful really.

Adapted drivers: i915, llvmpipe, r300, softpipe.
No changes required in: r600, radeonsi.

User vertex buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:26 +02:00
Marek Olšák
7a05459726 st/mesa: make user constant buffers optional 2012-04-30 01:09:57 +02:00
Marek Olšák
507337864f gallium: change set_constant_buffer to be UBO-friendly 2012-04-30 01:09:57 +02:00
Marek Olšák
1b749dc34f gallium: add PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT
This is required for any serious constant buffer support.
Constant buffer offsets on ATI and NVIDIA DX10 and DX11 GPUs must be
a multiple of 256.

In OpenGL, this can be queried via GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.
2012-04-30 01:09:57 +02:00
Marek Olšák
8c655f499c st/mesa: make user index buffers optional
v2: use a separate upload buffer for indices
2012-04-30 01:09:57 +02:00
Marek Olšák
989bdaab51 st/mesa: only set index buffer when drawing is indexed
and restructure the code a bit
2012-04-30 01:09:57 +02:00
Marek Olšák
437ab1d6df gallium: add PIPE_CAP_USER_INDEX_BUFFERS and PIPE_CAP_USER_CONSTANT_BUFFERS 2012-04-30 01:09:57 +02:00
José Fonseca
4c15a77f27 scons: Parse = operator in source lists too.
Should fix the scons build.
2012-04-29 21:44:05 +01:00
Christoph Bumiller
b328949a37 nv50,nvc0: fix depth/stencil resolve
Cannot sample depth/stencil with a single view, and needed to use
different shader code for nve4.
2012-04-29 18:03:18 +02:00
Christoph Bumiller
d46f969b84 nvc0/ir/opt: INTERP does not support JOIN 2012-04-29 18:03:15 +02:00
Christoph Bumiller
1f4c154f02 nv50/ir/opt: try to convert ABS(SUB) to SAD 2012-04-29 18:03:11 +02:00
Christoph Bumiller
d6ab3106cf nvc0/ir: try to use the optimal texture op mode
Don't really know what they are yet but for groups of textures, the
last one should use mode "p" and the others "t".
2012-04-29 18:02:37 +02:00
Christoph Bumiller
afcd7b5d16 nvc0/ir: initial implementation of nve4 scheduling hints 2012-04-29 17:59:06 +02:00
Christoph Bumiller
00fe442253 nvc0/ir: implement better placement of texture barriers
Put them before first uses instead of right after the texturing
instruction and cull unnecessary barriers.
2012-04-29 17:56:57 +02:00
Christoph Bumiller
163b290f88 nv50/ir/tgsi: fix handling of early RET
We have to actually emit RET, too, of course, not just the PRERET.
2012-04-29 17:55:36 +02:00
Christoph Bumiller
d9baa004ea nvc0/ir/emit: fix emitTXQ 2nd src 2012-04-29 17:55:13 +02:00
Christoph Bumiller
3a9f036e00 nvc0/ir/target: integer ADD doesn't support ABS modifier 2012-04-29 17:54:34 +02:00
Marek Olšák
18bcb962bb u_vbuf: unbind vertex buffers on destroy 2012-04-29 17:41:37 +02:00
Marek Olšák
7622496d7b u_blitter: fix resource leak 2012-04-29 17:31:27 +02:00
Marek Olšák
63ca2eda13 radeonsi: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
c69248fa3f r600g: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
498e71c156 r300g: make r300_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
a784d86508 r300g: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
2ed1cdb2a5 radeonsi: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
0a6120244e winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight
into the winsys.
2012-04-29 14:46:52 +02:00
Dylan Noblesmith
8e90913e9f mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0
As noted in commit be4e46b21a,
this was missing before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-29 11:18:31 +00:00
Dylan Noblesmith
e4c97f1e60 autoconf: pass -Wall to automake
And fix these warning that appear at autoreconf time:
"`:='-style assignments are not portable"

v2: Fix the recently-converted-to-automake r600.
2012-04-29 11:17:47 +00:00
Vinson Lee
e372aa6949 glsl: Remove unused member predicate from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-28 14:00:36 -07:00
Kenneth Graunke
b443ca96a5 i965/fs: Fix FB writes that tried to use the non-existent m16 register.
A little analysis shows that the worst-case value for "nr" is 17:
- base_mrf = 2                       ... 2
- header present (say gen == 5)      ... 4
- aa_dest_stencil_reg (stencil test) ... 5
- SIMD16 mode: += 4 * reg_width      ... 13
- source_depth_to_render_target      ... 15
- dest_depth_reg                     ... 17

This resulted in us setting base_mrf to 2 and mlen to 15.  In other
words, we'd try to use m2..m16.  But m16 doesn't exist pre-Gen6.  Also,
the instruction scheduler data structures use arrays of size 16, so this
would cause us to access them out of bounds.

While the debugger system routine may need m0 and m1, we don't use it
today, so the simplest solution is just to move base_mrf back to 1.
That way, our worst case message fits in m1..m15, which is legal.

An alternative would be to fail on SIMD16 in this case, but that seems
a bit unfortunate if there's no real need to reserve m0 and m1.

Fixes new piglit test shaders/depth-test-and-write on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48218
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-27 16:53:37 -07:00
Vinson Lee
6af4c9006c glsl: Remove unused member mem_ctx from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-26 21:09:42 -07:00
Ben Skeggs
9856fd02a0 nv30: properly init window information
Should fix >2k rendering issues reported on nv4x.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-27 09:32:57 +10:00
Tom Stellard
a2f7ecfa74 radeonsi/llvm: Silence a warning 2012-04-25 18:09:05 -04:00
Tom Stellard
21d3dd831e radeon/llvm: Remove unused header files 2012-04-25 12:52:44 -04:00
Tom Stellard
30f2a38cef radeon/llvm: Remove AMDILMachineFunctionInfo.cpp 2012-04-25 12:52:44 -04:00
Tom Stellard
540ec964db radeon/llvm: Remove AMDILModuleInfo.cpp 2012-04-25 12:52:43 -04:00
José Fonseca
914244e59d gallivm: Use lp_build_alloca instead of LLVMBuildAlloca on the loop limiter.
To ensure that the alloca is at the top of the function body, otherwise
LLVM will not eliminate them, causing stack misalignment on 32bits.

Reviewed-by: James Benton <jbenton@vmware.com>
2012-04-25 18:09:38 +01:00
Tom Stellard
9f45093433 radeon/llvm: Remove AMDILELFWriterInfo.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
d96682169e radeon/llvm: Remove AMDILLiteralManager.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
ba333a6518 radeon/llvm: Remove AMDILInliner.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
160d4a7891 radeon/llvm: Remove AMDILBarrierDetect.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
0e7161cce8 radeon/llvm: Remove AMDILPrintfConvert.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
04993c9630 radeon/llvm: Remove GlobalManager and KernelManager 2012-04-25 09:02:16 -04:00
Tom Stellard
8d3bf7ced5 radeon/llvm: Remove AsmPrinter files 2012-04-25 09:02:16 -04:00
Tom Stellard
ba9bd41880 radeon/llvm: Remove IOExpansion files 2012-04-25 09:02:16 -04:00
Tom Stellard
4b11f4321b radeon/llvm: Remove AMDILPointerManager.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
76940ba852 radeonsi/llvm: Fix initialization of SIMachineFunctionInfo
SIMachineFunctionInfo needs to be initialized before any of the
AMDIL passes.
2012-04-25 09:02:16 -04:00
José Fonseca
63da1aa5be mesa/st: Fix derreference after free. 2012-04-25 11:41:13 +01:00
Marek Olšák
1781d26faa gallium/docs: document the new vertex fetch CAPs 2012-04-24 23:10:46 +02:00
Christoph Bumiller
29a0c8cd60 nv50: fix typo in nv50_fragprog_assign_slots 2012-04-24 20:05:35 +02:00
Eric Anholt
e9df9636b9 glsl: Add implementation of inverse() for mat2/3/4.
This is taken from the ogl-math project, with Inverse renamed to adj
(since it's not actually the inverse), transposed, and our types
plugged in.  There are potential CSE opportunities in this code
(particularly for hardware with RCP but not DIV), but we should be
doing CSE anyway, so don't hand-optimize.

Fixes piglit inverse tests.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:15:47 -07:00
Eric Anholt
7de1331662 glsl: Add support for generating builtin code from GLSL instead of IR.
This takes advantage of the builtin compiler to generate IR into a
string, the same way we read GLSL for function prototypes for our
profiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:10 -07:00
Eric Anholt
41b47441d7 glsl: Make ir_reader parse the "temporary" variable qualifier.
This lets ir_reader eat the output of builtin_compiler on actual
function definitions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:07 -07:00
Eric Anholt
6a6cb03507 glsl: Add doxygen explaining what main.cpp is for.
I keep getting lost in the Makefile trying to figure out what to edit
to work on builtin_compiler or glsl_compiler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:00:54 -07:00
Eric Anholt
4650aea7a5 i965/vs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Eric Anholt
f41ecade7b i965/fs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Christoph Bumiller
587c221a29 nv50,nvc0: handle new vertex fetch caps 2012-04-24 13:37:03 +02:00
Christoph Bumiller
a48e5dee94 nv50,nvc0: don't initialize the draw module, we don't use it
But some day we might (e.g. for blending 16 bpp formats on nv50).
2012-04-24 13:35:44 +02:00
Christoph Bumiller
2170fed8f4 nv50: enable shader watchdog timer 2012-04-24 12:26:31 +02:00
Jeremy Huddleston
1a33c1b2b8 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
2012-04-24 00:26:48 -07:00
Marek Olšák
2a311b18fc radeonsi: stop using u_vbuf and adapt to gallium interface changes 2012-04-24 01:39:22 +02:00
Marek Olšák
89c4888710 u_vbuf: don't call u_vbuf_upload_buffers if there's nothing to upload 2012-04-24 01:39:22 +02:00
Marek Olšák
634066946e u_vbuf: don't upload user buffers if the driver supports them 2012-04-24 01:39:22 +02:00
Marek Olšák
6fe30fbc96 u_vbuf: optimize u_vbuf_translate_find_free_vb_slots 2012-04-24 01:39:22 +02:00
Marek Olšák
b5e5e61439 u_vbuf: turn bool arrays into bitmasks and loops into bitwise operations
Optimized functions:
- u_vbuf_need_minmax_index
- u_vbuf_mapping_vertex_buffer_blocks
2012-04-24 01:39:22 +02:00
Marek Olšák
eaf8fe3335 u_vbuf: take advantage of all new vertex fetch caps 2012-04-24 01:39:22 +02:00
Marek Olšák
a0e352f5eb u_vbuf: simplify u_vbuf_set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
039f53b814 u_vbuf: rename native_attribs -> driver_attribs 2012-04-24 01:39:22 +02:00
Marek Olšák
23b948057a r600g: move updating vertex buffer state into set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
3e3737e9e2 st/mesa: always expose ARB_ES2_compatibility
u_vbuf translates GL_FIXED too if needed.
2012-04-24 01:39:22 +02:00
Marek Olšák
a78fd815d4 st/mesa: always expose ARB_half_float_vertex
u_vbuf kicks in and translates it to float if it's unsupported.
2012-04-24 01:39:22 +02:00
Marek Olšák
e0773da1e8 gallium: make user vertex buffers optional
This couldn't be split because it would break bisecting.

Summary:
* r300g,r600g: stop using u_vbuf
* r300g,r600g: also report that the FIXED vertex type is unsupported
* u_vbuf: refactor for use in the state tracker
* cso: wire up u_vbuf with cso_context
* st/mesa: conditionally install u_vbuf
2012-04-24 01:39:22 +02:00
Marek Olšák
79eafc14ca i915g: report that all vertex formats are supported
So that u_vbuf isn't enabled.
2012-04-24 01:39:22 +02:00
Marek Olšák
428855eea3 r600g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
e54cc2c070 r300g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
ae799a4948 u_vbuf: pull u_vbuf_draw_max_vertex_count into r300g 2012-04-24 01:39:22 +02:00
Marek Olšák
7fe3631a7a u_vbuf: make use of the new CAPs to determine what to do
This adds the ability to initialize u_vbuf_caps before creating u_vbuf itself.
It will be useful for determining if u_vbuf should be used or not.

Also adapt r300g and r600g.
2012-04-24 01:39:22 +02:00
Marek Olšák
978c1aa1d0 gallium drivers: report that user vertex buffers are supported 2012-04-24 01:39:21 +02:00
Marek Olšák
c9a9d1ba11 gallium: add CAPs for vertex fetcher
Supported vertex formats will be queried using
is_format_supported(.., PIPE_BIND_VERTEX_BUFFER, ..).
2012-04-24 01:39:21 +02:00
Marek Olšák
a52b3338c6 u_vbuf: remove u_vbuf_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
7d36478d88 u_vbuf: use user_ptr from pipe_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
e8ab3b1ce7 gallium: add user_ptr in pipe_resource
I need to access the pointer in st/mesa when I only have pipe_resource.
2012-04-24 01:39:21 +02:00
Marek Olšák
5ec7c28fdb u_vbuf: override draw_vbo 2012-04-24 01:39:21 +02:00
Marek Olšák
889238c8b1 u_vbuf: override create/bind/destroy_vertex_elements_state 2012-04-24 01:39:21 +02:00
Marek Olšák
2d03d4f4a3 u_vbuf: override set_vertex_buffers 2012-04-24 01:39:21 +02:00
Marek Olšák
31714ea4d5 u_vbuf: override set_index_buffer
This makes u_vbuf_mgr call the driver instead of the other way around.
2012-04-24 01:39:21 +02:00
Marek Olšák
76c4760e5d st/mesa: use cso_set_index_buffer and cso_draw_vbo
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
0f00786868 gallium/util: use cso_draw_arrays in util_draw_vertex_buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
76eefcc70c cso: add set_index_buffer and draw_vbo passthrough functions
v2: use util_draw_init_info

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Jeremy Huddleston
d9c9c7a111 darwin: Don't build gallium
fe3f98ed70 intentionally broke it, so
don't build it.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Jonas Maebe
c60ffd2840 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Marek Olšák
802ca81e26 vbo: call UpdateState directly when notifying a driver about _NEW_ARRAY
Core Mesa doesn't need to know about this.

This also removes the hack in recalculate_input_bindings.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
6fc565a94b vbo: do FLUSH_CURRENT before validating and updating state
This fixes an assertion failure since:
   commit 81afdd20f3
   vbo: don't check twice whether it's valid to render

FLUSH_CURRENT may set _NEW_CURRENT_ATTRIB.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
edec3fa812 r300g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
f940c0a3d9 r600g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Brian Paul
7f5420762c r600g: init vars to silence warnings 2012-04-23 13:29:06 -06:00
Han Shen(沈涵)
b352d676e4 bin/mklib: remove '-m32' for arm linux
-m32 is not a valid option for ARM.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-04-23 13:27:07 -06:00
Brian Paul
99ed0b2f9b st/mesa: no-op glCopyPixels if source region is out of bounds
If the source region for a glCopyPixels is completely outside the
source buffer bounds, no-op the copy.  Fixes a failed assertion.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-04-23 13:27:07 -06:00
Tom Stellard
d7f9b6ce13 radeon/llvm: Don't print an error message when there is no error
A blank line with an empty error message was being printed even when the
target lookup succeeded.
2012-04-23 09:34:05 -04:00
Tom Stellard
f5fc3ac284 radeon/llvm: Lower VCREATE_v4f32 for R600 and SI 2012-04-23 09:34:05 -04:00
Tom Stellard
519789d7e6 r600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG 2012-04-23 09:34:05 -04:00
Tom Stellard
3c0f521cbf r600g/llvm: Only emit an instruction's explicit operands 2012-04-23 09:34:05 -04:00
Tom Stellard
b3863eb9a5 r600g/llvm: Handle copies between vector registers 2012-04-23 09:34:05 -04:00
Tom Stellard
d4da0a0627 r600g/llvm: Remove debugging hack from R600InstrInfo::copyPhysReg() 2012-04-23 09:34:05 -04:00
Tom Stellard
90a42df0d0 r600g/llvm: Tell the code emitter to ignore KILL and BUNDLE 2012-04-23 09:34:04 -04:00
Tom Stellard
fa52aeb396 r600/llvm: Add LOAD_VTX instruction 2012-04-23 09:34:04 -04:00
Tom Stellard
ced73ea5df r600g: Add hooks for the LLVM shader compiler
The LLVM backend can now be enabled for r600g by using the
--enable-r600-llvm-compiler configure flag.  If you configure with this
flag, you can still use the default compiler by setting the envrionment
variable R600_USE_LLVM=0

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
2da9610566 r600g: Add TGSI->LLVM implementation v2
v2: Add case for ARUBA in r600_llvm_gpu_string()

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
509ddb0a04 radeon: Move radeon_llvm_emit.cpp declarations into their own header
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:33:55 -04:00
Tom Stellard
6e238bf27c radeon: Remove HAVE_LLVM ifdefs
Only LLVM 3.1 is supported, so these are not necessary.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:48 -04:00
Vadim Girlin
65b35b63d3 r600g: fix gpr number calculation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 08:53:47 -04:00
Tom Stellard
adb8eca1d8 configure.ac: Move HAVE_LLVM definition into configure.ac
Otherwise HAVE_LLVM won't be included in the $(DEFINES) variable for
Automake generated Makefiles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:47 -04:00
Dave Airlie
62b0323cf6 r600g: split add_reg into add_reg and add_reg_bo variants
This shaves 2k off the final dri.so, and removes lots of pointless
NULL, 0 passing.

most like pointless - but it looked nicer to me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-23 10:23:46 +01:00
Jonas Maebe
8d09f4d0cc glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-22 20:39:32 -07:00
Dave Airlie
e6aad9ba04 r600g: enable GLSL130 on all cards
Alexandre Demers sent me some cayman results with no major problems.

I'll rip out the env var in a week or so.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-22 08:09:05 +01:00
Dave Airlie
47d22e56de r600g: enable dual src blending on r600 cards
tested on my rv610 and it passes the tests with no hangs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:46:35 +01:00
Dave Airlie
7745cf2be4 r600g: enable GLSL 1.30 for r600 class
Full piglit run on my rv610 with no regressions.

This only leaves cayman, however my cayman is resisting my attempt
to get through a full piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:40:32 +01:00
Dave Airlie
12bedaa24b r600: enable glsl 1.30 on r700
I've done a piglit run on rv740 and confirmed no regressions.

We don't get GL3 on r700 due to transform feedback being busted still.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 10:38:31 +01:00
Dave Airlie
5f457f6618 r600g: report INTEGERS cap if glsl130 is on.
This cap is used by u_blitter to decide if it can use integers
in vertex data.

fixes some crashes with glsl130 in piglit

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:33:22 +01:00
Dave Airlie
7af9f6325e r600g: enable glsl 130 on evergreen.
I've done a piglit run on my SUMO machine and I see no regressions.

Lots of things to fix (skip->fail), but hey maybe we can fix them
if we can see them.

I'll try and work my way across r600,700,cayman sometime if nobody
else gets to them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:01:57 +01:00
Vadim Girlin
951b888be4 r600g: disable I2F conversion for InstanceID if integers are supported
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:44:06 +01:00
Vadim Girlin
e382a0c142 r600g: store glsl_feature_level in the r600_screen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:43:24 +01:00
Brian Paul
b0e048f0b9 mesa: move gl_array_attrib::NewState to gl_array_object::NewArrays
The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-20 07:32:33 -06:00
Brian Paul
0615eb8fc3 docs: recommend 2GB of RAM for Viewperf tests 2012-04-20 07:10:17 -06:00
Eric Anholt
137c5ece7d i965: Convert live interval computation to using live variable analysis.
Our previous live interval analysis just said that anything in a loop
was live for the whole loop.  If you had to spill a reg in a loop,
then we would consider the unspilled value live across the loop too,
so you never made progress by spilling.  Eventually it would consider
everything in the loop unspillable and fail out.

With the new analysis, things completely deffed and used inside the
loop won't be marked live across the loop, so even if you
spill/unspill something that used to be live across the loop, you
reduce register pressure.  But you usually don't even have to spill
any more, since our intervals are smaller than before.

This fixes assertion failure trying to compile the shader for the
"glyphy" text rasterier and piglit glsl-fs-unroll-explosion.

Improves Unigine Tropics performance 1.3% +/- 0.2% (n=5), by allowing
more shaders to be compiled in 16-wide mode.
2012-04-19 17:44:55 -07:00
Eric Anholt
34b17ee598 i965: Move the old live interval analysis code next to the new live vars code.
I'm about to replace the insides of this using the new analysis.
2012-04-19 17:44:55 -07:00
Eric Anholt
0d6c96a5c3 i965: Add support for live variable analysis using dataflow analysis. 2012-04-19 17:44:54 -07:00
Eric Anholt
080b125c64 i965: Add basic block generator.
This takes the fs_inst list generated by the visitor, and generates a
list of basic blocks with edges between them.  This is a building
block for data-flow analysis.
2012-04-19 17:44:54 -07:00
Eric Anholt
8890c75951 i965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation. 2012-04-19 17:44:54 -07:00
Eric Anholt
4b2a4cb7c2 glsl: Properly throw compile-time errors for conflicting FS output writes.
We were checking for these at link time previously, which is not as
early as mandated, and would actually fail to detect conflicting
writes if dead code removal removed some writes.

Fixes failures in piglit
glsl-*/compiler/fragment-outputs/write-gl_Frag*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:45 -07:00
Eric Anholt
f2475ca424 glsl: Track in each ir_variable whether it was ever assigned.
This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:36 -07:00
Eric Anholt
cc7e0de009 glsl: Convert the tests directory to automake.
This runs optimization-test and produces the usual automake test
output, which may be interesting to automated build systems.

This doesn't convert the tests to be individually exposed to the
automake runner, because automake doesn't like wildcards (due to being
nonportable in make, not that we care).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:31 -07:00
Eric Anholt
86f270e0a9 glsl: Fix up some comments in structure splitting, based on array-split work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:28 -07:00
Eric Anholt
6de5da0796 glsl: Don't allow array splitting on function arguments.
This is the reason the declaration member existed in the reference
visitor, but I didn't copy the code from structure splitting that
avoided setting it.

This wasn't currently a problem, because we don't allow splitting of
in/out variables.  But that would be nice to change some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:14 -07:00
Eric Anholt
538ba0a363 glsl: Rename the "whole_array_access" member in array splitting.
This was carried over from structure splitting, without thinking about
whether the name still made sense in this context.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:12 -07:00
Eric Anholt
36a8c9caaf glsl: Fix up a comment explaining what a visitor class does.
Ken noted that some of the "actual work" was happening in the caller
of this class.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:09 -07:00
Eric Anholt
c07290ddb2 glsl: Use the column_types() helper method.
Ken noted this in a review of this patch that I pushed early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:02 -07:00
Eric Anholt
40da3b0320 glx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-04-19 16:32:46 -07:00
Marek Olšák
bf3304a84b Revert "mesa: only update _MaxElement when we actually need it"
This reverts commit 0de5a21470.

I was wrong, we use it in the vbo module too.
This fixes a performance regression in Nexuiz.
2012-04-19 20:48:52 +02:00
Michel Dänzer
dbf48e88eb radeonsi: Fix VGPR_BIT() definition.
Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.
2012-04-19 19:59:54 +02:00
Michel Dänzer
09b2cd7ade radeonsi: Replace magic numbers for vertex buffer resource. 2012-04-19 19:59:54 +02:00
Michel Dänzer
9918fbd026 radeonsi: (User) SGPR related cleanups.
Use the same user SGPRs for the same purpose in vertex and pixel shaders.

Better calculation of the number of SGPRs to reserve.
2012-04-19 19:59:54 +02:00
Michel Dänzer
de12c6cb54 radeonsi: Fix sampler offsets for shader intrinsic.
The sampler number is in TGSI source register 1, and the S_LOAD_DWORD*
instructions take offsets in DWORDs, not bytes.
2012-04-19 19:59:54 +02:00
Brian Paul
7103a18c12 docs: overhaul the Mesa build/install instructions
Rearrange thing in general.  Mark the legacy Makefile system as deprecated.
2012-04-19 11:22:47 -06:00
Brian Paul
f64bae2e2a docs: freshen up the download/unpack instructions 2012-04-19 11:22:47 -06:00
Brian Paul
0e5327ecf4 mesa: move unrefs of array objects earlier in _mesa_free_context_data()
If a non-default array object was bound at context destruction time
we'd try to unreference the array object after it was already deleted
in _mesa_free_varray_data().  Now do the unref first.

Fixes a regression from commit 86f53e6d6b.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-19 11:22:37 -06:00
Christoph Bumiller
939b26639f nv50,nvc0: prevent multiple flushes when user spins on get_query_result 2012-04-19 14:56:04 +02:00
Christoph Bumiller
90b5301cea nv50/ir/opt: swap VP inputs to first source where possible 2012-04-19 14:56:03 +02:00
Marek Olšák
97e2f625b8 vbo: remove vbo_context::mat_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
8c990de0d6 vbo: remove vbo_context::generic_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fa48137f29 vbo: remove vbo_context::legacy_currval
It's not nice when you have several variables pointing to the same array
and you wanna ask your editor "where is this used" and you only get an answer
for one of the four currval, legacy_currval, generic_currval, mat_currval,
which is quite useless, because you never see the whole picture.

Let's get rid of the additional pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
f9c40dbb0d vbo: remove unused variables in vbo_context
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
81afdd20f3 vbo: don't check twice whether it's valid to render
It's already done in _mesa_validate_Draw* and it's not needed to do it again
unless I am missing something.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fb4a34e60e mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & valid
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
576c8c592a mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs
This is a frequently-updated state and _NEW_ARRAY already causes revalidation
of the vbo module. It's kinda counter-productive to recompute arrays
in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
784dd51198 mesa,vbo: properly detect when vertex arrays need to be recalculated
This moves the RebindArrays flag into the vbo module, consolidates the code,
and adds missing vbo_draw_method calls.

Also with this change, the vertex arrays are not needlessly recalculated twice.
The issue with the old code was:
- If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set.
- _mesa_update_state is called and the vp_varying_inputs change causes
  regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM.
- The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets
  the recalculate_inputs flag to TRUE again.
- The new code sets the flag to FALSE after the second _mesa_update_state,
  because there can't possibly be any change which would require recalculating
  the arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
0de5a21470 mesa: only update _MaxElement when we actually need it
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
233da380a9 st/mesa: use bitshifting to define state flags
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Michel Dänzer
e1a173fb33 radeonsi: MIMG shader instructions require waiting for the results. 2012-04-19 09:36:52 +02:00
Michel Dänzer
2308cf8daf radeonsi: Replace more magic numbers for sampler state. 2012-04-19 09:36:52 +02:00
Michel Dänzer
a1b67da0e1 radeonsi: Fix mip filter encoding in sampler state.
Blits are starting to work.
2012-04-19 09:36:51 +02:00
Michel Dänzer
81c847f0f7 radeonsi: Set tiling mode index for depth/stencil buffers. 2012-04-19 09:36:51 +02:00
Kenneth Graunke
14e9942841 glsl: Remove unused mem_ctx field from ir_array_splitting_visitor.
Vinson reported that we failed to initialize this, which would lead to
all kinds of crashes if we actually used it.  Since we don't use it,
we may as well just delete the broken code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 19:11:10 -07:00
Kenneth Graunke
4f96e9830f i965: Rename BRW_MAX_SURFACES to BRW_MAX_WM_SURFACES.
Now that we use separate binding tables for WM, VS, and GS, and have
BRW_MAX_VS_SURFACES and BRW_MAX_GS_SURFACES macros, we really shouldn't
have an unqualified BRW_MAX_SURFACES macro.  It's confusing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Kenneth Graunke
5177f6b1b9 i965: Fix outdated comments about binding tables.
They had a number of issues:
- A paragraph states that we use a single binding table, but we don't.
- We labelled the WM binding table diagram as SOL/WM.
- The WM diagram had an "Only relevant to the WM" comment.  Duh.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Mathias Fröhlich
86f53e6d6b mesa: Use array object constructor.
This change uses the array object factory for gl_array_objects. This
prevents crashes when deriving from gl_array_object.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-04-18 19:51:16 +02:00
Brian Paul
8ec18dfc1a svga: flush drawing before clearing
We don't normally clear immediately after drawing something.  But as it
was, the drawing would incorrectly appear after the clear.

Fixes piglit clear-varray-2.0 failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-18 08:34:48 -06:00
Brian Paul
168a3b8627 pipebuffer: split up assertion
The problem with assert(a && b) is you don't know which term is zero
when there's a failure.
2012-04-18 08:34:48 -06:00
Brian Paul
cf736aa098 svga: return PIPE_OK instead of 0 2012-04-18 08:34:48 -06:00
Marek Olšák
bdb0ad77c2 gallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
462dcf6173 gallium/u_blit: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
5db9cedeaf gallium: remove PIPE_TRANSFER_NOOVERWRITE, use equivalent UNSYNCHRONIZED 2012-04-18 16:19:39 +02:00
Marek Olšák
a8a478999c st/mesa: write vertices directly into the buffer for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
2b151bbb95 st/mesa: use u_upload_mgr to upload vertices for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
6c1fbe912f st/mesa: write vertices directly into the buffer in glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
b69dad1683 st/mesa: use u_upload_mgr to upload vertices for glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
0a43fd4c01 st/mesa: use u_upload_mgr to upload vertices for glDrawTexOES 2012-04-18 16:19:39 +02:00
Marek Olšák
3e8093d068 st/mesa: write vertices directly into the buffer for glBitmap 2012-04-18 16:19:39 +02:00
Marek Olšák
76d9a99d6b st/mesa: use u_upload_mgr to upload vertices for glBitmap
instead of recreating the vertex buffer for each draw_vbo call.
2012-04-18 16:19:38 +02:00
Michel Dänzer
0ef90e52d1 radeonsi: Improve calculation of number of pixel shader interpolants. 2012-04-18 10:53:59 +02:00
Michel Dänzer
bb79126420 radeonsi: Fix calculation of pitch value in sampler view state. 2012-04-18 10:52:33 +02:00
Michel Dänzer
f2c81a4bff radeonsi: Set tiling mode index in sampler view state.
Hardcode index for linear mode for now.
2012-04-18 10:51:48 +02:00
Michel Dänzer
29d7186e4c radeonsi: Replace magic numbers with register definitions in sampler state. 2012-04-18 10:49:00 +02:00
Michel Dänzer
c4bf6517ed radeonsi: Fix white border color type in sampler state. 2012-04-18 10:48:26 +02:00
Kenneth Graunke
32f7676e9c glsl/builtins: Rework profiles to use the new '.glsl' common suffix.
Deletes a lot of pointless duplication, as well as some run-time effort.

Conveniently, GLSL 1.40 no longer needs a .vert variant, since it
doesn't define any built-ins specific to the vertex shader stage.

ARB_texture_rectangle and OES_EGL_image_external also only need a single
profile, since the .vert and .frag variants were identical.

I didn't bother with EXT_texture_array and OES_texture_3D because
they're so tiny that the savings would be miniscule.

Cuts the generated builtin_function.cpp from 1.7MB to 1.0MB (41%).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:18 -07:00
Kenneth Graunke
fbea94ae59 glsl/builtins: Support stage-agnostic built-in profiles.
The built-in subsystem uses "profiles," or GLSL shaders containing
prototypes for all built-ins supported within a particular language
version (or extension) and shader stage.

Since profiles were stage-specific, we had to cut and paste almost all
the prototypes between (e.g.) 110.vert and 110.frag.  Naturally, this
led to sundry cut and paste bugs, where someone fixed an issue in .frag
but neglected to update .vert, or vice-versa.  Geometry shaders would
have only made this worse.

This patch introduces support for a new '.glsl' profile suffix which
contains prototypes common to all shader stages.  The existing '.frag'
and '.vert' profiles need only contain the few stage-specific built-ins.

Not only does this remove duplication, it makes built-in setup slightly
faster: we don't need to re-read the common prototypes and function
bodies for both the vertex and fragment shader stage.

Internally, this was trivial.  We already create a list of gl_shader
objects to search through for built-ins: one for the core language
version/stage, and additional shaders for any extensions in use.  This
patch simply adds another shader to the list: core/common, core/stage,
and extensions.

The next patch will update the profiles to remove the duplication.
It's separated out purely to make review easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:15 -07:00
Kenneth Graunke
7e35d97a02 glsl: Make the standalone compiler accept '.glsl' files.
These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:04:57 -07:00
Brian Paul
a5e95a419e mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()
Accelerates a few glReadPixels cases for WebGL.
See https://bugs.freedesktop.org/show_bug.cgi?id=48545

v2: Per Jose, use bit twiddling for the swizzle case instead of ubyte
arrays (it's about 44% faster).

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-17 13:22:18 -06:00
Dave Airlie
b814506e87 configure.ac: add IA64 support.
ia64 on Linux can use DRI as well.

Reported-by: russiane39 on #radeon
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=48788
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-17 19:59:26 +01:00
Kenneth Graunke
f4f6e1f5a0 glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.
The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

The GLSL 4.20 specification corrects these to "ivec2", but doesn't
mention this as being a conscious change in behavior.  Nor does the
ARB_shading_language_420pack extension.  So presumably it was a typo.

At any rate, our builtin functions all use ivec already, so the fact
that these prototypes use plain vecs will only lead to applications
dying in a fire when trying to use them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-17 11:27:51 -07:00
Christoph Bumiller
48aec56559 nv50: specify location of UCPs to code generator
Was made configurable in e44089b2f7
for Kepler but forgot to update nv50.
2012-04-17 18:35:16 +02:00
Tom Stellard
6077b347ae r600g: Use automake to generate Makefile 2012-04-17 09:54:02 -04:00
Eric Anholt
35f2fb70d3 Revert "glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function."
This reverts commit 4ec449a6ed.

I meant to not push this one.  Review found that a link error is not
mandated: it should link, but you get undefined rendering if you rely
on a missing stage.

     page 42/55 section 2.11 "Vertex Shaders":

     "If the program object has no vertex shader, or no program object
      is currently in use, the results of vertex shader execution are
      undefined."

(and similar for page 160/173 section 3.9 "Fragment Shaders" for FS,
and page 45/58 section 2.11.2 "Program Objects" for program being 0)

It turns out the commit was broken anyway, because it was missing a
"goto done", so linkstatus got smashed back to true later and the
error just showed up as a warning in the infolog.
2012-04-16 13:50:05 -07:00
Eric Anholt
f084b5ad32 docs: Update GLSL 1.40 status.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
252d99e4fa docs: Update that int textures got done for GL3.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
45f460f61e docs: Update that ARB_draw_instanced is on in i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
61c4e5cd68 docs: Update TBO support.
All I know of that needs finishing in Mesa is to enable the extension
in a GL3.1 core context on i965 -- we're not going to expose it in
non-3.1 core contexts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
4ec449a6ed glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
acd4024e0a glsl: Add remaining *sampler2DRect* texture functions.
Fixes the new piglit texelFetch() tests on these.  Note that the rest
of the new functions are not tested (same as the non-2DRect versions
of most of them).
2012-04-16 11:59:29 -07:00
Eric Anholt
b9fed9f3d5 glsl: Fix the prototype of textureProjGradOffset(sampler2DShadow)
Indirectly caught by Ken's review of my GLSL 1.40 changes where I
copy-and-pasted this line.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:19 -07:00
Eric Anholt
56e2f97697 glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.
The non-integer versions were already reserved in 1.30, but apparently
these were forgotten.

Fixes piglit glsl-1.40/compiler/reserved/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:21 -07:00
Eric Anholt
d91c8edd85 glsl: Add textureSize(*samplerBuffer) support.
Fixes the corresponding new tests in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:18 -07:00
Eric Anholt
9a01e09ee5 glsl: Fix comment typo in 1.40 work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:16 -07:00
Eric Anholt
ecc4c361a6 mesa: Remove dead _mesa_sizeof_glsl_type().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:14 -07:00
Eric Anholt
9d921b168b gtest: Don't actually install a library.
The whole point of importing it was that you're not supposed to
install this library.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=411825
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:25:39 -07:00
Brian Paul
6f89f5a524 svga: add case for PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-16 10:35:36 -06:00
Dylan Noblesmith
a3d56734df autoconf: add AM_PROG_CC_C_O
Prevents this error with Automake 1.9:

src/gallium/drivers/Makefile.am: C objects in subdir but
`AM_PROG_CC_C_O' not in `configure.ac'
autoreconf: automake failed with exit status: 1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 15:45:32 +00:00
Christoph Bumiller
847c898702 nvc0: fix nve4 linear copies 2012-04-16 00:38:17 +02:00
Christoph Bumiller
1ce9205f79 targets/xvmc-nouveau: fix accidental hardcoded include path
5b0cd37324 wasn't meant to be pushed.
2012-04-15 16:40:53 +02:00
Christoph Bumiller
e55c276255 nv50: use correct semantic map value for undefined PointSize output 2012-04-15 16:30:13 +02:00
Christoph Bumiller
5b0cd37324 targets/xvmc-nouveau: add libdrm include path 2012-04-15 16:26:21 +02:00
Ben Skeggs
d37f90f131 nv30: init sample_mask to some default value at context creation time
Fixes demos/lodbias.
2012-04-15 22:18:02 +10:00
Ben Skeggs
29128e5ee2 nv30: fix some sifm transfer issues 2012-04-15 21:56:20 +10:00
José Fonseca
abfe759172 scons: Fix egl-static build due to conflicting symbols.
radeonsi and r600 have duplicate symbols, so it's not possible to
statically link both.  Remove the newcomer, radeonsi, until duplicate
symbols are fixed.
2012-04-15 11:32:21 +01:00
Christoph Bumiller
e44089b2f7 nvc0: add initial support for nve4+ (Kepler) chipsets
Most things that work on Fermi should work on Kepler too.

There are a few performance optimizations left to do, like better
placement of texture barriers and adding scheduling data to the
shader instructions (without them, a thread group will be masked
for 32 cycles after each single instruction issue).
2012-04-15 00:08:51 +02:00
Tom Stellard
69a921892d radeonsi: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS/
Fixes build broken by commit 0d29fb017b
2012-04-14 17:40:35 -04:00
Christoph Bumiller
a6fcf14c23 nv50/ir/opt: extend handleCVT for nv50's SET u32 to f32 chain 2012-04-14 21:54:04 +02:00
Christoph Bumiller
a9f22b91e5 nv50/ir: print interpolation mode 2012-04-14 21:54:04 +02:00
Christoph Bumiller
dcc91fc5d3 nv50: update FP linkage state on one/two-sided lighting switch 2012-04-14 21:54:04 +02:00
Christoph Bumiller
df982399cc nv50: delete old shader compiler files 2012-04-14 21:54:04 +02:00
Christoph Bumiller
0bbf1659df nv50: hook up to new shader code generator 2012-04-14 21:54:04 +02:00
Christoph Bumiller
322bc7ed68 nv50/ir: import nv50 target 2012-04-14 21:54:04 +02:00
Christoph Bumiller
15ce0f76e2 nv50/ir: fix off-by-ones in CSE and nvc0 insnCanLoad 2012-04-14 21:54:04 +02:00
Christoph Bumiller
ce04221081 nv50/ir/tgsi: generate UCPs with actual outputs instead of SVs
gl_ClipDistance is treated the same way, this is just nicer and
easier assign slots for them on nv50.
2012-04-14 21:54:04 +02:00
Francisco Jerez
d07e4421ab nv50/ir: Fix type of the instruction created by mkCmp() for dst in FILE_FLAGS. 2012-04-14 21:54:04 +02:00
Christoph Bumiller
f8c3212cbb nv50/ir: fix Instruction::isCommutationLegal for WAW 2012-04-14 21:54:03 +02:00
Francisco Jerez
93508b5b0d nv50/ir/opt: Add isOptSupported() check in logical arith optimization. 2012-04-14 21:54:03 +02:00
Francisco Jerez
f4dbdcbfcf nv50/ir/ra: Fix live set propagation in the secondary passes of buildLiveSets(). 2012-04-14 21:54:03 +02:00
Christoph Bumiller
2fc014f8c0 nv50/ir/opt: don't regard OP_WRSV as dead code 2012-04-14 21:54:03 +02:00
Christoph Bumiller
a765d7880f nv50/ir: add isUniform query to Values 2012-04-14 21:54:03 +02:00
Christoph Bumiller
e43a3a66a9 nv50/ir: rewrite the register allocator as GCRA, with spilling
This is more flexible than the linear scan, and we don't need the
separate allocation pass for constrained values anymore.
2012-04-14 21:54:03 +02:00
Christoph Bumiller
99319328d4 nv50/ir/tgsi: only export x-component of PSIZE 2012-04-14 21:54:03 +02:00
Christoph Bumiller
12a2f5121d nvc0: fix emission of 3rd src in SET_AND,OR,XOR 2012-04-14 21:54:03 +02:00
Francisco Jerez
f01efba60a nv50/ir: Fix BuildUtil::mkSelect and mkClobber 2012-04-14 21:54:03 +02:00
Christoph Bumiller
054fab5b48 nv50/ir: fix reg file conflicts with undefined-value placeholders 2012-04-14 21:54:03 +02:00
Christoph Bumiller
51327a2df2 nv50/ir/opt: silence warning (int < Elements() signedness) 2012-04-14 21:54:03 +02:00
Christoph Bumiller
ef7f9f68cf nv50/ir/opt: fix combineSt access to wrong instruction 2012-04-14 21:54:03 +02:00
Christoph Bumiller
bb9c15bac4 nv50/ir/opt: another insn NULL check in phi elimination 2012-04-14 21:54:03 +02:00
Francisco Jerez
4ece0dbd2f nv50/ir/ssa: Take into account function inputs and outputs. 2012-04-14 21:54:02 +02:00
Francisco Jerez
4a44f94caf nv50/ir: Clean up before calculating instruction ordering for a new function. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a539785187 nv50/ir/ra: Allocate registers for function arguments. 2012-04-14 21:54:02 +02:00
Francisco Jerez
530ff61ba7 nv50/ir: Take into account function args in the live range calculation code. 2012-04-14 21:54:02 +02:00
Francisco Jerez
ed255dbae2 nv50/ir/ra: Use matching physical regs for function args in caller and callee. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a3dd45e1c2 nv50/ir/tgsi: Infer function inputs/outputs.
Edit: Don't do it for the main function of (graphics) shaders,
its inputs and outputs always go through TGSI_FILE_INPUT/OUTPUT.
This prevents all TEMPs from counting as live out and reduces
register pressure.
2012-04-14 21:54:02 +02:00
Francisco Jerez
9bb36d54a2 nv50/ir/tgsi: Replace the inlining logic with proper function calls. 2012-04-14 21:54:02 +02:00
Francisco Jerez
56d40aa51b nv50/ir: Decouple DataArray from the dictionary that maps locations to values.
The point is to keep an independent dictionary for each function.

The array that was being used as dictionary has been converted into a
"bimap" for two different reasons: first, because having an almost
empty instance of an array with as many entries as registers there are
in the program, once for every function, would be wasteful, and
second, because we want to be able to map Value pointers back to
locations at some point.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
d41f293bf0 nv50/ir/opt: don't delete instruction in removeFlow before its last use 2012-04-14 21:54:02 +02:00
Christoph Bumiller
be161e66d6 nv50/ir/opt: check BB equality before instruction ordering in CSE 2012-04-14 21:54:02 +02:00
Christoph Bumiller
44e84d6f16 nv50/ir/opt: don't copy-propagate cond MOVs or MOVs to other reg files
We've never encountered the latter on nvc0, but on nv50 we have moves
between GPRs and address regs.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
ca1fc2b864 nv50/ir/opt: don't replace conditional definitions in CSE 2012-04-14 21:54:02 +02:00
Francisco Jerez
90f0fac655 nv50/ir/opt: Update the symbol size when combining loads and stores. 2012-04-14 21:54:02 +02:00
Christoph Bumiller
5df92c81c3 nv50/ir: initialize FlowInstruction::builtin 2012-04-14 21:54:01 +02:00
Francisco Jerez
1e95794173 nv50/ir/opt: Fix for function calls. 2012-04-14 21:54:01 +02:00
Francisco Jerez
98116cc3dc nv50/ir: Build a "symbol" table with the binary offsets of each function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
5e4b2a1a47 nv50/ir: Add support for removing functions from a program. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d32ebb8c30 nv50/ir: Scan program functions in DFS-postorder.
The reason is that several passes (regalloc, function argument
binding, inlining) are going to require the callees of a function to
be processed before the caller.
2012-04-14 21:54:01 +02:00
Francisco Jerez
78de8c8ab5 nv50/ir: Deal with graph iterators using RAII. 2012-04-14 21:54:01 +02:00
Francisco Jerez
898b0981b6 nv50/ir: Add convenience method for calculating the live sets of a function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
3e9150cd96 nv50/ir: Add support code for calculating the clobber set of a BB or function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d6d1f0e4a2 nv50/ir/opt: Don't lose modifiers during constant folding. 2012-04-14 21:54:01 +02:00
Francisco Jerez
14d5f975a6 nv50/ir/opt: Improve modifier handling. 2012-04-14 21:54:01 +02:00
Francisco Jerez
784848a94d nv50/ir: Add support for cloning FlowInsns, ImmediateVals and BBs. 2012-04-14 21:54:01 +02:00
Francisco Jerez
a05e6a3fa2 nv50/ir: Decouple object cloning logic from the sub-object recursion policy. 2012-04-14 21:54:01 +02:00
Francisco Jerez
da28ba00d8 nv50/ir: Make sure that several IR objects are destroyed on takedown. 2012-04-14 21:54:01 +02:00
Christoph Bumiller
9362d4bc0a nv50/ir: make Instruction::src/def container private 2012-04-14 21:54:00 +02:00
Francisco Jerez
8cc2eca5df nv50/ir: Add support for unlimited instruction arguments. 2012-04-14 21:54:00 +02:00
Christoph Bumiller
15d224f7a7 nv50/ir: temporarily exclude nv50 code emitter from build
It's not used yet and shouldn't have been included in the first
place.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
f113b6f959 nv50/ir: copy value size in SSA-rename pass 2012-04-14 21:54:00 +02:00
Christoph Bumiller
55f9bdb64e nv50/ir/opt: improve post-multiply and check target for support 2012-04-14 21:54:00 +02:00
Christoph Bumiller
56cf2da022 nv50/ir: add setFlagsDef/Src helper
Will be used by nv50 target.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
286abcb51e nv50/ir: add isAccessSupported check for memory access coalescing 2012-04-14 21:54:00 +02:00
Christoph Bumiller
c04d6d95e0 nv50/ir: add function for splitting a BasicBlock
Fixes to initial implementation by Francisco Jerez.
2012-04-14 21:54:00 +02:00
Francisco Jerez
0056e1b988 nv50/ir: Allow attaching two nodes when either one is already inside the graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
099b81396e nv50/ir: Allow inserting isolated nodes to a graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
1829484458 nv50/ir: Fix memory corruption in Function::orderInstructions().
"iter" doesn't reference a BasicBlock directly, but a Node::Graph,
i.e. BasicBlock::get() is casting to the wrong pointer type.
2012-04-14 21:54:00 +02:00
Francisco Jerez
ab382fbc35 nv50/ir: Fix up insertion of PHI instructions using bb->insertHead(). 2012-04-14 21:54:00 +02:00
Christoph Bumiller
fc740e7924 nv50/ir: fix insertHead and remove for BBs with PHI ops only 2012-04-14 21:54:00 +02:00
Francisco Jerez
349cb60ed5 nv50/ir: Don't crash on zero sized BitSets. 2012-04-14 21:54:00 +02:00
Francisco Jerez
f0a7ec9a2f nv50/ir: Fix Interval::clear(). 2012-04-14 21:53:59 +02:00
Christoph Bumiller
cd6d63fa60 nv50/ir/tgsi: handle inferSrcType(NOT) to be u32 2012-04-14 21:53:59 +02:00
Francisco Jerez
658c0bee71 nv50/ir/opt: Fix OP_NOT to modifier conversion. 2012-04-14 21:53:59 +02:00
Dave Airlie
f8741ff21e r600g: disable dual-src hangs evergreen for some reason.
This did work previously, so I've broken something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-14 20:25:59 +01:00
Tom Stellard
0b59909e78 r300/compiler: Exit immediately from rc_vert_fc() if there is an error
This way we correctly report "Too many temporaries" errors.

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

Note: This is a candidate for the stable branches.
2012-04-14 12:11:29 -04:00
Tom Stellard
73249239cf r300/compiler: Copy all instruction attributes during local transfoms
Instruction attributes like WriteALUResult and ALUResultCompare
were being discarded during the some of the local transformations.

This fixes the following piglit tests:

glsl1-inequality (vec2, pass)
loopfunc
fs-any-bvec2-using-if
fs-op-ne-bvec2-bvec2-using-if
fs-op-ne-ivec2-ivec2-using-if
fs-op-ne-mat2-mat2-using-if
fs-op-ne-vec2-vec2-using-if
fs-op-ne-mat2x3-mat2x3-using-if
fs-op-ne-mat2x4-mat2x4-using-if

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

NOTE: This is a candidate for the stable branches.
2012-04-14 10:02:19 -04:00
Tom Stellard
b2df031a95 r300/compiler: Fix nested flow control in r500 vertex shaders 2012-04-13 22:24:16 -04:00
Tom Stellard
4a269a8dc0 r300/compiler: Clear loop registers in vertex shaders w/o loops
The loop registers weren't being cleared, so any shader that was
executed after a shader containing loops was at risk of having a loop
randomly inserted into it.

This fixes over one hundred piglit tests, although these test
only failed during full piglit runs and would pass if
run individually.  The exact number of piglit tests that this patch
fixes will vary depending on the version of piglit and the order the
tests are run.

NOTE: This is a candidate for the stable branches.
2012-04-13 22:23:46 -04:00
Eric Anholt
3f349d4e18 glsl: If an "if" has no "then" or "else" code left, remove it.
Cuts 8/1068 instructions from glyphy's fragment shaders on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-13 17:13:23 -07:00
Eric Anholt
8bb0091e68 glsl: Add a helper for generating temporary variables in ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:20 -07:00
Eric Anholt
d32780d504 glsl: Add a helper for ir_builder to make dereferences for assignments.
v2: Fix writemask setup for non-vec4 assignments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:17 -07:00
Eric Anholt
7e88f8ce8f glsl: Make a little tracking class for emitting IR lists.
This lets us significantly shorten p->instructions->push_tail(ir), and
will be used in a few more places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:14 -07:00
Eric Anholt
b782352745 glsl: Add common swizzles to ir_builder.
Now we can fold a bunch of our expression setup in ff_fragment_shader
into single-line, parseable commits.

v2: Make it actually work.  I wasn't setting num_components in the
    mask structure, and not setting up a mask structure is way easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:10 -07:00
Eric Anholt
d6e6566206 glsl: Let ir_builder expressions take un-dereferenced variables.
Having to explicitly dereference is irritating and bloats the code,
when the compiler can detect and do the right thing.

v2: Use a little shim class to produce the automatic dereference
    generation at compile time as opposed to runtime, while also
    allowing compile-time type checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:03 -07:00
Eric Anholt
599aac95ff glsl: Create an ir_builder helper for hand-generating IR.
The C++ constructors with placement new, while functional, are
extremely verbose, leading to generation of simple GLSL IR expressions
like (a * b + c * d) expanding to many lines of code and using lots of
temporary variables.  By creating a new ir_builder.h that puts simple
generators in our namespace and taking advantage of ralloc_parent(),
we can generate much more compact code, at a minor runtime cost.

v2: Replace ir_instruction usage with just ir_rvalue.
v3: Drop remaining missed as_rvalue() in v2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 16:59:45 -07:00
Christoph Bumiller
0e8ad4cc74 nv50,nvc0: fix handling of user vbufs with stride < access size 2012-04-14 06:14:21 +02:00
Christoph Bumiller
7a40ae4a31 nvc0: prefix all macro methods with MACRO
Some of them have non-macro counterparts.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
ce713cd520 nvc0: replace VERTEX_DATA push mode with translate to buffer
While pushing vertices through the FIFO is relatively fast on nv50,
it's horribly slow on nvc0.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
edbfeed56f nvc0: improve vertex state validation
Now updating vertex attribute format only when necessary.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
784f49e696 nvc0: track texture dirty state individually 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2206a7f513 nv50,nvc0: use new scratch buffers code 2012-04-14 06:14:21 +02:00
Christoph Bumiller
680f20351e nouveau: add new shared scratch buffers 2012-04-14 06:14:21 +02:00
Christoph Bumiller
36158c1994 nvc0: only force early fragment tests if requested by shader 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2d06ee8bf7 nv50,nvc0: hold references to the framebuffer surfaces 2012-04-14 06:14:21 +02:00
Marek Olšák
687c05661f r300g: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Marek Olšák
7864933acd u_blitter: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Brian Paul
286e50a87d docs: document another viewperf bug in Maya-03 2012-04-13 14:31:33 -06:00
Marcin Slusarz
f2509df95c xorg/nouveau: switch to libdrm_nouveau-2.0 2012-04-13 21:55:56 +02:00
Martin Peres
3dd12ccc06 targets/{egl-static,gbm}: further clean-up the nvfx remains 2012-04-14 03:12:39 +02:00
Christoph Bumiller
21b50ce63b nvc0: remove include of old libdrm_nouveau's nouveau_reloc.h 2012-04-14 03:05:02 +02:00
Christoph Bumiller
802d02c453 nv50,nvc0: handle PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-14 02:40:30 +02:00
Christoph Bumiller
42ec248eb7 nv30: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS
Merge accident.
2012-04-14 02:40:09 +02:00
Ben Skeggs
a2fc42b899 nv30: import new driver for GeForce FX/6/7 chipsets, and Quadro variants
The primary motivation for this rewrite was to have a maintainable driver
going forward, as nvfx was quite horrible in a lot of ways.

The driver is heavily based on the design of the nv50/nvc0 3d drivers we
already have, and uses the same common buffer/fence code.  It also passes
a HEAP more piglit tests than nvfx did, supports a couple more features,
and a few more to come still probably.

The CPU footprint of this driver is far far less than nvfx, and translates
into far greater framerates in a lot of applications (unless you're using
a CPU that's way way newer than the GPUs of these generations....)

Basically, we once again have a maintained driver for these chipsets \o/

Feel free to report bugs now!
2012-04-14 02:56:34 +10:00
Christoph Bumiller
6d1cdec3ba nouveau: switch to libdrm_nouveau-2.0 2012-04-14 02:56:33 +10:00
Christoph Bumiller
3c7872f35f nvc0: remove obsolete nvc0_push2.c
Slower version of nvc0_push.c, was only used to ascertain that
bugs were not the new version's fault.
2012-04-14 02:56:33 +10:00
Christoph Bumiller
a3fee8fc86 nouveau: remove automatic buffer migration heuristics 2012-04-14 02:56:32 +10:00
Ben Skeggs
66c7dc5688 nvfx: completely remove this driver (GeForce FX/6/7)
This driver hasn't been maintained properly for a very long time, and for
many very good reasons.  It's horrible.

A new driver supporting these chipsets will appear with the commits that
port vieux/nv50/nvc0 to libdrm_nouveau-2.0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-14 02:56:30 +10:00
Ben Skeggs
f3d8bd3f7b nouveau: rework and simplify nv04/nv05 driver a bit
TEXTURED_TRIANGLE and MULTITEX_TRIANGLE are both a bit special in that if
you use any other graph object in the meantime they'll forget their state
and spew a lovely METHOD_CNT error at you when you try to draw.

The pre-newlib driver has a flush_notify() hook which does this state
re-emit, and a number of random workarounds like extra flushes and state
dirtying after various operations to solve this issue.

I'm taking a slightly different approach to things instead, which has the
nice side-effect of removing the divergent code-paths for ttri/mtri, the
flush/dirty workarounds and the need for flush_notify.  Also gives a few
FPS boost in OA, yay.
2012-04-14 02:56:12 +10:00
Ben Skeggs
2e47d01c9e nouveau/vieux: switch to libdrm_nouveau-2.0 2012-04-14 02:56:12 +10:00
Dave Airlie
7308b6e75f docs: update GL3.txt for ARB_blend_func_extended
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
1f2b539451 gallium: document dual source blending restrictions on gallium
As per Brian's suggestion, document the restrictions on dual src blending.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
d1cc87c0b6 r600g: initial r600 dual src blending support
survives piglit with no regressions on rv610/evergreen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
4b1c3b920e softpipe: add dual source blending support
This adds support for a single dual source blending MRT to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
c59d32d1ce util: add dual blend helper function (v2)
This is just a function to tell if a certain blend mode requires dual sources.

v2: move to inlines as per Brian's suggestion

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
a21df96507 st/mesa: add ARB_blend_func_extended support to state tracker.
This adds the blend mode mapping, it also uses the var->index in the
glsl to tgsi convertor - this is the other half of my using 4 in the GLSL
compiler.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
0d29fb017b gallium: rename DUAL_SOURCE_BLEND cap to MAX_DUAL_SOURCE_RENDER_TARGETS
Though I don't think we'll ever expose > 1.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
1256a5dcc8 glsl: add support for ARB_blend_func_extended (v3)
This adds index support to the GLSL compiler.

I'm not 100% sure of my approach here, esp without how output ordering
happens wrt location, index pairs, in the "mark" function.

Since current hw doesn't ever have a location > 0 with an index > 0,
we don't have to work out if the output ordering the hw requires is
location, index, location, index or location, location, index, index.
But we have no hw to know, so punt on it for now.

v2: index requires layout - catch and error
    setup explicit index properly.

v3: drop idx_offset stuff, assume index follow location

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:01 +01:00
Dave Airlie
f8cf79936b mesa: add support for ARB_blend_func_extended (v4)
Add implementations of the two API functions,
Add a new strings to uint mapping for index bindings
Add the blending mode validation for SRC1 + SRC_ALPHA_SATURATE
Add get for MAX_DUAL_SOURCE_DRAW_BUFFERS

v2:
Add check in valid_to_render to address case in spec ERRORS.

v3:
Add index to ir.h so this patch compiles on its own
fixup comment

v4: fixup Brian's comments

The GLSL patch will setup the indices.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:18:55 +01:00
Tom Stellard
a75c6163e6 radeonsi: initial WIP SI code
This commit adds initial support for acceleration
on SI chips.  egltri is starting to work.

The SI/R600 llvm backend is currently included in mesa
but that may change in the future.

The plan is to write a single gallium driver and
use gallium to support X acceleration.

This commit contains patches from:
Tom Stellard <thomas.stellard@amd.com>
Michel Dänzer <michel.daenzer@amd.com>
Alex Deucher <alexander.deucher@amd.com>
Vadim Girlin <vadimgirlin@gmail.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

The following commits were squashed in:

======================================================================

radeonsi: Remove unused winsys pointer

This was removed from r600g in commit:

commit 96d882939d
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Feb 17 01:49:49 2012 +0100

    gallium: remove unused winsys pointers in pipe_screen and pipe_context

    A winsys is already a private object of a driver.

======================================================================

radeonsi: Copy color clamping CAPs from r600

Not sure if the values of these CAPS are correct for radeonsi, but the
same changed were made to r600g in commit:

commit bc1c836938
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jan 23 03:11:17 2012 +0100

    st/mesa: do vertex and fragment color clamping in shaders

    For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
    the perfect place for a fallback.
    The exceptions are:
    - r500 (vertex clamp only)
    - nv50 (both)
    - nvc0 (both)
    - softpipe (both)

    We also have to take into account that r300 can do CLAMPED vertex colors only,
    while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
    with the two new CAPs.

======================================================================

radeonsi: Remove PIPE_CAP_OUTPUT_READ

This CAP was dropped in commit:

commit 04e3240087
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Feb 23 23:44:36 2012 +0100

    gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

    r600g is the only driver which has made use of it. The reason the CAP was
    added was to fix some piglit tests when the GLSL pass lower_output_reads
    didn't exist.

    However, not removing output reads breaks the fallback for glClampColorARB,
    which assumes outputs are not readable. The fix would be non-trivial
    and my personal preference is to remove the CAP, considering that reading
    outputs is uncommon and that we can now use lower_output_reads to fix
    the issue that the CAP was supposed to workaround in the first place.

======================================================================

radeonsi: Add missing parameters to rws->buffer_get_tiling() call

This was changed in commit:

commit c0c979eebc
Author: Jerome Glisse <jglisse@redhat.com>
Date:   Mon Jan 30 17:22:13 2012 -0500

    r600g: add support for common surface allocator for tiling v13

    Tiled surface have all kind of alignment constraint that needs to
    be met. Instead of having all this code duplicated btw ddx and
    mesa use common code in libdrm_radeon this also ensure that both
    ddx and mesa compute those alignment in the same way.

    v2 fix evergreen
    v3 fix compressed texture and workaround cube texture issue by
       disabling 2D array mode for cubemap (need to check if r7xx and
       newer are also affected by the issue)
    v4 fix texture array
    v5 fix evergreen and newer, split surface values computation from
       mipmap tree generation so that we can get them directly from the
       ddx
    v6 final fix to evergreen tile split value
    v7 fix mipmap offset to avoid to use random value, use color view
       depth view to address different layer as hardware is doing some
       magic rotation depending on the layer
    v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
       evergreen, align bytes per pixel to a multiple of a dword
    v9 fix handling of stencil on evergreen, half fix for compressed
       texture
    v10 fix evergreen compressed texture proper support for stencil
        tile split. Fix stencil issue when array mode was clear by
        the kernel, always program stencil bo. On evergreen depth
        buffer bo need to be big enough to hold depth buffer + stencil
        buffer as even with stencil disabled things get written there.
    v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
        old ddx overestimate those. Fix linear case when pitch*height < 64.
        Fix r300g.
    v12 Fix linear case when pitch*height < 64 for old path, adapt to
        libdrm API change
    v13 add libdrm check

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>

======================================================================

radeonsi: Remove PIPE_TRANSFER_MAP_PERMANENTLY

This was removed in commit:

commit 62f44f670b
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Mar 5 13:45:00 2012 +0100

    Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"

    This reverts commit 0950086376.

    It was decided to refactor the transfer API instead of adding workarounds
    to address the performance issues.

======================================================================

radeonsi: Handle PIPE_VIDEO_CAP_PREFERED_FORMAT.

Reintroduced in commit 9d9afcb5ba.

======================================================================

radeonsi: nuke the fallback for vertex and fragment color clamping

Ported from r600g commit c2b800cf38.

======================================================================

radeonsi: don't expose transform_feedback2 without kernel support

Ported from r600g commit 15146fd1bc.

======================================================================

radeonsi: Handle PIPE_CAP_GLSL_FEATURE_LEVEL.

Ported from r600g part of commit 171be75522.

======================================================================

radeonsi: set minimum point size to 1.0 for non-sprite non-aa points.

Ported from r600g commit f183cc9ce3.

======================================================================

radeonsi: rework and consolidate stencilref state setting.

Ported from r600g commit a2361946e7.

======================================================================

radeonsi: cleanup setting DB_SHADER_CONTROL.

Ported from r600g commit 3d061caaed.

======================================================================

radeonsi: Get rid of register masks.

Ported from r600g commits
3d061caaed13b646ff40754f8ebe73f3d4983c5b..9344ab382a1765c1a7c2560e771485edf4954fe2.

======================================================================

radeonsi: get rid of r600_context_reg.

Ported from r600g commits
9344ab382a1765c1a7c2560e771485edf4954fe2..bed20f02a771f43e1c5092254705701c228cfa7f.

======================================================================

radeonsi: Fix regression from 'Get rid of register masks'.

======================================================================

radeonsi: optimize r600_resource_va.

Ported from r600g commit 669d8766ff.

======================================================================

radeonsi: remove u8,u16,u32,u64 types.

Ported from r600g commit 78293b99b2.

======================================================================

radeonsi: merge r600_context with r600_pipe_context.

Ported from r600g commit e4340c1908.

======================================================================

radeonsi: Miscellaneous context cleanups.

Ported from r600g commits
e4340c1908a6a3b09e1a15d5195f6da7d00494d0..621e0db71c5ddcb379171064a4f720c9cf01e888.

======================================================================

radeonsi: add a new simple API for state emission.

Ported from r600g commits
621e0db71c5ddcb379171064a4f720c9cf01e888..f661405637bba32c2cfbeecf6e2e56e414e9521e.

======================================================================

radeonsi: Also remove sbu_flags member of struct r600_reg.

Requires using sid.h instead of r600d.h for the new CP_COHER_CNTL definitions,
so some code needs to be disabled for now.

======================================================================

radeonsi: Miscellaneous simplifications.

Ported from r600g commits 38bf276348 and
b0337b679a.

======================================================================

radeonsi: Handle PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION.

Ported from commit 8b4f7b0672.

======================================================================

radeonsi: Use a fake reloc to sleep for fences.

Ported from r600g commit 8cd03b933c.

======================================================================

radeonsi: adapt to get_query_result interface change.

Ported from r600g commit 4445e170be.
2012-04-13 10:32:06 -04:00
Dylan Noblesmith
e55cf4854d st/vega: silence enum cast warnings
clang warns on these:

stroker.c:626:19: warning: implicit conversion from enumeration
type 'VGPathCommand' to different enumeration type 'VGPathSegment'
[-Wconversion]

No change in the underlying value.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:27:11 +00:00
Dylan Noblesmith
dd32df3829 i965: fix typo
Noticed by clang:

brw_wm_surface_state.c:330:30: warning: initializer overrides prior
initialization of this subobject [-Winitializer-overrides]
      [MESA_FORMAT_Z24_S8] = 0,
                             ^
brw_wm_surface_state.c:326:30: note: previous initialization is here
      [MESA_FORMAT_Z24_S8] = 0,
                             ^

No functionality change, since the array is declared static so
it was zero-initialized by default.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-13 14:25:12 +00:00
Dylan Noblesmith
52d021d4d7 mesa: fix truncated value warning
Silences a clang warning:

format_pack.c:2546:30: warning: implicit conversion from 'int' to
'GLubyte' (aka 'unsigned char') changes value from 65535 to 255
[-Wconstant-conversion]
               d[i] = d[i] ? 0xffff : 0x0;
                           ~ ^~~~~~

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
75fe7d1995 mesa: don't cast away const
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
2bb91274e2 egl-static: fix printf warning
Noticed by clang:

egl_st.c:57:50: warning: field precision should have type 'int',
but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
      ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
                                               ~~^~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
6a491b5728 st/vega: fix uninitialized values
C still treats array arguments exactly like pointer arguments.
By sheer coincidence, this still worked fine on 64-bit
machines where 2 * sizeof(float) == sizeof(void*), but not
on 32-bit.

Noticed by clang:

text.c:76:51: warning: sizeof on array function parameter will
return size of 'const VGfloat *' (aka 'const float *') instead of
'const VGfloat [2]' [-Wsizeof-array-argument]
   memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin));

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
071501a681 egl: fix uninitialized values
Noticed by clang:

eglimage.c:48:28: warning: argument to 'sizeof' in 'memset' call is
the same expression as the destination; did you mean to dereference
it? [-Wsizeof-pointer-memaccess]
   memset(attrs, 0, sizeof(attrs));
          ~~~~~            ^~~~~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
520521e380 util: fix uninitialized table
Most of the 256 values in the 'generic_to_slot' table were supposed to
be initialized with the default value 0xff, but were left at zero
(from CALLOC_STRUCT()) instead.

Noticed by clang:

u_linkage.h:60:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination;
      did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(table, 0xff, sizeof(table));
          ~~~~~               ^~~~~

Also fix a signed/unsigned comparison and a comment typo here.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:07 +00:00
Dylan Noblesmith
ccff749712 util: fix undefined behavior
container_of() can legally return anything, even invalid addresses
that cause segfaults, when 'sample' is an uninitialized pointer.

Bug exposed by clang.

NOTE: This is a candidate for the 8.0 branch.
2012-04-13 14:25:07 +00:00
Vinson Lee
10ec14865a ir_to_mesa: Fix uninitialized member in add_uniform_to_shader.
Fix uninitialized scalar field defect reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 22:43:23 -07:00
Neil Roberts
4f2eafe4dc wayland-drm: Implement wl_buffer.damage in old versions of Wayland
Commit 272bc48976 removed the damage implementation for the
wl_buffer_interface because that has been removed from git master of
Wayland. However this breaks building with the 0.85 branch of Wayland
because it would end up initialising the struct incorrectly.

For the time being it's quite convenient for some compositors to track
the 0.85 branch of Wayland because the protocol is stable but they
will also want to track the master branch of Mesa so that they can use
the gbm surface changes.

This patch adds a compile-time check for the version of Wayland so
that it can work with either Wayland master or the 0.85 branch.

krh: Edited to also account for API changes in 6802eaa68, which
removes the timestamp argument from wl_resource_destroy().
2012-04-12 23:14:22 -04:00
Stéphane Marchesin
368878cc5f Revert "i915g: Implement stipple with draw."
This reverts commit 3cff45fdb1.
2012-04-12 18:31:10 -07:00
Stéphane Marchesin
05265bee85 Revert "i915g: Remove unused poly stipple state."
This reverts commit be6a02266d.
2012-04-12 18:30:59 -07:00
Ian Romanick
0d2bc18e4d tests/glx: Point at the imported copy of gtest
This is just in case there's one installed on the system.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:19:19 -07:00
Eric Anholt
94726d263e glx: Hook up the unit tests again using the internal gtest.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:18:00 -07:00
Ian Romanick
3d000e7dd1 gtest: Fix up import of gtest 1.6.0
The include files were all missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:17:52 -07:00
Eric Anholt
19a4c0646b gtest: Build as a convenience library.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:17:43 -07:00
Eric Anholt
fe358c0ffa gtest: Import sources from gtest 1.6.0.
The upstream of gtest has decided that the intended usage model is for
projects to import the source and use it, which is reflected in their
recent removal of the gtest-config tool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-12 17:17:10 -07:00
Marek Olšák
6f03692775 cso: unreference saved vertex buffers when restoring
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 19:17:47 +02:00
Eric Anholt
249fc70561 i965: When the kernel lacks the LLC check, assume it's present on gen >= 6.
The param wasn't added until drm-intel-next for 3.4, so we were
missing our various LLC fast-paths.
2012-04-11 18:12:12 -07:00
Eric Anholt
e3df28337b intel: Drop backwards compat code for not having libdrm with the LLC check. 2012-04-11 18:12:12 -07:00
Eric Anholt
80ecb8f15b i965/fs: Avoid generating extra AND instructions on bool logic ops.
By making a bool fs_reg only have a defined low bit (matching CMP
output), instead of being a full 0 or 1 value, we reduce the ANDs
generated in logic chains like:

   if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth ||
       v_texcoord.y < 0.0 || v_texcoord.y > 1.0)
      discard;

My concern originally when writing this code was that we would end up
generating unnecessary ANDs on bool uniforms, so I put the ANDs right
at the point of doing the CMPs that otherwise set only the low bit.
However, in order to use a bool, we're generating some instruction
anyway (e.g. moving it so as to produce a condition code update), and
those instructions can often be turned into an AND at that point.  It
turns out in the shaders I have on hand, none of them regress in
instruction count:

Total instructions: 262649 -> 262545
39/2148 programs affected (1.8%)
14253 -> 14149 instructions in affected programs (0.7% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
32ae8d3b32 i965/fs: Try to avoid generating extra MOVs to do saturates.
This change (before the previous two) produced a .23% +/- .11%
performance improvement in Unigine Tropics at 1024x768 on IVB.

Total instructions: 269270 -> 262649
614/2148 programs affected (28.6%)
179386 -> 172765 instructions in affected programs (3.7% reduction)

v2: Move some of the logic of finding the instruction that produced
    the result of an expression tree to a helper.
2012-04-11 18:08:21 -07:00
Eric Anholt
3bdccbc3e0 glsl: Extend the array splitting optimization pass to matrices.
This should fit in well with our lower_mat_op_to_vec code: now, in
addition to having expressions on each column of a matrix, we also
split the columns to separate variables so they can be tracked
individually by the copy propagation, dead code, and other passes.

This optimizes out some more code generation in unigine and gstreamer
shaders.

Total instructions: 269342 -> 269270
14/2148 programs affected (0.7%)
2226 -> 2154 instructions in affected programs (3.2% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
60177d5e2a glsl: Add an array splitting pass.
I've had this code laying around almost done for a long time.  The
idea is like opt_structure_splitting, that we've got a bunch of
transforms at the GLSL IR level that only understand scalars and
vectors, which just skip complicated dereferences.  While driver
backends may manage some optimization after they split matrices up
themselves, it would be better to bring all of our optimization to
bear on the problem.

While I wasn't expecting changes quite yet, a few programs end up
winning: a gstreamer convolution shader, and the Humus dynamic
branching demo:
Total instructions: 269430 -> 269342
3/2148 programs affected (0.1%)
1498 -> 1410 instructions in affected programs (5.9% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
fda662f4df glsl: Don't apply optimization passes to builtins.
The builtins we have are generally optimized, having been
hand-written.  This avoids generating bad code when an optimization
pass prints debug output.
2012-04-11 18:08:21 -07:00
Brian Paul
0fd4165261 docs: document yet another viewperf bug 2012-04-11 12:02:11 -06:00
Brian Paul
71d69161ab mesa: add _mesa_total_texture_memory() debug function
This function can be called in gdb to find out how much memory is used
by all texture objects.
2012-04-11 07:00:01 -06:00
Brian Paul
223654b81d mesa: new _mesa_total_buffer_object_memory() debug function
This function can be called in gdb to find out how much memory is used
by buffer objects.
2012-04-11 07:00:01 -06:00
Chad Versace
5154b45217 mapi: Fix Android build
The Android build was broken by
    commit ca760181b4
    Author: Kristian Høgsberg <krh@bitplanet.net>
    Date:   Fri Mar 16 12:55:40 2012 -0400

    shared-glapi: Convert to automake

The offending change was that it redefined the filepaths in sources.mak
like this:
    - FOO_FILES := bar.c
    + FOO_FILES := $(TOP)/src/mapi/mapi/bar.c
This broke the build because source filepaths in Android makefiles must be
relative to the makefile.

Ideally, this could be fixed by reverting the change in sources.mak and
making shared-glapi's Makefile.am use $(addprefix $(TOP)/src/mapi/mapi,
$(FOO_FILES)). However, automake doesn't understand builtin GNU make
functions, such as addprefix. So, it seems that automake and Android can
no longer share sources.mak.

Fix the build by duplicating the source lists from sources.mak into
Android.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-10 21:07:12 -07:00
Mandeep Singh Baines
0695cf68f5 egl_dri2: fix aux buffer leak in drm platform
Keep a reference to any newly allocated aux buffers to avoid
re-allocating for every st_framebuffer_validate() (i.e. leaking).

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-04-10 19:08:12 -04:00
Paul Berry
a27c7d80af i965: Stop lying about cpp and height of a stencil buffer.
When using a separate stencil buffer, i965 requires that the pitch of
the buffer (in the 3DSTATE_STENCIL_BUFFER command) be specified as 2x
the actual pitch.

Previously this was accomplished by doubling the "cpp" and "pitch"
values stored in the intel_region data structure, and halving the
height.  However, this was confusing, and it led to a subtle (but
benign) bug: since a stencil buffer is W-tiled, its true height must
be aligned to a multiple of 64; we were accidentally aligning its faux
height to a multiple of 64, causing memory to be wasted.

Note that for window system stencil buffers, the DDX also doubles the
cpp and pitch values.  To facilitate fixing this DDX server bug in the
future, we fix the cpp and pitch values we receive from the X server
only if cpp has the "incorrect" value of 2.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Clarify comments about the DDX.
2012-04-10 11:19:05 -07:00
Pekka Paalanen
272bc48976 wayland-drm: remove wl_buffer.damage
This is a related fix for the Wayland change:

commit 83685c506e76212ae4e5cb722205d98d3b0603b9
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 26 16:33:24 2012 -0400

    Remove wl_buffer.damage and simplify shm implementation

Apparently, this should also fix a memory leak. When wl_buffer.damage
was removed from Wayland and Mesa was not fixed, wl_buffer.destroy ended
up in the (empty) damage function instead of calling
wl_resource_destroy().

Spotted during build as:
  CC     wayland-drm-protocol.lo
wayland-drm.c:80:2: warning: initialization from incompatible pointer type
wayland-drm.c:82:1: warning: excess elements in struct initializer
wayland-drm.c:82:1: warning: (near initialization for 'drm_buffer_interface')

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-10 13:06:56 -04:00
Vinson Lee
70d038e46e st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fixes uninitialized member defects reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 22:32:23 -07:00
Chad Versace
36fef005b1 main: Fix memory leak in _mesa_make_extension_string()
I forgot to free the string returned by strdup().

Note: This is a candidate for the stable branches.
CC: Johannes Obermayr <johannesobermayr@gmx.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-09 17:31:51 -07:00
Vadim Girlin
783e4da72a r600g: check gpr count limit
This should help to prevent gpu lockups.
See https://bugs.freedesktop.org/show_bug.cgi?id=48472

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-09 18:05:57 -04:00
Vadim Girlin
4b06280ea3 glsl: fix variable ordering in the output_read_remover
Use the hash of the variable name instead of the pointer value.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 18:04:00 -04:00
Eric Anholt
a07cf3397e i965: Add support for sampling texture buffer objects on gen7+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:27 -07:00
Eric Anholt
0b3729c987 i965: Add real support for texturing/rendering with MESA_FORMAT_RGBA8888_REV.
This was hacked in in one place for EGL image stuff, but the right
thing to do was just to provide the mapping from the mesa format to
the native hardware format, which includes render target support.

This turns out to be required for GL_ARB_texture_buffer_object, which
sees data in this layout.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:15 -07:00
Eric Anholt
aa8ce1be4a i965/gen7: Fix the /* ignored */ comment on constant surface setup.
It turns out this field *is* used, and it's the stride between samples
from the buffer.  Discovered during TBO debugging.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:12 -07:00
Eric Anholt
bf82ce3c66 mesa: Add support for the GL 3.1 R/RG formats in texture buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:49 -07:00
Eric Anholt
664355f05b mesa: Track a gl_format for the texture buffer format.
There was a function full of unused mappings from the GLenum to
datatype/comps, but that wasn't all the information a driver would
want, which includes the other fields that a gl_format has.  Given
that all the texture buffer formats were represented in gl_format,
just use that as our description.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:44 -07:00
Eric Anholt
dcf42dbd06 mesa: Handle updating texture state for buffer textures.
We have to skip some work that wants to look at texture images, since
buffer textures don't have any of that complexity.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:33 -07:00
Eric Anholt
18c2ee0df5 mesa: Create the default (name==0) buffer texture.
All that should be needed is that it exists.  Fixes segfaults on first
_mesa_update_context() with a samplerBuffer-using shader active but
without a particular buffer texture enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:30 -07:00
Eric Anholt
bb430ced7f glsl: Add texelFetch(*samplerBuffer) entrypoints to GLSL 1.40.
Fix texelFetch(sampler2DRect) and textureSize(samplerBuffer)
generation to not reference a LOD at the same time because it's easier
than not fixing it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:27 -07:00
Eric Anholt
6598552521 glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.
The samplerBuffer type will be undefined in !glsl 1.40, and the
keyword is marked as reserved.  The [iu]samplerBuffer types are not
marked as reserved pre-1.40, so they don't have separate tokens and
fall through to normal type handling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:06 -07:00
Eric Anholt
6d0f5684c1 mesa: Set the correct initial value of the texture buffer object format.
Fixes piglit GL_ARB_texture_buffer_object/get

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:03 -07:00
Eric Anholt
44f2cee0fd mesa: Set up glTexBuffer{,ARB} for display list compile.
We're supposed to just immediately call it.  Fixes piglit
GL_ARB_texture_buffer_object/dlist

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:57 -07:00
Eric Anholt
62bdb187f8 glapi: regen for TBO change. 2012-04-09 14:33:53 -07:00
Eric Anholt
0be44a3541 glapi: Mark TexBuffer as an alias of TexBufferARB.
This is set correctly in gl.spec, but was missed in Mesa.  As a
result, only one of the two was hooked up in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:41 -07:00
Eric Anholt
eb7a71dea7 glsl: Drop the round-trip through ast_type_specifier for many builtin types.
We have lexer recognition of a bunch of our types based on the
handling.  This code was mapping those recognized tokens to an enum
and then to a string of their name.  Just drop the enums and provide
the string directly in the parser.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:30:46 -07:00
Kenneth Graunke
b2c0df2b60 glsl: Use (const char *) in AST nodes rather than plain (char *).
Nothing actually relied on them being mutable, and there was at least
one cast which discarded const qualifiers.  The next patch would have
introduced many more.

Casting away const qualifiers should be avoided if at all possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 14:30:34 -07:00
Eric Anholt
68b99be409 ff_fragment_shader: Remove some dead fields.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 14:09:21 -07:00
Kenneth Graunke
430562a980 x86-64: Don't print "Initializing x86-64 optimizations" in debug builds.
In "release" builds, Mesa would print this message if the MESA_DEBUG
variable was set.  Make it so for debug builds as well.

I build debug builds all the time, but I'm not debugging this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:39 -07:00
Kenneth Graunke
781e2d5cfa ir_to_mesa: Remove pretense of support for function calls.
While ir_to_mesa contains code that attempts to support functions, I
honestly doubt it's been tested and have little confidence that it
works.

The comment in visit(ir_function *ir) doesn't inspire confidence:
/* Ignore function bodies other than main() -- we shouldn't see calls to
 * them since they should all be inlined before we get to ir_to_mesa.
 */

Furthermore, hardware drivers such as i915, i965, and (AFAICT) r200
don't support the BGNSUB/ENDSUB/CAL opcodes anyway.  Only swrast does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:37 -07:00
Kenneth Graunke
f78f48b6d2 i965: Remove vestiges of function call support from the old VS backend.
This never worked.  brwProgramStringNotify also explicitly rejects
programs that use CAL and RET.  So there's no need for this to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:27 -07:00
Yuanhan Liu
c653287549 i915: set SPRITE_POINT_ENABLE bit correctly
When SPRITE_POINT_ENABLE bit is set, the texture coord would be
replaced, and this is only needed when we called something like
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE).

And more,  we currently handle varying inputs as texture coord,
we would be careful when setting this bit and set it just when
needed, or you will find the value of varying input is not right
and changed.

Thus we do set SPRITE_POINT_ENABLE bit only when all enabled tex
coord units need do CoordReplace. Or fallback is needed to make
sure the rendering is right.

With handling the bit setup at i915_update_sprite_point_enable(),
we don't need the relative code at i915Enable then.

This patch would _really_ fix the webglc point-size.html test case and
of course, not regress piglit point-sprite and glean-pointSprite
testcase.

NOTE: This is a candidate for stable release branches.

v2: fallback just when all enabled tex coord units need do
    CoordReplace (Eric)
v3: move the sprite point validate code at I915InvalidateState (Eric)
v4: sprite point enable bit update based on _NEW_PROGRAM, too
    add relative _NEW-state comments to show what state is being used(Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:17 +08:00
Yuanhan Liu
8b5b3b93d7 glx: fix compile warnings
Fix 'set but not used' warnings; gl_version, gl_versions_profiles and
glx_extensions variables are used just only HAVE_XCB_GLX_CREATE_CONTEXT
is defined. Thus those warnings are shown when that macro isn't defined.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:10 +08:00
Johannes Obermayr
7bb1c784a3 st/xa: Link with -Wl,-r instead of -r.
This is required to link with clang:
  /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400160.
2012-04-07 20:33:44 +02:00
Johannes Obermayr
a50d695ac2 tgsi: Fix conflict with fortify printf redirect in glibc.
Fixes clang error:

   tgsi/tgsi_dump.c:72:12: error: no member named '__printf_chk' in 'struct dump_ctx'
         ctx->printf( ctx, "%u", e );
         ~~~  ^
   /usr/include/bits/stdio2.h:109:3: note: expanded from macro 'printf'
     __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
     ^

 Idea stolen from:
   http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg210998.html

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-07 20:33:37 +02:00
Brian Paul
299c9052e8 st/mesa: fix max_offset computation for base vertex
Add the maximum base vertex offset to max_index for computing the
buffer size.  Fixes a failed assertion in the u_upload_mgr.c code with
the VMware svga driver.

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

v2: incorporate Marek's suggestions.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-04-06 14:18:53 -06:00
Brian Paul
ecc480524b svga: add missing cases for PIPE_CAP_x queries
Return 0 for features we don't support.  Added debug_printf()
warnings when we fail to handle a new PIPE_CAP_x case.  That will
alert us to interfaces changes in the future.  We don't want to
just ignore new PIPE_CAPs and possibly miss something important.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
d7707ef5a5 svga: return 1 for PIPE_CAP_VERTEX_COLOR_UNCLAMPED query
Before, we weren't clamping the vertex colors produced by ARB vertex
programs.  This could result in some rendering being too bright (in
ETQW, for example).

Also add cases for PIPE_CAP_VERTEX_COLOR_CLAMPED and
PIPE_CAP_FRAGMENT_COLOR_CLAMPED with comments to be complete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
0adc5d9cfd svga: handle TGSI_SEMANTIC_CLIPDIST/VERTEX semantics
We can't support these vertex attributes, but don't die in an assertion.
Issue a warning instead.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48142
2012-04-06 14:10:50 -06:00
Brian Paul
0cd68001f8 gallium/docs: fix typos 2012-04-06 14:10:50 -06:00
Kenneth Graunke
2a80a1e2a7 i965: Actually upload sampler state pointers for the VS unit on Gen6.
We already program all the sampler state correctly, we just didn't give
the GPU a pointer to it for the VS stage.  Thus, any texturing other
than texelFetch() wouldn't work.

Fixes piglit test vs-textureLod-miplevels and 99 of oglconform's
glsl-bif-tex subtests.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-05 18:37:34 -07:00
James Benton
cf68959f99 gallivm: Updated lp_build_log2_approx to use a more accurate polynomial.
Tested with lp_test_arit with 100% passes and piglit tests with 100%
pass for log but some tests still fail for pow.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:34:11 +01:00
James Benton
7c639feb2f gallivm: Updated lp_build_polynomial to compute odd and even terms separately to decrease data dependency for faster runtime.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:32:54 +01:00
Alexandre Demers
129d5138d6 xatracker: fix the build of a 32bit lib on a 64bit os
we were missing cflags.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2012-04-05 00:18:25 -04:00
Marek Olšák
34e53adc51 r600g: inline r600_upload_index_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
e9abb2cd6e r600g: inline r600_upload_const_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
82a7fe6f5c r600g: handle DISCARD_WHOLE_RESOURCE for buffers
This should prevent stalls and therefore increase perfomance in some cases.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c7d0e9ec32 r600g: invalidate caches at the beginning of CS
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
a633d82ce3 r600g: remove dead code after the rework
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
68bbfc1afe r600g: rework state emission of constant buffers
Framerate in ipers:
  before: 43.6 FPS
  after:  46.6 FPS

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c76462b45f r600g: rework state emission of vertex buffers
This reduces a little of CPU overhead.
The idea is to translate pipe vertex buffers directly into the CS
and not using any intermediate representations.

Framerate in Torcs:
  before: 32.2
  after:  34.6

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
5c03d1fa0f r600g: kill off the fallback for crazy src_offset values
st/mesa doesn't allow src_offset to be greater than stride and the maximum
stride r600 supports is 2047.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Alexandre Demers
3ea3695b04 st/xvmc: fix library installation dir
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47878

v2: some reordering and while at it also fix the
    comment in Makefile.xvmc

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-04 10:57:50 +02:00
Marek Olšák
75f8990547 r300g/swtcl: fix crash when back color is present in vertex shader
The shader transformation code sometimes produced invalid TGSI.
2012-04-04 04:28:41 +02:00
Marek Olšák
ba86e03167 r300g/swtcl: initialize some Draw options 2012-04-04 04:28:41 +02:00
Marek Olšák
c3481f3410 r300g/swtcl: fix polygon offset 2012-04-04 04:28:41 +02:00
Marek Olšák
3b8fe06eb6 r300g/swtcl: don't expose shader subroutine support
RET in the main function doesn't work. This should be fixed in Draw, but meh.
2012-04-04 04:28:41 +02:00
Marek Olšák
6bede55241 r300g: initialize state & render functions before creating u_vbuf & u_blitter 2012-04-04 04:28:40 +02:00
Marek Olšák
da2123051c r300g/swtcl: don't enter u_vbuf_mgr 2012-04-04 04:28:40 +02:00
Marek Olšák
5ce0598a03 r300g/swtcl: don't print an error when getting ClipVertex
Draw can do it just fine.
2012-04-04 04:28:40 +02:00
Benjamin Franzke
9ba3cecaa0 st/egl: Update to the new wl_shm_pool interface 2012-04-03 20:28:20 +02:00
Marek Olšák
900be21e09 u_blitter: don't use user buffers 2012-04-03 20:05:53 +02:00
Vinson Lee
4f513002f6 gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.
llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-03 10:55:45 -07:00
Christian König
24ca588ce6 st/vdpau: fix deadlock in PresentationQueueQuerySurfaceStatus
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-03 17:33:26 +02:00
Marek Olšák
7f2156c9bd r600g: remove dead code in r600_update_derived_state 2012-04-03 17:09:47 +02:00
James Benton
5db9d76a6a gallivm: Maximum loop iterations
Limits maximum loop iterations in a TGSI shader to prevent infinite
loops from occurring, any iteration in any loop counts towards this
limit

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-03 10:11:27 +01:00
José Fonseca
d312b224b6 gallivm: Simplify/reorder minimax helper. 2012-04-03 09:12:47 +01:00
Vinson Lee
431b458f24 swrast: Fix memory leaks in blit_linear.
Fixes Coverity resource leak defects.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-02 21:47:41 -07:00
Kenneth Graunke
f75c2d5314 glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Variables have types, expression trees have types, but statements don't.
Rather than have a nonsensical field that stays NULL in the base class,
just move it to where it makes sense.

Fix up a few places that lazily used ir_instruction even though they
actually knew the particular subclass.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:46 -07:00
Kenneth Graunke
82065fa20e glsl: Remove ir_call::get_callee() and set_callee().
Previously, set_callee() performed some assertions about the type of the
ir_call; protecting the bare pointer ensured these checks would be run.

However, ir_call no longer has a type, so the getter and setter methods
don't actually do anything useful.  Remove them in favor of accessing
callee directly, as is done with most other fields in our IR.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:43 -07:00
Kenneth Graunke
d884f60861 glsl: Convert ir_call to be a statement rather than a value.
Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
  stream, treating it as an untyped statement.  Yet, it was a subclass
  of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
  arbitrary expression trees.  While this fit naturally with the source
  language, it meant that expressions might not be pure, making it
  difficult to transform and optimize them.  To combat this, we always
  emitted ir_call directly in the RHS of an ir_assignment, only using
  a temporary variable in expression trees.  Many passes relied on this
  assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue).  Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one.  They cannot be embedded in expressions.

All expression trees are now pure, without exception.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:41 -07:00
Kenneth Graunke
622eed0750 glsl: Split out ir_reader's ability to read ir_dereference_variables.
Most of the time, we just want to read an ir_dereference, so there's no
need to have these in separate functions.  However, the next patch will
want to read an ir_dereference_variable directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:38 -07:00
Kenneth Graunke
d0fa0cb52c glsl: Move constant expression handling from calls to signatures.
When translating a call from AST to HIR, we need to decide whether it
can be evaluated to a constant before emitting any code (namely, the
temporary declaration, assignment, and call.)

Soon, ir_call will become a statement taking a dereference of where to
store the return value, rather than an rvalue to be used on the RHS of
an assignment.  It will be more convenient to try evaluation before
creating a call.  ir_function_signature seems like a reasonable place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:36 -07:00
Kenneth Graunke
807e967c61 glsl: Use ir_rvalue to represent generic error_type values.
Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions).  This is rather awkward,
as it's the only class that can be used in both forms.

A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type.  If ir_call is to become a statement, it
can no longer serve this purpose.

Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing.  So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue.  This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any).  The downside is that the base class is no longer
abstract.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:34 -07:00
Kenneth Graunke
ac0f8bae8d glsl: Combine AST-level and IR-level parameter mode checking loops.
generate_call() and ast_function_expression::hir() both tried to verify
that 'out' and 'inout' parameters used l-values.  Irritatingly, it
turned out that this was not redundant; both checks caught -some- cases.

This patch combines the two into a single "complete" function that does
all the parameter mode checking.  It also adds a comment clarifying why
AST-level checking is necessary in the first place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:32 -07:00
Kenneth Graunke
909e889967 glsl: Split up function matching and call generation a bit more.
We used to have one big function, match_signature_by_name, which found
a matching signature, performed out-parameter conversions, and generated
the ir_call.  As the code for matching against built-in functions became
more complicated, I split it internally, creating generate_call().

However, I left the same awkward interface.  This patch splits it into
three functions:
1. match_signature_by_name()

   This now takes a name, a list of parameters, the symbol table, and
   returns an ir_function_signature.  Simple and one purpose: matching.

2. no_matching_function_error()

   Generate the "no matching function" error and list of prototypes.
   This was complex enough that I felt it deserved its own function.

3. generate_call()

   Do the out-parameter conversion and generate the ir_call.  This
   could probably use more splitting.

The caller now has a more natural workflow: find a matching signature,
then either generate an error or a call.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:29 -07:00
Kenneth Graunke
0405bd08ca glsl: Don't trust loop analysis in the presence of function calls.
Function calls may have side effects that alter variables used inside
the loop.  In the fragment shader, they may even terminate the shader.
This means our analysis about loop-constant or induction variables may
be completely wrong.

In general it's impossible to determine whether they actually do or not
(due to the halting problem), so we'd need to perform conservative
static analysis.  For now, it's not worth the complexity: most functions
will be inlined, at which point we can unroll them successfully.

Fixes Piglit tests:
- shaders/glsl-fs-unroll-out-param
- shaders/glsl-fs-unroll-side-effect

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:19 -07:00
Kenneth Graunke
252d3118dd i965/aub: Dump a final bitmap from DestroyContext.
Certain applications don't call SwapBuffers before exiting.  Yet, we'd
really like to see a bitmap containing the final rendered image even if
they choose never to present it.

In particular, Piglit tests (at least with -auto -fbo) fall into this
category.  Many of them failed to dump any images at all.

Dumping one final image at context destruction time seems to work.
We may wish to pursue a more elegant solution later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-02 13:47:53 -07:00
Marek Olšák
42bc0b9b9d r600g: unduplicate code for PS partial flush 2012-04-01 23:57:50 +02:00
Marek Olšák
bc95152f1d r600g: determine in advance if hw has vertex cache 2012-04-01 23:57:50 +02:00
Marek Olšák
669d8766ff r600g: optimize r600_resource_va
Avoid calling get_radeon_bo and inline it.
2012-04-01 23:57:50 +02:00
Marcin Slusarz
68e4c83ffa targets/{xvmc,vdpau,va}: remove all objects on make clean 2012-04-01 17:42:48 +02:00
Eugeni Dodonov
a45247fb1b intel: add PCI IDs for Ivy Bridge GT2 server variant
Those IDs are used by Bromolow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-04-01 10:50:55 -03:00
Vinson Lee
4123d0b321 linker: Fix memory leak in count_uniform_size::visit_field.
Fixes a Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-31 11:15:41 -07:00
Kenneth Graunke
bd2410b48d intel: Add some PCI IDs for Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke
4848122a96 i965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.
These can be used to implement EXT_texture_swizzle without baking
state-dependent swizzle instructions into the shader and forcing
recompiles.

For now, just set them to pass-through mode, so everything continues to
work as it did on Ivybridge.  We can optimize this later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke
a23dcc18e7 i965: Fill in Sample Mask in Haswell's 3DSTATE_PS.
We only need one sample, since we don't support multisampling yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:23 -07:00
Kenneth Graunke
fc8edbe016 i965: Set "Stencil Buffer Enable" bit on Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:21 -07:00
Kenneth Graunke
b4410ac394 i965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.
Apparently this needs to be the same as in 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:03 -07:00
Kenneth Graunke
1b3a199097 i965: Update max VS/PS threads shift offsets for Haswell.
These now start at bit 23 instead of bit 24/25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:02 -07:00
Kenneth Graunke
1ba8c6ad03 i965: Disable HiZ on Haswell for now.
Getting HiZ working means updating all the state packets for resolves
and clears.  It's not worth doing until we get the basics working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:59 -07:00
Kenneth Graunke
180aecb6dc i965: Add initial IS_HASWELL() macros.
For now, these all return 0, as I don't yet want to enable Haswell
support.  Eventually they will be filled in with proper PCI IDs.

Also add an is_haswell field similar to is_g4x to make it easy to
distinguish Gen7 and Gen7.5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:48 -07:00
Kenneth Graunke
01044fce6b i965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.
According to the BSpec ISA volume's "Accumulator Register" section:

"[DevIVB] SIMD16 execution on dwords is not allowed when accumulator is
 explicit source or destination operand."

Fixes piglit tests:
- fs-multiply-const-ivec4
- fs-multiply-const-uvec4
- fs-multiply-ivec4-const
- fs-multiply-uvec4-const

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-30 14:27:54 -07:00
Marek Olšák
99a192ce7d gallium/postprocess: document serious issue causing undefined behavior 2012-03-30 18:14:06 +02:00
Marek Olšák
ead0a89c96 r600g: cleanup after get_query_result change
Finally, union r600_query_result can be removed.
2012-03-30 17:12:52 +02:00
Marek Olšák
6d73382afc r300g: cleanup after get_query_result change 2012-03-30 17:12:51 +02:00
Marek Olšák
452d07759d gallium/util: add helper function util_query_clear_result 2012-03-30 17:12:51 +02:00
Marek Olšák
4445e170be gallium: adapt to get_query_result interface change
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Marek Olšák
102ed41ae6 gallium: make get_query_result return union* and not void*
This replaces the cryptic void* parameter with a union.
(based on union r600_query_result)

Users of this can still pass uint64* in it, but that cannot work for every
query type, obviously. Most importantly, the code now documents what should
be expected from get_query_result.

This also adds pipe_query_data_pipeline_statistics as per the D3D11 docs.

v2: fix indentation, add comments and use the doxygen style

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Tom Stellard
7d87c71a70 configure: Add --with-llvm-shared-libs
This option allows targets to link against the LLVM shared library
instead of the static libs.  With LLVM 2.9, his saves ~11 MB for each of
the r300 target libraries.
2012-03-30 09:13:04 -04:00
Kristian Høgsberg
2402ce04ae shared-glapi: Include from builddir
Fixes out-of-tree builds.

https://bugs.freedesktop.org/show_bug.cgi?id=47649
2012-03-29 09:25:15 -04:00
Vinson Lee
a7b8e16dc6 gallivm: Fix method overriding in raw_debug_ostream.
Use matching type qualifers to avoid method hiding.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-28 22:46:17 -07:00
Ander Conselvan de Oliveira
4a976b60b1 egl_dri2: use gbm_surface as the native window type in drm platform 2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira
fd6acb97fb gbm: Create hooks for dri2_loader_extension in dri backend
Pass a dri2_loader extension to the dri driver when gbm creates the dri
screen.  The implementation jumps through pointers in the gbm device
so that an EGL on GBM implementation can provide the real implementations.
2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira
0d1ef1f57f gbm: Add gbm_surface interface
The idea here is to be able to create an egl window surface from a
gbm_surface.  This avoids the need for the surfaceless extension and
lets the EGL platform handle buffer allocation, while keeping the user
in charge of somehow presenting the buffers (using kms page flipping,
for example).

gbm_surface_lock_front_buffer() locks a surface's front buffer and
returns a gbm bo representing it.  This bo should later be returned
to the gbm surface using gbm_surface_release_buffer().
2012-03-28 22:14:34 -04:00
Brian Paul
7f16246ace draw: fix missing immediates bug in polygon stipple code
The function that counts the number of TGSI immediates also needs to
emit the immediates.  This fixes assorted failures when using polygon
stipple with fragment shaders that have their own immediates.

NOTE: This is a candidate for the 8.0 branch.
2012-03-28 11:43:18 -06:00
Christian König
fc0a5e21d7 vl: move winsys helper out of winsys directory
They aren't winsys of their own,
just help dealing with them.

v2: add some more comments in vl_winsys.h

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-28 15:47:41 +02:00
Jon TURNEY
ba83b8b4ae Use -no-undefined libtool flag in src/glx/Makefile.am
"Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-28 13:03:52 +01:00
Yuanhan Liu
9cb777eb71 intel: fix un-blanced map_refcount issue
This is a regression introduced by commit cdcfd5, which forget to
increase the map_refcount for successfully-mapped region. Thus caused a
wrong non-blanced map_refcount.

This would fix the regression found in the two following webglc testcase
on Pineview platform:
   texture-npot.html
   gl-max-texture-dimensions.html

Cc: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-28 09:51:38 +08:00
Wang YanQing
7a6324dbfe glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will
make a segment failed.

[minor-indent-issue-fixed-by: Yuanhan Liu]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-28 09:51:16 +08:00
Marek Olšák
9773369ab4 r600g: also disable transform feedback on cayman
It's said to cause troubles there.
The env var is R600_STREAMOUT again.
2012-03-28 02:21:03 +02:00
Marek Olšák
393d741788 r600g: enable transform feedback on everything that isn't r700
Use R700_STREAMOUT=1 if you wanna hack transform feedback on r700.
2012-03-27 21:06:59 +02:00
Benjamin Franzke
ad22e647e0 st/egl: Also remove wl_buffer_damage in wayland backend
As commit 03eca9d92d does for egl_dri2.
2012-03-27 18:51:53 +02:00
ojab
60b58822f0 gallivm: Use InitializeNativeTargetDisassembler().
To initialize only native LLVM Disassembler on LLVM >= 3.1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-03-27 16:28:30 +01:00
Ander Conselvan de Oliveira
410aa3eb45 egl_dri2: make flush extension useable by drm platform 2012-03-27 08:28:07 -04:00
Kristian Høgsberg
03eca9d92d wayland: Stop using wl_buffer.damage 2012-03-27 08:28:07 -04:00
Neil Roberts
03f617f413 Add support for GL_EXT_unpack_subimage on GLES2
This extension just permits GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_ROWS
and GL_UNPACK_SKIP_PIXELS to be passed to glPixelStore on GLES2 so it
is trivial to implement.
2012-03-27 08:28:06 -04:00
Benjamin Franzke
860f4846c7 gles: Enable the GL_EXT_read_format_bgra extension
Also fixes the usage of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,
which may be set to a BGRA format e.g. for a MESA_FORMAT_ARGB8888 fb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Benjamin Franzke
e9a5457d73 gles1: Enable GL_EXT_texture_format_BGRA8888 in APIspec
The extension is already exposed for GLES1, but the APIspec
doesnt allow the usage of GL_BGRA_EXT in glTex(Sub)Image2D.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Dylan Noblesmith
aebd549243 glapi: regenerate enums.c
For previous four commits:

    glapi: add GL_ARB_texture_float
    glapi: add GL_ARB_depth_buffer_float
    glapi: add GL_ARB_texture_compression_rgtc
    glapi: add ARB_texture_rg
2012-03-26 21:35:24 +00:00
Dylan Noblesmith
91c8bedb8a glapi: add GL_ARB_texture_float
And add some missing core GL 3.0 enums that came from this
extension, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:17 +00:00
Dylan Noblesmith
50fa821854 glapi: add GL_ARB_depth_buffer_float
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:04 +00:00
Dylan Noblesmith
faf954f151 glapi: add GL_ARB_texture_compression_rgtc
Noticed this was missing when writing the "glapi: sort ARB extensions
by number" commit, which at least shows it was effective.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
bae4cd6882 glapi: add ARB_texture_rg
Noticed it was missing based on the lack of a descriptive enum
name from this bug's error message:

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

This moves two enums out of GL3x.xml. Though since this and
GL_ARB_texture_compression_rgtc are both strict subsets of GL3,
both extensions should have had all their enums in that file
to begin with, not just two of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
a419595a87 regen for "glapi: sort ARB extensions by number" 2012-03-26 21:28:10 +00:00
Dylan Noblesmith
1ae2e39d01 glapi: sort ARB extensions by number
And add comments to fill in for extensions that aren't there.

Noticed the comment about "ARB extensions sorted by extension number"
didn't extend to the <xi:include> directives when it became clear
GL_ARB_texture_rg was missing, going by the error message seen here:

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

This makes it easier to notice in the future if an extension is missing
when it shouldn't be.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:27:15 +00:00
Vinson Lee
b688700edc mesa: Fix memory leak in generate_mipmap_compressed.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 14:08:11 -07:00
Dave Airlie
7449ae4597 glsl: fix linker error message context for frag shader output.
A later error prints this properly, fix this case to do the same.

v2: remove attribute as per Ian's suggestion
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-26 18:48:46 +01:00
Dave Airlie
a83c1d61c2 glapi: ARB_blend_func_extended support + regen. (v2)
This adds the xml file covering ARB_blend_func_extended.

v2: fix SRC1_ALPHA

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-26 18:42:41 +01:00
Kenneth Graunke
7a348b91ce glsl: Make ir_dereference_variable ctor assert the variable exists.
This also seems like a bad idea.  There were too many instances for me
to thoroughly scan the code as I did with the last two patches, but a
quick scan indicated that most callers newly allocate a variable,
dereference it, or NULL-check.  In some cases, it wasn't clear that the
value would be non-NULL, but they didn't check for error_type either.

At any rate, not checking for this is a bug, and assertions will trigger
it earlier and more reliably than returning error_type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:57 -07:00
Kenneth Graunke
dca19a7711 glsl: Explicitly NULL-check variables before making a dereference.
The constructor currently returns a ir_dereference_variable of error
type when provided NULL, but that's about to change in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:55 -07:00
Kenneth Graunke
2cd652f810 glsl: Make ir_dereference_record constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_record() constructor
seems like a bad idea.  Currently, if provided NULL, it returns a
partially constructed value of error type.  However, none of the callers
are prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:53 -07:00
Kenneth Graunke
25b0d45d03 glsl: Make ir_dereference_array constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_array() constructor seems
like a bad idea.  Currently, if provided NULL, it returns a partially
constructed value of error type.  However, none of the callers are
prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:51 -07:00
Kenneth Graunke
ced54dcf9b glsl: Comment that expression flattening is used for matrix operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:44 -07:00
Christian König
7f6af49092 st/vdpau: clear video surface at least once
So if anything goes wrong we won't display a random image.

v2: flush before using the surface with the decoder.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Christian König
9f777699ed st/vdpau: invert interlaced buffer checks
That wasn't working as supposed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Dave Airlie
7b6424143d intel: fix TFP at 16-bpp
don't ask why I had to debug this.

tested to fix g-s and kwin at 16-bpp on Ironlake.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:15:52 +01:00
Dave Airlie
d6c5ad52b2 drisw: fix image stride calculation for 16-bit.
If you ran g-s in 16-bpp we'd do a bunch of memory corruption.

now it just misrenders for some other reasons.

applies to stable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:15:23 +01:00
Dave Airlie
ba3a4d79a7 glsl: fix compiling warning from gcc 4.7
ir_validate.cpp: In member function ‘virtual ir_visitor_status ir_validate::visit_leave(ir_swizzle*)’:
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::x’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::y’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::z’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::w’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
b78a77f979 glsl: initialise const force glsl extension warning in fake ctx
valgrind complained about an uninitialised value being used in
glsl_parser_extras.cpp, and this was the one it was giving out about.

Just initialise the value in the fakectx.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
989e013b80 makefile: add phony am--refresh target
for some reason when I configure --with-dri-drivers="" the src/mesa/drivers/dri
Makefile tries to call the am--refresh target in the toplevel Makefile,
we don't have one, and I'm not sure what it should look like.

This makes things continue on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:09:35 +01:00
Dave Airlie
ea663d56e2 docs/GL3.txt: document ARB_blend_func_extended state
I've written softpipe version in my tree, + gallium/mesa/glsl changes,
however r600 currently hangs the GPU.
2012-03-24 16:35:46 +00:00
Dave Airlie
2c778375a1 glx/drisw: avoid segfaults when we fail to get visual
piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen,

it now fails instead of segfaulting, much prettier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-24 13:05:19 +00:00
Vinson Lee
0f3aa9f4bd mesa: Fix memory leak in _mesa_get_uniform_location.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-23 22:52:57 -07:00
Brian Paul
318669f196 st/mesa: fix mipmap image size computation w.r.t. texture arrays
The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-23 10:08:49 -06:00
Brian Paul
281d0fd3a9 mesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-23 10:08:49 -06:00
Dylan Noblesmith
8d9decb75f intel: fix null dereference processing HiZ buffer
Or technically, a near-null dereference.

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

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-22 20:51:38 +00:00
Christopher Yeleighton
0c406afab0 docs: fix html in bugs.html
https://bugs.freedesktop.org/show_bug.cgi?id=47310
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-22 08:15:11 -06:00
Christian König
f23a2cb5d2 st/vdpau: improve frame dumping functionality a bit
Just a workaround until we get a real unit-
testing tool for VDPAU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Christian König
fa66fda5b0 st/vdpau: add VC-1 startcode if none is found in the stream
v2: only advanced profile needs that.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Eric Anholt
e07b1603e2 glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.
When a GL LD_PRELOAD library like apitrace was used,
glXGetProcAddress() would return the preload's symbols instead of
libGL's symbol, leading to infinite recursion when the returned
function was called.  This didn't hit apitrace on most apps because
who calls glXGetProcAddress() on the global functions.

The -Bsymbolic, which was present in mklib before automake conversion,
causes the glxcmds.c:GLX_functions table to be resolved at link time,
so that LD_PRELOADs don't affect it any more.

Fixes crashes when running wine under apitrace.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-03-21 13:55:41 -07:00
Brian Paul
20836c8185 st/mesa: set MaxUnrollIterations = 255
The default was 32 for the EmitNoLoops=0 case.  This allows the oZone3D
soft shadows test to work properly with the vmware driver.  Jose reported
that SM3 supports up to 255 loop iterations.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-21 13:46:44 -06:00
Brian Paul
7feabfe23d glsl: propagate MaxUnrollIterations to the optimizer's loop unroller
Instead of the hard-coded value of 32.  Note that MaxUnrollIterations
defaults to 32 so there's no net change.  But the gallium state tracker
can override this.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 13:46:36 -06:00
Eric Anholt
9bd38f3c67 intel: Make use of the new GPU-unsynchronized map functionality in libdrm.
Improves Unigine Tropics performance at 1024x768 by 2.06236% +/-
0.50272% (n=11).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
8308869311 intel: Drop the tracking of bo_map vs bo_map_gtt for unmapping.
drm_intel_bo_unmap() supports both in the current libdrm version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
f97da4ed71 i965: Avoid flushing the batch for busy BOs for ARB_mbr with INVALIDATE_BUFFER.
Unigine Tropics uses INVALIDATE_BUFFER and not UNSYNCHRONIZED to reset
the buffer object when its streaming wraps.  Don't penalize it by
flushing the batch at the wrap point, just allocate a new BO and get
to using it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
2222aa06e1 intel: Handle devid overrides using libdrm.
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
0247d89183 intel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.
It also asks for BMPs in the aub file at SwapBuffers time.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Eric Anholt
218f3a5663 intel: Bump libdrm requirement to 2.4.32.
We'll need this for AUB dumping and unsynchronized maps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Jakob Bornecrantz
3a4ded6d1f docs: Add 8.0.2 md5sums
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 0bf0ba44de)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
7bb7e5ffbb docs: Add 8.0.2 release notes
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 5f7204c3bb)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
56d05a8d3a mesa: Include mesa ES mapi generated files
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 770f785a6f)
2012-03-21 19:23:20 +00:00
Eric Anholt
f1c1c9eabe glsl: Don't require gl_Position to be written in GLSL 1.40.
Fixes piglit glsl-1.40/execution/tf-no-position.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:07:54 -07:00
Jon TURNEY
0bc4407744 mapi: Use -no-undefined libtool flag in src/mapi/shared-glapi/Makefile.am
Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library
is linked.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-21 11:31:45 -07:00
Eric Anholt
668ed95993 drirc: Add missing XML attributes that made the driconf application whine.
These are used for pretty presentation of the application name in the
UI.

Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 09:47:57 -07:00
Alex Deucher
b4082f492b r600g: add support for TN (trinity) APUs
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-20 19:43:59 -04:00
Eric Anholt
d09fce51f0 i965: Change the hiz-override env var to a driconf option.
The force-enable option is dropped, now that the hardware we were
concerned about has HiZ on by default.  Now, instead of doing
INTEL_HIZ=0 to test disabling hiz, you can set hiz=false.

v2: Disable separate stencil on gen6 when HIZ is turned off.
    (previously, this had to be done manually in addition).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-20 15:47:48 -07:00
Eric Anholt
447aff5b02 i965: Drop the INTEL_FORCE_GS environment variable.
This was a debug option during gen6 transform feedback bringup (and a
similar one existed during gen4 bringup).  However, it looks like
we're done with that, and we don't anticipate it being used again,
either for geometry shaders or transform feedback.

Suggested by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:31:44 -07:00
Eric Anholt
7e6221f2e3 intel: Drop the INTEL_NO_BLIT debug environment variable.
This was added in the i915/i965 merge from the i915 driver, but I
don't recall it ever being used since then.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Eric Anholt
67d3ff760a intel: Drop the INTEL_STRICT_CONFORMANCE environment variable.
If you want to test the graphics driver, you want to test it under the
conditions that users will see, not some set of additional fallbacks.
If you want to test swrast, run the swrast driver (or no_rast=true)
instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Anuj Phogat
cdcfd5d1d6 intel: Fix a case when mapping large texture fails
This patch handles a case when mapping a large texture fails
in drm_intel_gem_bo_map_gtt(). These changes avoid assertion
failure later in the driver as reported in following bugs:

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

Testing: No regressions in piglit quick.tests

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-20 15:11:39 -07:00
Kenneth Graunke
2097af9728 Add Makefile to shared-glapi .gitignore 2012-03-20 11:50:51 -07:00
Kenneth Graunke
dfce56ba4d Add Makefile.in to toplevel .gitignore
To avoid redundancies, this patch also removes Makefile.in from the
other .gitignore files.

Acked-by: Eric Anholt <eric@anholt.net>
2012-03-20 11:50:50 -07:00
Paul Berry
b41ab3b42c Add .deps/, .libs/, and *.la to toplevel .gitignore
To avoid redundancies, this patch also removes .deps, .libs, and *.la
from .gitignore files in subdirectories.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 11:50:50 -07:00
Brian Paul
75f82b5d58 mesa: only test cube face widths in _mesa_test_texobj_completeness()
As Eric pointed out, we know the cube faces are square at this point
so we only need to test the texture widths for consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 09:43:10 -06:00
Brian Paul
2cbccfdcb0 softpipe: set max cube texture size to 4Kx4K
The max size was 16Kx16K so a 4 byte/pixel, six-sided cube would require
6 GBytes of memory.  If mipmapped, 8 GB.  Reduce the max size to 4K to
make the total size more reasonable.

Fixes a crash with the new piglit max-texture-size test.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-20 08:23:32 -06:00
Brian Paul
73fd269d2f mesa: add integer texture completeness check
Per the spec, only nearest filtering is supported for integer textures.
Otherwise, the texture is incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
f4a93e0665 mesa: rework texture completeness testing
Instead of gl_texture_object::_Complete there are now two fields:
_BaseComplete and _MipmapComplete.  The former indicates whether the base
texture level is valid.  The later indicates whether the whole mipmap is
valid.

With sampler objects, a single texture can appear to be both complete and
incomplete at the same time.  See the GL_ARB_sampler_objects spec for more
details.  To implement this we now check if the texture is complete with
respect to a sampler state.

Another benefit of this is we no longer need to invalidate a texture's
completeness state when we change the minification/magnification filters
with glTexParameter().

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
b219b2c310 mesa: add _mesa_is_mipmap_filter() helper
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
ff005bdb7c mesa: use _mesa_dirty_texobj() in glTexParameter code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
878c69fe54 mesa: use _mesa_dirty_texobj() function
To mark the texture object as incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
d335e69b9a mesa: rewrite/consolidate code in _mesa_test_texobj_completeness()
Merge the mipmap level checking code that was separate cases for 1D,
2D, 3D and CUBE before.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
e86d0dea8e mesa: use new baseImage var to simplify _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
fbbbb98fc4 mesa: add comments in _mesa_test_texobj_completeness() related to the spec
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
085d2bb97e mesa: better debug message in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c9537f7d0 mesa: move some code in _mesa_test_texobj_completeness()
Move the simple MaxLevel < BaseLevel test earlier to be closer to where
we error-check BaseLevel.  Also, use the local baseLevel var in more places.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c385d382f mesa: use switch(target) in _mesa_test_texobj_completeness()
and add missing case for GL_TEXTURE_BUFFER.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
cfd5b14dac mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
3f7509beff mesa: make _mesa_reference_sampler_object() an inline function
To make the no-change case faster, as we do for the other object-reference
functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Eric Anholt
0225a15b69 glsl: Don't include the deprecated structure types in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-19 22:14:02 -07:00
Eric Anholt
56118ef929 mesa: Validate the drawing primitive against the transform feedback mode.
Fixes piglit GL_EXT_transform_feedback/negative-prims.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:53 -07:00
Eric Anholt
7ca4f07b5b mesa: Fold error generation into _mesa_valid_prim_mode().
We want to start emitting an INVALID_OPERATION from here for transform
feedback.  Note that this forced dlist.c to almost not use this
function, since it wants different behavior during dlist compile.
Just pull the non-TF, non-GS test out for compile, because:

1) TF doesn't matter in that case because there's no drawing.
2) I don't think we're going to see GSes and display lists in the same
   context, if we don't do GL_ARB_compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:22 -07:00
Kristian Høgsberg
ca760181b4 shared-glapi: Convert to automake
This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency.  The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm.  Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.

Morale of the story: don't mix mklib and libtool.
2012-03-19 11:13:06 -04:00
Alex Deucher
91ddfa72b4 r600g: fix r600_get_backend_mask() for virtual addresses
I don't think we should hit this path for virtual addresses,
but just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-19 10:52:46 -04:00
Yuanhan Liu
40c995c1fd i915: fallback for NPOT cubemap texture
Although some hardware support NPOT cubemap, but it seems we don't know
the right layout for NPOT cubemap. Thus seems we need do fallback for
other platforms as well.

See comments inline the code for more detailed info.

v2: give a more detailed info about why we need fallback for other
    platfroms as well.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-19 10:06:48 +08:00
Marek Olšák
a2e7629e68 r600g: fix point rendering
Accidentally broken in c7eaf274a9.
2012-03-19 03:00:04 +01:00
Brian Paul
03f8a97d71 st/mesa: add null pointer check in st_texture_image_map()
If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it.  Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.

Fixes a crash with the upcoming piglit max-texture-size test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-17 16:15:59 -06:00
Alex Hultman
c3fe44c5f9 docs: add info for installing dependencies on fedora
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-17 16:15:28 -06:00
Brian Paul
aec47e7d42 dri_util: add copyright/license blurb 2012-03-17 16:15:28 -06:00
Jeremy Huddleston
90a51753c4 darwin: Link against libxcb
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
f9e1295cff darwin: Build create_context.c
Fixes a build regression from: 588042a8ec

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
61f6aff5d9 darwin: config file cleanups
Set our default compiler based on what our installed XCode prefers

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:01:46 -07:00
Eric Anholt
31866308fc i965/fs: Jump from discard statements to the end of the program when done.
From the GLSL 1.30 spec:

     The discard keyword is only allowed within fragment shaders. It
     can be used within a fragment shader to abandon the operation on
     the current fragment. This keyword causes the fragment to be
     discarded and no updates to any buffers will occur. Control flow
     exits the shader, and subsequent implicit or explicit derivatives
     are undefined when this control flow is non-uniform (meaning
     different fragments within the primitive take different control
     paths).

v2: Don't emit the final HALT if no other HALTs were emitted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-16 11:55:38 -07:00
Eric Anholt
bddb2edab6 i965: Add disasm for gen6+ UIP/JIP on BREAK/CONT/HALT.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-16 11:55:35 -07:00
Eric Anholt
c0795742a3 glsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.
By setting lod to 0 in the builtin function implementation, we avoid
needing to update all the visitors to ignore LOD in this case, when
the hardware drivers actually want to ask for LOD 0 for rectangular
textures.

Fixes piglit spec/GLSL-1.40/textureSize-*Rect.

v2: Change style of looking for substrings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
e06ab8c363 glsl: Set up generated builtin functions handling for GLSL 1.40.
Otherwise, when we go to use ir_reader on the generated code, we won't
have the types present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
3645b77b71 glsl: Add support for integer sampler2DRect variants in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
c72840630b glsl: Drop ftransform() from GLSL 1.40 profile.
This is the one builtin function claimed to be dropped due to the
ARB_compatibility split.

Fixes piglit spec/GLSL-1.40/compiler/ftransform.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
590ad64fc8 glsl: Copy GLSL 1.30 builtin profile to GLSL 1.40.
All that's changed is the #version changing to 140.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
25c729bf9f glsl: When failing to compile some builtins, print the error.
This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
497aab39f0 glsl: Let the builtin compiler process GLSL 1.40 shaders.
This is required to put the new 1.40 builtins in place, since they
require new types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:49 -07:00
Eric Anholt
177ccd246f glsl: Update builtin variables for GLSL 1.40.
Mostly this is a matter of removing variables that have been moved to
the compatibility profile.  There's one addition: gl_InstanceID is
present in the core now.

This fixes the new piglit tests for GLSL 1.40 builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
c5ff9a8b9e glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.
This gets a basic #version 140 shader compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
ac5a5b3243 glsl: Add support for parsing #version 140.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Kenneth Graunke
99cd475cc9 i965: Enable SIMD16 mode for shaders with loops on Gen6+.
The hardware supports it; there's no reason not to.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-14 15:02:48 -07:00
Vinson Lee
fe34006908 gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.
llvm-3.1svn r152620 refactored the OProfile profiling code.
createOProfileJITEventListener was moved from the llvm namespace to the
llvm::JITEventListener namespace.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-14 09:30:40 -07:00
Tom Stellard
dc382e5c35 noop: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
3f3f10f78c identity: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
26ab747284 galahad: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
fe3f98ed70 gallium/drivers: Use automake to generate makefile 2012-03-14 10:25:59 -04:00
Christopher Yeleighton
ea738548e5 docs: fix html in banner.html
https://bugs.freedesktop.org/show_bug.cgi?id=47304

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-14 08:06:37 -06:00
Eric Anholt
ead3589aa2 glsl: Avoid extra if statements for logic and/or with no side effects.
This avoids extra if statements in the common case of just comparing
two expressions that don't involve assignments or function calls,
along with simplifying the handling of constant expressions.  Reduces
i965 instructions generated in unigine tropics and sanctuary,
yofrankie, warsow, gstreamer shaders, and the weston compositor.

shader-db results:
Total instructions: 213052 -> 212752
38/1246 programs affected (3.0%)
14309 -> 14009 instructions in affected programs (2.1% reduction)
2012-03-13 13:50:08 -07:00
Dylan Noblesmith
b536ac6b2b mesa: add back glGetnUniform*v() overflow error reporting
The error was removed in:

commit 719909698c
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Oct 18 16:01:49 2011 -0700

    mesa: Rewrite the way uniforms are tracked and handled

The GL_ARB_robustness spec doesn't say the implementation
should truncate the output, so just return after setting
the required error like it did before the above commit.

Also fixup an old comment and add an assert.

NOTE: This is a candidate for the 8.0 branch.
2012-03-13 15:59:24 +00:00
Anuj Phogat
cc5b0ffae0 mesa: Fix the cause of piglit test fbo-array failure
Handle the special case of glFramebufferTextureLayer() for which we pass
teximage = 0 internally in framebuffer_texture(). This patch makes failing
piglit test fbo-array, fbo-depth-array to pass.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47126

V4: Removed the duplicated code.
Note: This is a candidate for the stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-12 11:58:12 -07:00
Brian Paul
6830e6515c mesa: fix _mesa_DebugMessageCallbackARB() to silence warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-12 12:54:25 -06:00
Brian Paul
82195815ec radeon: remove use of DD_FLATSHADE
This got missed earlier <sigh>.
2012-03-12 12:47:03 -06:00
Christopher Yeleighton
7f94d9819d docs: fix up html tags in autoconf.html
http://bugs.freedesktop.org/show_bug.cgi?id=47241

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-12 12:22:34 -06:00
Brian Paul
534cbbe658 mesa: add more comments about textarget in framebuffer_texture() 2012-03-12 11:40:44 -06:00
Brian Paul
92c42d8170 mesa: renumber remaining DD_ constants
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
741bfef26c mesa: remove unused DD_TRI_CULL_FRONT_BACK
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d710bbcd74 mesa: remove unused DD_FLATSHADE
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d269b1f310 mesa: remove unused DD_TRI_TWOSTENCIL
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
291e4104ae mesa: remove _DD_NEW_x flags
They're no longer used anywhere.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d2b849a227 tnl: stop using _DD_NEW_x flags
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
938aaec981 swrast: s/_DD_NEW_SEPARATE_SPECULAR/_MESA_NEW_SEPARATE_SPECULAR/
Another step toward removing the _DD_NEW_x flags

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
5edd7b8c46 mesa: define _MESA_NEW_SEPARATE_SPECULAR
This will replace the soon-to-be-removed _DD_NEW_SEPARATE_SPECULAR flag.
Note: there's a similar composite _MESA_NEW_NEED_EYE_COORDS flag set already.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
22d6268df7 i915: remove occurances of _DD_NEW_x flags
Just use the corresponding _NEW_x flags intead.  The _DD_NEW_x flags
will be removed in a following patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
f21dfa9d4b mesa: remove ctx->Driver.ClearColor() hook
The driver Clear() function should just grab the clear color out of the
context.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
9c53fc593e mesa/gdi: remove clear_color() function
Setup the clearing color in the clear() function.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
fdbb717b24 xlib: remove clear_color() function
Just setup the clearing color in clear_buffers().

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
c90ae6b501 radeon/r200: remove ClearColor driver functions
The state.color.clear value was never used anywhere.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5f80218884 mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooks
Not used by any drivers.  Drivers can easily access the values
from the Mesa context at glClear() time.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
e0ed951e13 radeon/r200: remove ClearDepth() and ClearStencil() driver hooks
The computed stencil.clear and depth.clear values aren't used anywhere.
Those fields have been removed too.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5bb2059be7 radeon/r200: remove hyperz/fast clear testing code
The flags which were computed were never actually used.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Kenneth Graunke
5ac910c014 docs: Fix unclosed anchor tag in xlibdriver.html.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47205
2012-03-11 23:39:54 -07:00
José Fonseca
901a118327 egl/drm: Include errno.h
Fixes scons build.
2012-03-11 19:51:00 +00:00
David Fries
b60120608f Set close on exec flag FD_CLOEXEC
Set the close on exec flag when opening dri character devices, so they
will be closed and free any resouces allocated in exec.

Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 19:05:50 +00:00
José Fonseca
5ea18503e7 mapi/glapi: Fix glDebugMessageCallbackARB arg type to GLDEBUGPROCARB
Necessary to prevent type mismatches on MinGW.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:30 +00:00
José Fonseca
10d3b6500b glapi/gen: Add support for pointer types.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
7221f52389 mesa: Prevent collision of ERROR define on Windows.
This issue might recur on other OSes. If so then it might be better
to remove the C-preprocessor magic, and use fully qualified defines
instead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
fa476782fd include: Fix glDebugMessageCallbackARB's prototype.
Seems to be a bug in Khronos headers, as

http://www.opengl.org/registry/specs/ARB/debug_output.txt states userParam
is not a const pointer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:23:45 +00:00
Marek Olšák
bb1d126b23 mesa: expose ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
d7d0d2890a mesa: display list dispatch for ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
0e4508e077 mesa: print GL errors via debug_output 2012-03-10 21:42:06 +01:00
nobled
ae4a8a59b7 mesa: implement the last of GL_ARB_debug_output
Store client-defined message IDs in a hash table,
and sort them by severity into three linked lists
so they can be selected by severity level later.
2012-03-10 21:42:06 +01:00
nobled
41308d9699 mesa: add struct for managing client debug namespaces
The final piece of the puzzle for GL_ARB_debug_output.
2012-03-10 21:42:06 +01:00
nobled
f6f3093940 mesa: add control for categories of application-provided messages
This state is needed for deciding whether or not to log
application messages with IDs that haven't been specifically
passed to glDebugMessageControlARB yet.

State for each individual ID number ever passed to
glDebugMessageControlARB (per-context) still needs to be added.
2012-03-10 21:42:06 +01:00
nobled
4667cb2162 mesa: add yet more context fields for GL_ARB_debug_output 2012-03-10 21:42:06 +01:00
nobled
c68f0b8cab mesa: add glDebugMessageControlARB
Controlling the output of client-provided messages
isn't done yet.
2012-03-10 21:42:05 +01:00
nobled
76414cded8 mesa: add message-toggle booleans for GL_ARB_debug_output 2012-03-10 21:42:05 +01:00
nobled
5dd750d685 mesa: add some GL_ARB_debug_output functions 2012-03-10 21:42:05 +01:00
nobled
ed087ee498 mesa: add infrastructure for GL_ARB_debug_output
Marek v2: don't add the extension to extensions.c yet
2012-03-10 21:42:05 +01:00
Marek Olšák
3917503b9a glapi: regenerate files 2012-03-10 21:42:05 +01:00
nobled
a0d6732182 glapi: add ARB_debug_output.xml
Marek v2: replace GLDEBUGPROCARB with void*
2012-03-10 21:42:04 +01:00
nobled
5ab088c7e2 mesa: split error handling into its own file
Also add _mesa_vsnprintf.
2012-03-10 21:42:04 +01:00
Kenneth Graunke
60218b604a drirc: Add force_glsl_extensions_warn workaround for Unigine Heaven.
Unfortunately, Unigine Heaven 3.0 still needs this.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-09 15:21:10 -08:00
José Fonseca
105ef87842 svga: Disable bogus assertions concerning min_index/max_index.
min_index/max_index are merely conservative guesses, so we can't
make buffer overflow detection based on their values.

Tested-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-09 18:57:17 +00:00
Brian Paul
f5d0ced242 mesa: fix GL_LUMINANCE handling in glGetTexImage
There are several cases in which we need to explicity "rebase" colors
(ex: set G=B=0) when getting GL_LUMINANCE textures:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

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

Also fixes the new piglit getteximage-luminance test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:45:33 -07:00
Brian Paul
9917988223 svga: add null vs pointer check in update_need_pipeline()
Based on a patch submitted by Vic Lee.  The other part of his patch
which checked the fs pointer wasn't needed.

This fixes a crash when clear() is called before any VS or FS is set.
But this can only happen when the driver is used without the Mesa
state tracker.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:25:18 -07:00
Christoph Bumiller
fb3cb5c2dd nv50: add support for R8G8_R8B8 and G8R8_B8R8 formats 2012-03-09 15:21:01 +01:00
Christoph Bumiller
95df2d0ca7 nv50,nvc0: share the format table code 2012-03-09 15:19:28 +01:00
Christian König
63d53063f7 vl: handle DRI2GetBuffers reply with multiple buffers
This fixes a crash in XBMC, but we still doesn't see a picture.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:45:09 +01:00
Christian König
85dbb22796 vl/mpeg12: make bitstream decoder more robust
Just another xine workaround.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:51 +01:00
Christian König
9a3c2776ac st/vdpau: fix two small memory leaks
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:34 +01:00
Christian König
2e5f3cdca5 st/vdpau: add xine workaround
For reasons I don't understand xine tries to set
the surface format by using a zero pitch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:20 +01:00
Christian König
7236f170e4 vl/video_buffer: add YUYV and UYVY support
This gets xine working with VDPAU.

v2: some minor bugfixes.
v3: create the resource with the subsampled
    format to avoid tilling problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:04 +01:00
Christian König
fb016854bc r600g: add support for subsampled rgb formats
v2: r600 formats are msb first!

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:49 +01:00
Christian König
461c34c0cb gallivm: add support for R8G8_R8B8 and G8R8_B8R8 formats
Just to keep lp_test_format happy.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:27 +01:00
Christian König
4f41f8edb3 gallium: add R8G8_R8B8 and G8R8_B8R8 formats
v2: simplify implementation by using correct swizzle
v3: fix mix with successor patch

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:40:54 +01:00
Christian König
5c8040aee6 u_format: fix a comment about subsampled formats
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:36:34 +01:00
Brian Paul
5beba3d0ba mesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:58 -07:00
Brian Paul
ad897fff77 mesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code
See the comments for _mesa_rebase_rgba_float() for details.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:53 -07:00
Brian Paul
774c402765 mesa: add _mesa_rebase_rgba_float/uint() functions
These will be used by glReadPixels() and glGetTexImage() to fix issues
with reading GL_LUMINANCE and other formats.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:36 -07:00
Eric Anholt
be5f27a84d glsl: Refine the loop instruction counting.
Before, we were only counting top-level instructions.  But if we have
an assignment of a giant expression tree (such as the ones eventually
generated by glsl-fs-unroll), we were counting the same as an
assignment of a variable deref.

glsl-fs-unroll-explosion now fails in a reasonable amount of time on
i965 because the unrolling didn't go ridiculously far.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-08 11:19:12 -08:00
Marek Olšák
7f1cbf12bc r600g: enable ARB_draw_instanced 2012-03-08 12:21:47 +01:00
Christian König
ac1dd440b8 vl/video_buffer: add YUVA and VUYA support
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d6119ac9fa gallium: remove format aliases
They are incomplete and don't make to much sense.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d5fc3746fe st/vdpau: cleanup YCBCR matching functions
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
5d5b414a7b st/vdpau: fix chroma_format handling in VideoSurfaceQueryGetPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Marek Olšák
f6546535c9 r600g: use SX_MISC to implement rasterizer discard
Yeah I am reworking it again. This is way simpler than the other methods.
2012-03-08 11:23:24 +01:00
Marek Olšák
c7eaf274a9 Revert "r600g: fix and improve rasterizer discard for r600-r700"
I will use SX_MISC instead.

This reverts commit 597fd6dc8c.
2012-03-08 11:23:24 +01:00
Marek Olšák
80e4d18f84 Revert "r600g: rework rasterizer discard for evergreen"
I will use SX_MISC instead.

This reverts commit 734792e83f.

Conflicts:

	src/gallium/drivers/r600/evergreen_hw_context.c
	src/gallium/drivers/r600/evergreen_state.c
	src/gallium/drivers/r600/r600_hw_context.c
	src/gallium/drivers/r600/r600_pipe.h
2012-03-08 11:23:24 +01:00
Zack Rusin
831de96db8 svga: fix the rasterizer state resets
draw module calls back into the driver and sets certain parts
of the state to whatever it needs, unfortunately unless you
get the ordering of calls to draw just right you'll end up
reseting your own driver state. That's what was happening to us
draw module would under certain conditions reset our own driver
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-07 19:17:27 -05:00
Johannes Obermayr
d249bd9cbd glx: Also put a symlink from libGL.so in lib/ for now.
This fixes the libGLU.so.* build when a system libGL.so is not present
since it is relying on the lib/ to build against until it gets
converted to automake.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-03-07 09:37:46 -08:00
Benjamin Franzke
ab6e081914 gbm_dri: Fix DRIimage lookup callback
That is by making the dri extension variables static in gbm_dri.c.

The image_lookup_extension is provided by egl_dri2 when using x11 or wayland
platforms, when using the drm platform, gbm_dri has a wrapper for it.
Both use the same variables name image_lookup_extension.

Since -fvisibility=hidden was (probably by mistake) removed when converting to
automake, the "image_lookup_extension" symbol from egl_dri2.c became exported
in libEGL.so, so "image_lookup_extension" from gbm_dri.c was ignored.
This resulted in calling incorrect callbacks.

We cant make the image_lookup_extension static in egl_dri2.c right now,
since its used across multiple files.

Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=58099
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-03-07 18:17:56 +01:00
Brian Paul
6c1dea5445 mesa: handle array textures in strip_texture_border()
If the texture is a 1D array, don't remove the border pixel from the
height.  Similarly for 2D array textures and the depth direction.
Simplify the function by assuming the border is always one pixel.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-07 08:17:20 -07:00
Brian Paul
4f869e9cb5 docs: add more MinGW prerequisite tips
Provided by Charles Huber on the mesa-users list.
2012-03-07 08:08:36 -07:00
Marek Olšák
d0f8561574 r600g: only emit SX_SURFACE_SYNC on r700 if there's CS checker support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47039
2012-03-07 13:52:58 +01:00
Yuanhan Liu
43af02ac73 i965: handle gl_PointCoord for Gen4 and Gen5 platforms
This patch add the support of gl_PointCoord gl builtin variable for
platform gen4 and gen5(ILK).

Unlike gen6+, we don't have a hardware support of gl_PointCoord, means
hardware will not calculate the interpolation coefficient for you.
Instead, you should handle it yourself in sf shader stage.

But badly, gl_PointCoord is a FS instead of VS builtin variable, thus
it's not included in c.vue_map generated in VS stage. Thus the current
code doesn't aware of this attribute. And to handle it correctly, we
need add it to c.vue_map manually to let SF shader generate the needed
interpolation coefficient for FS shader. SF stage has it's own copy of
vue_map, thus I think it's safe to do it manually.

Since handling gl_PointCoord for gen4 and gen5 platforms is somehow a
little special, I added a lot of comments and hope I didn't overdo it ;)

v2: add a /* _NEW_BUFFERS */ comment to note the state flag dependency
    and also add the _NEW_BUFFERS dirty mask (Eric).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45975
Piglit: glsl-fs-pointcoord and fbo-gl_pointcoord

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:30:01 +08:00
Yuanhan Liu
cf2f9ef015 i915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check
We have to do fallback when the 'Clipped Drawing Rectangle X/Y Max'
exceed the hardware's limit no matter the drawing rectangle offset
changed or not.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:20:20 +08:00
nobled
4aa1ac5fe9 dri/nouveau: don't use nested functions
It's a GNU extension that isn't supported by clang right now:
http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Nested-Functions.html
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

With this, clang now compiles the nouveau classic driver.

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

(Types changed from e.g. 'unsigned char' to 'GLubyte' so that the types can
be concatenated to form a unique function name without any whitespace
interfering.)

[ Francisco Jerez: give meaningful names to the dispatch functions. ]
2012-03-06 21:26:21 +01:00
Vinson Lee
1633dcd890 gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.
llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
MCRegisterInfo argument.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 10:31:12 -08:00
Dave Airlie
ef3e26c2e4 draw/llvm: add clip distance support
This add clipdistance support like the non-llvm draw paths,
if we have a clip distance we compare with it instead of doing
the dot4.

We also have to put the have_clipvertex bit into the emitted
vertex header.

Fixes vs-clip-distance-all-planes-enabled, vs-clip-distance-const-reject,
vs-clip-distance-enables, vs-clip-distance-implicitly-sized,
vs-clip-distance-in-param, vs-clip-distance-uint-index.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:33 +00:00
Dave Airlie
9c465a95ac draw/llvm: fix storing of clipvertex and positions into pre_clip_pos (v2)
This fixes the rest of the piglit clipvertex tests.

v2: fixup comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:02 +00:00
Dave Airlie
cb4bcbcb1d draw/llvm: fix clipvertex setting up clipmask. (v2)
We incorrectly setup clipmask for gl_ClipVertex, this fixes the clipmask
setup.

v2: fix comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

fix comment
2012-03-06 09:34:52 +00:00
Dave Airlie
357afb68e4 gallium: add llvm-related TODOs. (v2)
This is just a simple text file containing a list of goals for gallivm/llvmpipe
and some info on what is required to get there along with some info on who
is looking at things.

v2: add EXT_texture_array.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:23:57 +00:00
Anuj Phogat
a9523af0e8 mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()
_mesa_max_texture_levels() is also used to test valid texture target
in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed
as texture target in glGetTexLevelParameter(). So, this should throw
GL_INVALID_ENUM error.

Few other functions which use _mesa_max_texture_levels() like
getcompressedteximage_error_check() and getteximage_error_check()
also don't accept GL_TEXTURE_CUBE_MAP.

Above fix makes piglit fbo-cubemap test to fail. This is because of
incorrect texture target passed to _mesa_max_texture_levels() in
framebuffer_texture(). Fixing that as well

Note: This is a candidate for the stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 19:02:08 -08:00
Jon TURNEY
71f4a960f8 egl: Use -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

If I had a dollar for every time I wrote this patch, I'd have about
$10 :-)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 18:39:29 -08:00
Daniel Vetter
f172eae8b2 i965: fixup W-tile offset computation to take swizzling into account
There's even a comment in the code containing the right swizzling
computations!

Previously this has not been noticed because we need to manually
enabled swizzling on snb/ivb (kernel 3.4 will do that) and we
don't use the separate stencil on ilk (where the bios enables
swizzling). This fixes

piglit ./bin/fbo-stencil  readpixels GL_DEPTH32F_STENCIL8 -auto

on recent drm-intel-next kernels.

Also remove the comment about ivb, it's stale now.

Swizzling detection is done by allocating a temporary x-tiled
buffer object. Unfortunately kernels before v3.2 lie on snb/ivb
because they claim that swizzling is enable, but it isn't. The
kernel commit that fixes this for backport to pre-v3.2 is

commit acc83eb5a1e0ae7dbbf89ca2a1a943ade224bb84
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 12 20:49:16 2011 +0200

    drm/i915: fix swizzling on gen6+

But if the kernel doesn't lie, this now works on swizzling and
not swizzling machines.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 12:02:47 -08:00
Benjamin Franzke
3ff04ea236 meta: Fix compilation without FEATURE_EXT_transform_feedback
That is when building with --disable-opengl.
Fix for commit cb045880b1.

CC: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
84f107d287 meta: Fix compilation without FEATURE_feedback
That is when building with --disable-opengl.
Fix for commit c5f4024a79.

CC: Chad Versace <chad@chad-versace.us>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
e6aa32ac7f wayland: Use new wl_display_disconnect
This replaces the previously used wl_display_destroy.
wl_display_destroy was povided by wayland-client.so and
wayland-server.so, to resolve that conflict its renamed client-side.
2012-03-05 20:34:42 +01:00
Roland Scheidegger
da5e9fce47 gallivm: fix floating type in lp_build_mod helper
untested, but cannot have worked before.
2012-03-05 19:09:56 +01:00
Christian König
05579339c0 st/vdpau: make the interface thread save
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:32 +01:00
Christian König
1d0c357a97 st/vdpau: implement support for high-precision output timing
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:25 +01:00
Christian König
4f5469f8d6 st/vdpau: implement support for extra mixer layers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:16 +01:00
Marek Olšák
e363dd5c7d r600g: replace atom_ prefix with _state and _cmd suffixes 2012-03-05 16:22:28 +01:00
Marek Olšák
330b6c85c9 r600g: cleanup includes 2012-03-05 15:57:32 +01:00
Marek Olšák
6f50d3d19d winsys/radeon: cleanup includes 2012-03-05 15:31:35 +01:00
Marek Olšák
6ed5855009 r600g: move r600_context_bo_reloc to r600_pipe.h
so that we don't have to include r600_hw_context_priv.h outside of
the *hw_context* files.
2012-03-05 15:31:35 +01:00
Marek Olšák
45d731fdf9 r600g: remove unused function r600_context_reg_bo 2012-03-05 15:31:35 +01:00
Marek Olšák
8a56ed8d6d r600g: remove unused definitions 2012-03-05 15:14:40 +01:00
Marek Olšák
0d91ddf1d4 r600g: don't enable tiling for STAGING and STREAM usage cases
Reviewed by: Christian König <christian.koenig@amd.com>
2012-03-05 14:55:46 +01:00
Marek Olšák
29e55bc5f1 winsys/radeon: add usage parameter to cs_is_buffer_referenced
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
96ef4ddc3d r600g: initialize DB_DEPTH_CONTROL at beginning of CS
Otherwise streamout with rasterizer discard will make the kernel upset
if the state tracker doesn't set a depth-stencil-alpha state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
428146c14f r600g: initialize VS_GS_OUT_PRIM_TYPE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
6187503f95 r600g: initialize SX_SURFACE_SYNC
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
f71f5edf78 r600g: if pixel shader is NULL, bind a dummy one
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
914b4bb80c r600g: add support for missing colorbuffer formats
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
c60d789b3b r600g: remove support for SCALED colorbuffer formats
Unused by the current stack and APIs, therefore untestable.
It was used to facilitate the transition to integers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
515a64a28c r600g: permit blitting between textures with STREAM and STAGING usage
Eventually I'd like to make every format blittable, so that the function
can go away.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
597fd6dc8c r600g: fix and improve rasterizer discard for r600-r700
For polygons, we have been using face culling with success, but that doesn't
work for points and lines.

Setting the point size and line width to 0 fixes it.

Also improve it even more by setting SCREEN_SCISSOR to a zero area.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
734792e83f r600g: rework rasterizer discard for evergreen
Implement it right using STRMOUT_CONFIG.RAST_STREAM. This fixes rasterizer
discard with points and lines.

This also adds another derived state. It's a combination of rasterizer discard
and streamout enable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
ca78a47b05 r600g: make some scissor regs invariant on r600-r700
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
cd5d02bf51 r600g: make some scissor regs invariant on evergreen
We only need one scissor for the framebuffer.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
aacd653834 r600g: rework scissor for r600-r700
We must use VPORT_SCISSOR, because that's the only one we can use for multiple
scissor rectangles in ARB_viewport_array.

R700 can use the VPORT_SCISSOR_ENABLE bit, but R600 doesn't have that and must
emit a 8192x8192 rectangle if scissor is disabled.

This commit also cleanups magic numbers in create_rs_state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
2881d456a5 r600g: rework scissor for evergreen
VPORT_SCISSOR is the OpenGL scissor. How do I know? Because there are
16 of them just like GL4.1 has multiple scissor rectangles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
370c8b5ee7 r600g: remove obsolete todo comments
Also use XXX in the other ones, because it's the most used word for that
purpose in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
0018db1126 r600g: correctly handle queries which don't need begin_query
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
09ec30f028 r600g: don't suspend timer queries for u_blitter
Timer queries should be able to measure the time spent in u_blitter as well.

Queries are split into two groups: the timer ones and the others (streamout,
occlusion), because we should only suspend non-timer queries for u_blitter,
and later if the non-timer queries are suspended, the context flush should
only suspend and resume the timer queries.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
eabcecc26b r600g: release query buffers in destroy_query
This fixes a memory leak introduced with the rework.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
83667acfd9 r600g: move all query code into r600_query.c
And rename or inline functions where appropriate.
There is no reason to keep this stuff in r600_hw_context.c.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:14 +01:00
Marek Olšák
62f44f670b Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"
This reverts commit 0950086376.

It was decided to refactor the transfer API instead of adding workarounds
to address the performance issues.
2012-03-05 13:47:49 +01:00
Yuanhan Liu
058fc6521e i915: fix wrong rendering of gl_PointSize on Pineview
The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-05 10:42:58 +08:00
Yuanhan Liu
9962280c33 tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 10:39:54 +08:00
Tom Stellard
befcce264c r300/compiler: Add support for inline literals
On R500 chips, shader instructions can take 7-bit (3-bit mantissa, 4-bit
exponent) floating point values as inputs in place of registers.
2012-03-04 19:36:27 -05:00
Christian König
95594bae47 vl: fix shader in/out numbering
Fix all the other wrong numberings.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-03 10:53:07 +01:00
Eric Anholt
31b044506e egl: Also put a symlink from libEGL.so in lib/ for now.
This fixes the egl_gallium.so driver build when no system libEGL.so is
present, since it's relying on the lib/ to build against until it gets
converted to automake.
2012-03-02 18:42:25 -08:00
Kurt Roeckx
489ac8e73a i915: Fix i830 polygon stipple from PBOs.
This is a direct port of the i915 patch in
a856da6324.

Fixes glean's pbo test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:32:15 -08:00
Kurt Roeckx
024ece7523 i915: Compute maximum number of verts using the actual batchbuffer size.
We were looking at the size of batch.map for how big the batchbuffer
was, but on 865 we just use a single-page batchbuffer due to hardware
limits.

v2: Removed check for sizeof map < bo->size, since that's always false.
    [change by anholt]
NOTE: This is a candidate for release branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
2012-03-02 17:16:13 -08:00
Chris Wilson
33b07893e9 i830: Compute initial number of vertices from remaining batch space
In order to prevent an overflow of the batch buffer when emitting
triangles, we need to limit the initial primitive to fit within the
current batch. To do we need to measure the remaining space and thence
compute the maximum number of vertices that fit into that space.

Reported-by: Kurt Roeckx <kurt@roeckx.be>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Alban Browaeys
7d13a6e64b dri/i915: Fix off-by-one in i830 clip region size.
The hardware, like i915, uses an inclusive bounds on min and max for
the drawing rectangle, but we were providing a number for exclusive.
The number of bits used by the hardware only covers this value going
up to the maximum size, so when we programmed 2048 as the maximum
inclusive X, it saw a maximum X of 0 and clipped all rendering.  This
caused rendering failures in gnome-shell.

Fixes piglit fbo-maxsize.

v2: dropped changes to the blitter, which does use an exclusive x2, y2.
    [change by anholt]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45558
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Eric Anholt
ae92180d72 intel: Don't enable GL_ARB_draw_instanced pre-gen4.
swtnl doesn't handle this extension.
2012-03-02 17:16:11 -08:00
Eric Anholt
4d4f2daefa i915: Fix piglit fbo-nodepth-test on i830.
This is a direct port of fc4fba52cf from
i915, and fixes GPU hangs when running piglit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:11 -08:00
Christian König
a9073e3486 vl/compositor: fix shader in/out numbering
Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 16:07:18 +01:00
Christian König
54faecf607 st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
d14c879d82 st/vdpau: implement OutputSurfacePutBitsYCbCr
v2: the csc_matrix is optional

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
8d0808214a st/vdpau: implement VideoSurfaceGetBitsYCbCr
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:12 +01:00
Christian König
222600972c st/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:06 +01:00
Christian König
507fd8026a st/vdpau: implement OutputSurfaceGetBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:37:59 +01:00
Christian König
494e0025d9 st/vdpau: implement OutputSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
a0571b135e st/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
379f46c8ac st/vdpau: fix default swizzle for Output/Bitmap samplers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
503cfbc7ba st/vdpau: add support for per vertex colors
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
bf19596870 st/vdpau: implement BitmapSurfaceQueryCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
abf31e3822 st/vdpau: implement OutputSurfaceRenderBitmapSurface
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
2ec6af0c63 st/vdpau: implement BitmapSurfaceGetParameters
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
e44731265d st/vdpau: implement BitmapSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
3aa087fa04 st/vdpau: implement BitmapSurfaceCreate/Destroy
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
f8ac7e0348 st/vdpau: avoid an unnessasary copy
Delay the actual mixer rendering until we really
know which surface is the real destination.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
14766f8200 vl/csc: simplify matrix handling
A csc matrix is only 4x3 not 4x4, also define a VDPAU compatible type for it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
74a4e90894 vl/compositor: add support for per layer dst areas
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
b90727bb24 vl/compositor: add per vertex color suport
Used in subtitles, for example.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
d645dc65b6 vl/compositor: replace pipe_video_rect with u_rect
So we support things like flipping also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
32c4381d4a vl/compositor: split shaders and state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:20 +01:00
Vinson Lee
834f515988 Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."
This reverts commit d5a6c17254.

llvm-3.1svn r151687 makes MemoryObject accessor members const again.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-01 10:36:06 -08:00
Brian Paul
0605c6d861 Revert "st/mesa: don't unreference user attribs up front."
This reverts commit 72931ca4b9.

This commit caused a few piglit regressions (quad-invariance, draw-batch,
etc) with the vmware svga driver.
2012-03-01 08:55:24 -07:00
Christian König
c14c84f383 vl: move dirty area handling into winsys abstraction
Fixing uninitialized areas in SwapBuffers mode.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:55 +01:00
Christian König
91ac681113 vl: hide X latency by using asynchronous requests
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:51 +01:00
Christian König
66480c0f56 vl: use SwapBuffers instead of CopyBuffers
This should speed things up a bit, but also shows
some bugs with the kernel implementation.

v2: require xcb-dri2 version 1.8

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:46 +01:00
Christian König
f56784f9d0 st/xvmc: remove dst buffer texture workaround
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:39 +01:00
Christian König
80b40a4841 vl: rewrite vl DRI backend using XCB
v2: also set array_size of texture

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 14:37:44 +01:00
José Fonseca
6b024464e8 egl: Don't include strings.h on Windows.
strings.h is needed for the declaration of strcasecmp(), but only on
non-Windows platforms.
2012-03-01 06:37:30 +00:00
Yuanhan Liu
ffee498fb8 mesa: let GL3 buf obj queries not depend on opengl major version
While the ARB_map_buffer_range extension spec says nothing about these
queries -- they were added in GL 3.0 --, it seems like this could be an
error in the extension spec.  This is one of the extensions, like
ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to
previous versions.  These extensions are supposed to provide identical
functionality to OpenGL 3.0.  The other cases of mismatches have been
determined to be bugs in the extension specs.

And tools like apitrace rely on such queries to function properly.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-01 06:17:48 +00:00
José Fonseca
8c34a41278 gallivm: Update comments and prototype of vector-selects.
No runtime behavior change. As vector selects are still not very well
supported by LLVM.
2012-03-01 06:00:48 +00:00
Brian Paul
b5653880f6 docs: remove mention of components no longer in main Mesa tree 2012-02-29 20:54:33 -07:00
Brian Paul
3b744cb61a st/mesa: remove old assertion 2012-02-29 20:53:47 -07:00
Brian Paul
dab5f98404 r300g: init chan=0 to silence warning 2012-02-29 20:53:46 -07:00
Kenneth Graunke
c59bdee12e i965: Disable PrimitiveID upload.
We currently don't support gl_PrimitiveID, and I believe asking the
hardware to generate it results in vertex cache invalidations.

This could result in slowdowns for applications that use gl_InstanceID,
which would be counter-productive.  Just turn it off for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e9bcdc2c37 i965: Enable the GL_ARB_draw_instanced extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e568b00562 i965: Fix swizzles for system values such as gl_InstanceID.
visit(ir_variable *) sets dst_reg::writemask to the appropriate channel
for system values.  Unfortunately, visit(ir_dereference_variable *) then
calls swizzle_for_size, which for a float, sets the swizzle to .x.

This works for gl_VertexID, since we store it in the .x component (see
brw_draw_upload.c:732 - VID), but fails for gl_InstanceID (IID) since we
store it in the .y channel.

To fix this, avoid calling swizzle_for_size on ir_var_system_values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Ian Romanick
1e6a2c1059 glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension
Originally ARB_draw_instanced only specified that ARB decorated name.
Since no vendor actually implemented that behavior and some apps use
the undecorated name, the extension now specifies that both names are
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 14:57:15 -08:00
Eric Anholt
767ba60831 mesa: Add missing error check for first < 0 in glDrawArraysInstanced().
Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
871518dbf8 mesa: Fix display lists for draw_elements_base_vertex with draw_instanced.
Fixes piglit GL_ARB_draw_elements_base_vertex/dlist-arb_draw_instanced

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
3c69a18b6a mesa: Fix display list handling for GL_ARB_draw_instanced.
When you called them in a display list compile before, you would just
end up calling through NULL.

Fixes piglit GL_ARB_draw_instanced/dlist.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
d534b68404 mesa: Fix typo in comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:11 -08:00
Kenneth Graunke
b2ace06cbb i965: Fix Gen6+ dynamic state upper bound on older kernels.
Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object.  Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

NOTE: This is a candidate for release branches.
Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 12:59:54 -08:00
Eric Anholt
e5f895485e egl/drivers: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:41 -08:00
Eric Anholt
88612029f6 egl/main: Convert to automake.
The drivers/ walk-through-subdirs makefile is converted as well so I
didn't need to keep EGL_DRIVERS_DIRS along with the per-driver
HAVE_EGL_DRIVER_WHATEVER.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
28d92eff73 egl: Clean up some flow of EGL platform handling.
The default case code was set up in a separate way, while this makes
it more normal.  I wanted to add code to the explicit x11 platform and
default x11 platform cases in the next commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
d019cf9124 egl: Drop the non-builtin-drivers support.
The two drivers both did builtin mode, so drop the non-builtin build
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
9f0f00c319 egl: Drop _EGL_MAIN entrypoint obfuscation.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
8ffb098234 glx: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Mathias Fröhlich
ba1d921bdf mesa: Push the shine table into the tnl module.
All users of the shine table outside of the tnl module
are gone. Move the implementation into the tnl module and
prefix the public functions with _tnl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:28 +01:00
Mathias Fröhlich
8e5bc6dd1d mesa: Do not invalidate shine tables in compute light positions.
Since the shine tables are now only used in the tnl lighting stage, where
they are validated through the tnl driver function NotifyMaterialChange
called in tnl/t_vb_light.c, we can not omit calling
_mesa_validate_all_lighting_tables (which only validates the shine tables)
in main/light.c.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:24 +01:00
Mathias Fröhlich
7793a63d3d mesa: Avoid revalidating shine tables in _tnl_RasterPos.
Now that _tnl_RasterPos no longer uses the shine tables, avoid
revalidating them.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:20 +01:00
Mathias Fröhlich
a1b1f8ff86 mesa: Avoid using the shine table for _tnl_RasterPos
Use direct computation of pow for computing the shininess
in _tnl_RasterPos. Since the _tnl_RasterPos function is still
used by plenty drivers that do only need the shine table for
_tnl_RasterPos but do not make use of swtnl computations, this
enables pushing down the shine table computation and validation
into the tnl module, which will happen in a followup change.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:16 +01:00
Mathias Fröhlich
703ada1e45 mesa: Avoid explicit invalidation of shine tables.
Since the shine tables are implicitly invalidated by having
a different shininess value than the current one, we can
omit the explicit invalidation of the shine table.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:07 +01:00
Mathias Fröhlich
619baeae3c mesa: Remove gl_light_attrib::_Flags.
This variable is only used locally in _mesa_update_lighting.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:36:44 +01:00
Mathias Fröhlich
6b48d7e83d mesa: Remove _CosCutoffNeg from light state.
It is only used as a temporary variable during computation of
_CosCutoff. So, don't store it.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:35:37 +01:00
Brian Paul
7f9692b97d util: replace format equality test with compatibility test in blit code
This lets us use the resource_copy_region() path when blitting from
R8G8B8A8 to R8G8B8x8, for example.

v2: be smarter when src_format==dst_format

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:40:37 -07:00
Brian Paul
ce671c7ace util: better comment for util_is_format_compatible() 2012-02-29 08:40:37 -07:00
Brian Paul
9b9c7da966 mesa: use arrayObj var in more places in client_state() 2012-02-29 08:39:20 -07:00
Brian Paul
6eba268ec6 mesa: asst. fixes for texture arrays and borders
For 1D array textures, there is no border on the height dimension.
For 2D array textures, there is no border on the depth dimension.
2012-02-29 08:39:20 -07:00
Brian Paul
738482eec9 mesa: check for no state change in VertexAttribDivisor()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:39:20 -07:00
Brian Paul
9e68a8fa72 util: fix assertions in u_blitter.c code
Assertions of the form assert(a && b) should be written as separate assertions
so that you can actually tell which part is false when there's a failure.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 08:39:20 -07:00
Brian Paul
84870e2156 mesa: reorder things in mtypes.h
Move structs, enums, etc so they're in more logical order.  In particular,
the shader and transform feedback-related structs/enums were pretty
scattered around.
2012-02-29 08:39:20 -07:00
Brian Paul
83fed5e130 svga: fix max_lod clamping in update_tss_binding()
After biasing we need to clamp to be sure we don't exceed the number of
levels in the mipmap.  This fixes an assertion at svga_sampler_view.c:70

v2: simplify the biasing, clamping code per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:34:37 -07:00
Christian König
fce888a706 st/vdpau: fix use of *.o in Makefile.vdpau
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:30 +01:00
Christian König
acbc3c9678 st/xvmc: fix use of *.o in Makefile.xvmc
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:07 +01:00
Eric Anholt
0da5086443 i965: Avoid blocking on the GPU for setting the HiZ op vertex data.
We need to allocate new space every time to avoid blocking on the last
HiZ op completing.  There are two easy ways to do this:
brw_state_batch() and intel_upload_data().  brw_state_batch() is
simpler and avoids another buffer allocation.

Improves Unigine Tropics performance 0.376416% +/- 0.148722% (n=7).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-28 14:08:56 -08:00
Kenneth Graunke
b823b99ec0 glcpp: Don't strlen() the output for every token being printed.
The ralloc string appending functions were originally intended for
simple, non-hot-path uses like printing to an info log.

Cuts Unigine Tropics load time by around 20% (6 seconds).

v2: Avoid strlen() on every newline, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Kenneth Graunke
8292b7419d ralloc: Make rewrite_tail increase "start" by the new text's length.
Both callers of rewrite_tail immediately compute the new total string
length by adding the (known) length of the existing string plus the
length of the newly appended text.  Unfortunately, callers generally
won't know the length of the new text, as it's printf-formatted.

Since ralloc already computes this length, it makes sense to add it in
and save the caller the effort.  This simplifies both existing callers,
but more importantly, will allow for cheap-appending in the next commit.

v2: The link_uniforms code needs both the old and new length.
    Apply the obvious fix (which sadly makes it less of a cleanup).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Dave Airlie
579ccae73d gallivm: add major integer opcodes to the tgsi action handler
This adds support for all the opcodes needed for native integer
support with GLSL 1.20 enabled, and some of the ones for GLSL1.30
support.

I've split them between non-cpu and cpu along the same lines
Tom's code did for the other ones I think, but I'm open to review
on which ones should go where.

With instance ids fixed I get no regressions on my box here
with LLVM 2.8, will test with later LLVMs as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:56:18 +00:00
Dave Airlie
e2a2b33544 gallivm: drop deprecated opcodes
These are integer opcodes not deprecated ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:53:16 +00:00
Dave Airlie
2a76609681 gallivm: only do rcp/mul for floating
rcp asserts on type.floating so don't go passing non-floating
things into it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:52:36 +00:00
José Fonseca
9773370eda svga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.
Backends usually advertise a SVGA3D_DEVCAP_MAX_POINT_SIZE between 63 and
256, so an hardcoded max point size of 80 is often incorrect.

This limitation does not apply for anti-aliased points (as they are done
via draw module) but we still advertise the same limit for both, because
all others pipe drivers do.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-28 15:38:53 +00:00
Neil Roberts
d9c4209777 mesa: Don't disable fast path for normalized types
Mesa has a fast path for the generic fallback when using glReadPixels
for RGBA data which uses memcpy.  However it was really difficult to
hit this case because it would not be used if any transferOps are
enabled.  Any type apart from floating point or non-normalized integer
types (so any of the common types) would force enabling clamping so
the fast path could not be used.  This patch makes it ignore clamping
when determining whether to use the fast path if the data type of the
buffer is an unsigned normalized type because in that case clamping
will not have any effect anyway.

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

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-28 07:56:21 -07:00
Brian Paul
c51264c379 gallium: remove trailing comma to silence warning 2012-02-28 07:56:21 -07:00
Brian Paul
1535794722 mesa: minor comment, whitespace fixes in teximage.c 2012-02-28 07:55:10 -07:00
Dave Airlie
a46548e0ef gallivm: add frem support to the lp_build_mod helper.
for completeness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:43:14 +00:00
Dave Airlie
aec11e4daa gallivm: add bitarit xor and not ops.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:42:17 +00:00
Dave Airlie
72931ca4b9 st/mesa: don't unreference user attribs up front.
postpone unreferences until end of function, as the ones in use will
get naturally dereferenced.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:33:06 +00:00
Dave Airlie
fd4a3d463c mesa/vbo: inline vbo_sizeof_ib_type.
Can't see any reason this wouldn't be better off as an inline.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:32:26 +00:00
Dave Airlie
4ffc8b9ae4 gallivm: add integer and unsigned mod arit functions. (v2)
use a single entry point, as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:31:49 +00:00
Brian Paul
c3e3df9b18 tgsi: remove trailing comma to silence warning 2012-02-27 20:28:37 -07:00
Brian Paul
2aeadabc7e xlib: silence unused var warning 2012-02-27 20:28:37 -07:00
José Fonseca
67e501ad29 svga: Remove unused SVGA_TEX_UNITS constant. 2012-02-27 19:24:43 +00:00
José Fonseca
e567b34f0d svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-27 19:24:42 +00:00
Marek Olšák
bf4fedcef3 r600g: use u_default_transfer_flush_region for all resource types 2012-02-27 16:22:40 +01:00
Marek Olšák
ab13288821 r600g: use u_default_transfer_inline_write for all resource types 2012-02-27 16:22:34 +01:00
Marek Olšák
335facb502 gallium/util: add fast path for buffers in u_default_transfer_inline_write
v2: fix indentation, add assertions
2012-02-27 16:22:26 +01:00
Marek Olšák
615baedc77 gallium/util: set correct usage flags in u_default_transfer_inline_write
The DISCARD flags should improve performance in drivers which handle them.
2012-02-27 16:22:13 +01:00
Marek Olšák
4c02baade9 r600g: fix streamout cache flush for r600
Figured out by trial and error.
2012-02-27 16:21:45 +01:00
Christian König
15e60d9976 vl: fix a douple free in xsp winsys backend
There are a couple of more bugs, but it is only
useful for debugging anyway.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:57:24 +01:00
Christian König
20be286709 vl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:53:49 +01:00
Marek Olšák
897af1d499 r600g: cleanup r600_transfer_struct
Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.
2012-02-27 02:03:24 +01:00
Marek Olšák
622b65d33b r600g: check for R600_STREAMOUT env var in winsys 2012-02-27 02:03:24 +01:00
Marek Olšák
b85fc0ac7e r600g: move initialization of use_surface flag into screen_create
Also change the type to bool and give it a less ambiguous name.
2012-02-27 02:03:23 +01:00
Marek Olšák
81c0484862 r600g: properly check whether texture is busy in get_transfer 2012-02-27 02:03:23 +01:00
Marek Olšák
d334d591a7 r600g: rename r600_resource_texture::depth to bool is_depth
It's used as a boolean.
2012-02-27 02:03:23 +01:00
Marek Olšák
04e3240087 gallium: remove PIPE_SHADER_CAP_OUTPUT_READ
r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.
2012-02-27 02:03:23 +01:00
Marek Olšák
74d303521e gallium/rtasm: properly detect SSE and SSE2
This should fix crashes on ancient processors.
2012-02-27 02:03:23 +01:00
Tom Stellard
e6fa2d89e1 r300g: Use automake to generate Makefile v3
v2:
  - s/$(top_builddir)/$(top_srcdir)/
  - Always generate Makefile.in

v3:
  - Fixes from Matt Turner
  - Use Mesa CFLAGS
2012-02-26 15:13:47 -05:00
Tom Stellard
edf3307977 r300g: Reorganize the compiler unit tests 2012-02-26 15:13:47 -05:00
Tom Stellard
7acbbc0704 r300/compiler: Schedule KIL instructions before output writes 2012-02-26 15:13:46 -05:00
Tom Stellard
134a0a5ff8 r300/compiler: Use the smart scheduler for r300 cards 2012-02-26 15:13:40 -05:00
Tom Stellard
342cac7166 r300/compiler: Fix bug when lowering KILP on r300 cards
KILP instruction inside IF blocks were being lowered to an unconditional
KIL.  Since r300 doesn't support branching, when the IF's were lowered
to conditional moves, the KIL would always be executed.  This is not a
problem with the mesa state tracker, because the GLSL compiler handles
lowering IF's, but this bug was appearing in the VDPAU state tracker,
which does not use the GLSL compiler.

Note: This is a candidate for the stable branches.
2012-02-26 09:18:41 -05:00
Christian König
2a97a00e28 vl/compositor: fix a simple typo
Otherwise the dirty area tracking won't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:58 +01:00
Christian König
dcf8ee7d6a st/xvmc: move xvmc state tracker out of xorg subdir
The xvmc state tracker is completely seperate and
doesn't shares code or anything else with the
xorg state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:26 +01:00
Christian König
1448e829e8 vl: rework winsys interface
Throw out all the old and now unneeded stuff.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:14 +01:00
Christian König
b34c35a524 vl: cleanup dri winsys abstraction
There was way to much dead code in it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:00 +01:00
Vinson Lee
c5e6460022 scons: Don't build the assembly sources on Mac OS X.
This patch allows the Mac OS X SCons build to complete. The assembly
sources contain psuedo-ops that not are supported on Mac OS X.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-25 00:25:43 -08:00
Stéphane Marchesin
6512bc4e67 i915g: Fix fallout from 8e4540ec2a
Fixes piglit regressions from that change.
2012-02-24 15:17:27 -08:00
Zack Rusin
5d9bfc4d3f svga: Fix stencil op mapping
We were inverting the meaning of the stencil op flags: in svga/d3d
the normal incr/decr wraps and the SAT ops clamp.
This fixes piglit failures (at least stencil-twoside and stencil-wrap).
We should backport this everywhere we can.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-24 14:55:56 -05:00
Brian Paul
e0095548c0 svga: fix use of SVGA3D_x vs. PIPE_FORMAT_x in svga_is_format_supported()
Two of the switch cases used PIPE_FORMAT_ tokens instead of SVGA3D_ tokens.
As it happens, the token values are equal for these formats so there's no
net change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-02-24 10:15:37 -07:00
Brian Paul
590321c39d mesa/gdi: include swrast.h to fix compilation 2012-02-24 09:27:35 -07:00
Brian Paul
d7d4a1955b st/mesa: initialize the MaxViewport, MaxRenderbufferSize constants
Use the max 2D/rect texture size as the limit.  If that's not true
for some devices we'll need new PIPE_CAP_ queries.
2012-02-24 08:03:15 -07:00
Brian Paul
2b0aa3fb21 mesa: move more swrast-related #defines out of core Mesa 2012-02-24 08:03:15 -07:00
Brian Paul
7ad880f49f mesa: remove STENCIL_BITS use 2012-02-24 08:03:14 -07:00
Brian Paul
074637bf99 xlib: remove STENCIL_BITS 2012-02-24 08:03:13 -07:00
Brian Paul
5f60a00743 st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS
Remove some Mesa/swrast stuff.
2012-02-24 08:03:13 -07:00
Brian Paul
630ab0d27b mesa: remove last of MAX_WIDTH, MAX_HEIGHT
Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values
instead.
2012-02-24 08:03:12 -07:00
Brian Paul
70d3363757 mesa: remove MAX_WIDTH from prog_execute.h
define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).
2012-02-24 08:03:12 -07:00
Brian Paul
0a543eb5c4 st/glx: remove MAX_WIDTH/HEIGHT usage 2012-02-24 08:03:11 -07:00
Brian Paul
3ff527fb68 intel: remove MAX_WIDTH usage in intelInitContext() 2012-02-24 08:03:11 -07:00
Brian Paul
cb49def3d6 swrast: check max renderbuffer size against SWRAST_MAX_WIDTH 2012-02-24 08:03:10 -07:00
Brian Paul
a3b2c3a421 osmesa: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:10 -07:00
Brian Paul
df22829b9c dri/swrast: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:09 -07:00
Brian Paul
3f8a61ffa2 xlib: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:08 -07:00
Brian Paul
47d88ef204 swrast: define, use SWRAST_MAX_WIDTH/HEIGHT
We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.
2012-02-24 08:03:08 -07:00
Brian Paul
b5d096ac1a mesa: remove some cruft from config.h 2012-02-24 08:03:07 -07:00
Brian Paul
cfecffeedc mesa: minor comment clean-ups in config.h 2012-02-24 08:03:07 -07:00
Brian Paul
99d22c4e38 mesa: remove WIN32 MAX_WIDTH work-around in config.h
There aren't any more stack-allocated arrays dimensioned by MAX_WIDTH
so there shouldn't be any more stack overflows.
2012-02-24 08:03:06 -07:00
Brian Paul
ed65c5ccc3 swrast: remove MAX_WIDTH array in s_span.c 2012-02-24 08:03:06 -07:00
Brian Paul
30ea34a8d9 swrast: simplify mask array code 2012-02-24 08:03:05 -07:00
Brian Paul
fb1650b202 swrast: stop using MAX_WIDTH arrays in triangle code 2012-02-24 08:03:05 -07:00
Brian Paul
32bf36106e swrast: remove MAX_WIDTH arrays in stencil code
Use some per-context temporary arrays instead.
2012-02-24 08:03:04 -07:00
Brian Paul
401810b658 swrast: remove MAX_WIDTH arrays in s_drawpix.c 2012-02-24 08:03:04 -07:00
Brian Paul
0c70d2c5bb swrast: remove MAX_WIDTH arrays in s_zoom.c 2012-02-24 08:03:03 -07:00
Brian Paul
237b2fca7a swrast: remove MAX_WIDTH arrays in s_depth.c 2012-02-24 08:03:03 -07:00
Brian Paul
837b55517e swrast: remove MAX_WIDTH arrays in s_copypix.c 2012-02-24 08:03:02 -07:00
Brian Paul
08687c7912 mesa: move/fix MAX_WIDTH/HEIGHT-related assertions
Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 08:02:54 -07:00
Brian Paul
3e88e43224 st/mesa: stop using MAX_WIDTH in st_cb_texture.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:59 -07:00
Brian Paul
62c69c340e st/mesa: stop using MAX_WIDTH in st_cb_drawpixels.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
531eaca41b mesa: stop using MAX_WIDTH in glReadPixels code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
2e09fe4b9c mesa: stop using MAX_WIDTH in texstore code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:57 -07:00
Marek Olšák
a0a9e56cfe u_blitter: decrease minimum buffer range alignment to 4 for copy_buffer 2012-02-24 02:28:59 +01:00
Marek Olšák
59fbd8c6be u_blitter: check for invalid values in copy_buffer 2012-02-24 02:28:54 +01:00
Marek Olšák
df00dc3c81 r600g: rework queries
We always mapped the query buffer in begin_query, causing stalls
if the buffer was busy.

This commit reworks it such that the query buffer is only mapped
in get_query_result as it's supposed to be.

The query buffer is no longer treated as a ring buffer. Instead, the results
are just appended and when the buffer is full, we create a new one. One query
can have more than one query buffer, though that's a very rare case.
Begin_query releases all query buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
5b84a8c3c3 r600g: cleanup magic numbers in set_xx_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
89293287b8 r600g: remove duplicated evergreen_context_ps_partial_flush
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
84db8f9a22 r600g: remove duplicated evergreen_context_pipe_state_set_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
edc0ce292b r600g: remove duplicated set_xx_resource functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
985bd5487e r600g: remove duplicated function r600_state_sampler_init
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
cf59ed3f23 r600g: fixup name of evergreen-specific function
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
04d2828b03 r600g: simplify fail paths in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
99d5c1a13b gallium/u_slab: fix possible crash in util_slab_destroy
It may happen if util_slab_create has not been called.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
6a94c9dde0 r600g: fix possible crashes in destroy_context when failing in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
9670e72f6e r600g: consolidate common context init code
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
f841b8a833 r600g: define GROUP_FORCE_NEW_BLOCK in common header
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Jakob Bornecrantz
bed7b4aa5f st/dri: Fix crash in st/dri from dri format commit
Introduced with 8de5c355fa, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
2012-02-23 19:16:58 +01:00
Paul Berry
bc39de8c0b glapi: Fix incorrect enum value.
From http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt:

    Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
    and GetDoublev:

    TEXTURE_CUBE_MAP_SEAMLESS                   0x884F

This caused a change in enums.c, which is manually built from the .xml
files.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-23 09:35:44 -08:00
Brian Paul
4a72d859b4 util: add mutex lock in u_debug_memory.c code
The linked list of memory allocations was not protected by a mutex.
This lead to sporadic failures with multi-threaded apps.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:10 -07:00
Brian Paul
810584270d svga: no-op sampler view referencing if no change
Just to be safe with ref counting and avoid atomic operations.
2012-02-23 07:49:09 -07:00
Brian Paul
0fffaa512c svga: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:09 -07:00
Brian Paul
be05388ce9 st/wgl: check for hPbuffer=0 in wgl pbuffer functions
Per the GL_WGL_pbuffer spec, generate ERROR_INVALID_HANDLE and
return FALSE (and don't segfault).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
José Fonseca
9ffc8ea8f4 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-23 07:49:08 -07:00
Brian Paul
6835103878 st/mesa: use pipe_sampler_view_release()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
Brian Paul
4fdf42883f gallium: added pipe_sampler_view_release() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
c68334ffc0 st/mesa: add floating point formats in st_new_renderbuffer_fb()
To allow creating floating point buffers / pbuffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
09d0fa5be8 svga: re-enable deleted surface caching
Basically, instead of immediately freeing deleted surfaces, hang onto
them in a cache to do quick re-allocation.  This helps when surfaces
are frequently destroyed and then reallocated a bit later.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
500e7c5860 svga: implement surface cache size limit
There was a SVGA_HOST_SURFACE_CACHE_BYTES symbol, but it was never
used.

Now when we go to add a newly deleted surface to the cache we check
if the cache size would be exceeded.  If so, try to free the least
recently "unused" surfaces until the cache is smaller.  If we can't
do that, simply don't cache the newly deleted surface.  The alternative
involves flushing and waiting and we don't want to do that.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
32f669e7fc svga: add svga_format_size() function
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
8a9cad6384 svga: use dummy shaders when translation fails
Before, if shader translation failed for any reason we'd keep trying
to translate the shader over and over again during state validation.
The dummy fragment shader emits solid red so that might be visual
clue that translation is failing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
4516fcc57f svga: move temp register index assertions
The assertion recently added in dst_register() was invalid because that
function is also (suprisingly) used to declare constant registers.

Move the assertion to the callers where we're really creating temp
registers and add some code to prevent emitting invalid temp register
indexes for release builds.

Also, update the comment for get_temp().  It didn't return -1 if it
ran out of registers and none of the callers checked for that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
f12f67c00a svga: check that we don't exceed temp register limit
And assert on the register index in dst_register().  The dest can
only be an output or temp reg and there's more of the later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:05 -07:00
José Fonseca
a1482b21cb scons: Update windows llvm libraries for version 3.0. 2012-02-23 12:29:29 +00:00
Alex Corscadden
1702d8bdd8 Add a test for the compare opcode.
This is a test for the compare opcode (CMP).  This should draw a green triangle
in the fs-test.
2012-02-23 12:29:29 +00:00
Satyajit Sarangi
132daa87fb r600g: Fix build when libdrm is installed to non-standard dir.
Signed-off-by: Satyajit Sarangi<kernel.saty@gmail.com>
Signed-off-by: Tom Stellard <tstellar@gmail.com>
2012-02-22 20:39:01 -05:00
Paul Berry
80513ec8b4 i915: Initialize swrast_texture_image structure fields.
Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale
fields to swrast) moved the initialization of the Width, Height, and
DepthScale fields to _swrast_alloc_texture_image_buffer().  However,
i915 doesn't call this function because it performs its own buffer
allocation.  As a result, the Width, Height, and DepthScale fields
weren't getting initialized properly, and some operations requiring
swrast would fail.

This patch ensures that Width, Height, and DepthScale are properly
initialized by separating the code that sets them into a new function,
_swrast_init_texture_image(), which is called by
intel_alloc_texture_image_buffer() as well as
_swrast_alloc_texture_image_buffer().  It also moves the
initialization of _IsPowerOfTwo into this function.

Fixes piglit test fbo/fbo-cubemap on i915.

Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216

This is a candidate for the 8.0 branch.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-22 13:33:20 -08:00
Jesse Barnes
0beed7f072 intel: bump DRI_IMAGE extension version to 3
To indicate support for the format query.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:55:06 -08:00
Jesse Barnes
8de5c355fa gbm: track buffer format through DRI drivers
GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.

So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested.  GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:41:40 -08:00
José Fonseca
d35d3d612a tests/graw: Add a bunch of tests.
These were rotting in an internal branch, but contain nothing confidential,
and would be much more useful if kept up-to-date with latest gallium
interface changes.

Several authors including Keith Whitwell, Zack Rusin, and Brian Paul.
2012-02-22 15:22:31 +00:00
Brian Paul
0df14f9a55 mesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image
About a 10% improvement over the swizzle-copy path.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-22 11:56:20 +00:00
José Fonseca
3dd7b53178 gallium/cso: Put the comment about shader in the code for future reference. 2012-02-22 08:41:19 +00:00
Eric Anholt
ab79d2be2e i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:50 -08:00
Eric Anholt
6ca50f381c i965: Correct the size of the state batch space allocated for binding tables.
In the gen6 GS case, we were under-counting and so other state would
get smashed.  In the VS case, we were over-counting, so everything was
fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:48 -08:00
Eric Anholt
9fa6377a75 i965: Fix a bad comment in gen6 sol setup.
This was copy and paste from the VS where I had similar code.  We're
only looking at things derived from BRW_NEW_VERTEX_PROGRAM in this
block.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:46 -08:00
Eric Anholt
96ba94cad2 i965/gen6: Fix the size of the GS surface binding table.
I obviously didn't test on gen6 before pushing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:39 -08:00
Marek Olšák
5d2de9232d r600g: move invariant register updates into start_cs for evergreen and cayman 2012-02-21 21:42:27 +01:00
Marek Olšák
fbebd431ec r600g: move invariant register updates into start_cs for r6xx-r7xx 2012-02-21 21:42:27 +01:00
Marek Olšák
e2809849ec r600g: add a depth misc state which depends on occlusion queries
This is a state which is derived from other states and is actually the first
state which doesn't correspond to any gallium state.

There are two state flags:
  bool occlusion_query_enabled
  bool flush_depthstencil_enabled

Additional flags can be added later if needed, e.g. bool hiz_enabled.
The emit function will have to figure out the register values by itself.

It basically just emits the registers when the state changes.
This commit also adds a few helper functions for writing registers directly
into a command stream.
2012-02-21 21:42:27 +01:00
Marek Olšák
8f5c172c85 r600g: consolidate the main draw code
The code was almost the same for r600 and eg. What can't be consolidated is
in the *_prepare functions.
2012-02-21 21:42:27 +01:00
Marek Olšák
182fd4c544 r600g: move all invariant state from draw_vbo into start_cs 2012-02-21 21:42:27 +01:00
Marek Olšák
f126253040 r600g: turn init_config into a command buffer for starting a CS
This is the first pure command buffer. It contains CS initialization
packets and emits invariant state (i.e. the registers which never or rarely
change).

The affected registers are removed from *_hw_context.c, so that both ways
of emitting commands can co-exist.

v2: emit context_control in cayman's start_cs too
2012-02-21 21:42:27 +01:00
Kenneth Graunke
172bb92db1 i965: Only set Last Render Target Select on the last FB write.
Fixes GPU hangs in OilRush, Trine, and Amnesia: The Dark Descent,
which all use MRT (multiple render targets).

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38720
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40059
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45216
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 12:36:20 -08:00
Marek Olšák
32f833e5a5 gallium/cso: kill off non-functional shader caching
Suggested by José.

We don't provide shader caching in CSO. Most of the time the api provides
object semantics for shaders anyway, and the cases where it doesn't
(eg mesa's internall-generated texenv programs), it will be up to
the state tracker to implement their own specialized caching.
2012-02-21 21:09:16 +01:00
Marek Olšák
a6ef7f7ce4 gallium/util: remove u_simple_screen
Deprecated and unused.
2012-02-21 21:09:16 +01:00
Marek Olšák
96d882939d gallium: remove unused winsys pointers in pipe_screen and pipe_context
A winsys is already a private object of a driver.
2012-02-21 21:09:16 +01:00
Eric Anholt
f33d100fa7 intel: Silence valgrind warning for getparam ioctl argument.
It was concerned that the 4 pad bytes on LP64 were uninitialized.
2012-02-21 12:04:07 -08:00
Eric Anholt
5a7942c2f1 i965: Rename the original binding table to mention that it's the WM now.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:16 -08:00
Eric Anholt
f9c3ea32cd i965: Split the gen6 GS binding table to a separate table.
Improves VS state change microbenchmark performance by 7.08729% +/-
1.22289% (n=10) on gen7, because we don't upload the 64 dwords of
unused binding table any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:14 -08:00
Eric Anholt
07e00b3040 i965: Split the VS binding table to a separate table.
This is a step toward making the samplers/binding tables reflect
sampler uniform mappings instead of embedding those in the programs.
No significant performance difference on the microbenchmark (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:12 -08:00
Eric Anholt
8387156620 i965/gen6+: Avoid recomputing whether we use noperspective.
Improves VS state change microbenchmark performance 2.38246% +/-
1.15046% (n=20).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:10 -08:00
Eric Anholt
e9cfaed1a5 i965/gen7: Skip checking if we need a GS program for now.
We always say no.  Improves VS state change microbenchmark performance
7.68747% +/- 1.40826% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:08 -08:00
Eric Anholt
71d71d5e89 i965: Compute required barycentric interp modes once at FS compile time.
Improves VS state change microbenchmark performance 1.78817% +/-
0.556878% (n=25).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:06 -08:00
Eric Anholt
f0cecd43d6 i965: Move VUE map computation to once at VS compile time.
With this and the previous patch, 640x480 nexuiz is running 0.169118%
+/- 0.0863696% faster (n=121).  On a VS state change microbenchmark,
performance is increased 8.28645% +/- 0.460478% (n=52).

v2: Fix CACHE_NEW_VS comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:02 -08:00
Eric Anholt
9f3d3216cf i965: Make the userclip flag for the VUE map come from VS prog data.
This reduces recomputation of state based on non-clipping-related
transform changes, and is a step toward removing VUE map
recomputation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:53:37 -08:00
Anuj Phogat
b5c409363c mesa: fix issues with texture border and array textures
For a 1D texture array, the border only applies to the width.  For a 2D
texture array the border applies to the width and height but not the depth.
Sucha cases were  not handled correctly in _mesa_init_teximage_fields().

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-21 10:46:55 -08:00
Jerome Glisse
e372e53ee0 radeon/r600g: fix virtual address space allocation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-21 12:34:54 -05:00
José Fonseca
6fd62c998a llvmpipe: Remove lp_test_sincos.
Completely replaced by lp_test_arit.
2012-02-21 16:04:54 +00:00
Christian König
37f97e1753 vl: add support for bob deinterlacing
v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE
    for unknown picture structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:27 +01:00
Christian König
0f194fc9e4 st/vdpau: Use transfer_inline_write to upload ycbcr data
Uses less code and looks at least a bit cleaner than mapping manually.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:20 +01:00
Christian König
736dda82ca st/vdpau: remove unnecessary tracing and adjust tracing levels a bit
Tracing function entry/exits is a bit pointless
when VDPAU_TRACE=1 does the same thing.

v2: use WARN instead of ERR for application problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:11 +01:00
José Fonseca
a206c4cd69 gallivm: Fix TGSI_OPCODE_ARR's translation.
Like TGSI_OPCODE_ARL, destination should be an integer.

This fixes invalid LLVM IR on an internal state tracker (currently Mesa
never emits this opcode).

In the future consider making ADDR register also a integer-as-float array,
like all other register kinds, or simply replace ADDR & ARR/ARL with
integer temp and instructions.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-21 08:23:20 +00:00
Vinson Lee
d394bc5853 st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.
Fixes this GCC warning.
native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but not
used [-Wunused-function]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 13:17:23 -08:00
José Fonseca
dbadd39508 llvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-20 17:07:22 +00:00
Brian Paul
d2003ee7b7 mesa: check for no state change in glPrimitiveRestartIndex()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:34 -07:00
Brian Paul
45453d8f69 mesa: check for no state change in Enable/DisableVertexAttribArray()
Avoid setting dirty state flags when enabling or disabling a vertex
attribute arrays when there's no change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Brian Paul
e14b357367 mesa: add missing return after _mesa_error() in update_array()
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Tom Stellard
e1044b4082 r300g: Fix build when libdrm is installed to non-standard dir 2012-02-19 19:40:32 -05:00
Kenneth Graunke
df5963c256 i965: Make the dummy fragment shader work in SIMD16 mode.
If you're resorting to the dummy shader, you've probably already turned
off SIMD16 mode.  But if you didn't, it would die in a fire.

We could either fail to compile in SIMD16 mode...or just fix it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:46 -08:00
Kenneth Graunke
393b42240f i965: Fix GPU hangs in the dummy fragment shader.
The dummy FB write failed to specify EOT and a message length, causing
the GPU to hang.  Now we can enjoy "everyone's favorite color" again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:38 -08:00
Vinson Lee
0342ffba1f st/vega: Remove unused variable.
Fixes this GCC warning.
mask.c: In function ‘mask_layer_fill’:
mask.c:387:12: warning: variable ‘alpha_color’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:09:27 -08:00
Vinson Lee
e77e88740d st/glx: Remove unused variables.
Fixes these GCC warnings.
glx_api.c: In function ‘choose_visual’:
glx_api.c:678:8: warning: variable ‘trans_value’ set but not used
[-Wunused-but-set-variable]
glx_api.c:677:8: warning: variable ‘trans_type’ set but not used
[-Wunused-but-set-variable]
glx_api.c:663:8: warning: variable ‘min_ci’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:02:01 -08:00
Dave Airlie
c67a1f1d53 draw: add missing streamout state setup for draw/llvm.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-18 12:44:10 +00:00
Kenneth Graunke
6e738d35c5 vbo: Eliminate short-circuiting in invalid-start case.
Now that we have a index_range_invalid flag, we can just use that rather
than calling vbo_validated_drawrangeelements directly and returning.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-17 14:57:11 -08:00
Kenneth Graunke
112b02c324 vbo: Rework checking of 'end' against _MaxElement.
This failed to take basevertex into account:

If basevertex < 0:
   (end + basevertex) might actually be in-bounds while 'end' is not.
   We would have clamped in this case when we probably shouldn't.
   This could break application drawing.

If basevertex > 0:
   'end' might be in-bounds while (end + basevertex) might not.
   We would have failed to clamp in this place.  There's a comment
   indicating the TNL module depends on max_index being in-bounds;
   if so, it would likely break horribly.

Rather than trying to clamp correctly in the face of basevertex, simply
delete the clamping code and indicate that we don't have a valid range.
This causes _tnl_vbo_draw_prims to use vbo_get_minmax_indices() to
compute the actual bounds, which is much safer.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:55 -08:00
Kenneth Graunke
f00c97b23f vbo: Ignore invalid element ranges which are outside VBO bounds.
Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:44 -08:00
Kenneth Graunke
f9be8543aa vbo: Remove pedantic warning about 'end' beind out of bounds.
The application supplied [start, end] range is merely a conservative
hint of the ranges of index values inside the index buffer.  There is no
requirement that all vertices in the range [start, end] be referenced.

Passing an 'end' value larger than the maximum legal index is perfectly
acceptible; applications can legally pass 0xffffffff when they don't
have a tighter bound readily available.

Thus, the warning doesn't indicate a correctness issue; it could only
indicate a performance issue.  However, it does not even do that.

glDrawRangeElements is designed to optimize non-VBO vertex data uploads
by providing an upper bound on the size of buffers a driver would need
to allocate.  With VBOs, the data is already in an uploaded buffer, so
the range doesn't help.

The clincher is: we only know _MaxElement for VBOs.  For user-space
arrays, we just set it to 2,000,000,000 (see mesa/main/varray.h:63.)
So we can only check this in the case where it is not useful.

Many applications, including the Unigine demos, currently trigger this
warning, which suggests the applications are buggy when they're actually
fine.  Eliminating the warning should confuse users less while not
actually losing any benefit to application developers.

NOTE: This is a candidate for release branches.

Suggested-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:24 -08:00
Eric Anholt
e2dce7f7ee intel: Fix rendering from textures after RenderTexture().
There's a serious trap for drivers: RenderTexture() does not indicate
that the texture is currently bound to the draw buffer, despite
FinishRenderTexture() signaling that the texture is just now being
unbound from the draw buffer.

We were acting as if RenderTexture() *was* the start of rendering and
that we could make texturing incoherent with the current contents of
the renderbuffer.  This caused intel oglconform sRGB
Mipmap.1D_textures to fail, because we got a call to TexImage() and
thus RenderTexture() on a texture bound to a framebuffer that wasn't
the draw buffer, so we skipped validating the new image into the
texture object used for rendering.

We can't (easily) make RenderTexture() indicate the start of drawing,
because both our driver and gallium are using it as the moment to set
up the renderbuffer wrapper used for things like MapRenderbuffer().
Instead, postpone the setup of the workaround render target miptree
until update_renderbuffer time, so that we no longer need to skip
validation of miptrees used as render targets.  As a bonus, this
should make GL_NV_texture_barrier possible.

(This also fixes a regression in the gen4 small-mipmap rendering since
3b38b33c16, which switched
set_draw_offset from image->mt to irb->mt but didn't move the irb->mt
replacement up before set_draw_offset).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
NOTE: This is a candidate for the 8.0 branch.
2012-02-17 13:31:27 -08:00
Eric Anholt
308c6be802 intel: Improve the fallback debug for framebuffer status checks. 2012-02-17 13:31:27 -08:00
Eric Anholt
a1fd13fff1 mesa: Only end render-to-texture at bind time for drawbuffers.
If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?
2012-02-17 13:31:27 -08:00
Dave Airlie
7199b0b681 gallivm: fetch immediates to correct type (v2)
Fetch float/uint/int immediates.

v2: bitcast to uint/int to floats as per Jose's suggestions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
117a0e91af gallivm: enable stores of integer types. (v2) + fix ARL
Infer from the operand the type of value to store.
MOV is untyped but we use the float store path.

v2: make MOV use float store path.

I've had to squash merge the ARL fix to be stored
as an integer in here to avoid regressions in a number
of piglit tests.

From now on ARL stores to an integer just like HW does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
141f2c2fc9 gallivm: enable fetch for integer opcodes. (v2)
The infers the type of data required using the opcode,
and casts the input to the appropriate type.

So far this only handles non-indirect constant and temporaries.

v2: as per Jose suggestion, fetch immediates via floats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
66461aa249 gallivm: add uint/int bld to the base builder. (v2)
These are used inside the action handlers for the integer opcodes.

v2: use uint_bld/int_bld, drop higher level uint_bld.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
f667a6f3ce gallivm: fix build gather to take a bld context
Then pass the correct build context to it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
639fbe2e75 gallivm: pass build context to exec_mask_store.
For now just pass the current context, but when we want to
store int or unsigned we need to pass those later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
13e2e51f70 tgsi: add source/destination type from opcodes. (v2)
These two functions produce the src/dst types for an opcode.

MOV is special since it can be used to mov float->float and int->int,
so just return VOID.

v2: use a new enum for the opcode type as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
José Fonseca
9be0f9b0e4 gallivm: Initialize x86 disassembler on x86_64 too. 2012-02-17 17:22:23 +00:00
José Fonseca
e648f5e197 llvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.
Instead of assuming 4 wide vectors.
2012-02-17 16:17:28 +00:00
José Fonseca
b5941e33d0 llvmpipe: Specify lp_test_arit's target precision per function. 2012-02-17 16:10:22 +00:00
José Fonseca
fc79c4fbd4 llvmpipe: Add a negation test to lp_test_arit. 2012-02-17 15:57:54 +00:00
Ian Romanick
f767ee5404 docs: News and release notes link for 8.0.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 23:31:50 -08:00
Ian Romanick
578dc605b6 docs: Add 8.0.1 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d38a295289)
2012-02-16 23:31:50 -08:00
Ian Romanick
61cf89c002 docs: Add 8.0.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fe77fd3983)
2012-02-16 23:31:50 -08:00
Marek Olšák
e05bc52b9c r300g: don't use pipe_screen::winsys 2012-02-17 01:39:48 +01:00
Marek Olšák
c9e9cfbf60 r300g: don't use pipe_context::winsys 2012-02-17 01:26:56 +01:00
Ian Romanick
f16c40d2f6 mesa: Update the version string to 8.1-devel
The numeric version was updated in 46883e0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 15:29:26 -08:00
Brian Paul
ca1b2da300 docs: replace gitweb link with cgit link 2012-02-16 13:35:02 -07:00
Brian Paul
6f3d918409 mesa: add missing texture integer test in glTexSubImage()
If the texture format is integer, the incoming user data must also be
integer (and similarly for non-integer textures).

NOTE: This is a candidate for the stable branches.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-16 09:37:11 -07:00
Marek Olšák
b0b8121813 r600g: remove the workaround for quads and provoking vertex 2012-02-16 17:15:50 +01:00
Marek Olšák
73191026b4 r600g: remove redundant r600_context::vs_so_stride_in_dw 2012-02-16 15:56:59 +01:00
Kenneth Graunke
709f50928e i965: Emit Ivybridge VS workaround flushes.
I recently discovered this text in the BSpec.  It seems wise to comply,
though I haven't observed it to fix anything yet.

Fixes a regression in glean/fbo since 28cfa1fa21.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-15 22:17:39 -08:00
Eric Anholt
b631b471d8 mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.
Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:33 -08:00
Eric Anholt
4b6e45c7d6 mesa: Fix push/pop of multisample coverage invert.
In the table of of push/pop attributes, this one doesn't fall under
the enable group.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:24 -08:00
Ian Romanick
3e22d4e5fc swrast: Only avoid empty _TexEnvPrograms
If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
2012-02-15 14:50:40 -08:00
Ian Romanick
8f3be33985 glapi: Include GLES2 headers for ES2 extension functions
This fixes build errors like

In file included from glapi_dispatch.c:91:
../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
'glDrawBuffersNV'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-02-15 14:50:00 -08:00
Brian Paul
7539a0d677 st/mesa: fix typo: s/patent/parent/ 2012-02-15 14:37:07 -07:00
Brian Paul
456a02b0c7 st/mesa: remove unused st_equal_formats() function
It was incomplete and didn't take byte swapping into account either.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c9d0526084 st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()
st_equal_formats() is no longer used now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
b549fd138e st/mesa: remove INLINE qualifiers
from st_get/create_texture_sampler_view_from stobj() functions.
No real value in these cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
9600b0762b st/mesa: simplify st_create_texture_sampler_view()
Implement in terms of st_create_texture_sampler_view_format().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
91ec17835f st/mesa: remove unused st_get_texture_sampler_view()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0315cb9f8f st/mesa: use private pipe_sampler_view in decompress_with_blit()
Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c5ba6a7807 st/mesa: use private pipe_sampler_view in st_render_mipmap()
Rather than the one in st_texture_object.  This sampler view really has
no connection to the one used for rendering.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0bda900743 mesa: use z32f_x24s8 struct in format pack/unpack code
And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row().
As suggested by José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-15 14:08:50 -07:00
Brian Paul
dba7ad0ca9 st/mesa: assorted clean-ups in st_cb_fbo.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
418306397f st/mesa: remove st_framebuffer_renderbuffer()
Just use _mesa_framebuffer_renderbuffer().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
ea2aca036c st/mesa: remove st_get_default_texture()
Just use _mesa_get_fallback_texture() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
c04db7f7fa mesa: fix _mesa_get_fallback_texture() to handle all texture targets
Previously, this function only handled 2D textures.

The fallback texture is used when we try to sample from an incomplete
texture object.  GLSL says sampling an incomplete texture should return
(0,0,0,1).

v2: use a 1-texel texture image, per José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
447071cfb0 st/mesa: improve assertion/check for stencil format 2012-02-15 14:07:43 -07:00
Brian Paul
f1334f232f gallium: fix some comments in p_state.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
82ddd1129e mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Added in _mesa_pack_uint_24_8_depth_stencil_row().  This could be hit
by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8)
into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5e81d3b853 st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5a70e12fc0 st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
The st_renderbuffer_alloc_storage() function is used to allocate both
window-system buffers and user-created renderbuffers.  The later kind
are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
those surfaces.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
fc855f85d0 st/mesa: use u_surface_default_template() helper
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d9ae5db6e3 st/mesa: remove redundant memset(surface_template,0)
The subsequent u_surface_default_template() call does that for us.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
2e12b4cfef st/mesa: remove st_renderbuffer::stride
It was only used for software buffers and easily computed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d765c8ee8c st/mesa: remove st_renderbuffer::format
We only used it in a few places that can implemented differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
dbe88515c5 mesa: fix comment typos in fbobject.c 2012-02-15 14:07:43 -07:00
Kenneth Graunke
4b27406820 i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Commit dc7f449d1a introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

NOTE: This is a candidate for the 8.0 branch (with the previous commit).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:37 -08:00
Kenneth Graunke
8ab02b5118 i965/fs: Add a new fs_inst::regs_written function.
Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

NOTE: This is a candidate for the 8.0 branch (dependency of a fix).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:05 -08:00
Dave Airlie
c89b471f8c llvmpipe: fix fogcoord writing (v2)
this fixes the fogcoord related piglit tests, like I fixed them in softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-15 19:25:27 +00:00
Anuj Phogat
66bf25f1a2 meta: Avoid FBO resizing/reallocating in decompress_texture_image
Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 09:23:13 -08:00
Christian König
78734e375a st/vdpau: fix a small memory leak
The matrix filter wasn't freed on mixer destruction.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:32:08 +01:00
Christian König
553e820387 vl: fix low strength denoise filter
A filter strength of zero or one doesn't make any
sense. Thanks to Andy Furniss for pointing this out.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:31:29 +01:00
Jerome Glisse
356eb0aadb r600g: fix tiling with cayman and virtual memory
The virtual address but follow the alignment requirement of the
tiled surface. The bo from handle case is not properly fix. Need
bigger change for a proper fix. Work around that by enforcing 1M
alignment for those bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-14 15:56:09 -05:00
Paul Berry
6b0a07f9ce i915: Fix type of "specoffset" variable.
Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 11:40:02 -08:00
Eric Anholt
93831a54c7 i965/fs: Enable register spilling on gen7 too.
It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Eric Anholt
a7f46eadea i965: Report the failure message when failing to compile the fragment shader.
We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Simon Farnsworth
8cd03b933c r600g: Use a fake reloc to sleep for fences
r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Note: this is a candidate for the stable branches.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-14 09:56:23 -05:00
Marek Olšák
014198ec88 r600g: consolidate set_blend_color code 2012-02-14 15:51:59 +01:00
Marek Olšák
5cc9aa0e02 r600g: consolidate more translate functions 2012-02-14 15:49:24 +01:00
Marek Olšák
d214275ace r600g: inline r600_translate_ds_func 2012-02-14 15:49:24 +01:00
Marek Olšák
85571ed53c r600g: remove unused variable 2012-02-14 15:49:24 +01:00
Marek Olšák
9a20130e5f r600g: consolidate some translate functions 2012-02-14 15:49:23 +01:00
Marek Olšák
39b0da9f8d Revert "r600g: don't advertise integer textures without GLSL 1.3"
This reverts commit 2c06bcb909.

It breaks u_blitter trying to blit compressed textures as uint.
2012-02-14 15:48:37 +01:00
Marek Olšák
2c06bcb909 r600g: don't advertise integer textures without GLSL 1.3 2012-02-14 15:04:51 +01:00
Anuj Phogat
4042702591 meta: Add pixel store/pack operations in decompress_texture_image
This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

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

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-13 11:07:48 -08:00
Brian Paul
df1cd55ebf mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
in _mesa_error_check_format_and_type().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967
2012-02-13 08:47:59 -07:00
Stéphane Marchesin
d2c54fb522 gallivm: Replace architecture test with PIPE_ARCH_*
X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

https://bugs.freedesktop.org/show_bug.cgi?id=45420
2012-02-12 16:32:15 -08:00
Stéphane Marchesin
a2caf952a1 i915g: Remove useless draw calls. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
633f21652a i915g: Add a way to profile the contents of command buffers. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
8b3e0b2715 i915g: Fix comments. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
c1896cdc91 i915g: Don't emit state when it's already bound. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
be6a02266d i915g: Remove unused poly stipple state. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
3cff45fdb1 i915g: Implement stipple with draw. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
175adf0776 i915g: Fix comment. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
4dc0425261 i915g: Move ureg defines to the header so we can share them. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
8e4540ec2a i915g: Separate declarations and program in the fragment program struct.
We need this later to fixup fragment programs properly.
2012-02-12 16:32:14 -08:00
Dave Airlie
094eeff199 st/mesa: only resolve if number of samples is > 1
Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-02-12 21:35:27 +01:00
Brian Paul
bd1ae51b13 swrast: fix span color type selection
Fixes a regression from commit 660ed923de.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45578
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45577
2012-02-12 11:22:31 -07:00
Dave Airlie
b72d5767e3 extensions: remove unused code.
Comparing an unsigned to < 0 is pointless.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Dave Airlie
449cae141e mesa/texparam: drop double semicolons
no idea where these came from, drop them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Marek Olšák
6cd9159cea r300g: always fail to create a multisample resource
Just to be safe.
2012-02-12 13:07:51 +01:00
Marek Olšák
6d89a795a5 r300g: assert-fail when calling resource_resolve
And reset the dest pointer to NULL after it.
2012-02-12 13:07:51 +01:00
Alex Deucher
c565ff60d6 gallium/xvmc: r300 and r600 now depend on libdrm_radeon
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=45907

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-11 10:57:24 -05:00
Vinson Lee
d5a6c17254 gallivm: Change getExtent and readByte to non-const with llvm-3.1.
Fix build with llvm-3.1svn.

llvm-3.1svn r149918 changed BufferMemoryObject::getExtent and
BufferMemoryObject::readByte from const member functions to non-const
member functions in include/llvm/Support/MemoryObject.h.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 23:24:48 -08:00
Kenneth Graunke
3340b47c22 i965: Fix border color on Ironlake.
Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound.  Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-10 20:47:49 -08:00
Eric Anholt
7d55f37b0e i965/fs: Add support for generating MADs.
Improves nexuiz performance 0.65% +/- .10% (n=5) on my gen6, and .39%
+/- .11% (n=10) on gen7.  No statistically significant performance
difference on warsow (n=5, but only one shader has MADs).

v2: Add support for MADs in 16-wide by using compression control.
v3: Don't generate MADs when it will force an immediate to be moved to a temp.
    (it's not clear whether this is a win or not, but it should result in less
     questionable change to codegen compared to v2).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2012-02-10 18:18:52 -08:00
Eric Anholt
a1bfafc5a9 i965/fs: Add missing register allocation for 3rd sources.
Our only instruction with a 3rd source so far was linterp, and that
value was never register-allocated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-10 17:08:04 -08:00
Eric Anholt
2b28fd6ca6 i965: Add support for the MAD opcode on gen6+.
v2: Fix MRF handling on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-02-10 17:08:03 -08:00
Ian Romanick
46883e01ba Bump version to 8.1 (devel)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-10 15:34:44 -08:00
Alex Deucher
a8cc228edd radeon: build fix after 9d9111108e
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-10 11:31:23 -05:00
Alex Deucher
5e1495b2d9 r600g: 128 bit formats require tile_type = 1 on cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Alex Deucher
acca690c25 r600g: fix tex tile_type offset for cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Brian Paul
ad9455314d st/wgl: refactor stw_pixelformat_init()
Replace duplicated code with add_color_format_variants() helper.
2012-02-10 16:23:27 +00:00
José Fonseca
9646762261 st/wgl: Properly support non-displayble pixel formats, and implement float pixelformats as as one.
WGL_ARB_pixel_format establishes the existence of pixel formats which
are invisible to GDI.

However we still need to pass a valid pixelformat to GDI, so that
context creation/binding works.

The actual WGL_TYPE_RGBA_FLOAT_ARB implementation is from Brian Paul.
2012-02-10 16:23:27 +00:00
José Fonseca
90a95f4d2c st/wgl: Invoke SetPixelFormat twice for pbuffers. 2012-02-10 16:23:27 +00:00
José Fonseca
0cf554fa9b st/wgl: Just pass pPixelFormat to stw_pixelformat_get_info().
Avoids the likely error of forgetting to subtract one.
2012-02-10 16:23:27 +00:00
José Fonseca
6beed86ab8 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-10 16:23:27 +00:00
Brian Paul
5ee8969b11 mesa: remove unused gl_shared_state::DriverData field 2012-02-10 08:26:31 -07:00
Brian Paul
9e0931e355 docs: remove link to the GLSL compiler page
The page is terribly out of date.
(cherry picked from commit 65526d54aa)
2012-02-10 08:08:39 -07:00
Brian Paul
7028e6dc46 docs: add VMware link
(cherry picked from commit 6aa9ce2687)
2012-02-10 08:08:39 -07:00
Brian Paul
d01de08c4c docs: update info about supported systems, GPUs, APIs
Add link to Intel's Linux graphics page, etc.
(cherry picked from commit 14cf3dd826)
2012-02-10 08:08:39 -07:00
Brian Paul
ad8eec9eec docs: add news item for 8.0 release
(cherry picked from commit 7aef839760)
2012-02-10 08:08:39 -07:00
Ian Romanick
94846f8cd1 docs: Add 8.0 MD5 checksums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fb56b0972d)
2012-02-10 08:08:39 -07:00
Brian Paul
d925b0d4a7 mesa: fix proxy texture target initialization
The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in
alloc_proxy_textures() because the elements in the targets[] array
were in the wrong order.

This didn't actually cause any failures since we never really use the
proxy texture's Target field.  But let's get it right.

NOTE: This is a candidate for the 8.0 branch.
2012-02-10 08:08:39 -07:00
Brian Paul
3e59fb570a mesa: remove unused gl_pixelmap::Map8[] array
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
80fd3d2ca8 st/mesa: stop using Map8[] tables in load_color_map_texture()
Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
0d6ef4e299 mesa: remove unused _mesa_map_ci8_to_rgba8()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
fcca8f0b7a mesa: fix error handling in get_tex_rgba_compressed() 2012-02-10 08:06:57 -07:00
Brian Paul
1a4f398a63 mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy() 2012-02-10 08:06:57 -07:00
Brian Paul
07459ba509 mesa: push row stride adjustment down into _mesa_decompress_image()
There's a mismatch in row strides for compressed textures between
what Driver.MapTextureImage() returns and what the software fetch-texel
functions use.  Move it down a layer.  The next step would be to fix
this in the fetch-texel functions.
2012-02-10 08:06:57 -07:00
Brian Paul
9d9111108e mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function 2012-02-10 08:06:57 -07:00
Brian Paul
d1b7967242 mesa: make _mesa_invalidate_shine_table() static 2012-02-10 08:06:57 -07:00
Brian Paul
ae509f88a5 mesa: remove gl_light::_SpotExpTable field
Just use pow() instead.  Spot lights aren't too common and fixed-function
lighting isn't as important as it used to me.

This saves 32KB per context.  Each table was 4KB and there's 8 lights.
2012-02-10 08:06:56 -07:00
Brian Paul
4dacf793c8 meta: replace abort() with _mesa_problem()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:56 -07:00
Brian Paul
068b9dc268 mesa: fix comment typo 2012-02-10 08:06:56 -07:00
Christian König
36cd50152c st/vdpau: use matrix filter to blur/sharpen video
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:10:05 +01:00
Christian König
d7db6343dd vl: add a matrix/convolution filter
Can be used for gaussian, mean, laplacian, emboss, sharpness...

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:09:27 +01:00
Christian König
bbb48e983d st/vdpau: use median filter for noise reduction
And while at it implement the rest of the feature
querying also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:07 +01:00
Christian König
a9ffcceee9 vl: add a median filter for noise reduction
This is a shader based median filter, generally
used for noise reduction, it could still need some
improvements, but should usually work out of the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:00 +01:00
Eric Anholt
a7750c9fb5 i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:19 -08:00
Eric Anholt
cdcfaa64e3 i965/gen7: Fix the length of the DS state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:18 -08:00
Eric Anholt
e5b225afbd i965/gen7: Fix GPU hangs from the HiZ op.
The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.
2012-02-09 19:03:18 -08:00
Mathias Fröhlich
67007080b7 glsl: Avoid excessive loop unrolling.
Avoid unrollong loops that are either nested loops or
where the loop body times the unroll count is huge.

The change is far from being perfect but it extends the
loop unrolling decision heuristic by some additional
safeguard. In particular this cuts down compilation of
a shader precomputing atmospheric scattering integral
tables containing two nesting levels in a loop from
something way beyond some minutes (I never waited for
it to finish) to some fractions of a second.

This fixes piglit tests glsl-fs-unroll-explosion and
glsl-vs-unroll-explosion on r600g.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-02-09 21:23:16 +01:00
Anuj Phogat
ea228d97f8 mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 11:59:38 -08:00
Dave Airlie
23c52caafb st/mesa: exit the update fragment samplers/textures loops early.
If we have no more enabled samplers and we've reset all the previously
used ones, no need to keep going around this loop.

(just moved some stuff around to clean it up a bit).

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 19:39:30 +00:00
Dave Airlie
86163b81a4 st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.
From what I can see we were taking the debug path all the time,
when we probably only want it for enable debug path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-09 19:39:30 +00:00
Chia-I Wu
50683d2aa6 mesa: enable remap table when --enable-shared-glapi
As libGL will use libglapi for function lookups, we need to enable the remap
table.

Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45660
2012-02-09 10:39:50 -05:00
Brian Paul
781f84a3c2 vbo: unmap vertex store before executing lists
We don't want our VBOs mapped when we're drawing.  This change checks
if the vertex store VBO is mapped before we execute a list, unmaps it,
then remaps it after drawing.  This situation pops up when building a
nested display list in GL_COMPILE_AND_EXECUTE mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-09 08:18:50 -07:00
Christoph Bumiller
8b4f7b0672 gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Just let the hardware do it if it can and avoid drivers having to
check for the special case on each draw call.

v2: update the draw module
2012-02-09 15:01:34 +01:00
Carl Worth
26de5273ac dri: Emit a critical error if the swrast driver fails to load.
Something has gone wrong if swrast is requested but cannot be
loaded. The user really should be made aware of this, (and instructed
to set LIBGL_DEBUG for more details).

The wording of this error message is updated from "reverting to
indirect rendering" to the more objectively descriptive "failed to
load driver: swrast". The former wording makes assumptions about what
the calling code will decide to do next, rather than simply describing
what went wrong within the current function. The new wording is
consistent with the critical errors recently added for hardware
drivers that fail to load.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
6c9af97740 dri: Emit a critical error if a named driver fails to load.
Something has gone wrong if we were asked to load a driver of a
specific name, but it failed to load for some reason. The user really
should be made aware of this, (and instructed to set LIBGL_DEBUG for
more details).

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
92bef0bfa1 dri: Add a CriticalErrorMessageF macro.
Sometimes an error is so sever that we want to print it even when the
user hasn't specifically requested debugging by setting LIBGL_DEBUG.

Add a CriticalErrorMessageF macro to be used for this case. (The error
message can still be slienced with the existing LIBGL_DEBUG=quiet).

For critical error messages we also direct the user to set the
LIBGL_DEBUG environment variable for more details.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
c09504c343 dri: Clarify comments on InfoMessageF and ErrorMessageF macros.
The description of ErrorMessageF was misleading in the case of
LIBGL_DEBUG being unset, (the previous comment could be understood to
mean the error should be printed, but the code does not print in this
case).

InfoMessageF previously had no comment at all.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Chad Versace
5497cc428f glsl: Fix Android build
The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-08 15:17:12 -08:00
Christian König
192467108b r600g: fix handling of outputs as TEX addr sources
Outputs should be treated in the same way as
inputs and temporaries here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2012-02-08 19:25:18 +01:00
Chad Versace
b44c459cc3 i965: Remove file i965/junk, accidentally added in 7b36c68 2012-02-08 09:19:56 -08:00
Dave Airlie
833a33bf6e st/mesa: avoid vertex texture and sampler updates for 0 case
If we had no vertex textures or samplers previously and we have none now,
don't bother doing the enables dance.

I was profiling nexuiz on noop and noticed these two functions in the
profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03%
for texture and samplers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-08 12:12:10 +00:00
Kenneth Graunke
33f4461ec9 i965: Remove broken symlink to intel_decode.c.
Eric removed intel_decode.c in 61b9ccd9e2.
2012-02-07 18:15:44 -08:00
Eric Anholt
7c857a6b15 i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.
We were doing saturate-based clamping on the [0,width] or [0,height]
coordinate, which meant only the first pixel was addressable.

Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
07e621c523 i965/fs: Move GL_CLAMP handling to coordinate setup.
We should be able to merge self-move instruction into the MRF move
anyway, and this simplifies things for the next commit.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
94866ffbb8 i965: Fix HiZ change compiler warning. 2012-02-07 16:03:30 -08:00
Chad Versace
7b36c68ba6 i965: Rewrite the HiZ op
The HiZ op was implemented as a meta-op. This patch reimplements it by
emitting a special HiZ batch. This fixes several known bugs, and likely
a lot of undiscovered ones too.

==== Why the HiZ meta-op needed to die ====

The HiZ op was implemented as a meta-op, which caused lots of trouble. All
other meta-ops occur as a result of some GL call (for example, glClear and
glGenerateMipmap), but the HiZ meta-op was special. It was called in
places that Mesa (in particular, the vbo and swrast modules) did not
expect---and were not prepared for---state changes to occur (for example:
glDraw; glCallList; within glBegin/End blocks; and within
swrast_prepare_render as a result of intel_miptree_map).

In an attempt to work around these unexpected state changes, I added two
hooks in i965:
  - A hook for glDraw, located in brw_predraw_resolve_buffers (which is
    called in the glDraw path). This hook detected if a predraw resolve
    meta-op had occurred, and would hackishly repropagate some GL state
    if necessary. This ensured that the meta-op state changes would not
    intefere with the vbo module's subsequent execution of glDraw.
  - A hook for glBegin, implemented by brwPrepareExecBegin. This hook
    resolved all buffers before entering
    a glBegin/End block, thus preventing an infinitely recurring call to
    vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to
    flush its vertex queue in response to GL state changes.

Unfortunately, these hooks were not sufficient. The meta-op state changes
still interacted badly with glPopAttrib (as discovered in bug 44927) and
with swrast rendering (as discovered by debugging gen6's swrast fallback
for glBitmap). I expect there are more undiscovered bugs. Rather than play
whack-a-mole in a minefield, the sane approach is to replace the HiZ
meta-op with something safer.

==== How it was killed ====

This patch consists of several logical components:
  1. Rewrite the HiZ op by replacing function gen6_resolve_slice with
     gen6_hiz_exec and gen7_hiz_exec. The new functions do not call
     a meta-op, but instead manually construct and emit a batch to "draw"
     the HiZ op's rectangle primitive. The new functions alter no GL
     state.
  2. Add fields to brw_context::hiz for the new HiZ op.
  3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable.
  4. Kill all dead HiZ code:
     - the function gen6_resolve_slice
     - the dirty flag BRW_NEW_HIZ
     - the dead fields in brw_context::hiz
     - the state packet manipulation triggered by the now removed
       brw_context::hiz::op
     - the meta-op workaround in brw_predraw_resolve_buffers (discussed
       above)
     - the meta-op workaround brwPrepareExecBegin (discussed above)

Note: This is a candidate for the 8.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reported-by: xunx.fang@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927
Reported-by: chao.a.chen@intel.com
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 15:15:03 -08:00
Ian Romanick
d59466279e intel: Avoid divide by zero for very small linear blits
If size is small (such as 1),

   pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);

makes pitch = 0.  Then

   height = size / pitch;

causes a division-by-zero exception.  If pitch is zero, set height to
1 and avoid the division.

This fixes piglit's bin/getteximage-formats test and glean's
bufferObject test.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44971
2012-02-07 10:00:32 -08:00
Ian Romanick
65b096aedd intel: Remove num_mapped_regions assertion from _intel_batchbuffer_flush
There are cases where a buffer can be mapped while another buffer is
flushed.  This can happen in the CopyPixels meta-op path for piglit's
fbo-mipmap-copypix.  After some discussion with Eric, it seems this
assertion is no longer necessary, and it has always been too strict.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43328
Cc: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 10:00:31 -08:00
Tobias Droste
d048ab5558 gallium/gbm: r300 and r600 now depend on libdrm
fixes undefined references in libradeonwinsys.a when linking

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2012-02-07 11:12:09 -05:00
Brian Paul
7335cf1c32 r600g: remove unused vars to silence warnings 2012-02-07 07:48:46 -07:00
Brian Paul
938671397f mesa: remove unused _mesa_error_check_format_type() function
This was only used by glReadPixels and glDrawPixels.  Now those
functions do the corresponding error checks.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:40 -07:00
Brian Paul
b8f7eef4ef mesa: stop using _mesa_error_check_format_type() in glReadPixels
Basically the same story as the previous commit.  But we were
already calling _mesa_source_buffer_exists() in ReadPixels().
Yeah, we were calling it twice.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:38 -07:00
Brian Paul
6bed7a861d mesa: stop using _mesa_error_check_format_type() in glDrawPixels
The _mesa_error_check_format_type() function does two things: check
that format/type is legal and check that the destination (or source
buffer for glReadPixels) actually exists.  Just move the relevant
parts of that into _mesa_DrawPixels().

We'll do a similar change in glReadPixels then get rid of the function
altogether.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
675d44629c mesa: remove redundant format/type checks in glReadPixels()
These are done in _mesa_error_check_format_and_type().

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
8b3a517673 mesa: remove redundant format/type checks in glGetTexImage()
The _mesa_error_check_format_and_type() function will catch all those
cases now.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
627b435dfe mesa: new _mesa_error_check_format_and_type() function
This replaces the _mesa_is_legal_format_and_type() function.

According to the spec, some invalid format/type combinations to
glDrawPixels, ReadPixels and glTexImage should generate
GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION.

With the old function we didn't make that distinction and generated
GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION.  The new
function returns one of those errors or GL_NO_ERROR.

This will also let us remove some redundant format/type checks in
follow-on commit.

v2: add more checks for ARB_texture_rgb10_a2ui at the top of
_mesa_error_check_format_and_type() per Ian.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Dave Airlie
699e3b9821 scons: fix typo in package version
pointed out on irc by GArik_

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:26:48 +00:00
Dave Airlie
ff60bd8058 radeon: only init surface manage on r600
r300 fails to init the manager and then fails to init.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:20:09 +00:00
José Fonseca
2470e918cc scons: Require same pkg-config versions as configure. 2012-02-07 11:41:08 +00:00
José Fonseca
f763ad5130 scons: r300/r600 now depends on libdrm.
As they now indirectly include on libdrm/radeon_surface.h.
2012-02-07 11:40:58 +00:00
Brian Paul
aed51e3e6a mesa: support more format/type combos in _mesa_dump_image() 2012-02-06 17:56:43 -07:00
Brian Paul
4ab8403c25 util: fix typo in debug_printf_once comment 2012-02-06 17:56:43 -07:00
Jerome Glisse
c0c979eebc r600g: add support for common surface allocator for tiling v13
Tiled surface have all kind of alignment constraint that needs to
be met. Instead of having all this code duplicated btw ddx and
mesa use common code in libdrm_radeon this also ensure that both
ddx and mesa compute those alignment in the same way.

v2 fix evergreen
v3 fix compressed texture and workaround cube texture issue by
   disabling 2D array mode for cubemap (need to check if r7xx and
   newer are also affected by the issue)
v4 fix texture array
v5 fix evergreen and newer, split surface values computation from
   mipmap tree generation so that we can get them directly from the
   ddx
v6 final fix to evergreen tile split value
v7 fix mipmap offset to avoid to use random value, use color view
   depth view to address different layer as hardware is doing some
   magic rotation depending on the layer
v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
   evergreen, align bytes per pixel to a multiple of a dword
v9 fix handling of stencil on evergreen, half fix for compressed
   texture
v10 fix evergreen compressed texture proper support for stencil
    tile split. Fix stencil issue when array mode was clear by
    the kernel, always program stencil bo. On evergreen depth
    buffer bo need to be big enough to hold depth buffer + stencil
    buffer as even with stencil disabled things get written there.
v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
    old ddx overestimate those. Fix linear case when pitch*height < 64.
    Fix r300g.
v12 Fix linear case when pitch*height < 64 for old path, adapt to
    libdrm API change
v13 add libdrm check

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-06 18:36:37 -05:00
Jon TURNEY
8937c166ef Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does
There is a mismatch between the way the X server and GLX library
calculates the image size for format GL_DEPTH_STENCIL(|_NV|_EXT)

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

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 23:00:44 +00:00
Christian König
814be043fa st/vdpau: use dst surface size if clip width/height is zero
Just another fix for gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 21:29:40 +01:00
Christian König
97349dfa79 st/vdpau: implement vlVdpOutputSurfaceQueryCapabilities
Fixing some problems with gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-02-06 21:26:49 +01:00
Christoph Bumiller
189e6c7e81 nv50: fix bad assertion on Elements(phi->src) in regalloc
The array is phi->src, phi->src[i] is just a pointer.
2012-02-06 12:19:57 +01:00
Jon TURNEY
ffc8494db5 dri: Don't build libdricommon.la if we don't need it
Refine 80aa78142d "dri: make sure to build libdricommon.la"
so we don't build libdricommon if we aren't building a dri driver which needs it (i.e.
if we are just building swrast)

In particular, this restores the ability to build the swrast dri driver without having to
have a xf86drm.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 11:10:51 +00:00
Christian König
9001682846 vl: add VL_MAX_SURFACES define
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8abbdb8865 vl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
70a7695b4d vl: prefix size defines with VL_
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
3ac959492d vl: remove assert on unknown video profile
It's perfectly valid to ask for an unknown
profile and get unknown code as a result.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
14f47d164d st/xvmc: respect caps when creating video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8f54929c5d st/vdpau: use interlacing capabilities
Recreate video buffer if need arises.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
8bfadc802f st/vdpau: implement uploads to interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
f3f03c67e9 vl: add interlacing capabilities
Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
3841d3fd13 vl: add a simple weave deinterlacer
Well it's not so simple, since it does
deinterlacing and scaling at the same time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:05 +01:00
Christian König
9f9628c72b vl/video_buffer: fix interlaced surface ordering
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Christian König
4ccae0dfaa vl/video_buffer: fix height of interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Roland Scheidegger
1f4a853b1e mesa: check_index_bounds off-by-one fix
in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-06 01:04:28 +01:00
Eric Anholt
b3c84a80cd mesa: Fix xcb-dri2 link flags leaking into LIBS.
Fixes the build of builtin_compiler on my 32-bit build where xcb-dri2
is in a custom prefix but the custom prefix flags weren't available.
It shouldn't have been in LIBS anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-04 22:04:35 +01:00
Eugeni Dodonov
84e5f1c635 intel: check for LLC support when reading maps
This checks for advertised LLC support by the GPU instead of relying on
the GPU generation for detection.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Eugeni Dodonov
7def293204 intel: verify if hardware has LLC support
Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Dave Airlie
fa2a76a21c draw: fix fog coord export.
This does what we do in the hw drivers, and only export the X.

fixes the fogcoord.dp* tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-04 17:50:43 +00:00
Chih-Wei Huang
f8be4f33d3 vbo: fix a building error
Signed-off-by: Marek Olšák <maraeo@gmail.com>

NOTE: This is a candidate for the 8.0 branch.
2012-02-04 08:59:09 +01:00
José Fonseca
8184228e8b llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 18:51:14 +00:00
Keith Whitwell
9a1fd9a37c llvmpipe: clear storage for newly allocated resources
Was previously being done in a state-tracker, but in a way which was
difficult for some drivers to optimize.  Push down to this level and
make it the individual drivers responsibility.
2012-02-03 18:51:14 +00:00
Ian Romanick
87b4c9b322 intel: FBOs with texture border are unsupported
FBOs differ from textures in a significant way.  With textures, we can
strip the border and get correct rendering except when the application
fetches texels outside [0,1].

With an FBO, the pixel at (0,0) is in the border.  The
ARB_framebuffer_object spec says:

    "If the attached image is a texture image, then the window
    coordinates (x[w], y[w]) correspond to the texel (i, j, k), from
    figure 3.10 as follows:

                           i = (x[w] - b)

                           j = (y[w] - b)

                           k = (layer - b)

    where <b> is the texture image's border width..."

Since the border doesn't exist, we can never render any pixels in the
correct location.  Just mark these FBOs FRAMEBUFFER_UNSUPPORTED.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42336
2012-02-03 10:50:01 -07:00
Ville Syrjala
0fcc518964 gallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events
Ever since xserver commit 531869448d07e00ae241120b59f3aaaa5709d59c,
the server no longer sends invalidate events to clients, unless they
have performed a GetBuffers request since the drawable was last
invalidated.

If the drawable gets invalidated immediately after the GetBuffers
request was processed by the X server, it's possible that Xlib
will process the invalidate event while waiting for the GetBuffers
reply. So the server, thinking the client knows that the buffers
are invalid, is waiting for another GetBuffers request before
sending any more invalidate events. The client, on the other hand,
believes the buffers to be valid, and thus is expecting to receive
another invalidate event before it has to send another GetBuffers
request. The end result is that the client never again sends
a GetBuffers request.

To avoid this problem, take a snapshot of the lastStamp before
doing GetBuffers, and retry if the snapshot and the current
lastStamp no longer match after the GetBuffers reply has been
processed.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-03 12:02:58 +00:00
Eric Anholt
57e44371a5 glsl: Add error case for switch() with two default cases.
Fixes piglit switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:04 +01:00
Eric Anholt
140632190c glsl: Throw an error when faced with a duplicated switch() case label.
The error message I chose matches gcc's error.  Fixes piglit
switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:02 +01:00
Eric Anholt
01a5a2c9d7 glsl: Add other missing error location information for switch statements.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:59 +01:00
Eric Anholt
663dcbbffe glsl: Add missing location info to case labels.
Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:57 +01:00
Eric Anholt
2c3e10e719 glsl: Throw the required error when a case label is a non-constant.
It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:54 +01:00
Eric Anholt
22d81f154f glsl: Save and restore the whole switch state for nesting.
This stuffs them all in a struct for sanity.  Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:50 +01:00
Eric Anholt
b8c9252570 dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.
I wasn't seeing it be needed because of the previous bug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:32 +01:00
Eric Anholt
4dd2743d45 dri: Fix typo in xml file that made all applications use the workaround.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:23 +01:00
Eric Anholt
27af00eac8 mesa: Fix the error message function names for glFlushMappedBufferRange().
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:05 +01:00
Eric Anholt
f20fb80a91 mesa: Fix bad-enum/no-buffer error handling for buffer object functions.
For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:02 +01:00
Brian Paul
84a1273e7f glsl: move array_sizing_visitor class outside of link_intrastage_shaders()
To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 20:10:51 -07:00
Brian Paul
8cbe699c0d gallium/postprocess: move declarations before code
To fix MSVC build.
2012-02-02 15:14:10 -07:00
Lauri Kasanen
81938d2137 gallium/postprocess: Just to be safe, reference all buffers from outside
Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:09 -05:00
Lauri Kasanen
c5976017e3 gallium/postprocess: Fix depth logic
This prevents a possible lapse of the depth buffer - the situation where
the app and pp have different depth buffers.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:06 -05:00
Carl Worth
cd2e2187cb glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
In commit 6ecee54a9a a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
64fd26a8a8 glsl: Add glcpp tests for a macro used twice
This test cases exposes a bug as described in this bug report:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Clearly, some memory is getting (incorrectly) freed on the first macro
invocation, leading to problems with the second macro invocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Carl Worth
7ab1c7f792 glcpp: Fix so that trailing punctuation does not prevent macro expansion
The trick here is that flex always chooses the rule that matches the most
text. So with a input text of "two:" which we want to be lexed as an
IDENTIFIER token "two" followed by an OTHER token ":" the previous OTHER
rule would match longer as a single token of "two:" which we don't want.

We prevent this by forcing the OTHER pattern to never match any
characters that appear in other constructs, (no letters, numbers, #,
_, whitespace, nor any punctuation that appear in CPP operators).

Fixes bug #44764:

	GLSL preprocessor doesn't replace defines ending with ":"
	https://bugs.freedesktop.org/show_bug.cgi?id=44764

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
e931b0e05b glcpp: Add new test showing bug where a trailing ':' prevents macro expansion
This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Ian Romanick
2e8f8cb383 mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 10:07:14 -07:00
Ian Romanick
5c341b7df3 mesa: Fix copy-and-paste bug in do_row_3D
Several of the half-float cases used 4 as the texel size when it
should have been some smaller value.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
2012-02-02 10:07:14 -07:00
Ian Romanick
660ed923de mesa: Convert colors if span ChanType and renderbuffer data type don't match
This is a partial revert of f9874fe.  It turns out that the types
don't always match.  Specifically, this can happen when doing
glCopyPixels from a float FBO to a RGBA8 FBO.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:14 -07:00
Ian Romanick
e06b1c65bc mesa: Set the gl_array_object::ARBsemantics flag at the right time
With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
2012-02-02 10:07:14 -07:00
Ian Romanick
af1477b088 mesa: Add unpack_uint_z_row support for floating-point depth buffers
This is a hack, and it will result in incorrect rendering.  However,
it does eliminate spurious warnings in several piglit CopyPixels tests
that involve floating-point depth buffers.

The real solution is to add a zf field to SWspan to store float Z
values.  When a float depth buffer is involved, swrast should also
populate the zf field.  I'll consider this post-8.0 work.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:01 -07:00
Brian Paul
e20e30b28c Revert "Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi""
This reverts commit 4e5a8937d1.
... to fix build with --enable-osmesa
2012-02-02 08:17:43 -07:00
José Fonseca
edb1970795 draw: Avoid NULL pointer dereference when binding NULL fragment shaders.
Now that the draw module avoids flushing, it may flush precisely when
binding a NULL shader, so care must be taken when restoring the original
fragment shader.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:30 +00:00
José Fonseca
efd73f72d8 mapi/glapi: Never use a generic no-op entry-point on Windows.
When GLAPIENTRY is __stdcall (ie Windows), the stack is popped by the
callee making the number/type of arguments significant, therefore
using a generic no-op causes stack corruption for many entry-points.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:24 +00:00
ojab
db312b62f2 gallivm: Fix LLVM-2.7 build.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-02-02 09:04:10 +00:00
José Fonseca
54fd495c41 gallivm: Remove MSVC RT hack.
The hack never worked reliably, and docs/llvmpipe.html is quite clear on
the requirement of matching CRT when building LLVM and Mesa already.
2012-02-02 09:04:10 +00:00
Anuj Phogat
15986d21eb mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1)

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case: max_values
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-01 18:49:22 -08:00
Zack Rusin
cff0eac702 svga: fix a crash happening before setting fragment shaders.
In certain situations API's will call pipe->clear which doesn't
require fragment shader, but then we'd try to verify the pipeline
and assume fragment shader was always set. This was leading to
crash when API would just call simple clear's before anything else.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 16:34:57 -05:00
Brian Paul
3279561e9a st-api: fix typos, whitespace, line wrapping 2012-02-01 14:02:35 -07:00
Brian Paul
e53557996e vbo: fix node_attrsz[] usage in vbo_bind_vertex_list()
The node_attrsz[] array is initially copied from the node->attrsz[]
array but some values get rewritten.  Thereafter, we need to use the
node_attrsz[] values.

Fixes a bug when replaying a display list that uses generic vertex
array[16] (at least).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-01 13:45:09 -07:00
Brian Paul
f09910f399 nv50: add assertions missed in earlier nv50 commit 2012-02-01 08:22:16 -07:00
Colin Walters
0d736b2076 build: Note that we don't support srcdir != builddir
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-01 15:02:29 +00:00
Brian Paul
541bb2e33f nv50: use larger arrays to silence warnings and fix buffer overflows
The warnings were:
nv50_pc_regalloc.c: In function ‘pass_generate_phi_movs’:
nv50_pc_regalloc.c:423:41: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp: In member function ‘bool nv50_ir::MemoryOpt::replaceStFromSt(nv50_ir::Instruction*, nv50_ir::MemoryOpt::Record*)’:
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds

And add some assertions to catch this sooner in debug builds.
2012-02-01 07:19:54 -07:00
Brian Paul
a1471e4877 mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)
This fixes a dangling texture object pointer bug hit via wglShareLists().
When we push the GL_TEXTURE_BIT state we may push references to the default
texture objects which are owned by the gl_shared_state object.  We don't
want to accidentally delete that shared state while the attribute stack
references shared objects.  So keep a reference to it.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:44 -07:00
Brian Paul
361cd53a77 mesa: use new _mesa_reference_shared_state() function
This cleans up the reference counting of shared context state.
The next patch will use this to fix an actual bug.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:40 -07:00
Brian Paul
133c5727b5 mesa: remove stray comment in PopAttrib() code 2012-02-01 06:52:30 -07:00
Matt Turner
7ef94c6a0b Revert "automake: src/mesa/drivers/osmesa"
This reverts commit 275ac7e5c1.
2012-01-31 21:34:42 -05:00
Matt Turner
a99164956f Revert "automake: src/glsl and src/glsl/glcpp"
This reverts commit 9947656168.
2012-01-31 21:33:59 -05:00
Matt Turner
70dd17152d Revert "src/glsl/glcpp: wire up glcpp-test to make check"
This reverts commit 2bb9f9e1fd.
2012-01-31 21:33:21 -05:00
Matt Turner
8c436b4ea6 Revert "Make sure libGL.so links with libglsl"
This reverts commit f53e7e981e.
2012-01-31 21:33:07 -05:00
Matt Turner
f6cc4347de Revert "glsl: Fix optimization tests after converting src/glsl to automake."
This reverts commit ffe376d5a7.
2012-01-31 21:32:33 -05:00
Marek Olšák
b0337b679a r600g: shorten expressions accessing family and chip_class 2012-01-31 23:28:55 +01:00
Marek Olšák
267bddaacb r300g: don't use pipe_context::winsys 2012-01-31 23:28:50 +01:00
Marek Olšák
38bf276348 r600g: remove unused variable num_dest_buffers 2012-01-31 23:28:42 +01:00
Marek Olšák
f661405637 r600g: use the new code for streamout flush as well 2012-01-31 23:12:31 +01:00
Marek Olšák
70d40fc675 r600g: rename r600_reg::flush_flags -> sbu_flags
There is no other use for that.
2012-01-31 23:12:30 +01:00
Marek Olšák
6d0a011acb r600g: fix computation of how many dwords is needed for a flush at the end of CS 2012-01-31 23:12:30 +01:00
Marek Olšák
1c5625cdb9 r600g: remove unused r600_reg::flush_mask 2012-01-31 23:12:30 +01:00
Marek Olšák
0671400dcc r600g: remove more dead code 2012-01-31 23:12:30 +01:00
Marek Olšák
74027a9ba2 r600g: remove dead code for tracking relocations 2012-01-31 23:12:30 +01:00
Marek Olšák
4fd97b46a0 r600g: remove unused flush code 2012-01-31 23:12:30 +01:00
Marek Olšák
0813e58a3e r600g: rework cache flushing
This also significantly improves the RV670 flush by using the CB1 flush
*always* and also DEST_BASE_0_ENA, which appears to magically fix some tests.
I am not entirely sure, but it's possible that RV670 flushing is fixed
completely.

v2: fix cayman by flushing texture cache instead of vertex cache

Thanks to Dave Airlie for testing Cayman.
2012-01-31 23:12:30 +01:00
Marek Olšák
2fe521fa41 r600g: add a new simple API for state emission 2012-01-31 23:12:30 +01:00
Marek Olšák
621e0db71c r600g: remove redundant pm4 and pm4_cdwords in r600_context
These only mirrored radeon_winsys_cs.
2012-01-31 23:12:30 +01:00
Marek Olšák
3b04671920 r600g: consolidate some context_draw code 2012-01-31 23:12:30 +01:00
Marek Olšák
302862defa r600g: remove the now-useless internal flush callback 2012-01-31 23:12:30 +01:00
Marek Olšák
bc70bcfc69 r600g: don't initialize the screen and winsys pointer twice 2012-01-31 23:12:30 +01:00
Marek Olšák
e4340c1908 r600g: merge r600_context with r600_pipe_context
The split made no sense.
2012-01-31 23:12:30 +01:00
Marek Olšák
78293b99b2 r600g: remove u8,u16,u32,u64 types 2012-01-31 23:12:30 +01:00
Paul Berry
ffe376d5a7 glsl: Fix optimization tests after converting src/glsl to automake.
Commit 99476561 (automake: src/glsl and src/glsl/glcpp) changed the
build system so that src/glsl/glsl_test is not built by default.  This
inadvertently broke "make check", since the tests in
src/glsl/tests/lower_jumps (which are run by "make check") rely on
glsl_test.

This patch ensures that "make check" builds glsl_test before running
any tests.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-31 10:15:08 -08:00
Matt Turner
f53e7e981e Make sure libGL.so links with libglsl
Can't link against *.la files if we're not using libtool to link.

Fixes undefined symbol: _ZN23ir_hierarchical_visitor5visitEP11ir_variable
2012-01-31 12:04:19 -05:00
Christian König
d36f89c8cf vl: fix some missing prototypes error
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45444
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-31 17:12:05 +01:00
Brian Paul
3fc6e4e025 osmesa: set RefCount = 1 in new_osmesa_renderbuffer()
This was lost during the renderbuffer overhaul work.  Fixes a failed
refcount assertion.
2012-01-31 07:44:55 -07:00
Vinson Lee
136791ebc1 osmesa: Fix osmesa_context.DataType type.
Fixes these GCC warnings.
osmesa.c: In function ‘osmesa_renderbuffer_storage’:
osmesa.c:417: warning: comparison is always false due to limited range of data type
osmesa.c:423: warning: comparison is always false due to limited range of data type
osmesa.c:431: warning: comparison is always false due to limited range of data type
osmesa.c:437: warning: comparison is always false due to limited range of data type
osmesa.c:447: warning: comparison is always false due to limited range of data type
osmesa.c:453: warning: comparison is always false due to limited range of data type
osmesa.c:463: warning: comparison is always false due to limited range of data type
osmesa.c:466: warning: comparison is always false due to limited range of data type
osmesa.c:476: warning: comparison is always false due to limited range of data type
osmesa.c:479: warning: comparison is always false due to limited range of data type

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-31 07:43:36 -07:00
Brian Paul
6386f80dbd vega: memset data array to zero to silence uninitialized var warnings 2012-01-31 07:01:29 -07:00
ojab
97329efc5f Initialize only native LLVM Disassembler.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-31 08:11:24 +00:00
Matt Turner
5920f18fae Remove autoreconf generated files
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:10 -05:00
Matt Turner
2bb9f9e1fd src/glsl/glcpp: wire up glcpp-test to make check
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:03 -05:00
Matt Turner
82060adcde glcpp-test: don't return failure if valgrind tests aren't run
Success was (tests-passed AND valgrind-tests-passed) but this meant that
if the valgrind tests weren't run it would be considered a failure.

The logic is now (tests-passed AND (!valgrind OR valgrind-tests-passed))
which lets us return success if the valgrind tests aren't run.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:57 -05:00
Matt Turner
9947656168 automake: src/glsl and src/glsl/glcpp
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:38 -05:00
Matt Turner
dfb6142548 autoconf: use AC_PROG_YACC/LEX
Needed for automake. Using AC_PROG_PATH(bison/flex) causes automake to
fail to build .y and .l files.

It is up to the builder to use bison/flex instead of yacc/lex.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:32 -05:00
Matt Turner
4ff8fd93e8 glsl: rename Makefile.sources' _SOURCES variables
automake uses variables named *_SOURCES.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:25 -05:00
Matt Turner
275ac7e5c1 automake: src/mesa/drivers/osmesa 2012-01-30 21:09:18 -05:00
Kenneth Graunke
e3b5200496 glsl: Rename class variable_entry to ir_variable_refcount_entry.
Exporting a publicly visible class with a generic name like
"variable_entry" via ir_variable_refcount.h is kind of mean.

Many IR transformers would like to define their own "variable_entry"
class.  If they accidentally include this header, the compiler/linker
may get confused and try to instantiate the wrong variable_entry class,
leading to bizarre runtime crashes.

The hope is that renaming this one will allow .cpp files to safely
declare and use their own file-scope "variable_entry" classes.

This avoids crashes caused by converting src/glsl to automake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 17:44:52 -08:00
Marek Olšák
bed20f02a7 r600g: get rid of r600_context_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:32 +01:00
Marek Olšák
85db520251 r600g: don't use r600_context_reg on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:30 +01:00
Marek Olšák
b1b969f670 r600g: don't use r600_context_reg on evergreen
Just getting rid of things which use the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:27 +01:00
Marek Olšák
9344ab382a r600g: get rid of the mask in r600_pipe_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:23 +01:00
Marek Olšák
4a058aebb2 r600g: get rid of the mask parameter in pipe_state_add_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:18 +01:00
Marek Olšák
0569f13d2b r600g: don't use register mask for TA_CNTL_AUX
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:16 +01:00
Marek Olšák
a494301f7f r600g: don't use register mask for PA_CL_CLIP_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:13 +01:00
Marek Olšák
97acf2ca59 r600g: don't use register mask for PA_CL_VS_OUT_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:07 +01:00
Marek Olšák
121940ecc7 r600g: set full register mask for PA_CL_CLIP_CNTL
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:03 +01:00
Marek Olšák
a652cc40b9 r600g: don't use register mask for PA_SU_SC_MODE_CNTL
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:00 +01:00
Marek Olšák
2000086fcd r600g: don't add PA_SC_LINE_STIPPLE to rasterizer_state
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:56 +01:00
Marek Olšák
84b4b2a8aa r600g: don't use register mask for CB_COLOR_CONTROL on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:53 +01:00
Marek Olšák
9c0b50ca0b r600g: don't set CB_TARGET_MASK in set_framebuffer_state
It's emitted in draw_vbo, always.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:50 +01:00
Marek Olšák
2ffa8af9db r600g: set full register mask for CB_COLOR_CONTROL on evergreen
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:46 +01:00
Marek Olšák
e3032a0523 r600g: use a more clever way to disable per-vertex point size
This uses point size clamping to force point size to a particular value,
making the vertex shader output irrelevant.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:37 +01:00
Marek Olšák
b6233f4d2e r600g: don't use register mask for DB_RENDER_CONTROL
We don't set the other bits anywhere else except the other DSA states,
which are mutually-exclusive with this one.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:32 +01:00
Marek Olšák
3d061caaed r600g: cleanup setting DB_SHADER_CONTROL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:29 +01:00
Marek Olšák
a2361946e7 r600g: rework and consolidate stencilref state setting
Stop using the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:25 +01:00
Marek Olšák
5345e3ea86 r600g: don't use register mask for SQ_GPR_RESOURCE_MGMT_1
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:15:51 +01:00
Marek Olšák
177845daa1 st/mesa: kill off point size clamping in vertex shaders
This fixes the gl_PointSize transform feedback test.
Point size clamping should happen at the rasterizer stage,
i.e. after the vertex and geometry shaders and transform feedback.

Drivers are expected to do this by themselves.
2012-01-31 00:54:34 +01:00
Marek Olšák
f183cc9ce3 r600g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
ac3a765589 r300g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
cb43954308 svga: set POINTSIZEMIN to 1.0 for non-sprite non-aa points
v2: add the helper function, improve the condition
2012-01-31 00:54:34 +01:00
Marek Olšák
b478fcb9a9 st/mesa: simplify initialization of light_twoside
Core Mesa does this for us, see update_two_size in state.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-31 00:54:34 +01:00
Brian Paul
6e9a1650e5 mesa: consolidate general ubyte texstore code
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
4c7e44e8e6 mesa: use _mesa_pack_ubyte_rgba_rect() in texstore code
Simplifies the general case code in the ubyte-valued texture format
functions.  More consolidation to come in subsequent commits.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
66940ad2d7 mesa: added _mesa_pack_ubyte_rgba_rect()
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Eric Anholt
ff2497dca3 dri: Add a default drirc to be installed to provide application workarounds.
Specifially, this being present works around a bug in Unigine
Sanctuary on i965 which previously resulted in bad rendering.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:24 -08:00
Eric Anholt
642247883f i965: Add a driconf option to force GLSL extension behavior to "warn".
This can be used to work around broken application behavior, like in
Unigine where it attempts to use texture arrays without declaring
either "#extension GL_EXT_texture_array : enable" or "#version 130".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:11 -08:00
Eric Anholt
b9e27cc142 mesa: Add a flag for forcing all GLSL extensions to "warn".
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:41:49 -08:00
Eric Anholt
61b9ccd9e2 intel: Use libdrm's decode functionality instead of the gpu-tools copy.
While typing out the new decode, I added a fallback mode for dumping
when we fail to re-map the BO after execution.  This should get us a
minimal dump when trying to dump a batch that results in a GPU hang.
2012-01-30 11:32:55 -08:00
Eric Anholt
493faa010d i965: Fix segfault with INTEL_DEBUG=batch on gen7 with samplers present.
This was a leftover from the conversion of this file for state streaming.
2012-01-30 11:32:55 -08:00
Eric Anholt
9195191e50 i965/vs: Avoid allocating registers in to the gen7 MRF hack region.
This is the corresponding fix to the previous one for the FS, but I
don't have a particular test for it.

NOTE: This is a candidate for the 8.0 branch.
2012-01-30 11:32:55 -08:00
Eric Anholt
e910241e97 i965/fs: Fix rendering corruption in unigine tropics.
We were allocating registers into the MRF hack region, resulting in
sparkly renering in a few of the scenes.  We could do better
allocation by making an MRF class, having MRFs conflict with the
corresponding GRFs, and tracking the live intervals of the "MRF"s and
setting up the conflicts.  But this is way easier for the moment.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:55 -08:00
Eric Anholt
b9aab8b3b3 autoconf: Enable missing-prototypes errors when available.
After the removal of the dri driver link test, this should help avoid
the original problem that it was designed to catch: The warning about
a missing prototype due to typoing a function name scrolling by in the
Mesa build spew, and you not noticing until you try to run an
application and it falls back to swrast.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:54 -08:00
Matt Turner
ef3cec5804 Rename R300_NO_TCL envvar to RADEON_NO_TCL
The envvar works for R100 and R200 too, and the classic R300 driver
doesn't even exist anymore.

"RADEON_NO_TCL" is already mentioned in the code and is the same envvar
used for the R300g driver.
2012-01-30 14:24:03 -05:00
José Fonseca
647ca47cc3 gallivm: Don't use C99 member initializers. 2012-01-30 19:05:58 +00:00
José Fonseca
dde807b9dc gallivm: Move declaration before code. 2012-01-30 18:59:29 +00:00
ojab
25ee5a27f3 Use only native engine & bitwriter LLVM libraries for linking.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-30 18:51:59 +00:00
Tom Stellard
bc2875aa48 gallivm: Add a new interface for doing TGSI->LLVM conversions
lp_bld_tgsi_soa.c has been adapted to use this new interface, but
lp_bld_tgsi_aos.c has only been partially adapted, since nothing in
gallium currently uses it.

v2:
- Rename lp_bld_tgsi_action.[ch] => lp_bld_tgsi_action.[ch]
- Initialize tgsi_info in lp_bld_tgsi_aos.c
- Fix copyright dates
2012-01-30 13:37:01 -05:00
Tom Stellard
82b71db03d gallium: Move duplicated helper macros to tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
6b63e25b3d gallium: Prefix #defines in tgsi_exec.h with TGSI_ 2012-01-30 13:37:00 -05:00
Tom Stellard
9ee1bcf7a5 gallium: Unify defines of CHAN_[XYZW] in tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
5204974462 gallivm: Add function lp_bld_gather_values() 2012-01-30 13:37:00 -05:00
Tom Stellard
df16945790 tgsi: Add output_mode to struct tgsi_opcode_info v2
v2:
- Rename output_type to output_mode
- Add shorthand definitions for TGSI_OUTPUT_*
2012-01-30 13:37:00 -05:00
Benjamin Franzke
c72d7df168 st/dri: Support 24bit formats in dri2_allocate_buffer
Prior commit 576161289d,
the parameter format was bpp, thus both 24bit and 32bit formats were
requested with format set to 32. Handle 24bit seperately now.

Fixes RGBX formats in wayland platform for egl_dri2 (EGL_ALPHA_SIZE=0).

Note: This is a candidate for the 8.0 branch.
2012-01-30 17:15:44 +01:00
Dave Airlie
fef395c0c3 mesa/format_unpack: add LUMINANCE 8/16 UINT/INT
This just copies what the LUMINANCE_ALPHA bits do.

Fixes piglit tests on softpipe complaining about missing unpack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:55:15 +00:00
Dave Airlie
29cf90b414 r600g: fix udiv/idiv/umod/imod on cayman
Cayman needs some of the MUL instructions spread across a full slot
of vectors.

It also no longer has RECIP_UINT, the recommendation is to replace it
with a U2F + RECIP_IEEE + MUL + F2U.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:53:15 +00:00
Dave Airlie
a33937d043 r600g: enable blend_bypass for uint/sint 2012-01-30 13:23:07 +00:00
Dave Airlie
cb40165974 r600g: fix fragcoord.w test on cayman 2012-01-30 13:23:07 +00:00
Marek Olšák
f9f8ce3ead r600g: remove unused streamout code 2012-01-30 01:27:25 +01:00
Marek Olšák
ce816dd831 r600g: disable printing debug info for streamout 2012-01-30 01:27:25 +01:00
Brian Paul
c946fc061a gallium: remove trailing comma to silence warning 2012-01-29 15:02:43 -07:00
Juan Zhao
03dae29472 add wayland cflags when building wayland-egl
to fix the header file missing when building wayland-egl
2012-01-29 16:51:27 +01:00
Christoph Bumiller
672ad90f54 nvfx,nv50,nvc0: handle PIPE_CAP_GLSL_FEATURE_LEVEL 2012-01-29 13:24:11 +01:00
Matt Turner
10c85526a2 dri: don't link with DRICORE_LIB_DEPS
DRI_LIB_DEPS is sufficient since it includes DRICORE_LIB_DEPS
2012-01-28 22:02:08 -05:00
Marek Olšák
335d49ef15 scons: don't add -Wmissing-field-initializers
The warning is absolutely useless. It doesn't actually say that there are
uninitialized variables. It points out the fact that there are missing
initializers and that variables are initialized to zero implicitly, which is
exactly what we want and what we commonly make use of.

C90 and C99 require all unspecified variables in the initializer list to be set
to zero.
2012-01-29 02:19:58 +01:00
Marek Olšák
41a4e274a4 st/mesa: use table-driven approach to exposing extensions for formats (v3)
The check for ctx->API was unnecessary, because OES extensions are not exposed
in desktop GL.

Also require renderbuffer support for ARB_texture_rgb10_a2ui,
as per the spec.

Tested by comparing old and new glxinfo with softpipe and r600g.

v2: fix bugs
v3: rename need_only_one -> need_at_least_one
    rename num_elements -> num_mappings
    add comments
    use const when appropriate

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-29 02:19:58 +01:00
Marek Olšák
c21d7b1e30 st/mesa: use table-driven approach to exposing extensions based on CAPs
This change is not exactly equivalent (sometimes we checked for non-zero,
sometimes if >0 or >1), but the behavior shouldn't change, because all drivers
report 0 for unsupported CAPs.

Exposing CAP_STREAM_OUTPUT_PAUSE_RESUME without CAP_MAX_STREAM_OUTPUT_BUFFERS
is a driver bug and st/mesa does no checking if the latter is supported as
well. Drivers must report CAPs consistently.

v2: make the array const
2012-01-29 02:19:57 +01:00
Marek Olšák
171be75522 st/mesa: add PIPE_CAP_GLSL_FEATURE_LEVEL, cleanup st_extensions.c
v2: handle the cap in r300 and r600 as well

Additional info for r600g:
   The env var R600_GLSL130=1 enables GLSL 1.3.
   Along with R600_STREAMOUT=1, it enables full GL 3.
2012-01-29 02:16:00 +01:00
Mathias Fröhlich
1d01429c6a state_stracker: Fix access to uninitialized memory.
Fix an access to uninitialized memory pointed out by valgrind in
glsl_to_tgsi_visitor::simplify_cmp(void).

Note: This is a candidate for the 8.0 branch.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-01-29 00:15:48 +01:00
Vinson Lee
743432039c draw: Remove unused variables.
Fix this GCC warning.
draw_pipe_clip.c: In function ‘interp’:
draw_pipe_clip.c:122:13: warning: variable ‘clip_dist’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-28 11:22:48 -08:00
Vadim Girlin
1a9d2b7642 r600g: fix linear and flat interpolation
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-28 16:20:37 +00:00
Yuanhan Liu
eaf360e5bf i965: fix inverted point sprite origin when rendering to FBO
When rendering to FBO, rendering is inverted. At the same time, we would
also make sure the point sprite origin is inverted. Or, we will get an
inverted result correspoinding to rendering to the default winsys FBO.

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

NOTE: This is a candidate for stable release branches.

v2: add the simliar logic to ivb, too (comments from Ian)
    simplify the logic operation (comments from Brian)

v3: pick a better comment from Eric
    use != for the logic instead of ^ (comments from Ian)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-28 09:59:13 +08:00
Brian Paul
d250287d53 mesa: remove byteswap check in fast_read_rgba_pixels_memcpy()
It's handled by _mesa_format_matches_format_and_type() now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
07ff5adc32 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb9_e5, r11_g11_b10f, argb2101010_uint functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
6f55ef3740 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb332, signed rgba8888, signed rgba888_rev functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
453d4b40bc mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgba5551, argb1555, argb2101010 formats.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
f6af4c511f mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb565, argb8888, rgb888, argb4444 functions.
2012-01-27 18:21:45 -07:00
Brian Paul
b27792335e mesa: use _mesa_format_matches_format_and_type() in texstore code
This simplifies the code quite a bit, consolidates some cases and
possibly catches more cases for the memcpy path.

More such changes will follow.  Do just a few at a time to help bisect
any possible regressions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
94a0d38c24 mesa: implement more cases in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
51aab798a3 mesa: use swapBytes parameter in _mesa_format_matches_format_and_type()
This will let us use memcpy in more situations.  We can also remove
the checks for byte spapping that happen before the calls to
_mesa_format_matches_format_and_type().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
06aa607ba7 mesa: added swapBytes parameter to _mesa_format_matches_format_and_type()
Not actually used yet though.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
952ca07852 mesa: rewrite, simplify some of the logic in _mesa_format_matches_format_and_type()
In preparation for adding GL_PACK/UNPACK_SWAP_BYTES support.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
966720f507 mesa: add BGR888 code in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
b019228d6b mesa: fix error in _mesa_format_matches_format_and_type() for RGB888
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
370e5d2106 mesa: remove redundant byte swap check
The outer conditional already did the test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
343100d1fc mesa: remove LSB-first pixel packing check in glReadPixels
GL_UNPACK_LSB_FIRST only applies to bitmap data, not glReadPixels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Chad Versace
ab1195cf11 swrast: Fix implicit declaration warnings
In a recent commit,
    commit 1c0f1dd42a
    Author: Chad Versace <chad.versace@linux.intel.com>
    swrast: Fix fixed-function fragment processing
I defined a new function,_swrast_fragment_program, but neglected
to #include s_fragprog.h for clients of that function.

Note: This is a candidate for the 8.0 branch.
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 16:53:51 -08:00
Alex Deucher
b8f7550a31 r600g: remove unsupported evergreen CB formats
The evergreen+ CB no longer supports the following formats
compared to 6xx/7xx:
- COLOR_4_4
- COLOR_3_3_2
- COLOR_6_5_5
- COLOR_8_24_FLOAT
- COLOR_24_8_FLOAT
- COLOR_11_11_10
- COLOR_11_11_10_FLOAT

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-27 18:46:03 -05:00
José Fonseca
3409118371 mesa: Avoid void * arithmetic.
Should fix MSVC build.
2012-01-27 21:54:12 +00:00
Chad Versace
1c0f1dd42a swrast: Fix fixed-function fragment processing
On i965, _mesa_ir_link_shader is never called. As a consequence, the
current fragment program (ctx->FragmentProgram->_Current) exists but is
invalid because it has no instructions. Yet swrast continued to attempt to
use the empty program.

To avoid using the empty program, this patch 1) defines a new function,
_swrast_use_fragment_program, which checks if the current fragment program
exists and differs from the fixed function fragment program, and, when
appropriate, 2) replaces checks of the form
    if (ctx->FragmentProgram->_Current == NULL)
with
    if (_swrast_use_fragment_program(ctx))

Fixes the following oglconform regressions on i965/gen6:
    api-fogcoord(basic.allCases.log)
    api-mtexcoord(basic.allCases.log)
    api-seccolor(basic.allCases.log)
    api-texcoord(basic.allCases.log)
    blend-separate(basic.allCases)
    colorsum(basic.allCases.log)

The tests were ran with the GLXFBConfig:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x021 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24 8  0  0  0  0  0 0 None

(Note: I originally believed that the hunk in
_swrast_update_fragment_program was unnecessary. But it is required to fix
blend-separate.)

Note: This is a candidate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reveiwed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 13:34:26 -08:00
Anuj Phogat
5665b5cc31 mesa: set clamp bit in glGetTexImage for GL_UNSIGNED_NORMALIZED
Color clamping should be enabled in glGetTexImage if texture dataType is
GL_UNSIGNED_NORMALIZED and format is GL_LUMINANCE or GL_LUMINANCE_ALPHA

Fixes 2 Intel oglconform test cases: pxconv-gettex and pxtrans-gettex
https://bugs.freedesktop.org/show_bug.cgi?id=40864

NOTE: This is a candidate for the 8.0 branch

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 13:22:52 -08:00
Eric Anholt
5f65598cc7 mesa: Don't round-trip integer texture data through a floating point temp.
This was losing bits of precision.  Fixes (with the previous commits):
piglit EXT_texture_integer/getteximage-clamping
piglit EXT_texture_integer/getteximage-clamping GL_ARB_texture_rg
oglc advanced.mipmap.upload

Regresses oglc negative.typeFormatMismatch.teximage from fail to
abort, because it's been hitting texstore for a format/type combo that
shouldn't happen.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:13 -08:00
Eric Anholt
dadbec1e90 mesa: When unpacking signed integer pixel data, don't clamp to 0.
In the core, we always treat spans of int/uint data as uint, so this
extract function was truncating storage of integer pixel data to a n
int texture to (0, max_int) instead of (min_int, max_int).  There is
probably missing code for handling truncation on conversion between
pixel formats, still, but this does improve things.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:11 -08:00
Eric Anholt
8b97bb02fb mesa: Add clamping for packing of integer data.
Mostly fixes piglit EXT_texture_integer/getteximage-clamping.  The
remaining failure involves precision loss on storing of int32 texture
data (something I knew was an issue, but wasn't trying to test).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:08 -08:00
Eric Anholt
de24ccabd6 mesa: Add missing format unpack for some integer texture formats.
This cut and paste is pretty awful.  I'm tempted to do a lot of this
using preprocessor tricks for customizing the parameter type from a
template function, but that's just a different sort of hideous.

Fixes 8 Intel oglconform int-textures cases.

NOTE: This is a candidate for the 8.0 branch.
v2: Add alpha formats, too.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:00:46 -08:00
Eric Anholt
3a8cf3357a i965: Don't allow rendering to non-GL_RED/RG/RGBA integer textures.
Fixes piglit EXT_texture_integer/fbo-blending.
2012-01-27 11:46:10 -08:00
Eric Anholt
796f44d779 intel: Pass the gl_renderbuffer to render_target_supported() vtable method.
I'm going to want to go looking at it for an integer texture fix.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
7cac88679b intel: Make a renderbuffer wrapping a texture have the same _BaseFormat.
Otherwise, when you asked for the _BaseFormat of an rb wrapping a
GL_RGB texture, you got GL_RGBA because that's what we were storing
the texture data as.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
b73f5df648 intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.
NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
74484c5d41 intel: Drop intel_wrap_miptree().
Most of this function was just calling
intel_renderbuffer_update_wrapper(), which was called immediately
afterwards in the only caller.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:09 -08:00
Eric Anholt
a4586d2e2e intel: Comment typo fix. 2012-01-27 11:46:09 -08:00
Eric Anholt
531e44415b mesa: Fix handling of glCopyBufferSubData() for src == dst.
Fixes piglit ARB_copy_buffer-overlap, on swrast, which previously
assertion failed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 11:44:31 -08:00
Eric Anholt
42e9936ce6 intel: Fix accum buffer mapping since the swrast rework.
A pure swrast-allocated buffer gets an irb of NULL, so we segfaulted
in the clear-accum test.  Just look at the swrast renderbuffer pointer
for handling swrast rbs.
2012-01-27 11:28:16 -08:00
Eric Anholt
3d8c27f882 mesa: Fix display list handling for GL_EXT_framebuffer_multisample.
From the extension spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., RenderbufferStorageMultisampleEXT..."

Fixes piglit EXT_framebuffer_multisample/dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Eric Anholt
25dd80555d mesa: Fix display list handling for EXT_framebuffer_object.
Noticed when handling a similar problem in EXT_framebuffer_multisample.

From the EXT_framebuffer_object spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., GenFramebuffersEXT, BindFramebufferEXT,
    DeleteFramebuffersEXT, CheckFramebufferStatusEXT,
    GenRenderbuffersEXT, BindRenderbufferEXT, DeleteRenderbuffersEXT,
    RenderbufferStorageEXT, FramebufferTexture1DEXT,
    FramebufferTexture2DEXT, FramebufferTexture3DEXT,
    FramebufferRenderbufferEXT, GenerateMipmapEXT..."

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Brian Paul
8b3c99a5eb gallivm: Swizzle constants into the right AoS ordering.
Constants array is always assumed to be RGBA, which means we need to
swizzle the constant elements into place to match the AoS ordering
(e.g., BGRA) that was passed to lp_build_tgsi_aos().

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-27 18:25:32 +00:00
José Fonseca
07635a4799 draw: Ensure that prepare is always run after LLVM garbagge collection.
Should avoid dangling pointer derreference with

  glean --run results --overwrite --quick --tests texSwizzle

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 18:24:14 +00:00
Jeremy Huddleston
b728eefb06 configure.ac: Don't use $CLANG since it will collide with the static analyzer.
We just prefix the $CLANG environment variable in configure.ac with acv_mesa_

Found by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 09:04:13 -08:00
Marek Olšák
3d993aff25 Revert "r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable"
This reverts commit d6cd514edb.

It broke multiple streamout buffers, because it only enabled the first one.
2012-01-27 17:49:41 +01:00
Matt Turner
9895f77249 i965/automake: use $top_srcdir instead of relative links
Fixes out-of-tree builds.
2012-01-27 00:35:10 -05:00
Matt Turner
64afb575b0 dri common: add .gitignore 2012-01-27 00:16:33 -05:00
Matt Turner
0c17823167 configure.ac: remove shared/static options
now that libtool provides them.
2012-01-26 19:36:52 -05:00
Matt Turner
80aa78142d dri: make sure to build libdricommon.la 2012-01-26 19:32:16 -05:00
Eric Anholt
c885039442 i965: Drop the missing symbols link test.
This was horribly broken and has cost everyone more time than we were
ever going to save using it.  It might have been fixable, but the
problem it was originally trying to solve can be better solved with
-Werror=missing-prototypes and -Werror=implicit-function-declaration.

Also, it was always producing a big scary warning about how the link
test was non-portable.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44928
2012-01-26 16:14:55 -08:00
Eric Anholt
1237a56916 nouveau: Fix missing dri common symbols after automake conversion. 2012-01-26 16:14:35 -08:00
Eric Anholt
5fa27eafc8 radeon: Fix missing dri common symbols after automake conversion.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:32 -08:00
Eric Anholt
45389caf05 dri: Move the compile of the common files to a convenience library.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:22 -08:00
Eric Anholt
29ea1c4461 i915: Fix driver after automakeification. 2012-01-26 16:13:39 -08:00
Kenneth Graunke
259b65e2e7 i965/vs: Use the sampler for VS pull constant loading on Ivybridge.
Substantially increases performance in GLBenchmark PRO:
- 320x240   => 3.28x
- 1920x1080 => 1.47x
- 2560x1440 => 1.27x

The LD message ignores the sampler unit index and SAMPLER_STATE pointer,
instead relying on hard-wired default state.  Thus, there's no need to
worry about running out of sampler units or providing SAMPLER_STATE;
this small patch should be all that's required.

NOTE: This is a candidate for release branches.
      (It requires the preceding commit to compile.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:54 -08:00
Kenneth Graunke
5f4575d42f i965: Expose brw_set_sampler_message for use outside brw_eu_emit.c.
brw_SAMPLE is full of complex workarounds for original Broadwater
hardware, and I'd rather avoid all that for my next Ivybridge patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:46 -08:00
Brian Paul
04341e51ce svga: reset vertex buffer offset in svga_release_user_upl_buffers()
This function releases the buffer that contains user-space vertex data.
The buffer_offset field points into that buffer.  So reset the
buffer_offset to zero when we release the buffer so that subsequent
draws don't inadvertantly get a bad offset.

Fixes error messages / failed assertions (in the draw module's bounds/size
checking code) when running piglit's polygon-mode test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-26 11:38:30 -07:00
José Fonseca
6549e721ad mapi: Make initMagic unsigned.
To avoid signed/unsigned comparison warnings against INIT_MAGIC
0xff8adc98, which doesn't fit on signed integers.
2012-01-26 17:33:33 +00:00
José Fonseca
1d1033926d scons: Remove references to u_thread.c
For future reference: always run "git grep" on refactorings.
2012-01-26 17:29:38 +00:00
Matt Turner
b7a81b6e51 Fix visibility of u_thread functions by inlining them
-fvisibility=hidden was preventing them from being exported, which
combined with shared-glapi was causing undefined symbol errors at
runtime.

We don't want to make these functions part of the ABI, and given
how simple they are, we simply inline them.
2012-01-26 12:05:33 -05:00
Brian Paul
0a966a686e nouveau: include s_context.h to silence missing prototype warnings 2012-01-26 08:16:54 -07:00
Brian Paul
88e7f56dd7 swrast: silence uninitialized var warnings 2012-01-26 08:16:33 -07:00
Lucas Stach
5ce7418739 nvfx: fix nv3x fallout from state validation changes
From c998f732d42da5e962fe5da294493132c3e8dc5f Mon Sep 17 00:00:00 2001
From: Lucas Stach <dev@lynxeye.de>
Date: Tue, 24 Jan 2012 09:46:32 +0100
Subject: [PATCH] nvfx: fix nv3x fallout from state validation changes

Apparently nv3x needs some curde hacks to work properly. This
is clearly not the right fix, but it's the behaviour of the old
code and fixes regressions seen by users.
2012-01-26 14:15:29 +01:00
Benjamin Franzke
1b417e1767 gbm: Add back link flags for udev, dl and glapi
They were left out when migrating to automake.
2012-01-26 13:23:25 +01:00
Benjamin Franzke
412042523e configure: Use WAYLAND_SCANNER_RULES only if available
This has the drawback that when creating configure for
distribution, wayland needs to be available for the packager.

Also the the macros has the wayland prefix hardcoded, so
we cant copy it in mesa right now.
2012-01-26 11:49:47 +01:00
Jakob Bornecrantz
b6d3a435a0 draw: Only run prepare when state, prim and opt changes
In bad applications like ipers which does a lot of draw calls with
no state changes this helps to greatly reduce time spent in prepare.
In ipers around 7% of CPU was spent in various prepare functions,
after this commit no prepare function show on the profile.

This commit also has the added benefit of now grouping all pipelined
drawing into a single draw call if the driver uses vbuf_render.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:46 -08:00
Jakob Bornecrantz
eb65ccbc21 draw: Don't revalidate pipeline on backend flushes
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:40 -08:00
Jakob Bornecrantz
4a79545bdf draw: Remove reduced_prim
Conflicts:

	src/gallium/auxiliary/draw/draw_context.c

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:36 -08:00
Benjamin Franzke
8b902056d5 automake: src/egl/wayland
So we can use the wayland scanner makro, which is way
better than our previous runtime-pkgconfig hack.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 10:07:11 +01:00
Paul Berry
dc435ae774 i965/gen6/GT1: Increase max_vs_entries to 256.
Previously, max_vs_entries was set to 128 for GT1, and 256 for GT2,
based on the PRM (see Vol2, part1, p28).  However, Bspec section 1.6.5
indicates that the maximum number of VS entries is 256 for GT1.

No piglit regressions on GT1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-25 09:43:14 -08:00
Paul Berry
6bc08ee569 i965/gen6: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
When storing data in a buffer of type DYNAMIC_DRAW, we don't create a
drm_intel_bo for it; instead we store the data in system memory and
defer allocation of the GPU buffer until it is needed.  Therefore, in
brw_update_sol_surface(), we can't just consult the "buffer" field of
the intel_buffer_object structure; we need to call
intel_bufferobj_buffer() to ensure that the deferred allocation
occurs.

This parallels a similar fix for gen7 (see commit ba6f4c9).

Fixes piglit test EXT_transform_feedback/buffer-usage on gen6.

This is a candidate for the 8.0 release branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-25 09:42:49 -08:00
Ander Conselvan de Oliveira
33f8a3cfbe gbm: fix copy & paste error in gbm_bo_get_handle documentation 2012-01-25 12:21:37 -05:00
José Fonseca
4ac37b0b81 mesa/st: Assign inputsRead at right (previous) location.
Fixes the

  src/mesa/state_tracker/st_glsl_to_tgsi.cpp:4032:src_register: Assertion `t->inputMapping[index] < (sizeof(t->inputs)/sizeof(*(t->inputs)))' failed.

assertion failure introduced in 697b9945fb
2012-01-25 13:48:18 +00:00
Marek Olšák
69c8f468ba mesa: remove ctx->Const.sRGBCapable
It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-25 12:35:37 +01:00
Marek Olšák
8ec05f06cb r600g: handle start_component from stream_output_info when possible 2012-01-25 12:35:20 +01:00
Marek Olšák
15146fd1bc r600g: don't expose transform_feedback2 without kernel support 2012-01-25 12:35:19 +01:00
Marek Olšák
3363e87d7d mesa: allow exposing GL3 without EXT_texture_integer
Strictly speaking, it's not legal to expose EXT_texture_integer without
EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4
is available without checking for it).

The check in compute_version is removed as well, because that's already
covered by GLSLVersion >= 130.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
636802f615 mesa: add missing integer alpha formats to _mesa_base_fbo_format
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
0cf0418363 st/mesa: require all s3tc formats for EXT_texture_compression_s3tc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
925fd2e1dd st/mesa: simplify enabling EXT_packed_depth_stencil and ARB_fbo
- use OR to combine bind flags
- combine both conditionals into one
- move the ARB_fbo enable where it belongs

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
95dab55751 mesa: remove obsolete comment in version.c
Pointed out by Brian Paul.
2012-01-25 12:35:19 +01:00
Marek Olšák
fc878cf7a4 gallium/docs: document more CAPs 2012-01-25 12:35:19 +01:00
Marek Olšák
c2b800cf38 r600g: nuke the fallback for vertex and fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
7023ed9e62 r300g: nuke the fallback for fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
697b9945fb st/mesa: inline if(1) conditional
v2: fix typo
2012-01-25 12:35:18 +01:00
Marek Olšák
732f69c94e st/mesa: move fragment shader tgsi tokens into st_fp_variant
The TGSI code may vary depending on the clamp_color bit.
2012-01-25 12:35:18 +01:00
Marek Olšák
bc1c836938 st/mesa: do vertex and fragment color clamping in shaders
For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
the perfect place for a fallback.
The exceptions are:
- r500 (vertex clamp only)
- nv50 (both)
- nvc0 (both)
- softpipe (both)

We also have to take into account that r300 can do CLAMPED vertex colors only,
while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
with the two new CAPs.
2012-01-25 12:35:18 +01:00
Christian König
c2e2b58a58 st/xvmc: remove xorg-server dependency
Fixing a circular build dependency.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-25 10:34:26 +01:00
Benjamin Franzke
36fb83e4a8 st/mesa: Fix recurring surfaceless contexts
A current incomplete framebuffer was incorrectly used as a
st_framebuffer. When accessing st_framebuffer childs bad things happen:
e.g. st_framebuffer::iface was used to check whether its an incomplete
fb, instead we need to compare st_framebuffer::Base against
mesa_get_incomplete_framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44919
Note: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 10:12:09 +01:00
Eric Anholt
422b18794e mesa: Fix CopyTex{Sub,}Image error checks for integer vs non-integer.
Fixes Intel oglconform negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
ee9804af14 mesa: Add missing integer R/RG cases to _mesa_is_color_format().
This is part of fixing Intel oglconform
negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
6bf0f6ae86 meta: Detect currently-unsupported integer CopyTexSubImage and complain.
This code is unprepared for handling integer (particularly, the
baseFormat of the TexFormat comes out as GL_RGBA, not GL_RGBA_INTEGER,
so the direct call of Driver.ReadPixels crashes due to the int vs
non-int error checking not having happened).  I'm frankly tempted to
convert this code to MapRenderbuffer/MapTexImage rather than doing it
as meta ops, now that we have that support.

Improves the remaining crash in Intel oglconform for int-textures to
just a rendering failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
d6c58545a1 mesa: Add the remaining from/to types for GL_EXT_texture_integer (and R/RG).
This aborts and crashes in intel oglconform's int-textures into being
just rendering failures.  Clamping isn't handled yet.

v2: Add missing "break".
v3: Drop the int/uint distinction, since they don't need different clamping.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
2012-01-24 16:35:47 -08:00
Eric Anholt
08acd4bd61 mesa: Add support for glGetTexImage on GL_TEXTURE_1D_ARRAY
Similarly to how we handle this in texstore, we have to remap height
to depth so that we MapTextureImage each image layer individually.

Fixes part of Intel oglconform's int-textures advanced.fbo.rtt

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:34:02 -08:00
Eric Anholt
86ca4f9cb6 mesa: s/GLuint col/GLint col/ to avoid signed/unsigned comparison warnings.
Suggested-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
9f1e64d085 mesa: Add support for glGetTexImage() from integer textures.
This is a step toward fixing Intel oglconform's
int-textures advanced.fbo.rtt.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
f6e82cd2a1 i965/gen6+: Work around GPU hangs with logic ops on integer textures.
This doesn't result in correct rendering -- GL requires that logic ops
work, while the hardware specs say it doesn't do them.  I'm not sure
how we would want to handle this.

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:20:21 -08:00
Eric Anholt
04b4880d7c i965/gen6+: Disable blending, alpha test, and dither on integer FBOs.
Fixes GPU hangs and some rendering failures in piglit
EXT_texture_integer/fbo-blending

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:00:04 -08:00
Brian Paul
4a1c660599 mesa/gdi: remove wmesa_set_renderbuffer_funcs() function
The code is no longer relevant.
Note: this driver is probably broken now.  There's no implementation
of ctx->Driver.Map/UnmapRenderbuffer().
2012-01-24 15:13:20 -07:00
Brian Paul
a9bf149e7f dri/swrast: remove obsolete swrast_span.c file from source list 2012-01-24 15:08:20 -07:00
Brian Paul
ba151a333b swrast: fix uninitialized variable warning 2012-01-24 14:12:39 -07:00
Brian Paul
cf386f0a2b swrast: make rowStride variable signed in put_z32_values()
As with commit aed5c8299f
2012-01-24 14:12:38 -07:00
Brian Paul
89bb19adb0 intel: use swrast code to map/unmap renderbuffers for swrast rendering 2012-01-24 14:12:38 -07:00
Brian Paul
4baf90353d mesa: update comments, fix whitespace in dd.h 2012-01-24 14:12:38 -07:00
Brian Paul
9403cc3aba swrast: remove unused StoreTexel code
No longer needed since we do all rendering to texture with the buffer
mapping and pixel packing functions.
2012-01-24 14:12:37 -07:00
Brian Paul
1caf698191 swrast: use Map/UnmapTextureImage() in framebuffer map/unmap code
When we're actually rendering into a texture, map the texture image
instead of the corresponding renderbuffer.  Before, we just copied
a pointer from the texture image to the renderbuffer.  This change
will make the code usable by hardware drivers.
2012-01-24 14:12:37 -07:00
Brian Paul
56d83ac4bf mesa: remove ctx->Driver.Map/UnmapTexture() hooks
No longer used anywhere.
2012-01-24 14:12:37 -07:00
Brian Paul
8b8a54afd9 nouveau: stop calling ctx->Driver.Map/UnmapTexture()
And remove unused nouveau_texture_map/unmap()
2012-01-24 14:12:36 -07:00
Brian Paul
4bbab2275f tnl: remove ctx->Driver.Map/UnmapTexture() calls
ctx->Driver.MapTexture() always points to _swrast_map_texture().
We're already reaching into swrast from t_vb_program.c anyway.
This will let us remove the ctx->Driver.Map/UnmapTexture() functions.
2012-01-24 14:12:36 -07:00
Brian Paul
bde356a158 swrast: move some renderbuffer functions to s_renderbuffer.c 2012-01-24 14:12:35 -07:00
Brian Paul
1839a7fc9f intel: remove intel_span_supports_format()
It always returned True.
2012-01-24 14:12:34 -07:00
Brian Paul
6c1e27ba21 swrast: remove a few extra _mesa_get_format_bytes() calls 2012-01-24 14:12:34 -07:00
Brian Paul
1da7d6c919 mesa: update comments for gl_renderbuffer 2012-01-24 14:12:33 -07:00
Brian Paul
1888dd52a3 mesa/swrast/drivers: remove obsolete gl_renderbuffer fields
This removes the last of the legacy fields from gl_renderbuffer.
2012-01-24 14:12:33 -07:00
Brian Paul
becbb64313 dri/swrast: use swrast_renderbuffer type 2012-01-24 14:12:33 -07:00
Brian Paul
0c1862851f swrast: use swrast_renderbuffer instead of gl_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
797c18be1f osmesa: use swrast_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
c080202db5 radeon: derive radeon_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
9f8ed9d662 intel: derive intel_renderbuffer from swrast_renderbuffer
Drivers that rely on swrast need to do this, as with swrast_texture_image.
2012-01-24 14:12:31 -07:00
Brian Paul
d16e71eeb4 xlib: derive xmesa_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
f2479530b8 swrast: allocate swrast_renderbuffers instead of gl_renderbuffers 2012-01-24 14:12:30 -07:00
Brian Paul
34988272d9 swrast: new swrast_renderbuffer type
This will let us move the swrast-specific fields out of gl_renderbuffer.
2012-01-24 14:12:30 -07:00
Brian Paul
924de7dc96 intel: use intel_rb_format() to get renderbuffer format
This will make future changes cleaner and less invasive.
2012-01-24 14:12:29 -07:00
Brian Paul
1048d55d5f dri/swrast: rename swrast_renderbuffer to dri_swrast_renderbuffer
To prevent name collision with future swrast_renderbuffer in the swrast
module.
2012-01-24 14:12:29 -07:00
Brian Paul
c45771905f swrast: use stencil packing function in s_stencil.c 2012-01-24 14:12:28 -07:00
Brian Paul
881ef2a9db swrast: use color packing functions in s_span.c 2012-01-24 14:12:28 -07:00
Brian Paul
8696a52102 swrast: remove s_spantemp.h 2012-01-24 14:12:27 -07:00
Brian Paul
b0f0d7a811 xlib: remove xm_span.c and related code 2012-01-24 14:12:27 -07:00
Brian Paul
59a5b5a193 mesa: remove gl_renderbuffer::Wrapped
There's no such thing as renderbuffer wrappers anymore.
2012-01-24 14:12:27 -07:00
Brian Paul
ab331140c6 swrast: rewrite, simplify the the render-to-texture code 2012-01-24 14:12:26 -07:00
Brian Paul
7a36345f70 mesa: rename gl_renderbuffer::Data to Buffer
To better indicate that this pointer to the malloc'd memory.
2012-01-24 14:12:26 -07:00
Brian Paul
f6a3979a04 mesa: move freeing of software renderbuffers into swrast 2012-01-24 14:12:25 -07:00
Brian Paul
f9874feef4 mesa: remove gl_renderbuffer::DataType 2012-01-24 14:12:24 -07:00
Brian Paul
1e1b5cb01a mesa: remove gl_renderbuffer:RowStride field 2012-01-24 14:12:24 -07:00
Brian Paul
82846fea4d mesa: finally, remove the GetRow/PutRow/etc functions 2012-01-24 14:12:23 -07:00
Brian Paul
304f7a1327 dri: remove all the obsolete spantmp files 2012-01-24 14:12:23 -07:00
Brian Paul
a4c6dedb27 radeon: remove obsolete GetRow/PutRow code 2012-01-24 14:12:22 -07:00
Brian Paul
f892debdc2 nouveau: remove obsolete GetRow/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
41869c4942 intel: remove most of the span Get/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
cb5fa9ea62 dri/swrast: remove obsolete GetRow/PutRow code 2012-01-24 14:12:20 -07:00
Brian Paul
2873555a76 osmesa: remove obsolete GetRow/PutRow code 2012-01-24 14:12:19 -07:00
Brian Paul
2e80c7e5bf xlib: remove obsolete GetRow/PutRow code 2012-01-24 14:12:18 -07:00
Brian Paul
0d2f0c8bb8 mesa: remove obsolete PutRow, etc assignments 2012-01-24 14:12:17 -07:00
Brian Paul
d65bbfa947 swrast: remove Get/PutRow()-related code 2012-01-24 14:12:16 -07:00
Brian Paul
a4a566a610 st/mesa: remove gl_renderbuffer::GetPointer stuff 2012-01-24 14:12:16 -07:00
Brian Paul
0ff817f200 swrast: stop using Put/GetRow/Values() in swrast code
All color buffer rendering is now done by accessing mapped renderbuffer
memory.  We're now able to get rid of all the GetRow/PutRow stuff.
2012-01-24 14:12:15 -07:00
Brian Paul
b766d4bb43 swrast: use gl_renderbuffer::StrideInBytes in depth/stencil code 2012-01-24 14:12:15 -07:00
Brian Paul
7d1ddec921 mesa: use gl_renderbuffer::Map for all depth/stencil accesses
Instead of using the obsolete gl_renderbuffer::Data field.
Color buffer are still accessed through GetRow/PutRow().
2012-01-24 14:12:14 -07:00
Brian Paul
14da67d9b9 intel: make intel_renderbuffer_map/unmap() static 2012-01-24 14:12:13 -07:00
Brian Paul
827c1d66f6 mesa: add new gl_renderbuffer fields
These are temporary, actually, but they'll make follow-on work easier to
implement in a step-by-step manner.  Eventually the Map and RowStrideBytes
fields will go into a new swrast_renderbuffer type, but adding that type
now would involve touching a _lot_ of code that'll eventually be removed.

The fields marked as obsolete will go away completely at some point.
2012-01-24 14:12:12 -07:00
Brian Paul
fc9f74839d swrast: flush pending rendering before unmapping buffers 2012-01-24 14:12:12 -07:00
Brian Paul
33257803d9 swrast: new assertions in _swrast_pixel_address() 2012-01-24 14:12:11 -07:00
Brian Paul
e34a54ff45 swrast: use _swrast_pixel_address() in more places 2012-01-24 14:12:11 -07:00
Brian Paul
bd3c10c0f0 swrast: s/Data/Map/ in swrast_texture_image
To indicate that it points to mapped texture memory.
2012-01-24 14:12:10 -07:00
Brian Paul
ecb8594c18 swrast: remove gl_renderbuffer::DataType check in DrawPixels()
The field will be going away so update this code.
2012-01-24 14:12:09 -07:00
Brian Paul
7726be1c1b swrast: remove gl_renderbuffer::DataType assertions
This field will go away, so remove some uses of it.
2012-01-24 14:12:09 -07:00
Brian Paul
ca6d86d26b st/mesa: remove gl_renderbuffer:DataType assignments
That field is only used by swrast code so there's no reason to mess
with it in the gallium state tracker.

This also lets us remove the unused st_format_data() type function and
related code.
2012-01-24 14:12:08 -07:00
Brian Paul
ff57b0f037 swrast: make _swrast_get_values(), _swrast_get_row() static
They were only called from in s_span.c
2012-01-24 14:12:07 -07:00
Brian Paul
267fb17884 swrast: remove dstType param from _swrast_read_rgba_span()
It was always GL_FLOAT.
2012-01-24 14:12:06 -07:00
Brian Paul
64be85540f swrast: remove unused _swrast_put_row() 2012-01-24 14:12:05 -07:00
Ian Romanick
34c353ce46 mesa: Don't resurrect deleted ARB VAOs in glPopClientAttrib
When ARB VAOs are used, glPopClientAttrib does not resurrect a deleted
VAO or VBO.  This difference between the two spec is, unfortunately,
not very well spelled out in the specs.

Fixes oglc vao(advanced.pushPop.deleteVAO) and
vao(advanced.pushPop.deleteVBO) tests.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
0963990153 mesa: Rename gl_array_object::VBOonly to ::ARBsemantics
There are more differences between Apple and ARB than just requiring
that all arrays be stored in VBOs.  Additional uses will be added in
following commits.

Also, set the flag at Bind time instead of Gen time.  The ARB_vao spec
specifies that behavior.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
9be3be3c66 swrast: Use fixed-function processing instead _TexEnvProgram for DrawPixels
This is a hack to work around drivers such as i965 that:

    - Set _MaintainTexEnvProgram to generate GLSL IR for
      fixed-function fragment processing.
    - Don't call _mesa_ir_link_shader to generate Mesa IR from the
      GLSL IR.
    - May use swrast to handle glDrawPixels.

Since _mesa_ir_link_shader is never called, there is no Mesa IR to
execute.  Instead do regular fixed-function processing.

Even on platforms that don't need this, the software fixed-function
code is much faster than the software shader code.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44749
2012-01-24 12:30:57 -08:00
Ian Romanick
34db7a8c1e mesa: Make sure _TexEnvProgram points at the current ff fragment program
At least one place, the _mesa_need_secondary_color function in
state.h, uses this to make decisions.  The next patch in this series
will add another dependency.  Ideally, this field would go away and be
replace by a flag or something.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-24 12:30:52 -08:00
Brian Paul
3e01c3f3ba softpipe: move var initialization to silence warning 2012-01-24 11:15:43 -07:00
Brian Paul
64cb0cae55 r600g: remove unused variable 2012-01-24 11:15:23 -07:00
Alexander von Gluck
873f3ae92e glsl: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:42 -07:00
Alexander von Gluck
02a1f9f14d mesa: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
32876a452f svga: fix typedef conflicts on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
1550b0668e llvmpipe: fix symbol conflict on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Alexander von Gluck
bca6cd2d71 scons: Remove Haiku one-offs for gallium drivers
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Michel Dänzer
7219af5ec1 gallium/postprocess: Proper reference counting of pp_jimenezmlaa depth buffer.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40776

NOTE: This is a candidate for the stable branches.
2012-01-24 17:57:56 +01:00
Matt Turner
027ce0c493 Revert "Always build shared glapi"
This reverts commit adefee50d9.

Shared glapi was never tested with --enable-xlib-glx and turns out
to cause a lot of problems.

Conflicts:

	configure.ac
2012-01-24 11:34:42 -05:00
Matt Turner
a208468e04 gbm: install libgbm.so into lib
This partially reverts commit 90e2568534.
2012-01-24 11:32:02 -05:00
Adam Jackson
fba8257f6a llvmpipe: Fix math error in LP_DEBUG=counters output
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-24 10:51:15 -05:00
Vadim Girlin
738334e80c r600g: fix inconsistency with INTERP* opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:31 -05:00
Vadim Girlin
65c0f77bcc r600g: replace raw opcodes with names in the is_alu_trans/vector
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:28 -05:00
Vadim Girlin
315cf30607 r600g: add missing opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:26 -05:00
Vadim Girlin
d89c96c75d r600g: fix loop break/continue operations
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Vadim Girlin
c4d644bac1 r600g: fix fragcoord.w
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Benjamin Franzke
468c7ea2ac targets/gbm: Fix install path
GBM_BACKEND_INSTALL_DIR was deleted by commit
06ad64ad29.
Since we dont need this configurable, use $(INSTALL_LIB_DIR)/gbm now.
2012-01-24 10:12:59 +01:00
Benjamin Franzke
ab52be6826 gbm/Makefile.template: Remove builtin-compile path
Builtins are handled by the main gbm Makefile since
06ad64ad29.
2012-01-24 10:00:52 +01:00
Benjamin Franzke
90e2568534 egl,gbm_gallium: Fix linkage against gbm from automake
Add src/gbm/.libs to ldflags.
The gbm lib is src/gbm/.libs/ instead of lib/
as of commit 06ad64ad29.
2012-01-24 10:00:52 +01:00
Vadim Girlin
5a84cc4ebc r600g: fix interpolation with clipvertex
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-24 08:24:58 +00:00
Chad Versace
aed5c8299f swrast: Fix unsigned promotion in pointer arithmetic
When rowstride was negatie, unsigned promotion caused a segfault here:

299│    if (rb->Format == MESA_FORMAT_S8) {
300│       const GLuint rowStride = rb->RowStride;
301│       for (i = 0; i < count; i++) {
302│          if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
303├>            stencil[i] = *(map + y[i] * rowStride + x[i]);
304│          }
305│       }
306│    }

Fixes segfault in oglconform
separatestencil-neu(NonPolygon.BothFacesBitmapCoreAPI),
though test still fails.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-23 17:44:52 -08:00
Ian Romanick
b48d4b64e9 meta: Fallback for glBlitFramebuffer from a multisample surface
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44818
2012-01-23 15:17:45 -08:00
Paul Berry
e2274aa739 i965/vs: Fix bogus assertion in emit_block_move()
i965 processes assignments of whole structures using
vec4_visitor::emit_block_move, a recursive function which visits each
element of a structure or array (to arbitrary nesting depth) and
copies it from the source to the destination.  Then it increments the
source and destination register numbers so that further recursive
invocations will copy the rest of the structure.  In addition, it sets
the swizzle field for the source register to an appropriate value of
swizzle_for_size(...) for the size of each element being copied, so
that later optimization passes won't be fooled into thinking that
unused vector elements are live.

This all works fine.  However, emit_block_move also contains an
assertion to verify, before setting the swizzle field for the source
register, that the source register doesn't already contain a
nontrivial swizzle.  The intention is to make sure that the caller of
emit_block_move hasn't already done some swizzling of the data before
the call, which emit_block_move would then counteract when it
overwrites the swizzle field.  But the assertion is at the lowest
level of nesting of emit_block_move, which means that after the first
element is copied, instead of checking the swizzle field set by the
caller, it checks the swizzle field used when moving the previous
element.  That means that if the structure contains elements of
different vector sizes (which therefore require different swizzles),
the assertion will erroneously fire.

This patch moves the assertion from emit_block_move to the calling
function, vec4_visitor::visit(ir_assignment *).  Since the caller is
non-recursive, the assertion will only happen once, and won't be
fooled by emit_block_move's modification of the swizzle field.

This patch also reverts commit fe006a7 (i965/vs: Fix swizzle related
assertion), which attempted to fix the bug by making the assertion
more lenient, but only worked properly for structures, arrays, and
matrices in which each constituent vector is the same size.

This fixes the problem described in comment 9 of
https://bugs.freedesktop.org/show_bug.cgi?id=40865.  Unfortunately, it
doesn't fix the whole bug, since the test in question is also failing
due to lack of register spilling support in the VS.

Fixes piglit test vs-assign-varied-struct.  No piglit regressions on
Sandy Bridge.

This is a candidate for the 8.0 release branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40865#c9
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 14:45:08 -08:00
Alex Deucher
c9cd170f2e r600g: clean up register headers
- CP_INTERRUPT packet doesn't exist
- remove lots of r6xx copy/paste remnants from evergreen reg header
- fix some cayman specific registers

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-23 16:44:53 -05:00
Eric Anholt
3353626a6a i965/vs: Enable workaround-free math on gen7.
This is similar to a commit that did the same for the FS.

Shaves several more instructions off of the VS in Lightsmark, but no
statistically significant performance difference (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:51:03 -08:00
Eric Anholt
1fde76b877 i965/vs: Use the embedded-comparison SEL on gen6+, like the FS does.
Shaves a few instructions off of the VS in Lightsmark, but no
statistically significant performance difference on gen7 (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:50:54 -08:00
Matt Turner
06ad64ad29 automake: src/gbm
libgbm.so.1.0.0 (instead of libgbm.so.1.0) is installed now
along with libgbm.so.1 (no change).
2012-01-23 15:18:12 -05:00
Eric Anholt
36473395f1 autoconf: Fix build of dri symbols test to not manually link expat.
AC_CHECK_LIB has this nasty behavior, like the cflags tests, of
automatically putting the tested value into the global LIBS on
success.  This caused -lexpat to end up in LIBS, but without the
--with-expat dir, so my 32-bit build on a 64 system using expat from a
custom prefix could only find the system expat and fail to link on the
one current consumer of the LIBS variable: the dri driver test link.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 11:34:05 -08:00
Kenneth Graunke
c25e5300cb i965: Fix border color on Sandybridge and Ivybridge.
While reading through the simulator, I found some interesting code that
looks like it checks the sampler default color pointer against the bound
set in STATE_BASE_ADDRESS.  On failure, it appears to program it to the
base address itself.

So I decided to try programming a legitimate bound, and lo and behold,
border color worked.

+92 piglits on Sandybridge.  Also fixes Lightsmark on Ivybridge.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-23 10:38:14 -08:00
Jon TURNEY
4e5a8937d1 Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi"
Since we now always build shared glapi, this exposes the fact that libOSMesa was
underlinked when glapi was built shared.

Fix this by doing the same thing as drivers/X11/Makefile already does, ensuring
that the library is linked with the shared glapi library.

(I'm not clear why we link with both glapi.a and glapi.so, so this may be all wrong)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-23 18:24:39 +00:00
Jon TURNEY
0fce6d3a77 Don't build shared dricore when unneeded
Refine "always build shared dricore" so we don't build it if we don't need
it because we aren't actually building any dri drivers because of --disable-driglx-direct

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-23 18:17:48 +00:00
Dave Airlie
d01e166391 r600g: cayman fix integer multiplies
Looks insane, but it does appear we need a full slot per input/output.

This fixes another 180 or so piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 13:59:57 +00:00
Dave Airlie
f01431d035 r600g: cayman initial integer support
Adds all the easier lowhanging opcodes.

Fixes ~3000 piglit tests with GLSL1.30 enabled on cayman.

This just leaves the mul/div/mod ops to fix up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 12:26:19 +00:00
Vadim Girlin
13daa059c0 r600g: fix VS fog export
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 10:01:35 +00:00
Matt Turner
4c84819a1b dri: install dri_interface.h
Broken in commit 129213e7.

Reported-by Kai Wasserbäch <kai@dev.carbon-project.org>
2012-01-22 17:16:02 -05:00
Dave Airlie
b9c706c8c5 r600g: shift integer ops are trans unit only on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:25:38 +00:00
Vadim Girlin
9733a89f6d r600g: replace trans/vector-only instruction lists with ranges (v2)
airlied : assert on cayman cases to keep compiler happy

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:13:00 +00:00
Dave Airlie
38ffc23e7b Revert "r600g: replace trans/vector-only instruction lists with ranges"
This reverts commit 946309067c.

Until we check the cayman bits out properly
2012-01-22 17:09:54 +00:00
Dave Airlie
a9d8809f16 r600g: srgb mode is only valid on certain format types.
"If set, forces degamma on XYZ if format is
FMT_8_8_8_8, FMT_BC1, FMT_BC2, or FMT_BC3"

Don't claim support for sRGB on any other formts.

This fixes glean texture_srgb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:53:46 +00:00
Dave Airlie
9783bba9bd r600g: initial cube shadow sampling
It doesn't pass the piglit test, but it seems to be a lot closer
than it was before. I need to track down if there is another problem.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:17:47 +00:00
Vadim Girlin
840a342cd0 r600g: take into account kcache banks for bank swizzle check
Due to the changes for multiple kcache banks support, now we are assigning
final SRCx_SEL values for kcache access at the later stage, when building the
bytecode. So we need to take into account kcache banks to distinguish
the constants with the same address but different bank index.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
60bf0f05b4 r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
946309067c r600g: replace trans/vector-only instruction lists with ranges
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Vadim Girlin
cb15783364 r600g: fix some interpolation tests for evergreen
Same fix as previously done by Dave Airlie for r600/r700

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Matt Turner
fd827a8d3e configure.ac: use AC_PROG_MKDIR_P
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45057
2012-01-21 22:43:54 -05:00
Matt Turner
d387899388 Remove src/mesa/ppc
It didn't actually do anything except modify the GL_RENDERER string.
2012-01-21 22:43:54 -05:00
Andrei Slăvoiu
309ba0cfa2 Fix mistake in 349845f7b 2012-01-21 11:36:26 -05:00
Vadim Girlin
54e8dcaad6 r600g: implement clip vertex v2
Clip planes are uploaded as a constant buffer and used by the vertex
shader to produce corresponding clip distances for hw clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Vadim Girlin
d649bf51ec r600g: improve kcache line sets handling v2
Add support for multiple kcache banks (constant buffers).
Lock the required lines only.
Allow up to 4 kcache line sets in the alu clause by using ALU_EXTENDED on eg+.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Dave Airlie
261dc72fe3 r600g: no need to do CUBE coordinate handling for TXQ.
Fixes texSize on cube.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 22:17:25 +10:00
Vadim Girlin
8b1471f8ca r600g: make INTERP_LOAD_P0 vector-only
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 11:07:22 +00:00
Vinson Lee
e9bcf4d56b glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning on non-debug builds.
glsl_types.cpp: In member function 'gl_texture_index
glsl_type::sampler_index() const':
glsl_types.cpp:157: warning: control reaches end of non-void function

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-20 23:53:59 -08:00
Alex Deucher
d6cd514edb r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Alex Deucher
90b36b50f5 r600g: update streamout support for virtual addresses
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Matt Turner
687a7302a5 Remove reference to now deleted dri/Makefile.targets 2012-01-20 16:54:12 -05:00
Matt Turner
129213e7a2 automake: src/mesa/drivers/dri 2012-01-20 15:54:08 -05:00
Matt Turner
349845f7b2 automake: src/mesa/drivers/dri/swrast 2012-01-20 15:54:08 -05:00
Matt Turner
3f96434f86 automake: src/mesa/drivers/dri/nouveau 2012-01-20 15:54:08 -05:00
Matt Turner
b38d7a0a24 automake: src/mesa/drivers/dri/r200 2012-01-20 15:54:08 -05:00
Matt Turner
e0ee818e2f automake: src/mesa/drivers/dri/radeon 2012-01-20 15:54:08 -05:00
Matt Turner
3c87dfce40 automake: src/mesa/drivers/dri/i915 2012-01-20 15:54:08 -05:00
Vadim Girlin
c60dcc49e4 r600g: fix streamout on evergreen
Enable it in the evergreen_context_draw if needed.
Same as already done in the r600_context_draw for r6xx/r7xx.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:10:39 -05:00
Vadim Girlin
c97632642a r600g: fix combined MEM_STREAM instructions
BURST_COUNT is clipped with ARRAY_SIZE, so set it to the max value
to avoid clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:09:42 -05:00
Matt Turner
2b3a8cbc89 Always build shared dricore
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
adefee50d9 Always build shared glapi
libglapi.so, libGL.so, libGLESv2.so, libGLESv1_CM.so must all
come from the same version of Mesa or bad things may happen.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
2fdbbeca43 Remove -ffast-math from default CFLAGS
Fixes glsl-const-folding-01. inversesqrt(1.0) != 1.0 was evaluating as
true.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:14 -05:00
Chad Versace
ba5252e590 intel/gen6: Some framebuffers having separate depthstencil should be unsupported
When the framebuffer has separate depth and stencil buffers, and HiZ is
not enabled on the depth buffer, mark the framebuffer as unsupported. This
happens when trying to create a framebuffer with Z16/S8 because we haven't
enabled HiZ on Z16 yet.

Fixes gles2conform test stencil8.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44948
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed--by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:37:19 -08:00
Chad Versace
f74d8aacbf mesa: Loosen glBlitFramebuffer restrictions on depthstencil buffers (v2)
This loosens the format validation in glBlitFramebuffer. When blitting
depth bits, don't require an exact match between the depth formats; only
require that the two formats have the same number of depth bits and the
same depth datatype (float vs uint). Ditto for stencil.

Between S8_Z24 buffers, the EXT_framebuffer_blit spec allows
glBlitFramebuffer to blit the depth and stencil bits separately. So I see
no reason to prevent blitting the depth bits between X8_Z24 and S8_Z24 or
the stencil bits between S8 and S8_Z24. However, we of course don't want
to allow blitting from Z32 to Z32_FLOAT.

Fixes Piglit fbo/fbo-blit-d24s8 on Intel drivers with separate stencil
enabled.

The problem was that, on Intel drivers with separate stencil, the default
framebuffer has separate depth and stencil buffers with formats X8_Z24 and
S8. The test attempts to blit the depth bits from a S8_Z24 buffer into the
default framebuffer.

v2: Check that depth datatypes match.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44665
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:35:49 -08:00
Christoph Bumiller
ab69d584f9 nvc0: fix some limit cap values
NOTE: This is a candidate for the 8.0 branch.
2012-01-20 19:24:31 +01:00
Christoph Bumiller
0d27be3d79 nvc0: handle discontiguous outputs in stream_output_info 2012-01-20 19:24:31 +01:00
Christoph Bumiller
d540af554a mesa: allocate transform_feedback_info::Outputs array dynamically
The nvc0 gallium driver is advertising 128 MAX_INTERLEAVED_COMPS
which made it always assert in the linker when TFB was used since
the Outputs array was smaller than that maximum.

v2: added assertions

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-20 19:24:31 +01:00
Dave Airlie
c96b983403 r600g: fixup AR handling (v5)
So it appears R600s (except rv670) do AR handling different using a different
opcode. This patch fixes up r600g to work properly on r600.

This fixes ~100 piglit tests here (in GLSL1.30 mode) on rv610.

v3: add index_mode as per the docs.

This still fails any dst relative tests for some reason I can't quite see yet,
but it passes a lot more tests than without.

v4: add a nop after dst.rel this could be improved using a second pass,
where we only insert nops if two instructions are sure to collide.
The docs say r600, rv610, rv630 needs this, and not rv670, rs780, rs880,
need AMD to confirm rv620, rv635.

v5: add is_nop_inst.

NOTE: This is a candidate for stable branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-20 17:58:53 +00:00
Brian Paul
0e019cbd1c mesa: include arrayobj.h to silence implicit function declaration warning
Caused by commit 7a1e941ebe.
2012-01-20 10:55:18 -07:00
Mathias Fröhlich
7a1e941ebe mesa: Fix and speedup gl_array_object::_MaxElement computation.
Use a bitmask approach to compute gl_array_object::_MaxElement.
To make this work correctly depending on the shader type actually used,
make use of the newly introduced typed bitmask getters.
With this change I gain about 5% draw time on some osgviewer examples.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:20 +01:00
Mathias Froehlich
2a207c4bf9 mesa: Introduce enabled bitfield helper functions.
Depending on the installed shader type, different arrays are used
from gl_array_object. Provide helper functions that compute
the bitmask of these arrays that are finally enabled for a given
shader type. The will be used in a followup change.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:11 +01:00
Mathias Fröhlich
f60e892c50 mesa: Use BITFIELD64_RANGE for VERT_BIT_*_ALL.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:05 +01:00
Stéphane Marchesin
63dbd3fefb i915g: Fix indentation. 2012-01-19 19:27:34 -08:00
Stéphane Marchesin
2f9df215a2 i915g: Fix indentation and comment. 2012-01-19 19:27:34 -08:00
Paul Berry
4f82fed493 glsl: Fix isinf() for non-C99-compliant compilers.
Commit ede60bc467 (glsl: Add isinf() and
isnan() builtins) uses "+INF" in the .ir file to represent infinity.
This worked on C99-compliant compilers, since the s-expression reader
uses strtod() to read numbers, and C99 requires strtod() to understand
"+INF".  However, it didn't work on non-C99-compliant compilers such
as MSVC.

This patch modifies the s-expression reader to explicitly check for
"+INF" rather than relying on strtod() to support it.

This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44767
Tested-by: Morgan Armand <morgan.devel@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-19 18:45:22 -08:00
Alex Deucher
5e576efef2 r600g: fix typo in evergreen register
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-19 21:09:20 -05:00
Brian Paul
7f2e12812a svga: move svga_texture() casts/calls in svga_surface_copy()
To fix failed assertions when calling glCopyBufferSubData().

svga_texture() asserts that the resource is a texture.  Simply move the
calls to svga_texture() after the code that handles non-texture copies
so that we don't call it with non-texture resources.

Fixes glean bufferObject failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 16:23:12 -07:00
Brian Paul
fdae0eaf22 st/mesa: copy num_immediates field when copying the immediates array
Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area.  Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 15:12:14 -07:00
Ian Romanick
f0ea46790f mesa: Set default access flags based on the run-time API
The default access flags for OpenGL ES (via GL_OES_map_buffer) and
desktop OpenGL are different.  The code previously tried to handle
this, but the decision was made at compile time.  Since the same
driver binary can be used for both OpenGL ES and desktop OpenGL, the
decision must be made at run-time.

This should fix bug #44433.  It appears that the test case does
various map and unmap operations and inspects the state of the buffer
object around each.  When it sees that GL_BUFFER_ACCESS does not match
its expectations, it fails.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44433
2012-01-19 09:34:01 -08:00
Brian Paul
75f37ddba7 st/mesa: add fallback pipe formats for (compressed) R, RG formats
If we don't find an exact PIPE_FORMAT_x for a GL_(COMPRESSED)_RED/RG format,
try uncompressed formats.  We were already doing this for the RGB(A) formats.

Fixes piglit arb_texture_compression-internal-format-query test.

NOTE: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 09:41:30 -07:00
Stéphane Marchesin
32b07bb149 i915g: Don't avoid flushing when we have a pending fence.
Otherwise the fence will never arrive.
Also check for a NULL i915->batch.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Stéphane Marchesin
2b4afdba05 i915g: Don't invert signalled/unsignalled fences
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Kenneth Graunke
dcdfd1905c i965: Fix disassembly of data port writes on Ivybridge.
msg_type moved by a bit, so the message type was being disassembled
incorrectly.  In particular, render target writes were showing up as
"OWORD block write".

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
a608be5d33 i965: Fix disassembly of sampler messages on Ivybridge.
Compared to sampler_gen5, simd_mode shifted by a bit and msg_type grew
by a bit.  So we were printing slightly incorrect numbers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
2e712e41db i965/vs: Take attributes into account when deciding urb_entry_size.
Both the VF and VS share space in the URB.  First, the VF stores
attributes (shader inputs) there.  The VS then reads the attributes,
executes, and reuses the space to store varyings (shader outputs).

Thus, we need to calculate the amount of URB space necessary for inputs,
outputs, and pick whichever is greater.

The old VS backend correctly did this (brw_vs_emit.c:408), but the new
VS backend only considered outputs.

Fixes vertex scrambling in GLBenchmark PRO on Ivybridge.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41318
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 14:42:04 -08:00
Stéphane Marchesin
81da773f84 st/dri: Remove useless flush front.
In the following scenario:
- CreateContext C1
- MakeCurrent C1
- DestroyContext C1 (does not actually destroy the first context, postponed
 until the next MakeCurrent)
 - CreateContext C2
 - MakeCurrent C2
MakeCurrent will call flush on a half destroyed context, leading to crashes.
Since the other paths (destroy and makecurrent) already flush the context,
there is no need to flush here, so we remove this useless flush front call.

This fixes GPU crashes with Chrome and gallium drivers.
2012-01-18 13:22:27 -08:00
Ian Romanick
8a47242755 intel: Set depth to 6 for cubemaps
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41216
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43212
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43250
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Jin Yang <jin.a.yang@intel.com>
2012-01-18 12:48:37 -08:00
Kristian Høgsberg
221c678329 gbm: Validate usage flags in gbm_bo_create_from_egl_image()
The entry point is supposed to validate that the EGLImage is suitable for
the passed in usage flags, but that was never implemented.
2012-01-18 15:32:51 -05:00
Eric Anholt
2f868f1ddd i965: Add support for Z16 depth formats.
v2: Don't flag the format as being HiZ ready (there's DRI2 handshake
    pain to go through).

Fixes piglit gl-3.0-required-sized-texture-formats

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
f0d5c92a4c i965/gen7: Set up surface horizontal alignment field.
This is required for Z16 support for texturing, which is the first
thing to have a horizontal alignment of 8.  Renderbuffers don't need
it, since they're always set up as the only mip level, but do it for
completeness anyway.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
fc767ff590 i965/gen7: Remove stale comment.
This field is actually set up above.

NOTE: This is a candidate for the 8.0 branch, to avoid conflicts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:21 -08:00
Eric Anholt
aad3a46ff4 glsl: Fix leak of linked uniform names at relink/free of the shader_program.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
5a0f395bcf glsl: Fix leak of LinkedTransformFeedback.Varyings.
I copy-and-pasted the thing I was allocating for as the context, so
the first time it would be NULL (root of a ralloc context) and they'd
chain off each other from then on.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
0f68d88034 mesa: Fix leak of uniform storage records on shader program link/free.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
cbd464a117 i965: Fix leak of the program cache BO on context destroy.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
7f278e15ad i965/vs: Fix leak of an empty hash_table structure per compile.
This statement got duplicated above, probably in a rebase resolution,
so we never freed the extra one.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b2be486962 i965: Fix refcount leak of the gl_program structure.
Fixes a leak of almost 200kb on a minimal shader_runner program
(algebraic-add-add-1).

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b972744c78 mesa: Make the register allocator allocation take a ralloc context.
This fixes a memory leak on i965 context destruction.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:11 -08:00
Brian Paul
a9eda41539 svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0
The legal range for the device is apparently [-16.0, +15.0].
Limiting the range to [-15, +15] fixes piglit's lodbias test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
fd890873b2 svga: fix min/max lod clamping
The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky.  Changing the base level
didn't work as expected before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
5abcd198b8 svga: add 0.5 in float->int conversion of sample min/max lod
This makes lod clamping more consistent with other drivers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
84c7c14697 st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 10:44:05 -07:00
Brian Paul
64fdfefb9d mesa: use GL_MAP_INVALIDATE_RANGE_BIT in glTexImage paths
Update the dd.h docs to indicate that GL_MAP_INVALIDATE_RANGE_BIT
can be used with GL_MAP_WRITE_BIT when mapping renderbuffers and
texture images.

Pass the flag when mapping texture images for glTexImage, glTexSubImage,
etc.  It's up to drivers whether to actually make use of the flag.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-18 10:44:05 -07:00
Brian Paul
1d7048f12e mesa: try RGBA_FLOAT16 before RGBA_FLOAT32 when choosing A,L,LA,I formats
To try to use less tex memory and maybe get better performance.
Spotted by Roland Scheidegger.

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
7628696004 mesa: fix tex format selection for GL_R32F and other R/G float formats
The i965 driver advertises GL_ARB_texture_float and GL_ARB_texture_rg
support but the ctx->TextureFormatSupported[] table entries for
MESA_FORMAT_R_FLOAT32 and MESA_FORMAT_RGBA_FLOAT32 are false on gen 4
hardware.  So the case for GL_R32F would fail and we'd print an
implementation error.

This patch adds more Mesa tex format options for GL_R32F and other R/G
formats so we fall back to 16-bit formats when 32-bit formats aren't
available.

Eric made the same fix in commit 6216a5b4 for the non R/G formats.

v2: try 16-bit formats before 32-bit formats and try RG formats before
RGBA where possible.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=44039

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
481011ffcd docs: add more potential dependencies for vmware guest driver 2012-01-18 10:44:05 -07:00
Alexander von Gluck IV
5481b5adcf scons: Add more machine architectures to the machine map
* BePC, BeBox, BeMac for Haiku.
* Add sparc architecture as Mesa looks for it.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 16:46:16 +00:00
Dave Airlie
0196433ce5 r600g: fix ISLT on r600/700
This fixes ISLT like evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 22:14:49 +10:00
Dave Airlie
5893e686b6 r600g: make r600/700 use correct ineg.
Noticed by Vadim Girlin on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 21:54:07 +10:00
Dave Airlie
1fc001ea15 r600g: fix some of the interpolation tests.
This enables linear gradients if we need a linear,
it also sets the flat shade flag for color/constant interpolations.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 20:13:16 +10:00
Kenneth Graunke
5acc7f38d4 i965: Bump Ivybridge's fake MRF range to g112-127 instead of g111-126.
When I originally implemented the hack to use GRFs 111+ as fake MRFs, I
did so purely to avoid rewriting all the code that dealt with MRFs.
However, it turns out that a similar hack is actually required.

Newly discovered language in the BSpec indicates that SEND instructions
with EOT set "should" use g112-g127 as their source registers.  Based on
assertions in the simulator, this is actually a requirement on certain
platforms.

Since we're faking MRFs already, we may as well use the officially
sanctioned range.  My guess is that we avoided this issue because we
seldom use m0: URB writes in the new VS backend start at m1, and RT
writes in the new FS backend start at m2.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 00:45:01 -08:00
Kenneth Graunke
bdedd03b70 i965: Remove the INTEL_OLD_VS option.
Now that we no longer generate Mesa IR from GLSL IR, it's impossible to
use the old vertex shader backend for GLSL programs.  There's simply no
Mesa IR to codegen from.

Any attempt to do so would result in immediate GPU hangs, presumably due
to the driver uploading an empty program with no EOT message.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-18 00:45:00 -08:00
Kenneth Graunke
d56ad273c0 mesa: Support GL_VERTEX_ATTRIB_ARRAY_INTEGER in GL 3.0 contexts.
According to Table 6.8 (Page 348) in the OpenGL 3.0 specification,
glGetVertexAttribiv supports GL_VERTEX_ATTRIB_ARRAY_INTEGER.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 00:45:00 -08:00
Vadim Girlin
b69728cba5 r600g: fix UINT_TO_FLT on evergreen
It should be processed as trans-only.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 08:03:41 +00:00
Chad Versace
a6dd4bf5fc i965/gen5: Fix rendering of depth buffers without stencil [v2]
Fixes the following OGLConform tests on gen5:
    depth-stencil(misc.state_on.depth_int)
    fbo_db_ARBfp(basic.OnlyDepthBuffDrawBufferRender)

The problem was that, if the depth buffer's Mesa format was X8_Z24, then
we emitted the hardware format D24_UNORM_X8. But, on gen5, D24_UNORM_S8
must be emitted.

This bug was introduced by:
    commit d84a180417
    Author: Eric Anholt <eric@anholt.net>
    i965: Base HW depth format setup based on MESA_FORMAT, not bpp.

v2: Deref 'intel' directly. Move the branch for newer chipset to top.
    Quote the PRM. As requested by Ken.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43408
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 17:26:45 -08:00
Anuj Phogat
ce1c949b16 intel: Return if pointer to intel_context is null
It is better to test if(intel == NULL) and simply return in that case.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 16:58:38 -08:00
Alex Deucher
46ce25722b r600g: add workaround for original R600 PS setup
The original R600 requires the UNCACHED_FIRST_INST bit
to be set in the PS.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is candidate for the stable branches.
2012-01-17 18:46:46 -05:00
Paul Berry
c03ad08e8d i965: Add .gitignore file to exclude automake build artifacts from git.
With the conversion to automake in commit
e326480e4e, several additional build
artifacts are created:

  src/mesa/drivers/dri/i965/.deps/
  src/mesa/drivers/dri/i965/.libs/
  src/mesa/drivers/dri/i965/Makefile
  src/mesa/drivers/dri/i965/Makefile.in
  src/mesa/drivers/dri/i965/i965_dri.la
  src/mesa/drivers/dri/i965/i965_symbols_test

This patch adds all of these files to .gitignore.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 15:44:26 -08:00
Anuj Phogat
f1a9a9bcd1 mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D()
with width = 0. Texture with zero size skips miptree allocation due to a
condition in function _mesa_store_teximage3d(). While calling glGetTexImage()
it results in assertion failure in intel_map_texture_image() due to null mt
pointer.

This patch fixes the issue by detecting the zero size texture early in
glGetTexImage and glGetCompressedTexImage functions. In such a case function
simply returns doing nothing.
Verified that below mentioned bug is fixed by this patch.

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

NOTE: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-17 15:14:44 -08:00
Alex Deucher
94556f3594 radeon: share common fog code between radeon and r200
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-17 18:09:25 -05:00
Alex Deucher
e77c495d09 radeon: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Alex Deucher
afdd6f8c34 r200: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Dave Airlie
ba59a1a0d8 r600g: fix recip_uint on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 06:53:02 +10:00
Vadim Girlin
7383e754b7 r600g: fix USLT for r600-eg 2012-01-17 15:25:12 -05:00
Alexander von Gluck IV
183133271c scons: Don't set visibility to hidden on Haiku
The Haiku swrast driver is out of tree.
2012-01-17 20:02:41 +00:00
Alexander von Gluck IV
64ae209d50 scons: Add Haiku build support
Enables building stock Mesa under the Haiku operating system.
2012-01-17 20:01:14 +00:00
Vadim Girlin
4ba4853c0a r600g: rework IDIV/UDIV and implement MOD/UMOD (v2)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-17 19:53:20 +00:00
Eric Anholt
7fa5c919b0 mesa: Enable silent automake rules when available.
Finally, a quiet build for the i965 driver, at least!  (Note, you can
still get verbose builds at build-time by saying "make V=1")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 10:35:24 -08:00
Eric Anholt
e326480e4e i965: Convert the build to using automake.
This does introduce a warning by the automake build system, that the
missing-symbols test build is non-portable.  That's true -- Mac OS X
can't take something built as a loadable module and just link it as a
library.  Of course, we aren't building this on OS X at all, so it
would be nice to be able to suppress it, but I haven't found a way.

Still, the build is going to be much quieter than we have ever had
before, so I think this is a fair tradeoff until we find a way to shut
that warning up.

v2: Put a link in /lib to avoid transition pains for people.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2012-01-17 10:35:24 -08:00
Eric Anholt
a14582d7e2 intel: Drop the version override code now that we don't have any left.
Fixes a compiler warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Eric Anholt
ccf0d31a21 intel: Fix warnings of undefined ffs().
For some reason these started showing up with the automake conversion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Scott Moreau
e0897009f8 Complete ARGB8888 naming convention format renames missed 2012-01-17 10:36:12 -05:00
Chad Versace
7e08bf08d1 i965: Fix gen6,gen7 when used with a non-HiZ capable DDX
Nothing works if HiZ is enabled and the DDX is incapable of HiZ (that is,
the DDX version is < 2.16).

The problem is that the refactoring that eliminated
intel_renderbuffer::stencil_rb broke the recovery path in
intel_verify_dri2_has_hiz().  Specifically, it broke line
intel_context.c:1445, which allocates the region for
DRI_BUFFER_DEPTH_STENCIL. That allocation was creating a separate stencil
miptree, despite the buffer being a packed depthstencil buffer. Havoc
ensued.

This patch introduces a bool flag that prevents allocation of that stencil
miptree.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44103
Tested-by: Ian Romanick <idr@freedesktop.org>
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-16 16:38:36 -08:00
Vinson Lee
8e543cc098 softpipe: Silence unused variable warning on non-LLVM builds.
Fix this GCC warning with non-LLVM builds.
sp_screen.c: In function ‘softpipe_get_shader_param’:
sp_screen.c:141:28: warning: unused variable ‘sp_screen’ [-Wunused-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-16 16:13:51 -08:00
Anuj Phogat
dd7220652e intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation
fault in function intelDRI2Flush. All the gl calls should be
ignored after setting the current context to null. So the contents
of framebuffer stay unchanged. But the driver should not seg fault.

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

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Yi Sun <yi.sun@intel.com>
2012-01-16 15:07:17 -08:00
Vinson Lee
6fe133889c llvmpipe: Remove unused variable 'packed' from lp_test_round.
Fix this GCC warning.
lp_test_round.c: In function ‘test_round’:
lp_test_round.c:126:13: warning: variable ‘packed’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:44:06 -08:00
Vinson Lee
eeff1ee746 util: Silence GCC unused-but-set-variable warning.
Fix this GCC 4.6 warning with 64-bit builds.
u_debug_stack.c: In function ‘debug_backtrace_capture’:
u_debug_stack.c:45:17: warning: variable ‘frame_pointer’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:41:55 -08:00
José Fonseca
455090c4c4 vl: Make array initialization portable.
Should fix MSVC build.
2012-01-16 12:21:40 +00:00
Stéphane Marchesin
23d4a0569d i915g: Fix the blending for the A8 destination buffer case.
The i915 GPU can't do A8 dst, so we abuse GREEN8 buffers for that
purpose. However, things get hairy as we start to do blending,
because then GL_DST_*_ALPHA should be replaced with GL_DST_*_COLOR.
This is what we do here.

Fixes piglt fbo-alpha.
2012-01-15 23:39:49 -08:00
Matt Turner
6e9478e382 r200: remove left-over EGL_SOURCES variable
Rest was removed in 2a928899e.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-15 12:09:52 -05:00
Dave Airlie
850021f225 r600g: fix mullo_uint trans slot only on r600/r700
This fixes 8 piglit tests that currently assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:53:41 +00:00
Vadim Girlin
91d4729696 r600g: implement clip distances
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:42 +00:00
Vadim Girlin
725a820b92 r600g: implement two-sided lighting (v3)
v2: select the colors in the pixel shader

v3: fix rs state creation for pre-evergreen

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:41 +00:00
Vadim Girlin
d84ab821c5 r600g: add support for ISHR/USHR/SHL on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
332e1d6d84 r600g: implement IDIV/UDIV on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
42539d569a r600g: implement ISSG on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
6b44470bb2 r600g: implement IABS on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
beb297f284 r600g: implement F2U on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
5d97c5033b r600g: add FLT_TO_UINT opcode for evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Vadim Girlin
a9302de4a3 r600g: fix F2I on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Christian König
2eabd05b75 vl: fix YV12 handling
We actually implemented YV21 instead of YV12, so fix the plane ordering.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
020a6f6cd8 st/vdpau: recreate video buffer if decode doesn't like it
Recreate the video buffer if the decoder can't handle it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
4a4811ea17 st/vdpau: recreate video buffer if format doesn't match
Recreate the video buffer in PutBitsYCbCr if the format doesn't match.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9d9afcb5ba vl: reintroduce PIPE_VIDEO_CAP_PREFERED_FORMAT
Create the video buffers in the format the driver preffers.
This temporary creates problems with decoder less VDPAU video playback.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
d6aa0ad55d vl: add h264 infrastructure
No implementation so far, just the defines for
VDPAUs picture info structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
8ea416f35d vl: move away from state like parameters
Again based on Maartens work, but keep begin_frame
and end_frame functions for now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9af70c90db vl/video_buffer: add support for interlaced buffers
Add the infrastructure, but not the decode implementation.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
12b49ca2df vl/video_buffer: improve constructor
Add a second extened constructor that takes plane
textures for the video buffer. Also provide a
function for texture templates.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
e027759336 vl/video_buffer: use template style create params
Just like in the rest of gallium, this reduces the
number of parameters significantly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Dave Airlie
39491d1d31 r600g: vertex id support.
This requires GLSL 1.30 enabled, which requires integer types enabled,
so don't bother doing an INT to FLT conversion on it.

We should probably remove the instance id flt->int conversion when
turning on native integers.

this passes the three piglit tests with GLSL 1.30 forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Dave Airlie
9a401a2fd6 r600g: make u2f trans only
as per the r600 isa doc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Lucas Stach
c82879a071 nvfx: random cleanups of the state validation code
Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:47 +01:00
Lucas Stach
bf8daf1c0a nvfx: drop render temporaries code
This code is unneeded now, we don't use render temps any more.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:05 +01:00
Lucas Stach
f428ae6f72 nvfx: rework state_fb code to get rid of render temps
This commit rewrites a lot of the state_fb code to support
rendering to targets not aligned to 64 byte.

This allows us to drop the render temporaries as unaligned
targets are the only use-case where they are really needed. The
temporaries code was used for a lot of things more, but apparently
those also work without temps.

There is one regression in piglit fbo-clear-formats, but this will
be fixed with the use of real hardware clears and doesn't matter in
practice as no real application tries to scissor clear a 2x2 pixel
render target.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:41 +01:00
Lucas Stach
7f918683c4 nvfx: say no to stream output caps
nvfx doesn't support any kind of stream out, so silence the
unused cap warnings.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:03 +01:00
Marek Olšák
5596db7411 mesa: update compute_version for GL3
only check ARB_fbo, add shader_texture_lod as a requirement

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-15 07:29:48 +01:00
Marek Olšák
2449695e82 gallium: improve the pipe_stream_output_info struct (v2)
There are 3 changes:

1) stride is specified for each buffer, not just one, so that drivers don't
   have to derive it from the outputs

2) new per-output property dst_offset, which specifies the offset
   into the buffer in dwords where the output should be stored,
   so that drivers don't have to compute the offsets manually;
   this will also be useful for gl_SkipComponents
   from ARB_transform_feedback3

3) register_mask is removed, instead, there is start_component
   and num_components; register_mask with non-consecutive 1s
   doesn't make much sense (some hardware cannot do packing of components)

Christoph Bumiller: fixed nvc0.

v2: resolve merge conflicts in Draw and clean it up
2012-01-15 07:28:35 +01:00
Dave Airlie
faa90abfe0 r600g: add r600 version of UINT_TO_FLT conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 22:03:28 +00:00
Dave Airlie
bfcffd4d72 r600g: fix r600 f2i to be trans only emitted.
This fixes a lot of asserts about the trans unit being used already.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 19:59:51 +00:00
Dave Airlie
55bd1c8365 r600g: add missing case for uint->flt conversion.
fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:50:43 +00:00
Dave Airlie
5250bd00c0 r600g: add missing r32 uint/sint fbo formats.
Fixes the GL3 required formats test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:42:42 +00:00
Jerome Glisse
bb1f0cf350 r600g: add support for virtual address space on cayman v11
Virtual address space put the userspace in charge of their GPU
address space. It's up to userspace to bind bo into the virtual
address space. Command stream can them be executed using the
IB_VM chunck.

This patch add support for this configuration. It doesn't remove
the 64K ib size limit thought this limit can be extanded up to
1M for IB_VM chunk.

v2: fix rendering
v3: fix rendering when using index buffer
v4: make vm conditional on kernel support add basic va management
v5: catch the case when we already have va for a bo
v6: agd5f: update on top of ioctl changes
v7: agd5f: further ioctl updates
v8: indentation cleanup + fix non cayman
v9: rebase against lastest mesa + improvement from Marek & Michel
v10: fix cut/paste bug
v11: don't rely on updated radeon_drm.h

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-13 18:00:53 -05:00
Roland Scheidegger
6c2c2c5a07 scons: Fix libGL.so build. 2012-01-13 22:39:14 +01:00
Brian Paul
548526f2e9 docs: add links to xf86-video-vmware wiki pages 2012-01-13 13:46:27 -07:00
Chad Versace
e13c99a004 i965: Comment gen6_hiz_get_framebuffer_enum()
Make the comments precise. Explain why each branch is needed and correct.
Document the potential pitfall in the true-branch.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:26:01 -08:00
Neil Roberts
9462b84478 gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES
When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer
with GL_DRAW_FRAMEBUFFER will report a 'user error' because
get_framebuffer_target validates that this enum from the framebuffer
blit extension is only used on GL. To work around it this patch makes
it use the GL_FRAMEBUFFER enum instead in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:06:30 -08:00
Brian Paul
27915708ed docs: new page describing how to build, install VMware SVGA3D guest driver 2012-01-13 10:54:58 -07:00
Brian Paul
b0af16abf1 mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()
The AL44 format occupies one byte, not two.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:51:28 -07:00
Brian Paul
540a8b2cfd osmesa: fix renderbuffer format selection
The gl_renderbuffer::Format field wasn't always set properly.  This
didn't matter much in the past but with the recent swrast/renderbuffer
mapping changes, core Mesa will be directly touching OSMesa colorbuffers
so using the right MESA_FORMAT_x value is important.

Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa
format/type combinations, such as GL_FLOAT / OSMESA_ARGB.  If anyone
runs into these we can add new Mesa formats.

v2: add warnings for unsupported formats, fix ARGB_REV mix-up.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:50:33 -07:00
Brian Paul
0c14bbbc86 docs: freshen up the introduction page with Mesa 8.0 info, etc 2012-01-13 09:50:33 -07:00
Tom Stellard
9611237051 gallivm: Allow target specific intrinsics in lp_declare_intrinsic()
Target specific intrinsics are also prefixed with llvm, so this assert
was preventing us from using them.
2012-01-13 11:45:49 -05:00
Rob Bradford
baab68e1a6 gbm: Add documentation for the public facing API 2012-01-13 09:31:24 -05:00
Rob Bradford
d036354105 doxygen: Add link to the gbm documentation to the header 2012-01-13 09:31:24 -05:00
Rob Bradford
245341f406 doxygen: Add doxygen file and build infrastructure for gbm 2012-01-13 09:31:23 -05:00
Vinson Lee
3e18ad7fd7 i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:19:34 -08:00
Paul Berry
fcd5af4a91 i965: Set pitch of pull constant buffers to 16.
We always access pull constant buffers using the message types "OWord
Block Read" or "OWord Dual Block Read".  According to the Sandy Bridge
PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:

    "the surface pitch is ignored, the surface is treated as a
    1-dimensional surface.  An element size (pitch) of 16 bytes is
    used to determine the size of the buffer for out-of-bounds
    checking if using the surface state model."

Previously we were setting the pitch for pull constant buffers to the
size of the whole constant buffer--this made no sense and would have
led to incorrect behavior if it were not for the fact that the pitch
is ignored.

For clarity, this patch sets the pitch for pull constant buffers to 16
bytes, consistent with the hardware's behavior.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Paul Berry
f6f43bd5a2 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Christoph Bumiller
af0ce1dba8 nv50/ir: make use of TGSI_INTERPOLATE_COLOR
Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Christoph Bumiller
7b6881932a nvc0: fix submission of VertexID and EdgeFlag in push mode
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Brian Paul
cb254b75d7 osmesa: fix glReadPixels, etc
Needed to implement the Map/UnmapRenderbuffer() driver hooks.
This fixes glRead/Draw/CopyPixels, etc.

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

Note: This is a candidate for the 8.0 branch.

Tested-by: Kevin Hobbs <hobbsk@ohiou.edu>
2012-01-12 13:49:15 -07:00
Brian Paul
062a4b601e intel: move declaration before code 2012-01-12 13:49:15 -07:00
Brian Paul
6dbdc03956 intel: fix mapping of malloc'd renderbuffers
This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.

v2: apply x/y offset to returned pointer

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-12 13:49:15 -07:00
Eric Anholt
9be6654c1f mesa: Throw the required error for glCopyPixels from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:20 -08:00
Eric Anholt
6950a4faf6 mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:18 -08:00
Eric Anholt
86b7c6707f mesa: Throw the required error for glReadPixels() from a multisampled FBO.
Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:15 -08:00
Eric Anholt
0e8d156c3c mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.
Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:13 -08:00
Eric Anholt
f83756f80f meta: Add GL_RED/GL_RG support to meta CopyTexImage.
Fixes some _mesa_problem()s in oglconform.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:10 -08:00
Eric Anholt
e6d6a10c5a i965/gen7: Fix depth buffer rendering to tile offsets.
Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer.  This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer.  This is great -- we get a range that should actually
match what we want.  However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present.  Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
    spec/ARB_depth_buffer_float/fbo-clear-formats
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:33:55 -08:00
Brian Paul
003dd8adf3 mesa: remove incorrect (float) cast in mipmap do_row()
The array holds GLuint values so remove the float cast.
Note, however, that to compute the average of four GLuints we really
want to do (a+b+c+d)/4 but that could overflow.  This change doesn't
address that for now.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:55 -07:00
Brian Paul
706400f0a7 swrast: use BITFIELD64_BIT() macro to fix MSVC warnings
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:50 -07:00
Brian Paul
decd018b99 mesa: fix ir_variable declaration
ir_variable is a class, not a struct.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:44 -07:00
Brian Paul
a240c998ac mesa: fix incorrect float vs. int values in a few places
In the first case, the newImage[] array contains GLuint values.
In the second case, the parameter type is GLuint, but the maxDepth
value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
Pass ~OU just to be safe.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:19 -07:00
Brian Paul
2f0fa456e3 meta: fix incorrect argument order in setup_texture_coords() call
And pass integer width, height values.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:01:59 -07:00
Brian Paul
36ede89687 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:58:45 -07:00
Brian Paul
185ee042ac mesa: whitespace, 80-column wrapping in buffers.c 2012-01-12 09:23:55 -07:00
Brian Paul
45a3b54063 mesa: remove obsolete comment on _mesa_dest_buffer_exists() 2012-01-12 09:23:55 -07:00
Brian Paul
50ad155d48 st/mesa: whitespace fixes, 80-column wrapping 2012-01-12 09:23:55 -07:00
Brian Paul
eab036a6ea mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions
We include both imports.h and u_math.h in the state tracker.  This
leads to multiple, conflicting definitions of ffs() with MSVC.
Use FFS_DEFINED to skip the ffs() in u_math.h.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:18:34 -07:00
Brian Paul
8cfaab59e0 st/mesa: re-order #includes in st_manager.c
include mesa headers before gallium headers to avoid problem with
ffs() being defined in u_math.h and then again in imports.h

The next commit will add some #ifdefs to prevent multiple definitions
of ffs().
2012-01-12 08:39:17 -07:00
Brian Paul
0c57323de8 sofpipe: remove extraneous semicolon 2012-01-12 08:30:52 -07:00
Brian Paul
9f2963b631 st/mesa: fix struct vs. class compilation warning
glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 08:29:16 -07:00
Dave Airlie
3e044bcc4b r600g: don't advertise integers yet on r600.
Still some work to be done before this is finished.

This is a candidate for 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 15:06:24 +00:00
Brian Paul
c7188ece0e configs: fix, simplify RADEON_LIBS, RADEON_CFLAGS
Fixes build problems with the r200, radeon drivers.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 07:54:19 -07:00
Brian Paul
9a548c27aa mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
2012-01-12 07:30:58 -07:00
Thomas Hellstrom
87118d84ff configure: Add the svga gallium driver to the default gallium drivers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
Thomas Hellstrom
8a4f7d1cdc st/xa: Bump version to 1.0.0 according to the README
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
José Fonseca
ce2929dde0 svga: Fix user clip planes.
Dirty flags also need to be updated in face of recent interface change.

Fixes regression in compiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 12:05:31 +00:00
Dave Airlie
16b5fda032 softpipe: bump max texture array layers to 256.
This as per GL3 specification.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 11:17:07 +00:00
Thomas Hellstrom
4dac89d92c gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 11:20:16 +01:00
Brian Paul
90d654b09d vbo: fix breakage from previous commit
Don't know how that slipped by.
2012-01-11 20:23:12 -07:00
Brian Paul
bbc74ffad6 vbo: fix void * arithmetic compilation error on MSVC
Also, call vbo_sizeof_ib_type() once and fix argument cast in
MapBufferRange() call.
2012-01-11 20:05:02 -07:00
Marek Olšák
4c0d88c145 docs/GL3: consolidate FBO extensions into one ARB 2012-01-12 03:59:21 +01:00
Marek Olšák
571e1947d0 docs/GL3: document r300 extension support 2012-01-12 03:59:21 +01:00
Marek Olšák
272896b885 docs/GL3: document what's missing for GL3 2012-01-12 03:59:21 +01:00
Yuanhan Liu
42d4972bf0 vbo: introduce vbo_get_minmax_indices function
Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
    vbo_get_minmax_index() instead.

    Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
    structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 10:47:41 +08:00
Brian Paul
459a44460e mesa: remove const qualifier from fProg to silence warning
The args to _mesa_reference_shader_program() can't be const.
2012-01-11 18:22:17 -07:00
Brian Paul
fe1b38960b mesa: include uniforms.h to silence warning, remove unused var 2012-01-11 18:22:17 -07:00
2462 changed files with 224384 additions and 280857 deletions

11
.dir-locals.el Normal file
View File

@@ -0,0 +1,11 @@
((nil
(indent-tabs-mode . nil)
(tab-width . 8)
(c-basic-offset . 3)
(c-file-style . "stroustrup")
(fill-column . 78)
(eval . (progn
(c-set-offset 'innamespace '0)
(c-set-offset 'inline-open '0)))
)
)

View File

@@ -1,10 +0,0 @@
;; -*- emacs-lisp -*-
;;
;; This file is processed by the dirvars emacs package. Each variable
;; setting below is performed when this dirvars file is loaded.
;;
indent-tabs-mode: nil
tab-width: 8
c-basic-offset: 3
kde-emacs-after-parent-string: ""
evaluate: (c-set-offset 'inline-open '0)

9
.gitignore vendored
View File

@@ -2,6 +2,8 @@
*.dll
*.exe
*.ilk
*.la
*.lo
*.o
*.obj
*.os
@@ -19,9 +21,11 @@
*~
depend
depend.bak
bin/ltmain.sh
lib
lib64
configure
configure.lineno
autom4te.cache
aclocal.m4
config.log
@@ -30,5 +34,10 @@ cscope*
.scon*
config.py
build
libtool
manifest.txt
Makefile.in
.dir-locals.el
.deps/
.libs/
/Makefile

View File

@@ -40,14 +40,16 @@ LOCAL_CFLAGS += \
-DANDROID_VERSION=0x0$(major)0$(minor)
LOCAL_CFLAGS += \
-DPTHREADS \
-DHAVE_PTHREAD=1 \
-fvisibility=hidden \
-Wno-sign-compare
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += \
-DUSE_X86_ASM
-DUSE_X86_ASM \
-DHAVE_DLOPEN \
endif
endif

View File

@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g nouveau r300g r600g vmwgfx
# gallium drivers: swrast i915g nouveau r300g r600g radeonsi vmwgfx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -37,7 +37,7 @@ DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g nouveau r300g r600g vmwgfx
gallium_drivers := swrast i915g nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))

263
Makefile
View File

@@ -1,263 +0,0 @@
# Top-level Mesa makefile
TOP = .
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
all: default
doxygen:
cd doxygen && $(MAKE)
check:
cd src/glsl/tests/ && ./optimization-test
make -C tests check
clean:
-@touch $(TOP)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
realclean: clean
-rm -rf lib*
-rm -f $(TOP)/configs/current
-rm -f $(TOP)/configs/autoconf
-rm -rf autom4te.cache
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
distclean: realclean
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
.PHONY: default doxygen clean realclean distclean install check
# If there's no current configuration file
$(TOP)/configs/current:
@echo
@echo
@echo "Please choose a configuration from the following list:"
@ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
@echo
@echo "Then type 'make <config>' (ex: 'make linux-x86')"
@echo
@echo "Or, run './configure' then 'make'"
@echo "See './configure --help' for details"
@echo
@echo "(ignore the following error message)"
@exit 1
# Rules to set/install a specific build configuration
aix \
aix-64 \
aix-64-static \
aix-gcc \
aix-static \
autoconf \
bluegene-osmesa \
bluegene-xlc-osmesa \
catamount-osmesa-pgi \
darwin \
darwin-fat-32bit \
darwin-fat-all \
freebsd \
freebsd-dri \
freebsd-dri-amd64 \
freebsd-dri-x86 \
hpux10 \
hpux10-gcc \
hpux10-static \
hpux11-32 \
hpux11-32-static \
hpux11-32-static-nothreads \
hpux11-64 \
hpux11-64-static \
hpux11-ia64 \
hpux11-ia64-static \
hpux9 \
hpux9-gcc \
irix6-64 \
irix6-64-static \
irix6-n32 \
irix6-n32-static \
irix6-o32 \
irix6-o32-static \
linux \
linux-i965 \
linux-alpha \
linux-alpha-static \
linux-debug \
linux-dri \
linux-dri-debug \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-dri-xcb \
linux-egl \
linux-indirect \
linux-fbdev \
linux-ia64-icc \
linux-ia64-icc-static \
linux-icc \
linux-icc-static \
linux-llvm \
linux-llvm-debug \
linux-opengl-es \
linux-osmesa \
linux-osmesa-static \
linux-osmesa16 \
linux-osmesa16-static \
linux-osmesa32 \
linux-ppc \
linux-ppc-static \
linux-profile \
linux-sparc \
linux-sparc5 \
linux-static \
linux-ultrasparc \
linux-tcc \
linux-x86 \
linux-x86-debug \
linux-x86-32 \
linux-x86-64 \
linux-x86-64-debug \
linux-x86-64-profile \
linux-x86-64-static \
linux-x86-profile \
linux-x86-static \
netbsd \
openbsd \
osf1 \
osf1-static \
solaris-x86 \
solaris-x86-gcc \
solaris-x86-gcc-static \
sunos4 \
sunos4-gcc \
sunos4-static \
sunos5 \
sunos5-gcc \
sunos5-64-gcc \
sunos5-smp \
sunos5-v8 \
sunos5-v8-static \
sunos5-v9 \
sunos5-v9-static \
sunos5-v9-cc-g++ \
ultrix-gcc:
@ if test -f configs/current -o -L configs/current; then \
if ! cmp configs/$@ configs/current > /dev/null; then \
echo "Please run 'make realclean' before changing configs" ; \
exit 1 ; \
fi ; \
else \
cd configs && rm -f current && ln -s $@ current ; \
fi
$(MAKE) default
# Rules for making release tarballs
PACKAGE_VERSION=8.0-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
tests/Makefile.in \
tests/glx/Makefile.in \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h
IGNORE_FILES = \
-x autogen.sh
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip \
tarballs: md5
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
ACLOCAL_FLAGS =
AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
manifest.txt: .git
( \
ls -1 $(EXTRA_FILES) ; \
git ls-files $(IGNORE_FILES) \
) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
../$(PACKAGE_DIR):
ln -s $(PWD) $@
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
rm -f $(PACKAGE_NAME).zip ; \
cd .. ; \
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

185
Makefile.am Normal file
View File

@@ -0,0 +1,185 @@
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4
doxygen:
cd doxygen && $(MAKE)
check-local:
$(MAKE) -C src/mapi/glapi/tests check
$(MAKE) -C src/mapi/shared-glapi/tests check
$(MAKE) -C src/mesa/main/tests check
$(MAKE) -C src/glsl/tests check
$(MAKE) -C src/glx/tests check
clean-local:
-@touch $(top_builddir)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(top_builddir)/configs/current || rm -f $(top_builddir)/configs/current
distclean-local:
-rm -rf lib*
-rm -f $(top_builddir)/configs/current
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
.PHONY: doxygen
# Rules for making release tarballs
PACKAGE_VERSION=9.0.1
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
bin/ar-lib \
bin/compile \
bin/config.sub \
bin/config.guess \
bin/depcomp \
bin/install-sh \
bin/ltmain.sh \
bin/missing \
bin/ylwrap \
src/glsl/glsl_parser.cc \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cc \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/main/api_exec_es1.c \
src/mesa/main/api_exec_es1_dispatch.h \
src/mesa/main/api_exec_es1_remap_helper.h \
src/mesa/main/api_exec_es2.c \
src/mesa/main/api_exec_es2_dispatch.h \
src/mesa/main/api_exec_es2_remap_helper.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h \
src/gallium/drivers/r600/Makefile.in \
src/gallium/drivers/r300/Makefile.in \
src/gallium/drivers/Makefile.in \
src/gallium/Makefile.in \
src/gallium/auxiliary/pipe-loader/Makefile.in \
src/gallium/targets/opencl/Makefile.in \
src/gallium/state_trackers/clover/Makefile.in \
src/mapi/glapi/tests/Makefile.in \
src/mapi/glapi/Makefile.in \
src/mapi/glapi/gen/Makefile.in \
src/mapi/es1api/Makefile.in \
src/mapi/shared-glapi/tests/Makefile.in \
src/mapi/shared-glapi/Makefile.in \
src/mapi/vgapi/Makefile.in \
src/mapi/es2api/Makefile.in \
src/glsl/tests/Makefile.in \
src/glsl/glcpp/Makefile.in \
src/glsl/Makefile.in \
src/gtest/Makefile.in \
src/egl/drivers/Makefile.in \
src/egl/drivers/glx/Makefile.in \
src/egl/drivers/dri2/Makefile.in \
src/egl/Makefile.in \
src/egl/main/Makefile.in \
src/egl/wayland/Makefile.in \
src/egl/wayland/wayland-drm/Makefile.in \
src/egl/wayland/wayland-egl/Makefile.in \
src/Makefile.in \
src/glx/tests/Makefile.in \
src/glx/Makefile.in \
src/gbm/Makefile.in \
src/mesa/drivers/Makefile.in \
src/mesa/drivers/dri/common/Makefile.in \
src/mesa/drivers/dri/i965/Makefile.in \
src/mesa/drivers/dri/r200/Makefile.in \
src/mesa/drivers/dri/Makefile.in \
src/mesa/drivers/dri/radeon/Makefile.in \
src/mesa/drivers/dri/swrast/Makefile.in \
src/mesa/drivers/dri/nouveau/Makefile.in \
src/mesa/drivers/dri/i915/Makefile.in \
src/mesa/drivers/osmesa/Makefile.in \
src/mesa/drivers/x11/Makefile.in \
src/mesa/Makefile.in \
src/mesa/libdricore/Makefile.in \
src/mesa/x86-64/Makefile.in \
src/mesa/main/tests/Makefile.in \
src/mesa/x86/Makefile.in \
Makefile.in
IGNORE_FILES = \
-x autogen.sh
parsers: configure
-@touch $(top_builddir)/configs/current
$(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
( \
ls -1 $(EXTRA_FILES) ; \
git ls-files $(IGNORE_FILES) \
) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
../$(PACKAGE_DIR):
ln -s $(PWD) $@
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
rm -f $(PACKAGE_NAME).zip ; \
cd .. ; \
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -3,17 +3,11 @@
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
SRCDIR=`(cd "$srcdir" && pwd)`
ORIGDIR=`pwd`
if test "x$SRCDIR" != "x$ORIGDIR"; then
echo "Mesa cannot be built when srcdir != builddir" 1>&2
exit 1
fi
MAKEFLAGS=""
cd "$srcdir"
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure "$@"

10
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,10 @@
# These commits were cherry picked without using -x.
# TBD
# Causes too many regressions...
413c4914129cd26ca87960852d8c0264c0fb29e7 intel: Improve teximage perf for Google Chrome paint rects (v3)
b1d0fe022dc4826dadce014ab8fe062a82f75a16 intel: Fix segfault in intel_texsubimage_tiled_memcpy
b5891286202987dfc2606ac716050c0ee426de11 intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy
# Introduces performance regressions for other games... don't cherry-pick for now
fa58644855e44830e0b91dc627703c236fa6712a r600g: fix abysmal performance in Reaction Quake

6
bin/.gitignore vendored
View File

@@ -1,2 +1,8 @@
config.guess
config.sub
install-sh
/depcomp
/missing
ylwrap
compile
ar-lib

View File

@@ -1,48 +0,0 @@
#!/bin/bash -e
usage()
{
echo "Usage: $0 <target1> <target2>"
echo "Highlight differences between Mesa configs"
echo "Example:"
echo " $0 linux linux-x86"
}
die()
{
echo "$@" >&2
return 1
}
case "$1" in
-h|--help) usage; exit 0;;
esac
[ $# -lt 2 ] && die 2 targets needed. See $0 --help
target1=$1
target2=$2
topdir=$(cd "`dirname $0`"/..; pwd)
cd "$topdir"
[ -f "./configs/$target1" ] || die Missing configs/$target1
[ -f "./configs/$target2" ] || die Missing configs/$target2
trap 'rm -f "$t1" "$t2"' 0
t1=$(mktemp)
t2=$(mktemp)
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t1
TOP = .
include \$(TOP)/configs/$target1
default:
EOF
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t2
TOP = .
include \$(TOP)/configs/$target2
default:
EOF
diff -pu -I'^#' $t1 $t2

1555
bin/config.guess vendored

File diff suppressed because it is too large Load Diff

1685
bin/config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +0,0 @@
#!/bin/sh
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

29
bin/get-pick-list.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
# Script for generating a list of candidates for cherry-picking to a stable branch
# Grep for commits with "cherry picked from commit" in the commit message.
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
grep "cherry picked from commit" |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
if [ -f bin/.cherry-ignore ] ; then
if grep -q ^$sha bin/.cherry-ignore ; then
continue
fi
fi
# Check to see if it has already been picked over.
if grep -q ^$sha already_picked ; then
continue
fi
git log -n1 --pretty=oneline $sha | cat
done
rm -f already_picked

View File

@@ -1 +0,0 @@
minstall

View File

@@ -319,6 +319,25 @@ case $ARCH in
fi
fi
# Check if objects are 32-bit and we're running in 64-bit
# environment. If so, pass -m32 flag to linker.
add_abi_flag_to_opts() {
case $(file $1) in
*32-bit*x86-64*)
# x86_64 x32 ABI.
OPTS="-mx32 ${OPTS}"
;;
*64-bit*x86-64*)
# x86_64 64-bit ABI.
OPTS="-m64 ${OPTS}"
;;
*32-bit*Intel*)
# x86 32-bit ABI.
OPTS="-m32 ${OPTS}"
;;
esac
}
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
@@ -330,13 +349,8 @@ case $ARCH in
;;
esac
# Check if objects are 32-bit and we're running in 64-bit
# environment. If so, pass -m32 flag to linker.
set ${OBJECTS}
ABI32=`file $1 | grep 32-bit`
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
# Check to see if we are building for a different ABI.
add_abi_flag_to_opts ${OBJECTS}
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -387,13 +401,9 @@ case $ARCH in
# exptmp is removed below
fi
# Check if objects are 32-bit and we're running in 64-bit
# environment. If so, pass -m32 flag to linker.
set ${OBJECTS}
ABI32=`file $1 | grep 32-bit`
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
# Check to see if we are building for a different ABI.
add_abi_flag_to_opts ${OBJECTS}
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi

23
bin/shortlog_mesa.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
typeset -i in_log=0
git shortlog $* | while read l
do
if [ $in_log -eq 0 ]; then
echo '<p>'$l'</p>'
echo '<ul>'
in_log=1
elif echo "$l" | egrep -q '^$' ; then
echo '</ul>'
echo
in_log=0
else
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
echo ' <li>'${mesg}'</li>'
fi
done

View File

@@ -1,17 +0,0 @@
#!/usr/bin/make -sf
# Print the various Mesa version fields. This is mostly used to add the
# version to configure.
# This reflects that this script is usually called from the toplevel
TOP = .
include $(TOP)/configs/default
version:
@echo $(MESA_VERSION)
major:
@echo $(MESA_MAJOR)
minor:
@echo $(MESA_MINOR)
tiny:
@echo $(MESA_TINY)

View File

@@ -31,9 +31,15 @@ _machine_map = {
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'BePC': 'x86',
'Intel': 'x86',
'ppc' : 'ppc',
'BeBox': 'ppc',
'BeMac': 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
'sparc': 'sparc',
'sun4u': 'sparc',
}
@@ -83,7 +89,7 @@ def AddOptions(opts):
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'windows', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
@@ -92,5 +98,6 @@ def AddOptions(opts):
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -1,27 +0,0 @@
# Configuration for AIX, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
# Misc tools and flags
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lpthread -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)

View File

@@ -1,24 +0,0 @@
# Configuration for AIX 64-bit, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64
# Compiler and flags
CC = xlc
CXX = xlC
CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lC
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11

View File

@@ -1,21 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -q64 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,21 +0,0 @@
# Configuration for AIX with gcc
include $(TOP)/configs/default
CONFIG_NAME = aix-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -DAIXV3
CXXFLAGS = -O2 -DAIXV3
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -1,20 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,31 +0,0 @@
# Configuration for building only libOSMesa on BlueGene, no Xlib driver
# This doesn't really have a lot of dependencies, so it should be usable
# on other (gcc-based) systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-gcc
CXX = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -1,27 +0,0 @@
# Configuration for building only libOSMesa on BlueGene using the IBM xlc compiler
# This doesn't really have a lot of dependencies, so it should be usable
# on similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlc
CXX = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlC
CFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -1,30 +0,0 @@
# Configuration for building only libOSMesa on Cray Xt3
# for the compute nodes running Catamount using the
# Portland Group compiler. The Portland Group toolchain has to be
# enabled before using "module switch PrgEnv-gnu PrgEnv-pgi" .
# This doesn't really have a lot of dependencies, so it should be usable
# on other similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = catamount-osmesa-pgi
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -9,21 +9,17 @@ CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_FLAGS@
ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
$(PIC_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
$(PIC_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LIBS = @RADEON_LIBS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
@@ -32,20 +28,22 @@ INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_BINDIR = @LLVM_BINDIR@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBDIR = @LLVM_LIBDIR@
LLVM_LIBS = @LLVM_LIBS@
LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
GLW_CFLAGS = @GLW_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
MESA_ASM_FILES = @MESA_ASM_FILES@
# Misc tools and flags
MAKE = @MAKE@
@@ -58,13 +56,20 @@ AWK = @AWK@
GREP = @GREP@
NM = @NM@
# Perl
PERL = @PERL@
# Indent (used for generating dispatch tables)
INDENT = @INDENT@
INDENT_FLAGS = @INDENT_FLAGS@
# Python and flags (generally only needed by the developers)
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
FLEX = @LEX@
BISON = @YACC@
# Library names (base name)
GL_LIB = @GL_LIB@
@@ -75,8 +80,6 @@ GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -88,29 +91,21 @@ GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -121,9 +116,6 @@ GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
@@ -135,24 +127,22 @@ GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
GL_LIB_DEPS = @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
@OSMESA_LIB_DEPS@
EGL_LIB_DEPS = @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
@GLU_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
@GLW_LIB_DEPS@
GLESv1_CM_LIB_DEPS = @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = @GLESv2_LIB_DEPS@
VG_LIB_DEPS = @VG_LIB_DEPS@
GLAPI_LIB_DEPS = @GLAPI_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
DRI_LIB_DEPS = @DRI_LIB_DEPS@
GALLIUM_DRI_LIB_DEPS = @GALLIUM_DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
@@ -179,6 +169,9 @@ DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
# XVMC library install directory
XVMC_LIB_INSTALL_DIR=@XVMC_LIB_INSTALL_DIR@
# VDPAU library install directory
VDPAU_LIB_INSTALL_DIR=@VDPAU_LIB_INSTALL_DIR@
@@ -188,6 +181,9 @@ VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# Path to OpenCL C library libclc
LIBCLC_PATH = @LIBCLC_PATH@
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
@@ -207,12 +203,6 @@ GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
@@ -224,9 +214,8 @@ WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
ifneq ($(LLVM_VERSION),)
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
endif
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@
GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@
GALLIUM_PIPE_LOADER_LIBS = @GALLIUM_PIPE_LOADER_LIBS@

View File

@@ -1,58 +0,0 @@
# Configuration for Darwin / MacOS X, making dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = darwin
INSTALL_DIR = /usr/X11
X11_DIR = $(INSTALL_DIR)
# Compiler and flags
CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
# -DIN_DRI_DRIVER
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-32bit

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386 -arch ppc64 -arch x86_64
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-all

View File

@@ -8,9 +8,9 @@
CONFIG_NAME = default
# Version info
MESA_MAJOR=8
MESA_MAJOR=9
MESA_MINOR=0
MESA_TINY=0
MESA_TINY=1
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -19,11 +19,9 @@ DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags
CC = cc
CXX = CC
HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
@@ -62,8 +60,6 @@ GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
@@ -75,27 +71,19 @@ GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
MESA_ASM_FILES =
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
# order to build the Motif widget too)
@@ -106,16 +94,9 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu
GLU_DIRS = sgi
gallium egl gallium/winsys gallium/targets
DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -131,17 +112,15 @@ EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = -ldl -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
GLESv1_CM_LIB_DEPS = -lpthread
GLESv2_LIB_DEPS = -lpthread
VG_LIB_DEPS = -lpthread
GLAPI_LIB_DEPS = -lpthread
# Program dependencies - specific GL libraries added in Makefiles
X11_LIBS = -lX11
@@ -160,9 +139,6 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -189,9 +165,16 @@ GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =
# default targets
# this helps reduce the mismatch between our automake Makefiles and the old
# custom Makefiles while we transition.
all: default
am--refresh:
distclean: clean
check:
test:

View File

@@ -1,29 +0,0 @@
# Configuration for FreeBSD
include $(TOP)/configs/default
CONFIG_NAME = FreeBSD
# Compiler and flags
CC = cc
CXX = c++
MAKE = gmake
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM \
-DHZ=100
X11_INCLUDES = -I/usr/local/include
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH = -L/usr/local/lib

View File

@@ -1,51 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd
CONFIG_NAME = freebsd-dri
# Compiler and flags
CC = gcc
CXX = g++
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
EXPAT_INCLUDES = -I/usr/local/include
X11_INCLUDES = -I/usr/local/include
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \
$(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `$(PKG_CONFIG) --cflags libdrm`
LIBDRM_LIB = `$(PKG_CONFIG) --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu
DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm
DRI_DIRS = i915 i965 r200 radeon

View File

@@ -1,10 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86-64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,13 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE

View File

@@ -1,18 +0,0 @@
# Configuration for HPUX v10, with gcc
include $(TOP)/configs/default
CONFIG_NAME = hpux10-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing

View File

@@ -1,26 +0,0 @@
# Configuration for HPUX v10, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,24 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,28 +0,0 @@
# Configuration for HPUX v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,28 +0,0 @@
# Configuration for HPUX IA64 v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.so
GLU_LIB_NAME = libGLU.so
GLW_LIB_NAME = libGLw.so
OSMESA_LIB_NAME = libOSMesa.so
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,25 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies

View File

@@ -1,15 +0,0 @@
# Configuration for HPUX v9, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9
# Compiler and flags
CC = cc
# XXX fix this
CXX = c++
CFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM
CXXFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5

View File

@@ -1,13 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9-gcc
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE

View File

@@ -1,16 +0,0 @@
# Configuration for IRIX 6.x, make n64 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64

View File

@@ -1,24 +0,0 @@
# Configuration for IRIX 6.x, make n64 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,16 +0,0 @@
# Configuration for IRIX 6.x, make n32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32

View File

@@ -1,23 +0,0 @@
# Configuration for IRIX 6.x, make n32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips2 -O2 -ansi -woff 3262,3666 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,17 +0,0 @@
# Configuration for IRIX 6.x, make o32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32

View File

@@ -1,23 +0,0 @@
# Configuration for IRIX 6.x, make o32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,37 +0,0 @@
# Configuration for generic Linux
include $(TOP)/configs/default
CONFIG_NAME = linux
# Compiler and flags
CC = gcc
CXX = g++
OPT_FLAGS = -O3 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
# to build properly on 64-bit platforms.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
-Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@@ -1,19 +0,0 @@
# Configuration for Linux on Alpha
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11

View File

@@ -1,27 +0,0 @@
# Configuration for Linux on Alpha, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11

View File

@@ -1,9 +0,0 @@
# Configuration for debugging on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
#CFLAGS += -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,76 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O2 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
# Directories
SRC_DIRS := glx egl $(SRC_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel svga/drm
GALLIUM_TARGET_DIRS = dri-vmwgfx
GALLIUM_STATE_TRACKERS_DIRS = egl dri
DRI_DIRS = i915 i965 nouveau r200 radeon swrast
INTEL_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_intel)
INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel)
NOUVEAU_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -1,14 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-debug
OPT_FLAGS = -O0 -g
ARCH_FLAGS = -DDEBUG
# Helpful to reduce the amount of stuff that gets built sometimes:
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200

View File

@@ -1,17 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-ppc
OPT_FLAGS = -Os -mcpu=603
PIC_FLAGS = -fPIC
ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
MESA_ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = r200 radeon

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,20 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86-64
ARCH_FLAGS = -m64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
LIB_DIR = lib64
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
DRI_DIRS = i915 i965 r200 radeon

View File

@@ -1,55 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri-xcb
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = $(shell $(PKG_CONFIG) --cflags-only-I x11) $(shell $(PKG_CONFIG) --cflags-only-I xcb) $(shell $(PKG_CONFIG) --cflags-only-I x11-xcb) $(shell $(PKG_CONFIG) --cflags-only-I xcb-glx)
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell $(PKG_CONFIG) --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell $(PKG_CONFIG) --libs xcb) $(shell $(PKG_CONFIG) --libs x11-xcb) $(shell $(PKG_CONFIG) --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu
DRIVER_DIRS = dri
DRI_DIRS = i915 r200 radeon

View File

@@ -1,58 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)
# Directories
SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = egl_drm
GALLIUM_TARGET_DIRS =
DRI_DIRS = intel

View File

@@ -1,18 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
MKLIB_OPTIONS = -arch icc-istatic
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,23 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
MKLIB_OPTIONS = -static -arch icc-istatic
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,19 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = g++
CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3
MKLIB_OPTIONS = -arch icc
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,23 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS
MKLIB_OPTIONS = -static -arch icc
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,52 +0,0 @@
# -*-makefile-*-
# Configuration for linux-indirect: Builds a libGL capable of indirect
# rendering, but *NOT* capable of direct rendering.
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DGLX_INDIRECT_RENDERING \
-DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu
DRIVER_DIRS =

View File

@@ -1,47 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with optimizations
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux
CONFIG_NAME = linux-llvm
# Add llvmpipe driver
GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
LLVM_VERSION := $(shell llvm-config --version)
ifeq ($(LLVM_VERSION),)
$(warning Could not find LLVM! Make Sure 'llvm-config' is in the path)
MESA_LLVM=0
else
MESA_LLVM=1
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
# $(info Using LLVM version: $(LLVM_VERSION))
endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags|sed 's/-DNDEBUG\>//g'`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
LLVM_CXXFLAGS=
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
# to allow the NV drivers to compile
LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)

View File

@@ -1,12 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with debugging info
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux-llvm
CONFIG_NAME = linux-llvm-debug
OPT_FLAGS = -g -ansi -pedantic
DEFINES += -DDEBUG -UNDEBUG

View File

@@ -1,28 +0,0 @@
# Configuration for OpenGL ES on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
# egl st needs this
DEFINES += -DGLX_DIRECT_RENDERING
# no mesa or egl drivers
DRIVER_DIRS =
EGL_DRIVERS_DIRS =
GALLIUM_DRIVERS_DIRS = softpipe
# build libGLES*.so
GALLIUM_STATE_TRACKERS_DIRS = es
# build egl_x11_{swrast,i915}.so
GALLIUM_DRIVERS_DIRS += trace rbug i915
GALLIUM_STATE_TRACKERS_DIRS += egl
GALLIUM_WINSYS_DIRS += drm/intel
GALLIUM_TARGET_DIRS += egl-swrast egl-i915

View File

@@ -1,26 +0,0 @@
# Configuration for building only libOSMesa on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -1,32 +0,0 @@
# Configuration for building static libOSMesa.a on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc -m32
CXX = g++ -m32
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,29 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -1,30 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.a
# Directories
SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread

View File

@@ -1,29 +0,0 @@
# Configuration for 32 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa32
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa32
OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on PPC
include $(TOP)/configs/linux
CONFIG_NAME = linux-ppc
OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
# FIXME: Use of PowerPC assembly should be enabled here.

View File

@@ -1,14 +0,0 @@
# Configuration for Linux on PPC, static libs
include $(TOP)/configs/linux-ppc
CONFIG_NAME = linux-ppc-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux with gprof
include $(TOP)/configs/linux-static
CONFIG_NAME = linux-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on Sparc
include $(TOP)/configs/linux
CONFIG_NAME = linux-sparc
#ASM_FLAGS = -DUSE_SPARC_ASM
#MESA_ASM_SOURCES = $(SPARC_SOURCES)
#GLAPI_ASM_SOURCES = $(SPARC_API)

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on Sparc5
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-sparc5
ARCH_FLAGS += -mcpu=ultrasparc

View File

@@ -1,23 +0,0 @@
# Configuration for generic Linux, making static libs
include $(TOP)/configs/linux
CONFIG_NAME = linux-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
-l$(GL_LIB) -lm -L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on UltraSparc
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-ultrasparc
ARCH_FLAGS += -mv8 -mtune=ultrasparc

View File

@@ -1,11 +0,0 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,7 +0,0 @@
# To build Linux x86 32-bit in an x86-64 environment
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-32
ARCH_FLAGS += -m32

View File

@@ -1,14 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86-64
ARCH_FLAGS = -m64
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
ASM_FLAGS = -DUSE_X86_64_ASM
LIB_DIR = lib64
EXTRA_LIB_PATH = -L/usr/X11R6/lib64

View File

@@ -1,8 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-debug
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux for 64-bit X86 (Opteron) with gprof
include $(TOP)/configs/linux-x86-64-static
CONFIG_NAME = linux-x86-64-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,21 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron), static libs
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,9 +0,0 @@
# Configuration for Linux with x86 code, but no gcc optimizations and
# debugging enabled.
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-debug
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux with x86 optimizations with gprof
include $(TOP)/configs/linux-x86-static
CONFIG_NAME = linux-x86-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,21 +0,0 @@
# Configuration for Linux with x86 optimizations, static libs
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =

View File

@@ -1,15 +0,0 @@
# Configuration for NetBSD
include $(TOP)/configs/default
CONFIG_NAME = netbsd
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100
CXXFLAGS = -O2 -fPIC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing

View File

@@ -1,20 +0,0 @@
# Configuration for OpenBSD
include $(TOP)/configs/default
CONFIG_NAME = openbsd
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
CXXFLAGS = -O2 -fPIC -I/usr/X11R6/include -DHZ=100
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)

View File

@@ -1,14 +0,0 @@
# Configuration for OSF/1
include $(TOP)/configs/default
CONFIG_NAME = osf1
# Compiler and flags
CC = cc
CXX = cxx
CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT
CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm

View File

@@ -1,15 +0,0 @@
# Configuration for OSF/1
include $(TOP)/configs/default
CONFIG_NAME = osf1
# Compiler and flags
CC = cc
CXX = cxx
CFLAGS = -O2 -std1 -ieee_with_no_inexact -DUSE_XSHM -DPTHREADS -D_REENTRANT
CXXFLAGS = -O2 -std ansi -ieee -DPTHREADS -D_REENTRANT
MKLIB_OPTIONS = -static
GL_LIB_DEPS =
GLU_LIB_DEPS =

View File

@@ -1,16 +0,0 @@
# Configuration for Solaris on x86
include $(TOP)/configs/default
CONFIG_NAME = solaris-x86
# Compiler and flags
CC = cc
CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
MKLIB_OPTIONS = -static
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

Some files were not shown because too many files have changed in this diff Show More