Compare commits

..

1472 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
1218 changed files with 53248 additions and 96401 deletions

View File

@@ -3,6 +3,7 @@
(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

@@ -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

@@ -21,11 +21,14 @@
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
@@ -51,16 +54,25 @@ distclean-local:
# Rules for making release tarballs
PACKAGE_VERSION=8.1-devel
PACKAGE_VERSION=9.0.1
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
src/glsl/glsl_parser.cpp \
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.cpp \
src/glsl/glsl_lexer.cc \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
@@ -72,7 +84,56 @@ EXTRA_FILES = \
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/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
@@ -80,7 +141,7 @@ IGNORE_FILES = \
parsers: configure
-@touch $(top_builddir)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(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

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

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

@@ -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,15 +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`
ARM=`file $1 | grep ARM`
# Do not add "-m32" option for arm.
if [ -z "$ARM" -a "${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}
@@ -389,15 +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`
ARM=`file $1 | grep ARM`
# Do not add "-m32" option for arm.
if [ -z "$ARM" -a "${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

View File

@@ -98,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

@@ -9,20 +9,17 @@ CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_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) $(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@
@@ -47,7 +44,6 @@ DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_FILES = @MESA_ASM_FILES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
@@ -100,7 +96,6 @@ GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
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@
@@ -110,7 +105,6 @@ GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
@@ -133,22 +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@
@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@

View File

@@ -8,9 +8,9 @@
CONFIG_NAME = default
# Version info
MESA_MAJOR=8
MESA_MINOR=1
MESA_TINY=0
MESA_MAJOR=9
MESA_MINOR=0
MESA_TINY=1
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
@@ -76,7 +76,6 @@ GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
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)*
@@ -95,8 +94,7 @@ 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
# Gallium directories and
@@ -114,15 +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
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

View File

@@ -6,9 +6,10 @@ dnl Tell the user about autoconf.html in the --help output
m4_divert_once([HELP_END], [
See docs/autoconf.html for more details on the options for Mesa.])
AC_INIT([Mesa], [8.1.0],
AC_INIT([Mesa], [9.0.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([foreign])
@@ -26,14 +27,14 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_PREREQ([2.2])
LT_INIT([disable-static])
dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
USER_CFLAGS="$CFLAGS"
USER_CXXFLAGS="$CXXFLAGS"
dnl Set internal versions
OSMESA_VERSION=8
AC_SUBST([OSMESA_VERSION])
dnl Versions for external dependencies
LIBDRM_REQUIRED=2.4.24
LIBDRM_RADEON_REQUIRED=2.4.31
LIBDRM_INTEL_REQUIRED=2.4.34
LIBDRM_RADEON_REQUIRED=2.4.39
LIBDRM_INTEL_REQUIRED=2.4.38
LIBDRM_NVVIEUX_REQUIRED=2.4.33
LIBDRM_NOUVEAU_REQUIRED=2.4.33
DRI2PROTO_REQUIRED=2.6
@@ -59,7 +60,7 @@ fi
AC_PROG_YACC
AC_PATH_PROG([YACC_INST], $YACC)
if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.y"; then
if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then
if test -z "$YACC_INST"; then
AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
fi
@@ -150,28 +151,22 @@ dnl LIB_DIR - library basename
LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
AC_SUBST([LIB_DIR])
dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
_SAVE_LDFLAGS="$LDFLAGS"
AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
AC_SUBST([EXTRA_LIB_PATH])
dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
_SAVE_CPPFLAGS="$CPPFLAGS"
AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
AC_SUBST([X11_INCLUDES])
dnl Compiler macros
DEFINES=""
AC_SUBST([DEFINES])
case "$host_os" in
linux*|*-gnu*|gnu*)
DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
;;
solaris*)
DEFINES="$DEFINES -DPTHREADS -DSVR4"
DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
;;
cygwin*)
DEFINES="$DEFINES -DPTHREADS"
DEFINES="$DEFINES -DHAVE_PTHREAD"
;;
esac
@@ -246,14 +241,6 @@ esac
AC_SUBST([VISIBILITY_CFLAGS])
AC_SUBST([VISIBILITY_CXXFLAGS])
dnl These should be unnecessary, but let the user set them if they want
AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Default is to use CFLAGS.])
AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
compiler. Default is to use CFLAGS.])
AC_SUBST([OPT_FLAGS])
AC_SUBST([ARCH_FLAGS])
dnl
dnl Hacks to enable 32 or 64 bit build
dnl
@@ -266,7 +253,6 @@ AC_ARG_ENABLE([32-bit],
if test "x$enable_32bit" = xyes; then
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -m32"
ARCH_FLAGS="$ARCH_FLAGS -m32"
CCASFLAGS="$CCASFLAGS -m32"
fi
if test "x$GXX" = xyes; then
@@ -293,15 +279,17 @@ dnl explicitly requested. If both disabled, set to static since shared
dnl was explicitly requested.
case "x$enable_static$enable_shared" in
xyesyes )
AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
enable_shared=no
;;
xnono )
AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
enable_static=yes
;;
esac
AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
dnl
dnl mklib options
dnl
@@ -357,18 +345,12 @@ AC_ARG_WITH([gl-lib-name],
[specify GL library name @<:@default=GL@:>@])],
[GL_LIB=$withval],
[GL_LIB=GL])
AC_ARG_WITH([glu-lib-name],
[AS_HELP_STRING([--with-glu-lib-name@<:@=NAME@:>@],
[specify GLU library name @<:@default=GLU@:>@])],
[GLU_LIB=$withval],
[GLU_LIB=GLU])
AC_ARG_WITH([osmesa-lib-name],
[AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
[specify OSMesa library name @<:@default=OSMesa@:>@])],
[OSMESA_LIB=$withval],
[OSMESA_LIB=OSMesa])
AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
AS_IF([test "x$GLU_LIB" = xyes], [GLU_LIB=GLU])
AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
dnl
@@ -383,13 +365,10 @@ AC_ARG_ENABLE([mangling],
if test "x${enable_mangling}" = "xyes" ; then
DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
GL_LIB="Mangled${GL_LIB}"
GLU_LIB="Mangled${GLU_LIB}"
OSMESA_LIB="Mangled${OSMESA_LIB}"
fi
AC_SUBST([GL_LIB])
AC_SUBST([GLU_LIB])
AC_SUBST([OSMESA_LIB])
AM_CONDITIONAL(HAVE_MANGLED_GL, test "x${enable_mangling}" = "xyes")
dnl
dnl potentially-infringing-but-nobody-knows-for-sure stuff
@@ -407,7 +386,6 @@ if test "x$enable_texture_float" = xyes; then
fi
GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
@@ -416,8 +394,6 @@ VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -426,7 +402,6 @@ VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENS
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
AC_SUBST([EGL_LIB_NAME])
AC_SUBST([GLESv1_CM_LIB_NAME])
@@ -435,8 +410,6 @@ AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
AC_SUBST([OSMESA_LIB_GLOB])
AC_SUBST([EGL_LIB_GLOB])
AC_SUBST([GLESv1_CM_LIB_GLOB])
AC_SUBST([GLESv2_LIB_GLOB])
@@ -454,7 +427,6 @@ AC_ARG_ENABLE([asm],
)
asm_arch=""
MESA_ASM_FILES=""
GLAPI_ASM_SOURCES=""
AC_MSG_CHECKING([whether to enable assembly])
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
@@ -483,13 +455,6 @@ if test "x$enable_asm" = xyes; then
;;
esac
;;
powerpc)
case "$host_os" in
linux*)
asm_arch=ppc
;;
esac
;;
sparc*)
case "$host_os" in
linux*)
@@ -503,19 +468,16 @@ if test "x$enable_asm" = xyes; then
x86)
DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
MESA_ASM_FILES='$(X86_FILES)'
GLAPI_ASM_SOURCES='$(X86_API)'
AC_MSG_RESULT([yes, x86])
;;
x86_64)
DEFINES="$DEFINES -DUSE_X86_64_ASM"
MESA_ASM_FILES='$(X86_64_FILES)'
GLAPI_ASM_SOURCES='$(X86-64_API)'
AC_MSG_RESULT([yes, x86_64])
;;
sparc)
DEFINES="$DEFINES -DUSE_SPARC_ASM"
MESA_ASM_FILES='$(SPARC_FILES)'
GLAPI_ASM_SOURCES='$(SPARC_API)'
AC_MSG_RESULT([yes, sparc])
;;
*)
@@ -524,20 +486,27 @@ if test "x$enable_asm" = xyes; then
esac
fi
AC_SUBST([MESA_ASM_FILES])
AC_SUBST([GLAPI_ASM_SOURCES])
dnl PIC code macro
MESA_PIC_FLAGS
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
[AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
[AC_CHECK_LIB([dl], [dlopen],
[DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
AC_SUBST([DLOPEN_LIBS])
dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
dnl Check for pthreads
AX_PTHREAD
dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
dnl to -pthread, which causes problems if we need -lpthread to appear in
dnl pkgconfig files.
test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
dnl SELinux awareness.
AC_ARG_ENABLE([selinux],
[AS_HELP_STRING([--enable-selinux],
@@ -552,6 +521,7 @@ if test "x$enable_selinux" = "xyes"; then
SELINUX_LIBS="-lselinux"
DEFINES="$DEFINES -DMESA_SELINUX"
fi
AC_SUBST([SELINUX_LIBS])
dnl Options for APIs
AC_ARG_ENABLE([opengl],
@@ -577,19 +547,19 @@ AC_ARG_ENABLE([openvg],
AC_ARG_ENABLE([dri],
[AS_HELP_STRING([--enable-dri],
[enable DRI modules @<:@default=auto@:>@])],
[enable DRI modules @<:@default=enabled@:>@])],
[enable_dri="$enableval"],
[enable_dri=auto])
[enable_dri=yes])
AC_ARG_ENABLE([glx],
[AS_HELP_STRING([--enable-glx],
[enable GLX library @<:@default=auto@:>@])],
[enable GLX library @<:@default=enabled@:>@])],
[enable_glx="$enableval"],
[enable_glx=auto])
[enable_glx=yes])
AC_ARG_ENABLE([osmesa],
[AS_HELP_STRING([--enable-osmesa],
[enable OSMesa library @<:@default=auto@:>@])],
[enable OSMesa library @<:@default=disabled@:>@])],
[enable_osmesa="$enableval"],
[enable_osmesa=auto])
[enable_osmesa=no])
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--disable-egl],
[disable EGL library @<:@default=enabled@:>@])],
@@ -639,9 +609,9 @@ AC_ARG_ENABLE([opencl],
[enable_opencl=no])
AC_ARG_ENABLE([xlib_glx],
[AS_HELP_STRING([--enable-xlib-glx],
[make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
[make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
[enable_xlib_glx="$enableval"],
[enable_xlib_glx=auto])
[enable_xlib_glx=no])
AC_ARG_ENABLE([gallium_egl],
[AS_HELP_STRING([--enable-gallium-egl],
[enable optional EGL state tracker (not required
@@ -675,7 +645,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
AC_ARG_WITH([gallium-drivers],
[AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
[comma delimited Gallium drivers list, e.g.
"i915,nouveau,r300,r600,svga,swrast"
"i915,nouveau,r300,r600,radeonsi,svga,swrast"
@<:@default=r300,r600,swrast@:>@])],
[with_gallium_drivers="$withval"],
[with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
@@ -715,125 +685,61 @@ if test "x$enable_gles2" = xyes; then
fi
AC_SUBST([API_DEFINES])
if test "x$enable_glx" = xno; then
AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
enable_xlib_glx=no
fi
if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
fi
# Disable GLX if DRI and Xlib-GLX are not enabled
if test "x$enable_glx" = xyes -a \
"x$enable_dri" = xno -a \
"x$enable_xlib_glx" = xno; then
AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
enable_glx=no
fi
AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
"x$enable_osmesa" = xyes)
AC_ARG_ENABLE([shared-glapi],
[AS_HELP_STRING([--enable-shared-glapi],
[EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
[Enable shared glapi for OpenGL @<:@default=yes@:>@])],
[enable_shared_glapi="$enableval"],
[enable_shared_glapi=no])
[enable_shared_glapi="$enable_dri"])
# Shared GLAPI is only useful for DRI
if test "x$enable_dri" = xno; then
AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
enable_shared_glapi=no
fi
# TODO: Get rid of SHARED_GLAPI variable
SHARED_GLAPI="0"
if test "x$enable_shared_glapi" = xyes; then
SHARED_GLAPI="1"
# libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
# the remap table)
DEFINES="$DEFINES -DIN_DRI_DRIVER"
SRC_DIRS="$SRC_DIRS mapi/shared-glapi"
CORE_DIRS="mapi/shared-glapi"
fi
AC_SUBST([SHARED_GLAPI])
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1)
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
dnl More later: fbdev, ...
dnl
default_driver="xlib"
case "$host_os" in
linux*)
case "$host_cpu" in
i*86|x86_64|powerpc*|sparc*|ia64*) default_driver="dri";;
esac
;;
*freebsd* | dragonfly* | *netbsd*)
case "$host_cpu" in
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
esac
if test "x$enable_opengl" = xno; then
default_driver="no"
fi
AC_ARG_WITH([driver],
[AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
[mesa_driver="$withval"],
[mesa_driver=auto])
dnl Check for valid option
case "x$mesa_driver" in
xxlib|xdri|xosmesa|xno)
if test "x$enable_dri" != xauto -o \
"x$enable_glx" != xauto -o \
"x$enable_osmesa" != xauto -o \
"x$enable_xlib_glx" != xauto; then
AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
fi
;;
xauto)
mesa_driver="$default_driver"
;;
*)
AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
;;
esac
# map $mesa_driver to APIs
if test "x$enable_dri" = xauto; then
case "x$mesa_driver" in
xdri) enable_dri=yes ;;
*) enable_dri=no ;;
esac
fi
if test "x$enable_glx" = xauto; then
case "x$mesa_driver" in
xdri|xxlib) enable_glx=yes ;;
*) enable_glx=no ;;
esac
fi
if test "x$enable_osmesa" = xauto; then
case "x$mesa_driver" in
xxlib|xosmesa) enable_osmesa=yes ;;
*) enable_osmesa=no ;;
esac
fi
if test "x$enable_xlib_glx" = xauto; then
case "x$mesa_driver" in
xxlib) enable_xlib_glx=yes ;;
*) enable_xlib_glx=no ;;
esac
fi
if test "x$enable_glx" = xno; then
enable_xlib_glx=no
fi
AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
dnl
dnl Driver specific build directories
dnl
dnl this variable will be prepended to SRC_DIRS and is not exported
CORE_DIRS=""
SRC_DIRS="gtest"
GLU_DIRS="sgi"
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_TARGET_DIRS=""
GALLIUM_WINSYS_DIRS="sw"
GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
GALLIUM_STATE_TRACKERS_DIRS=""
# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
x*yes*)
CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
;;
esac
# build glapi if OpenGL is enabled
if test "x$enable_opengl" = xyes; then
CORE_DIRS="$CORE_DIRS mapi/glapi"
@@ -883,7 +789,6 @@ if test "x$enable_osmesa" = xyes; then
fi
AC_SUBST([SRC_DIRS])
AC_SUBST([GLU_DIRS])
AC_SUBST([DRIVER_DIRS])
AC_SUBST([GALLIUM_DIRS])
AC_SUBST([GALLIUM_TARGET_DIRS])
@@ -899,7 +804,7 @@ PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
if test "x$enable_dri" = xyes; then
# DRI must be shared, I think
if test "$enable_static" = yes; then
AC_MSG_ERROR([Can't use static libraries for DRI drivers])
AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
fi
# not a hard requirement as swrast does not depend on it
@@ -908,32 +813,8 @@ if test "x$enable_dri" = xyes; then
fi
fi
dnl
dnl Find out if X is available. The variable have_x is set if libX11 is
dnl found to mimic AC_PATH_XTRA.
dnl
if test -n "$PKG_CONFIG"; then
AC_MSG_CHECKING([pkg-config files for X11 are available])
PKG_CHECK_EXISTS([x11],[
x11_pkgconfig=yes
have_x=yes
],[
x11_pkgconfig=no
])
AC_MSG_RESULT([$x11_pkgconfig])
else
x11_pkgconfig=no
fi
dnl Use the autoconf macro if no pkg-config files
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([X11], [x11])
else
AC_PATH_XTRA
test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
AC_SUBST([X11_CFLAGS])
AC_SUBST([X11_LIBS])
fi
dnl Find out if X is available.
PKG_CHECK_MODULES([X11], [x11])
dnl Try to tell the user that the --x-* options are only used when
dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
@@ -977,98 +858,52 @@ dnl
case "x$enable_glx$enable_xlib_glx" in
xyesyes)
# Xlib-based GLX
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([XLIBGL], [x11 xext])
GL_PC_REQ_PRIV="x11 xext"
X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
GL_LIB_DEPS="$XLIBGL_LIBS"
else
# should check these...
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
fi
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
PKG_CHECK_MODULES([XLIBGL], [x11 xext])
GL_PC_REQ_PRIV="x11 xext"
X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
GL_LIB_DEPS="$XLIBGL_LIBS"
GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
;;
xyesno)
# DRI-based GLX
PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
if test x"$driglx_direct" = xyes; then
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
fi
PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
fi
# find the DRI deps for libGL
if test "$x11_pkgconfig" = yes; then
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx"
dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1"
# add xf86vidmode if available
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
if test "$HAVE_XF86VIDMODE" = yes ; then
dri_modules="$dri_modules xxf86vm"
fi
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
GL_LIB_DEPS="$DRIGL_LIBS"
else
# should check these...
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
if test "x$HAVE_XF86VIDMODE" == xyes; then
GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
else
GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
fi
GL_PC_LIB_PRIV="$GL_LIB_DEPS"
GL_PC_CFLAGS="$X11_INCLUDES"
# XCB can only be used from pkg-config
PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
# add xf86vidmode if available
PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
if test "$HAVE_XF86VIDMODE" = yes ; then
dri_modules="$dri_modules xxf86vm"
fi
# Check to see if the xcb-glx library is new enough to support
# GLX_ARB_create_context. This bit of hackery is necessary until XCB 1.8
# is released.
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $X11_INCLUDES"
LDFLAGS="$LDFLAGS $GL_LIB_DEPS"
AC_CHECK_LIB(xcb-glx, xcb_glx_create_context_attribs_arb_checked,
[HAVE_XCB_GLX_CREATE_CONTEXT=yes],
[HAVE_XCB_GLX_CREATE_CONTEXT=no])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
PKG_CHECK_MODULES([DRIGL], [$dri_modules])
GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
GL_LIB_DEPS="$DRIGL_LIBS"
if test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes; then
X11_INCLUDES="$X11_INCLUDES -DHAVE_XCB_GLX_CREATE_CONTEXT"
fi
# need DRM libs, -lpthread, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
# need DRM libs, $PTHREAD_LIBS, etc.
GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
;;
esac
# This is outside the case (above) so that it is invoked even for non-GLX
# builds.
AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
AC_SUBST([GL_LIB_DEPS])
AC_SUBST([GL_PC_REQ_PRIV])
@@ -1080,21 +915,7 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
AC_SUBST([GLESv2_LIB_DEPS])
AC_SUBST([GLESv2_PC_LIB_PRIV])
GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
AC_SUBST([GLAPI_LIB_DEPS])
dnl Setup default DRI CFLAGS
DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
DRI_LIB_DEPS="-L\$(TOP)/\$(LIB_DIR) -ldricore$VERSION"
MESA_MODULES="\$(TOP)/\$(LIB_DIR)/libdricore$VERSION.so"
HAVE_DRICORE=yes
fi
AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
AC_SUBST([MESA_MODULES])
DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
AC_SUBST([HAVE_XF86VIDMODE])
@@ -1124,8 +945,8 @@ AC_ARG_ENABLE([glx-tls],
[GLX_USE_TLS=no])
AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
AS_IF([test "x$GLX_USE_TLS" = xyes],
[DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
[DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
dnl
dnl More DRI setup
@@ -1171,7 +992,7 @@ yes)
dri_drivers=`IFS=', '; echo $with_dri_drivers`
for driver in $dri_drivers; do
test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
done
DRI_DIRS="$dri_drivers"
if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
@@ -1209,7 +1030,7 @@ if test "x$enable_dri" = xyes; then
esac
;;
freebsd* | dragonfly* | *netbsd*)
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
if test "x$DRI_DIRS" = "xyes"; then
@@ -1268,11 +1089,14 @@ if test "x$enable_dri" = xyes; then
fi
# put all the necessary libs together
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
fi
AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
AC_SUBST([DRI_DIRS])
AC_SUBST([EXPAT_INCLUDES])
AC_SUBST([DRI_LIB_DEPS])
AC_SUBST([GALLIUM_DRI_LIB_DEPS])
case $DRI_DIRS in
*i915*|*i965*)
@@ -1363,13 +1187,14 @@ esac
if test "x$enable_osmesa" = xyes; then
# only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
else
OSMESA_LIB_DEPS=""
fi
OSMESA_MESA_DEPS=""
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
fi
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
AC_SUBST([OSMESA_PC_REQ])
@@ -1394,7 +1219,7 @@ if test "x$enable_gbm" = xyes; then
if test "x$enable_dri" = xyes; then
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
if test "$SHARED_GLAPI" -eq 0; then
if test "x$enable_shared_glapi" = xno; then
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
fi
fi
@@ -1411,7 +1236,7 @@ EGL_CLIENT_APIS=""
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
@@ -1534,10 +1359,12 @@ if test "x$enable_openvg" = xyes; then
fi
EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
CORE_DIRS="$CORE_DIRS mapi/vgapi"
GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
HAVE_ST_VEGA=yes
VG_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
AC_SUBST([VG_PC_LIB_PRIV])
fi
dnl
@@ -1632,66 +1459,13 @@ if test "x$enable_opencl" = xyes; then
enable_gallium_loader=yes
fi
dnl
dnl GLU configuration
dnl
AC_ARG_ENABLE([glu],
[AS_HELP_STRING([--disable-glu],
[enable OpenGL Utility library @<:@default=enabled@:>@])],
[enable_glu="$enableval"],
[enable_glu=yes])
if test "x$enable_glu" = xyes; then
if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
enable_glu=no
fi
fi
if test "x$enable_glu" = xyes; then
SRC_DIRS="$SRC_DIRS glu"
if test "x$enable_glx" = xno; then
# Link libGLU to libOSMesa instead of libGL
GLU_LIB_DEPS=""
GLU_PC_REQ="osmesa"
if test "$enable_static" = no; then
GLU_MESA_DEPS='-l$(OSMESA_LIB)'
else
GLU_MESA_DEPS=""
fi
else
# If static, empty GLU_LIB_DEPS and add libs for programs to link
GLU_PC_REQ="gl"
GLU_PC_LIB_PRIV="-lm"
if test "$enable_static" = no; then
GLU_LIB_DEPS="-lm"
GLU_MESA_DEPS='-l$(GL_LIB)'
else
GLU_LIB_DEPS=""
GLU_MESA_DEPS=""
fi
fi
fi
if test "$enable_static" = no; then
GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
fi
GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
AC_SUBST([GLU_LIB_DEPS])
AC_SUBST([GLU_MESA_DEPS])
AC_SUBST([GLU_PC_REQ])
AC_SUBST([GLU_PC_REQ_PRIV])
AC_SUBST([GLU_PC_LIB_PRIV])
AC_SUBST([GLU_PC_CFLAGS])
AC_SUBST([PROGRAM_DIRS])
dnl
dnl Gallium configuration
dnl
if test "x$with_gallium_drivers" != x; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
fi
AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
AC_SUBST([LLVM_BINDIR])
AC_SUBST([LLVM_CFLAGS])
@@ -1742,12 +1516,13 @@ for plat in $egl_platforms; do
;;
wayland)
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 0.99.0 wayland-server >= 0.99.0],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
m4_ifdef([WAYLAND_SCANNER_RULES],
[WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
[${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
;;
x11)
@@ -1846,6 +1621,13 @@ AC_ARG_WITH([llvm-shared-libs],
[with_llvm_shared_libs=yes],
[with_llvm_shared_libs=no])
AC_ARG_WITH([llvm-prefix],
[AS_HELP_STRING([--with-llvm-prefix],
[Prefix for LLVM installations in non-standard locations])],
[llvm_prefix="$withval"],
[llvm_prefix=""])
if test "x$with_gallium_drivers" = x; then
enable_gallium_llvm=no
fi
@@ -1855,7 +1637,11 @@ if test "x$enable_gallium_llvm" = xauto; then
esac
fi
if test "x$enable_gallium_llvm" = xyes; then
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
if test "x$llvm_prefix" != x; then
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
else
AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
fi
if test "x$LLVM_CONFIG" != xno; then
LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
@@ -1864,10 +1650,14 @@ if test "x$enable_gallium_llvm" = xyes; then
dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
else
LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
if test "x$enable_opencl" = xyes; then
LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs ipo linker instrumentation`"
LLVM_COMPONENTS="engine bitwriter"
if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
fi
if test "x$enable_opencl" = xyes; then
LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
fi
LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
fi
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
LLVM_BINDIR=`$LLVM_CONFIG --bindir`
@@ -2024,7 +1814,7 @@ if test "x$with_gallium_drivers" != x; then
USE_R600_LLVM_COMPILER=yes;
fi
if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
LLVM_LIBS="${LLVM_LIBS} `llvm-config --libs bitreader asmparser`"
LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`"
fi
gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
;;
@@ -2036,7 +1826,7 @@ if test "x$with_gallium_drivers" != x; then
AC_MSG_ERROR([LLVM 3.1 is required to build the radeonsi driver.])
fi
NEED_RADEON_GALLIUM=yes;
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi"
gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
;;
xnouveau)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
@@ -2090,6 +1880,12 @@ if test "x$enable_gallium_loader" = xyes; then
if test "x$enable_gallium_drm_loader" = xyes; then
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
if test "x$pipe_loader_have_xcb" = xyes; then
GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
fi
fi
AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
@@ -2125,8 +1921,6 @@ AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
AC_SUBST([GALLIUM_MAKE_DIRS])
AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_DRI_DRIVER, echo "$DRIVER_DIRS" | grep 'dri' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_OSMESA_DRIVER, echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
@@ -2146,51 +1940,62 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
dnl Substitute the config
AC_CONFIG_FILES([configs/current
Makefile
src/Makefile
src/gallium/Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/state_trackers/clover/Makefile
src/gallium/drivers/Makefile
src/gallium/drivers/r300/Makefile
src/gallium/drivers/r600/Makefile
src/gallium/targets/opencl/Makefile
src/gbm/Makefile
src/gbm/main/gbm.pc
src/egl/Makefile
src/egl/drivers/Makefile
src/egl/drivers/dri2/Makefile
src/egl/drivers/glx/Makefile
src/egl/Makefile
src/egl/main/Makefile
src/egl/main/egl.pc
src/egl/wayland/Makefile
src/egl/wayland/wayland-drm/Makefile
src/egl/wayland/wayland-egl/Makefile
src/egl/wayland/wayland-egl/wayland-egl.pc
src/egl/wayland/wayland-drm/Makefile
src/gallium/Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/drivers/Makefile
src/gallium/drivers/r300/Makefile
src/gallium/drivers/r600/Makefile
src/gallium/state_trackers/clover/Makefile
src/gallium/targets/opencl/Makefile
src/gbm/Makefile
src/gbm/main/gbm.pc
src/glsl/Makefile
src/glsl/glcpp/Makefile
src/glsl/tests/Makefile
src/glx/Makefile
src/glx/tests/Makefile
src/mapi/glapi/gen/Makefile
src/mapi/shared-glapi/Makefile
src/mapi/glapi/tests/Makefile
src/gtest/Makefile
src/Makefile
src/mapi/es1api/Makefile
src/mapi/es1api/glesv1_cm.pc
src/mapi/es2api/Makefile
src/mapi/es2api/glesv2.pc
src/mapi/glapi/Makefile
src/mapi/glapi/gen/Makefile
src/mapi/glapi/tests/Makefile
src/mapi/shared-glapi/Makefile
src/mapi/shared-glapi/tests/Makefile
src/mapi/vgapi/Makefile
src/mapi/vgapi/vg.pc
src/mesa/Makefile
src/mesa/libdricore/Makefile
src/mesa/main/tests/Makefile
src/mesa/x86/Makefile
src/mesa/x86-64/Makefile
src/mesa/gl.pc
src/mesa/drivers/Makefile
src/mesa/drivers/dri/dri.pc
src/mesa/drivers/dri/Makefile
src/mesa/drivers/dri/common/Makefile
src/mesa/drivers/dri/i915/Makefile
src/mesa/drivers/dri/i965/Makefile
src/mesa/drivers/dri/Makefile
src/mesa/drivers/dri/nouveau/Makefile
src/mesa/drivers/dri/r200/Makefile
src/mesa/drivers/dri/radeon/Makefile
src/mesa/drivers/dri/swrast/Makefile
src/mesa/drivers/osmesa/Makefile
src/mesa/drivers/osmesa/osmesa.pc
src/mesa/drivers/x11/Makefile
src/mesa/gl.pc
src/mesa/osmesa.pc])
src/mesa/libdricore/Makefile
src/mesa/main/tests/Makefile
src/mesa/x86-64/Makefile
src/mesa/x86/Makefile])
dnl Sort the dirs alphabetically
GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
@@ -2246,9 +2051,6 @@ xyesno)
;;
esac
echo ""
echo " GLU: $enable_glu"
dnl EGL
echo ""
echo " EGL: $enable_egl"
@@ -2297,12 +2099,13 @@ dnl Libraries
echo ""
echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static"
echo " Shared-glapi: $enable_shared_glapi"
dnl Compiler options
# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
cflags=`echo $CFLAGS $PIC_FLAGS | \
$SED 's/^ *//;s/ */ /;s/ *$//'`
cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
cxxflags=`echo $CXXFLAGS $PIC_FLAGS | \
$SED 's/^ *//;s/ */ /;s/ *$//'`
defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
echo ""

View File

@@ -42,21 +42,21 @@ GLX_ARB_create_context (GLX 1.4 is required) DONE
GL 3.1:
GLSL 1.40 missing: UBOS, inverse(),
highp change
GLSL 1.40 DONE (i965)
Forward compatibile context support/deprecations DONE (i965)
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (i965, r600)
16 vertex texture image units DONE
Texture buffer objs (GL_ARB_texture_buffer_object) needs GL3.1 enabling (i965)
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965)
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965)
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600)
GL 3.2:
Core/compatibility profiles not started
Core/compatibility profiles DONE
GLSL 1.50 not started
Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, swrast)
@@ -75,13 +75,13 @@ GL 3.3:
GLSL 3.30 new features in this version pretty much done
GL_ARB_blend_func_extended DONE (i965, r600, softpipe)
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (i965, r300, r600, swrast)
GL_ARB_sampler_objects DONE (i965, r300, r600)
GL_ARB_shader_bit_encoding DONE
GL_ARB_texture_rgb10_a2ui DONE (r600)
GL_ARB_texture_rgb10_a2ui DONE (i965, r600)
GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast)
GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (r300, r600)
GL_ARB_timer_query DONE (i965)
GL_ARB_instanced_arrays DONE (i965, r300, r600)
GL_ARB_vertex_type_2_10_10_10_rev DONE (r600)
@@ -91,6 +91,7 @@ GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend DONE (i965, r600, softpipe)
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader5 not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
GL_ARB_shader_subroutine not started
@@ -99,7 +100,7 @@ GL_ARB_texture_buffer_object_rgb32 not started
GL_ARB_texture_cube_map_array not started
GL_ARB_texture_gather not started
GL_ARB_transform_feedback2 DONE
GL_ARB_transform_feedback3 not started
GL_ARB_transform_feedback3 DONE
GL 4.1:
@@ -114,12 +115,13 @@ GL_ARB_viewport_array not started
GL 4.2:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_shader_atomic_counters not started
GL_ARB_texture_storage DONE (r300, r600, swrast)
GL_ARB_transform_feedback_instanced not started
GL_ARB_transform_feedback_instanced DONE
GL_ARB_base_instance DONE (nv50, nvc0, r600, radeonsi)
GL_ARB_shader_image_load_store not started
GL_ARB_conservative_depth DONE (softpipe)
@@ -128,5 +130,35 @@ GL_ARB_internalformat_query not started
GL_ARB_map_buffer_alignment not started
GL 4.3:
GLSL 4.3 not started
ARB_arrays_of_arrays not started
ARB_ES3_compatibility not started
ARB_clear_buffer_object not started
ARB_compute_shader started (gallium)
ARB_copy_image not started
ARB_debug_group not started
ARB_debug_label not started
ARB_debug_output DONE
ARB_debug_output2 not started
ARB_explicit_uniform_location not started
ARB_fragment_layer_viewport not started
ARB_framebuffer_no_attachments not started
ARB_internalformat_query2 not started
ARB_invalidate_subdata not started
ARB_multi_draw_indirect not started
ARB_program_interface_query not started
ARB_robust_buffer_access_behavior not started
ARB_shader_image_size not started
ARB_shader_storage_buffer_object not started
ARB_stencil_texturing not started
ARB_texture_buffer_range not started
ARB_texture_query_levels not started
ARB_texture_storage_multisample not started
ARB_texture_view not started
ARB_vertex_attrib_binding not started
More info about these features and the work involved can be found at
http://dri.freedesktop.org/wiki/MissingFunctionality

View File

@@ -56,12 +56,27 @@ New Procedures and Functions
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglQueryWaylandBufferWL(EGLDisplay dpy,
struct wl_buffer *buffer,
EGLint attribute, EGLint *value);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Accepted in the <attrib_list> parameter of eglCreateImageKHR:
EGL_WAYLAND_PLANE_WL 0x31D6
Possible values for EGL_TEXTURE_FORMAT:
EGL_TEXTURE_Y_U_V_WL 0x31D7
EGL_TEXTURE_Y_UV_WL 0x31D8
EGL_TEXTURE_Y_XUXV_WL 0x31D9
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
@@ -80,9 +95,67 @@ Additions to the EGL 1.4 Specification:
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
NULL context and an empty attribute_list.
A wl_buffer can have several planes, typically in case of planar
YUV formats. Depending on the exact YUV format in use, the
compositor will have to create one or more EGLImages for the
various planes. The eglQueryWaylandBufferWL function should be
used to first query the wl_buffer texture format using
EGL_TEXTURE_FORMAT as the attribute. If the wl_buffer object is
not an EGL wl_buffer (wl_shm and other wayland extensions can
create wl_buffer objects of different types), this query will
return EGL_FALSE. In that case the wl_buffer can not be used with
EGL and the compositor should have another way to get the buffer
contents.
If eglQueryWaylandBufferWL succeeds, the returned value will be
one of EGL_TEXTURE_RGB, EGL_TEXTURE_RGBA, EGL_TEXTURE_Y_U_V_WL,
EGL_TEXTURE_Y_UV_WL, EGL_TEXTURE_Y_XUXV_WL. The value returned
describes how many EGLImages must be used, which components will
be sampled from each EGLImage and how they map to rgba components
in the shader. The naming conventions separates planes by _ and
within each plane, the order or R, G, B, A, Y, U, and V indicates
how those components map to the rgba value returned by the
sampler. X indicates that the corresponding component in the rgba
value isn't used.
RGB and RGBA buffer types:
EGL_TEXTURE_RGB
One plane, samples RGB from the texture to rgb in the
shader. Alpha channel is not valid.
EGL_TEXTURE_RGBA
One plane, samples RGBA from the texture to rgba in the
shader.
YUV buffer types:
EGL_TEXTURE_Y_U_V_WL
Three planes, samples Y from the first plane to r in
the shader, U from the second plane to r, and V from
the third plane to r.
EGL_TEXTURE_Y_UV_WL
Two planes, samples Y from the first plane to r in
the shader, U and V from the second plane to rg.
EGL_TEXTURE_Y_XUXV_WL
Two planes, samples Y from the first plane to r in
the shader, U and V from the second plane to g and a.
After querying the wl_buffer layout, create EGLImages for the
planes by calling eglCreateImageKHR with wl_buffer as
EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL
context. If no attributes are given, an EGLImage will be created
for the first plane. For multi-planar buffers, specify the plane
to create the EGLImage for by using the EGL_WAYLAND_PLANE_WL
attribute. The value of the attribute is the index of the plane,
as defined by the buffer format. Writing to an EGLImage created
from a wl_buffer in any way (such as glTexImage2D, binding the
EGLImage as a renderbuffer etc) will result in undefined behavior.
Further, eglQueryWaylandBufferWL accepts attributes EGL_WIDTH and
EGL_HEIGHT to query the width and height of the wl_buffer.
Issues
@@ -90,3 +163,13 @@ Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)
Version 2, July 5, 2012
Add EGL_WAYLAND_PLANE_WL attribute to allow creating an EGLImage
for different planes of planar buffer. (Kristian Høgsberg)
Version 3, July 10, 2012
Add eglQueryWaylandBufferWL and the various buffer
formats. (Kristian Høgsberg)
Version 4, July 19, 2012
Use EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, and EGL_TEXTURE_RGBA,
and just define the new YUV texture formats. Add support for
EGL_WIDTH and EGL_HEIGHT in the query attributes (Kristian Høgsberg)

View File

@@ -17,10 +17,6 @@
<li><a href="#dri">DRI Driver Options</a></li>
<li><a href="#osmesa">OSMesa Driver Options</a></li>
</ul>
<li><p><a href="#library">Library Options</a>
<ul>
<li><a href="#glu">GLU</a></li>
</ul>
<li><p><a href="#demos">Demo Program Options</a>
</ol>
@@ -219,12 +215,6 @@ libraries that will be built. More details on the specific GL libraries
can be found in the <a href="install.html">basic installation
instructions</a>.
<dl>
<dt id="glu">GLU <dd><p> The libGLU library will be built by default
on all drivers. This can be disable with the option
<code>--disable-glu</code>.
</dl>
<h2 id="demos">4. Demo Program Options</h2>

View File

@@ -74,7 +74,6 @@
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="sourcetree.html" target="MainFrame">Source Code Tree</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>

View File

@@ -169,7 +169,7 @@ branch is relevant.
<dd>MESA_MAJOR, MESA_MINOR and MESA_TINY</dd>
<dt>Makefile.am</dt>
<dd>PACKAGE_VERSION</dd>
<dt>autoconf.ac</dt>
<dt>configure.ac</dt>
<dd>AC_INIT</dd>
<dt>src/mesa/main/version.h</dt>
<dd>MESA_MAJOR, MESA_MINOR, MESA_PATCH and MESA_VERSION_STRING</dd>

View File

@@ -197,7 +197,7 @@ few preprocessor defines.</p>
<ul>
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
<li>If <tt>PTHREADS</tt> is defined, method #3 is used.</li>
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
<li>If none of the preceeding are defined, method #1 is used.</li>
</ul>

View File

@@ -69,7 +69,6 @@ docs/ - documentation
src/ - source code for libraries
src/mesa - sources for the main Mesa library and device drivers
src/gallium - sources for Gallium and Gallium drivers
src/glu - libGLU source code
src/glx - sources for building libGL with full GLX and DRI support
</pre>
@@ -80,7 +79,12 @@ instructions</a>.
</p>
<h1>Demos and GLUT</h1>
<h1>Demos, GLUT, and GLU</h1>
<p>
A package of SGI's GLU library is available
<a href="ftp://ftp.freedesktop.org/pub/mesa/glu/" target="_parent">here</a>
</p>
<p>
A package of Mark Kilgard's GLUT library is available
@@ -93,9 +97,13 @@ The Mesa demos collection is available
</p>
<p>
In the past, GLUT and the Mesa demos were released in conjunction with
Mesa releases. But since GLUT and the demos change infrequently, they
were split off some time ago.
In the past, GLUT, GLU and the Mesa demos were released in conjunction with
Mesa releases. But since GLUT, GLU and the demos change infrequently, they
were split off into their own git repositories:
<a href="http://cgit.freedesktop.org/mesa/glut/">GLUT</a>,
<a href="http://cgit.freedesktop.org/mesa/glu/">GLU</a> and
<a href="http://cgit.freedesktop.org/mesa/demos/">Demos</a>,
</p>

View File

@@ -226,10 +226,6 @@ Basically you'll want the following:
</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
Mesa version number.
</li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
</li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
</li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
version number.
</li></ul>
<p>
After installing XFree86/X.org and the DRI drivers, some of these files

View File

@@ -1,46 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>SGI GLU</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>SGI SI GLU</h1>
(Silicon Graphics, Inc. Sample Implementation of the OpenGL Utility library)
<p>
SGI open-sourced their OpenGL Sample Implementation (SI) in January, 2000.
This includes the GLU library.
</p>
<p>
The SI GLU library implements GLU version 1.3 whereas the original
Mesa GLU library only implemented version 1.2.
We recommend using the SI GLU library instead of Mesa's GLU library
since it's more up-to-date, complete and reliable.
We're no longer developing the original Mesa GLU library.
</p>
<p>
The SI GLU library code is included in the Mesa distribution.
You don't have to download it separately.
</p>
<p>
<b>Olivier Michel</b> has made Linux RPMs of GLU for i386 and PowerPC.
You can download them from the
<a href="http://www.sourceforge.net/project/showfiles.php?group_id=3"
target="_parent">download area</a> under <b>Miscellaneous</b>.
</p>
<p>
Visit the <a href="http://oss.sgi.com/projects/ogl-sample/" target="_parent">
OpenGL Sample Implementation home page</a> for more information about the SI.
</p>
</body>
</html>

View File

@@ -31,13 +31,8 @@ issues in the code.
<b>Windows driver building, testing and maintenance.</b>
Fixing MSVC builds.
<li>
<b>Maintenance and testing of lesser-used drivers.</b>
Drivers such as i810, mach64, mga, r128, savage, sis, tdfx, unichrome, etc that aren't being maintained are being
deprecated starting in Mesa 8.0.<br>
They have to be ported to DRI2 to be accepted in mesa master again.
<li>
<b>Contribute more tests to
<a href="http://people.freedesktop.org/~nh/piglit/" target="_parent">Piglit</a>.</b>
<a href="http://piglit.freedesktop.org/" target="_parent">Piglit</a>.</b>
<li>
<b>Automatic testing.
</b>
@@ -46,6 +41,25 @@ the latest Mesa code and run tests (such as piglit) then report issues to
the mailing list.
</ol>
<p>
You can find some further To-do lists here:
</p>
<ul>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/GL3.txt"
target="_parent"><b>GL3.txt</b></a></li>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/docs/llvm-todo.txt"
target="_parent"><b>LLVMpipe - todo</b></a></li>
<li><a href="http://dri.freedesktop.org/wiki/MissingFunctionality"
target="_parent"><b>MissingFunctionality</b></a></li>
<li><a href="http://dri.freedesktop.org/wiki/RadeonsiToDo"
target="_parent"><b>RadeonsiToDo</b></a></li>
<li><a href="http://dri.freedesktop.org/wiki/R600ToDo"
target="_parent"><b>R600ToDo</b></a></li>
<li><a href="http://dri.freedesktop.org/wiki/R300ToDo"
target="_parent"><b>R300ToDo</b></a></li>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/i915/TODO"
target="_parent"><b>i915g TODO</b></a></li>
</ul>
<p>
If you want to do something new in Mesa, first join the Mesa developer's

View File

@@ -151,9 +151,6 @@ You'll see a set of library files similar to this:
lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
-rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
@@ -162,8 +159,6 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
<p>
<b>libGL</b> is the main OpenGL library (i.e. Mesa).
<br>
<b>libGLU</b> is the OpenGL Utility library.
<br>
<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
</p>

View File

@@ -166,6 +166,17 @@ of the OpenGL specification is implemented.
</p>
<h2>Version 9.x features</h2>
<p>
Version 9.x of Mesa implements the OpenGL 3.1 API.
While the driver for Intel Sandy Bridge and Ivy Bridge is the only
driver to support OpenGL 3.1, many developers across the open-source
community contributed features required for OpenGL 3.1. The primary
features added since the Mesa 8.0 release are
GL_ARB_texture_buffer_object and GL_ARB_uniform_buffer_object.
</p>
<h2>Version 8.x features</h2>
<p>
Version 8.x of Mesa implements the OpenGL 3.0 API.

View File

@@ -95,8 +95,6 @@ Device drivers src/mesa/drivers/* MIT, generally
Ext headers include/GL/glext.h Khronos
include/GL/glxext.h
SGI GLU library src/glu/sgi/ SGI Free B
</pre>
<p>

View File

@@ -9,6 +9,24 @@
<h1>News</h1>
<h2>October 8, 2012</h2>
<p>
<a href="relnotes-9.0.html">Mesa 9.0</a> is released.
This is the first version of Mesa to support OpenGL 3.1 and GLSL 1.40
(with the i965 driver).
See the release notes for more information about the release.
</p>
<h2>July 10, 2012</h2>
<p>
<a href="relnotes-8.0.4.html">Mesa 8.0.4</a> is released.
This is a bug fix release.
</p>
<h2>May 18, 2012</h2>
<p>

201
docs/relnotes-8.0.4.html Normal file
View File

@@ -0,0 +1,201 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 8.0.4 Release Notes / July 10, 2012</h1>
<p>
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
</p>
<p>
Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.0.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
02b96082d2f1ad72e7385f4022afafb9 MesaLib-8.0.4.tar.gz
d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2
1f0fdabe6e8019d4de6c16e20e74d163 MesaLib-8.0.4.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length &lt;= buffer-&gt;width0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb-&gt;rtt_level &lt;= strb-&gt;texture-&gt;last_level' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-8.0.3..mesa-8.0.4
</pre>
<p>Andreas Betz (1):</p>
<ul>
<li>vega: fix 565 color unpacking bug</li>
</ul>
<p>Antoine Labour (2):</p>
<ul>
<li>meta: Cleanup the resources we allocate.</li>
<li>mesa: Free uniforms correclty.</li>
</ul>
<p>Brian Paul (22):</p>
<ul>
<li>docs: add link to 8.0.3 release notes</li>
<li>mesa: fix Z32_FLOAT -&gt; uint conversion functions</li>
<li>draw: fix primitive restart bug by using the index buffer offset</li>
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
<li>svga: fix synchronization bug between sampler views and surfaces</li>
<li>mesa: new _mesa_error_check_format_and_type() function</li>
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
<li>mesa: fix missing return value in getteximage_error_check()</li>
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
<li>svga: add 0.5 in float-&gt;int conversion of sample min/max lod</li>
<li>svga: fix min/max lod clamping</li>
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
<li>draw: fix missing immediates bug in polygon stipple code</li>
<li>st/mesa: fix max_offset computation for base vertex</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
</ul>
<p>Dylan Noblesmith (1):</p>
<ul>
<li>mesa: require GL_MAX_SAMPLES &gt;= 4 for GL 3.0</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/vs: Fix texelFetchOffset()</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>docs: Add 8.0.3 release md5sums</li>
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
<li>glsl: Remove spurious printf messages</li>
<li>glsl: Fix pi/2 constant in acos built-in function</li>
<li>mesa: Bump version number to 8.0.4</li>
</ul>
<p>José Fonseca (2):</p>
<ul>
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
</ul>
<p>Kenneth Graunke (15):</p>
<ul>
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
</ul>
<p>Kurt Roeckx (1):</p>
<ul>
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
</ul>
<p>Lukas Rössler (1):</p>
<ul>
<li>glu: fix two Clang warnings</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
<li>st/mesa: don't do srgb-&gt;linear conversion in decompress_with_blit</li>
</ul>
<p>Paul Seidler (1):</p>
<ul>
<li>tests: include mesa headers</li>
</ul>
<p>Stéphane Marchesin (3):</p>
<ul>
<li>glx: Handle a null reply in QueryVersion.</li>
<li>i915g: Don't invert signalled/unsignalled fences</li>
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
</ul>
<p>Thomas Gstädtner (1):</p>
<ul>
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
</ul>
<p>Vadim Girlin (2):</p>
<ul>
<li>st/mesa: set stObj-&gt;lastLevel in guess_and_alloc_texture</li>
<li>r600g: check gpr count limit</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
</ul>
</body>
</html>

View File

@@ -1,56 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 8.1 Release Notes / date TBD</h1>
<p>
Mesa 8.1 is a new development release.
</p>
<p>
Mesa 8.1 implements the OpenGL 3.0 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.0.
</p>
<h2>MD5 checksums</h2>
<pre>
tbd
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_base_instance extension</li>
<li>GL_NV_read_buffer extension for ES 2.0</li>
<li>GL_ARB_shader_bit_encoding</li>
<li>GL_EXT_unpack_subimage for ES 2.0</li>
<li>GL_EXT_read_format_bgra for ES 1.1 and 2.0</li>
<li>GL_ARB_debug_output</li>
</ul>
<h2>Bug fixes</h2>
<p>TBD -- This list is likely incomplete.</p>
<h2>Changes</h2>
<p>TBD</p>
</body>
</html>

157
docs/relnotes-9.0.1.html Normal file
View File

@@ -0,0 +1,157 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 9.0.1 Release Notes / November 14th, 2012</h1>
<p>
Mesa 9.0.1 is a bug fix release which fixes bugs found since the 9.0 release.
</p>
<p>
Mesa 9.0 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
TBD.
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=44912">Bug 44912</a> - [bisected] WebGL conformance/textures/texture-mips tests fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55856">Bug 55856</a> - kwin with gles window content is not updating (gen4)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56057">Bug 56057</a> - INTEL_swap_event not correctly listed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56211">Bug 56211</a> - src/mesa/state_tracker/st_cb_texture.c:1123:copy_image_data_to_texture: Assertion `u_minify(stImage-&gt;pt-&gt;height0, src_level) == stImage-&gt;base.Height' failed.</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
</ul>
<h2>Changes</h2>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-9.0..mesa-9.0.1
</pre>
<p>Adam Jackson (1):</p>
<ul>
<li>glx: Add GLXBadProfileARB to the error string list</li>
</ul>
<p>Andreas Boll (7):</p>
<ul>
<li>docs: add news item for 9.0 release</li>
<li>mesa: add get-pick-list.sh script into bin/</li>
<li>mesa: add initial .cherry-ignore file for the 9.0 branch</li>
<li>mesa: use .cherry-ignore in the get-pick-list.sh script</li>
<li>build: add config.sub and config.guess to tarballs target</li>
<li>build: add missing Makefile.in files to tarballs target</li>
<li>build: add missing files to tarballs target</li>
</ul>
<p>Brian Paul (2):</p>
<ul>
<li>mesa: don't call TexImage driver hooks for zero-sized images</li>
<li>mesa: fix error check for zero-sized compressed subtexture</li>
</ul>
<p>Fredrik Höglund (1):</p>
<ul>
<li>egl_dri2/x11: Fix eglPostSubBufferNV()</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>docs: Add 9.0 release md5sums</li>
<li>i965: Fix regression in depth texture rendering on pre-SNB</li>
<li>glx: Set sRGBCapable to a default value</li>
<li>docs: Add 9.0.1 release notes</li>
<li>mesa: Bump version to 9.0.1</li>
</ul>
<p>Imre Deak (7):</p>
<ul>
<li>mesa: glGet: fix indentation of _mesa_init_get_hash</li>
<li>mesa: glGet: fix indentation of find_value</li>
<li>mesa: glGet: fix indentation of print_table_stats</li>
<li>mesa: glGet: fix API check for EGL_image_external enums</li>
<li>glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section</li>
<li>mesa: glGet: fix parameter lookup for apps using multiple APIs</li>
<li>glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS</li>
</ul>
<p>Jonas Ådahl (1):</p>
<ul>
<li>wayland: Destroy frame callback when destroying surface</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>glsl: Allow ir_if in the linker's move_non_declarations function.</li>
</ul>
<p>Kristian Høgsberg (5):</p>
<ul>
<li>gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()</li>
<li>gbm: Use the kms dumb ioctls for cursor instead of libkms</li>
<li>egl/wayland: Update to Wayland 0.99 API</li>
<li>wayland: Remove 0.85 compatibility #ifdefs</li>
<li>wayland: Drop support for ill-defined, unused wl_egl_pixmap</li>
</ul>
<p>Marcin Slusarz (1):</p>
<ul>
<li>nouveau: use pre-calculated stride for resource_get_handle</li>
</ul>
<p>Matt Turner (4):</p>
<ul>
<li>egl: Return EGL_BAD_MATCH for invalid profile attributes</li>
<li>Re-add HAVE_PTHREADS preprocessor macro</li>
<li>build: Ship install-sh in the tarball</li>
<li>ralloc: Annotate printf functions with PRINTFLIKE(...)</li>
</ul>
<p>Michel Dänzer (2):</p>
<ul>
<li>st/mesa: Fix source miptree level for copying data to finalized miptree.</li>
<li>st/mesa: Fix assertions for copying texture image to finalized miptree.</li>
</ul>
<p>Owen W. Taylor (1):</p>
<ul>
<li>glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()</li>
</ul>
<p>Quentin Glidic (1):</p>
<ul>
<li>intel: Add missing #include &lt;time.h&gt;</li>
</ul>
<p>Tomeu Vizoso (1):</p>
<ul>
<li>mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs</li>
</ul>
</body>
</html>

92
docs/relnotes-9.0.html Normal file
View File

@@ -0,0 +1,92 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Mesa 9.0 Release Notes / October 8th, 2012</h1>
<p>
Mesa 9.0 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 9.0.1.
</p>
<p>
Mesa 9.0 implements the OpenGL 3.1 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.1. OpenGL
3.1 is <strong>only</strong> available if requested at context creation
because GL_ARB_compatibility is not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
be4cd34c6599a7cb9d254b05c48bdb1f MesaLib-9.0.tar.gz
60e557ce407be3732711da484ab3db6c MesaLib-9.0.tar.bz2
16b128544cd3f7e237927bb9f8aab7ce MesaLib-9.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>Added new Gallium3D - nv30 driver</li>
<li>Added new Gallium3D - radeonsi driver</li>
<li>Added OpenCL state tracker Clover</li>
<li>Completed VDPAU state tracker (video decoding support is currently limited to MPEG1 and MPEG2)</li>
<li>GL_ARB_base_instance</li>
<li>GL_ARB_blend_func_extended</li>
<li>GL_ARB_debug_output</li>
<li>GL_ARB_invalidate_subdata - Currently a "no-op" implementation. This
extension is always enabled in all drivers.</li>
<li>GL_ARB_shader_bit_encoding</li>
<li>GL_ARB_texture_buffer_object</li>
<li>GL_ARB_timer_query</li>
<li>GL_ARB_transform_feedback3</li>
<li>GL_ARB_transform_feedback_instanced</li>
<li>GL_ARB_uniform_buffer_object</li>
<li>GL_EXT_unpack_subimage for ES 2.0</li>
<li>GL_EXT_read_format_bgra for ES 1.1 and 2.0</li>
<li>GL_EXT_texture_rg for ES 2.x</li>
<li>GL_NV_read_buffer for ES 2.0</li>
<li>GLX_ARB_create_context_robustness</li>
<li>EGL_KHR_create_context</li>
<li>EGL_KHR_surfaceless_context - This replaces the
EGL_KHR_surfaceless_{gles1,gles2,opengl} extensions that were never approved
by Khronos.</li>
<li>EGL_EXT_create_context_robustness</li>
</ul>
<h2>Bug fixes</h2>
<p>TBD -- This list is likely incomplete.</p>
<h2>Changes</h2>
<ul>
<li>
The legacy/static Makefile system (ex: 'make linux-dri') has been removed.
<br>
The two supported build methods are now autoconf/automake and SCons.
</li>
<li>Removed support for GL_ARB_shadow_ambient extension</li>
<li>Removed Gallium3D - nvfx driver (use nv30 instead)</li>
<li>
libGLU has been moved into its own repository, found at <a href="http://cgit.freedesktop.org/mesa/glu/">http://cgit.freedesktop.org/mesa/glu/</a>
</li>
</ul>
</body>
</html>

View File

@@ -14,11 +14,15 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
<li><a href="relnotes-8.1.html">8.1 release notes</a>
<li><a href="relnotes-9.0.1.html">9.0.1 release notes</a>
<li><a href="relnotes-9.0.html">9.0 release notes</a>
<li><a href="relnotes-8.0.4.html">8.0.4 release notes</a>
<li><a href="relnotes-8.0.3.html">8.0.3 release notes</a>
<li><a href="relnotes-8.0.2.html">8.0.2 release notes</a>
<li><a href="relnotes-8.0.1.html">8.0.1 release notes</a>
<li><a href="relnotes-8.0.html">8.0 release notes</a>
<li><a href="relnotes-7.11.2.html">7.11.2 release notes</a>
<li><a href="relnotes-7.11.1.html">7.11.1 release notes</a>
<li><a href="relnotes-7.11.html">7.11 release notes</a>
<li><a href="relnotes-7.10.3.html">7.10.3 release notes</a>
<li><a href="relnotes-7.10.2.html">7.10.2 release notes</a>

View File

@@ -243,7 +243,7 @@ regressions.
</p>
<p>
The <a href="http://people.freedesktop.org/~nh/piglit/" target="_parent">Piglit</a> project
The <a href="http://piglit.freedesktop.org/" target="_parent">Piglit</a> project
has many GLSL tests and the
<a href="http://glean.sf.net" target="_parent">Glean</a> glsl1 test
tests GLSL features.

View File

@@ -146,11 +146,6 @@ each directory.
</ul>
</ul>
<ul>
<li><b>glu</b> - The OpenGL Utility library
<ul>
<li><b>sgi</b> - GLU from SGI
<li><b>mesa</b> - Mesa version of GLU (deprecated)
</ul>
<li><b>glx</b> - The GLX library code for building libGL. This is used for
direct rendering drivers. It will dynamically load one of the
xxx_dri.so drivers.

View File

@@ -9,19 +9,25 @@
<h1>Development Utilities</h1>
<ul>
<dl>
<dt><a href="http://cgit.freedesktop.org/mesa/demos"
target="_parent">Mesa demos collection</a></dt>
<dd>includes several utility routines in the <code>src/util/</code>
directory.</dd>
<li>The Mesa distribution includes several utility routines in the
progs/util/ directory
<dt><a href="http://piglit.freedesktop.org"
target="_parent">Piglit</a></dt>
<dd>is an open-source test suite for OpenGL implementations.</dd>
<li>Allen Akin's <a href="http://glean.sourceforge.net/"
target="_parent">glean</a> is a framework for OpenGL testing.
<dt><a href="https://github.com/apitrace/apitrace"
target="_parent">ApiTrace</a></dt>
<dd>is a project to trace, analyze and debug graphics api's.</dd>
<li><a href="http://www.valgrind.org"
target="_parent">Valgrind</a> is a very useful tool for tracking down
memory-related problems in your code.
</ul>
<dt><a href="http://www.valgrind.org"
target="_parent">Valgrind</a></dt>
<dd>is a very useful tool for tracking down
memory-related problems in your code.</dd>
</dl>
</body>
</html>

View File

@@ -11,9 +11,8 @@ PROJECT_NAME = "Mesa GLSL module"
#---------------------------------------------------------------------------
INPUT = ../src/glsl/
RECURSIVE = NO
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
../src/glsl/glsl_lexer.h \
../src/glsl/glsl_parser.cpp \
EXCLUDE = ../src/glsl/glsl_lexer.cc \
../src/glsl/glsl_parser.cc \
../src/glsl/glsl_parser.h
EXCLUDE_PATTERNS =
#---------------------------------------------------------------------------

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2012 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -34,8 +34,8 @@ extern "C" {
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 15052 $ on $Date: 2011-07-06 17:43:46 -0700 (Wed, 06 Jul 2011) $ */
#define EGL_EGLEXT_VERSION 10
/* $Revision: 18699 $ on $Date: 2012-07-31 03:04:59 -0700 (Tue, 31 Jul 2012) $ */
#define EGL_EGLEXT_VERSION 14
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
@@ -178,15 +178,15 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
#ifndef EGL_NV_coverage_sample
#define EGL_NV_coverage_sample 1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
#endif
#ifndef EGL_NV_depth_nonlinear
#define EGL_NV_depth_nonlinear 1
#define EGL_DEPTH_ENCODING_NV 0x30E2
#define EGL_DEPTH_ENCODING_NV 0x30E2
#define EGL_DEPTH_ENCODING_NONE_NV 0
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
@@ -208,12 +208,12 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
typedef void* EGLSyncNV;
typedef khronos_utime_nanoseconds_t EGLTimeNV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
EGLBoolean eglFenceNV (EGLSyncNV sync);
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
@@ -313,7 +313,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */
#ifndef EGL_NV_system_time
#define EGL_NV_system_time 1
@@ -328,6 +328,134 @@ typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
#endif
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
#ifndef EGL_KHR_stream
#define EGL_KHR_stream 1
typedef void* EGLStreamKHR;
typedef khronos_uint64_t EGLuint64KHR;
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
#define EGL_PRODUCER_FRAME_KHR 0x3212
#define EGL_CONSUMER_FRAME_KHR 0x3213
#define EGL_STREAM_STATE_KHR 0x3214
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
#define EGL_BAD_STREAM_KHR 0x321B
#define EGL_BAD_STATE_KHR 0x321C
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_consumer_gltexture
#define EGL_KHR_stream_consumer_gltexture 1
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_producer_eglsurface
#define EGL_KHR_stream_producer_eglsurface 1
#define EGL_STREAM_BIT_KHR 0x0800
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_producer_aldatalocator
#define EGL_KHR_stream_producer_aldatalocator 1
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_fifo
#define EGL_KHR_stream_fifo 1
/* reuse EGLTimeKHR */
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
#endif
#endif
#ifndef EGL_EXT_create_context_robustness
#define EGL_EXT_create_context_robustness 1
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
#endif
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
#endif
#ifndef EGL_KHR_create_context
#define EGL_KHR_create_context 1
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
#endif
#ifndef EGL_KHR_surfaceless_context
#define EGL_KHR_surfaceless_context 1
/* No tokens/entry points, just relaxes an error condition */
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_cross_process_fd
#define EGL_KHR_stream_cross_process_fd 1
typedef int EGLNativeFileDescriptorKHR;
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif
#endif
#include <EGL/eglmesaext.h>
#ifdef __cplusplus

View File

@@ -112,14 +112,24 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
#define EGL_TEXTURE_Y_UV_WL 0x31D8
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
struct wl_display;
struct wl_buffer;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
#endif
#ifndef EGL_NOK_swap_region

File diff suppressed because it is too large Load Diff

View File

@@ -1,353 +0,0 @@
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* 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 including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* 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
* SILICON GRAPHICS, INC. 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.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*/
#ifndef __glu_h__
#define __glu_h__
#if defined(USE_MGL_NAMESPACE)
#include "glu_mangle.h"
#endif
#include <GL/gl.h>
#ifndef GLAPIENTRY
#if defined(_MSC_VER) || defined(__MINGW32__)
#define GLAPIENTRY __stdcall
#else
#define GLAPIENTRY
#endif
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *
#endif
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32)
# undef GLAPI
# define GLAPI __declspec(dllexport)
#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL)
/* tag specifying we're building for DLL runtime support */
# undef GLAPI
# define GLAPI __declspec(dllimport)
#elif !defined(GLAPI)
/* for use with static link lib build of Win32 edition only */
# define GLAPI extern
#endif /* _STATIC_MESA support */
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************/
/* Extensions */
#define GLU_EXT_object_space_tess 1
#define GLU_EXT_nurbs_tessellator 1
/* Boolean */
#define GLU_FALSE 0
#define GLU_TRUE 1
/* Version */
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
#define GLU_VERSION_1_3 1
/* StringName */
#define GLU_VERSION 100800
#define GLU_EXTENSIONS 100801
/* ErrorCode */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
#define GLU_INVALID_OPERATION 100904
/* NurbsDisplay */
/* GLU_FILL */
#define GLU_OUTLINE_POLYGON 100240
#define GLU_OUTLINE_PATCH 100241
/* NurbsCallback */
#define GLU_NURBS_ERROR 100103
#define GLU_ERROR 100103
#define GLU_NURBS_BEGIN 100164
#define GLU_NURBS_BEGIN_EXT 100164
#define GLU_NURBS_VERTEX 100165
#define GLU_NURBS_VERTEX_EXT 100165
#define GLU_NURBS_NORMAL 100166
#define GLU_NURBS_NORMAL_EXT 100166
#define GLU_NURBS_COLOR 100167
#define GLU_NURBS_COLOR_EXT 100167
#define GLU_NURBS_TEXTURE_COORD 100168
#define GLU_NURBS_TEX_COORD_EXT 100168
#define GLU_NURBS_END 100169
#define GLU_NURBS_END_EXT 100169
#define GLU_NURBS_BEGIN_DATA 100170
#define GLU_NURBS_BEGIN_DATA_EXT 100170
#define GLU_NURBS_VERTEX_DATA 100171
#define GLU_NURBS_VERTEX_DATA_EXT 100171
#define GLU_NURBS_NORMAL_DATA 100172
#define GLU_NURBS_NORMAL_DATA_EXT 100172
#define GLU_NURBS_COLOR_DATA 100173
#define GLU_NURBS_COLOR_DATA_EXT 100173
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
#define GLU_NURBS_END_DATA 100175
#define GLU_NURBS_END_DATA_EXT 100175
/* NurbsError */
#define GLU_NURBS_ERROR1 100251
#define GLU_NURBS_ERROR2 100252
#define GLU_NURBS_ERROR3 100253
#define GLU_NURBS_ERROR4 100254
#define GLU_NURBS_ERROR5 100255
#define GLU_NURBS_ERROR6 100256
#define GLU_NURBS_ERROR7 100257
#define GLU_NURBS_ERROR8 100258
#define GLU_NURBS_ERROR9 100259
#define GLU_NURBS_ERROR10 100260
#define GLU_NURBS_ERROR11 100261
#define GLU_NURBS_ERROR12 100262
#define GLU_NURBS_ERROR13 100263
#define GLU_NURBS_ERROR14 100264
#define GLU_NURBS_ERROR15 100265
#define GLU_NURBS_ERROR16 100266
#define GLU_NURBS_ERROR17 100267
#define GLU_NURBS_ERROR18 100268
#define GLU_NURBS_ERROR19 100269
#define GLU_NURBS_ERROR20 100270
#define GLU_NURBS_ERROR21 100271
#define GLU_NURBS_ERROR22 100272
#define GLU_NURBS_ERROR23 100273
#define GLU_NURBS_ERROR24 100274
#define GLU_NURBS_ERROR25 100275
#define GLU_NURBS_ERROR26 100276
#define GLU_NURBS_ERROR27 100277
#define GLU_NURBS_ERROR28 100278
#define GLU_NURBS_ERROR29 100279
#define GLU_NURBS_ERROR30 100280
#define GLU_NURBS_ERROR31 100281
#define GLU_NURBS_ERROR32 100282
#define GLU_NURBS_ERROR33 100283
#define GLU_NURBS_ERROR34 100284
#define GLU_NURBS_ERROR35 100285
#define GLU_NURBS_ERROR36 100286
#define GLU_NURBS_ERROR37 100287
/* NurbsProperty */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_METHOD 100205
#define GLU_U_STEP 100206
#define GLU_V_STEP 100207
#define GLU_NURBS_MODE 100160
#define GLU_NURBS_MODE_EXT 100160
#define GLU_NURBS_TESSELLATOR 100161
#define GLU_NURBS_TESSELLATOR_EXT 100161
#define GLU_NURBS_RENDERER 100162
#define GLU_NURBS_RENDERER_EXT 100162
/* NurbsSampling */
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
#define GLU_OBJECT_PATH_LENGTH 100209
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
#define GLU_PATH_LENGTH 100215
#define GLU_PARAMETRIC_ERROR 100216
#define GLU_DOMAIN_DISTANCE 100217
/* NurbsTrim */
#define GLU_MAP1_TRIM_2 100210
#define GLU_MAP1_TRIM_3 100211
/* QuadricDrawStyle */
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
/* QuadricCallback */
/* GLU_ERROR */
/* QuadricNormal */
#define GLU_SMOOTH 100000
#define GLU_FLAT 100001
#define GLU_NONE 100002
/* QuadricOrientation */
#define GLU_OUTSIDE 100020
#define GLU_INSIDE 100021
/* TessCallback */
#define GLU_TESS_BEGIN 100100
#define GLU_BEGIN 100100
#define GLU_TESS_VERTEX 100101
#define GLU_VERTEX 100101
#define GLU_TESS_END 100102
#define GLU_END 100102
#define GLU_TESS_ERROR 100103
#define GLU_TESS_EDGE_FLAG 100104
#define GLU_EDGE_FLAG 100104
#define GLU_TESS_COMBINE 100105
#define GLU_TESS_BEGIN_DATA 100106
#define GLU_TESS_VERTEX_DATA 100107
#define GLU_TESS_END_DATA 100108
#define GLU_TESS_ERROR_DATA 100109
#define GLU_TESS_EDGE_FLAG_DATA 100110
#define GLU_TESS_COMBINE_DATA 100111
/* TessContour */
#define GLU_CW 100120
#define GLU_CCW 100121
#define GLU_INTERIOR 100122
#define GLU_EXTERIOR 100123
#define GLU_UNKNOWN 100124
/* TessProperty */
#define GLU_TESS_WINDING_RULE 100140
#define GLU_TESS_BOUNDARY_ONLY 100141
#define GLU_TESS_TOLERANCE 100142
/* TessError */
#define GLU_TESS_ERROR1 100151
#define GLU_TESS_ERROR2 100152
#define GLU_TESS_ERROR3 100153
#define GLU_TESS_ERROR4 100154
#define GLU_TESS_ERROR5 100155
#define GLU_TESS_ERROR6 100156
#define GLU_TESS_ERROR7 100157
#define GLU_TESS_ERROR8 100158
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
#define GLU_TESS_MISSING_END_POLYGON 100153
#define GLU_TESS_MISSING_END_CONTOUR 100154
#define GLU_TESS_COORD_TOO_LARGE 100155
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
/* TessWinding */
#define GLU_TESS_WINDING_ODD 100130
#define GLU_TESS_WINDING_NONZERO 100131
#define GLU_TESS_WINDING_POSITIVE 100132
#define GLU_TESS_WINDING_NEGATIVE 100133
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
/*************************************************************/
#ifdef __cplusplus
class GLUnurbs;
class GLUquadric;
class GLUtesselator;
#else
typedef struct GLUnurbs GLUnurbs;
typedef struct GLUquadric GLUquadric;
typedef struct GLUtesselator GLUtesselator;
#endif
typedef GLUnurbs GLUnurbsObj;
typedef GLUquadric GLUquadricObj;
typedef GLUtesselator GLUtesselatorObj;
typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)(void);
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
#ifdef __cplusplus
}
#endif
#endif /* __glu_h__ */

View File

@@ -1,86 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 3.0
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GLU_MANGLE_H
#define GLU_MANGLE_H
#define gluLookAt mgluLookAt
#define gluOrtho2D mgluOrtho2D
#define gluPerspective mgluPerspective
#define gluPickMatrix mgluPickMatrix
#define gluProject mgluProject
#define gluUnProject mgluUnProject
#define gluErrorString mgluErrorString
#define gluScaleImage mgluScaleImage
#define gluBuild1DMipmaps mgluBuild1DMipmaps
#define gluBuild2DMipmaps mgluBuild2DMipmaps
#define gluNewQuadric mgluNewQuadric
#define gluDeleteQuadric mgluDeleteQuadric
#define gluQuadricDrawStyle mgluQuadricDrawStyle
#define gluQuadricOrientation mgluQuadricOrientation
#define gluQuadricNormals mgluQuadricNormals
#define gluQuadricTexture mgluQuadricTexture
#define gluQuadricCallback mgluQuadricCallback
#define gluCylinder mgluCylinder
#define gluSphere mgluSphere
#define gluDisk mgluDisk
#define gluPartialDisk mgluPartialDisk
#define gluNewNurbsRenderer mgluNewNurbsRenderer
#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer
#define gluLoadSamplingMatrices mgluLoadSamplingMatrices
#define gluNurbsProperty mgluNurbsProperty
#define gluGetNurbsProperty mgluGetNurbsProperty
#define gluBeginCurve mgluBeginCurve
#define gluEndCurve mgluEndCurve
#define gluNurbsCurve mgluNurbsCurve
#define gluBeginSurface mgluBeginSurface
#define gluEndSurface mgluEndSurface
#define gluNurbsSurface mgluNurbsSurface
#define gluBeginTrim mgluBeginTrim
#define gluEndTrim mgluEndTrim
#define gluPwlCurve mgluPwlCurve
#define gluNurbsCallback mgluNurbsCallback
#define gluNewTess mgluNewTess
#define gluDeleteTess mgluDeleteTess
#define gluTessBeginPolygon mgluTessBeginPolygon
#define gluTessBeginContour mgluTessBeginContour
#define gluTessVertex mgluTessVertex
#define gluTessEndPolygon mgluTessEndPolygon
#define gluTessEndContour mgluTessEndContour
#define gluTessProperty mgluTessProperty
#define gluTessNormal mgluTessNormal
#define gluTessCallback mgluTessCallback
#define gluGetTessProperty mgluGetTessProperty
#define gluBeginPolygon mgluBeginPolygon
#define gluNextContour mgluNextContour
#define gluEndPolygon mgluEndPolygon
#define gluGetString mgluGetString
#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels
#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels
#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels
#define gluBuild3DMipmaps mgluBuild3DMipmaps
#define gluCheckExtension mgluCheckExtension
#define gluUnProject4 mgluUnProject4
#define gluNurbsCallbackData mgluNurbsCallbackData
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
#endif

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2012 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -48,9 +48,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2010/08/06 */
/* glxext.h last updated 2012/02/29 */
/* Current version at http://www.opengl.org/registry/ */
#define GLX_GLXEXT_VERSION 32
#define GLX_GLXEXT_VERSION 33
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -440,6 +440,10 @@ extern "C" {
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif
#ifndef GLX_EXT_swap_control_tear
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
#endif
/*************************************************************/
@@ -964,9 +968,9 @@ typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoC
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern int glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
extern void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef int ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
#endif
#ifndef GLX_NV_copy_image
@@ -985,6 +989,10 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
#define GLX_NV_multisample_coverage 1
#endif
#ifndef GLX_EXT_swap_control_tear
#define GLX_EXT_swap_control_tear 1
#endif
#ifdef __cplusplus
}

View File

@@ -800,17 +800,35 @@ struct __DRIdri2LoaderExtensionRec {
#define __DRI_DRI2_VERSION 3
#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
#define __DRI_API_GLES 1
#define __DRI_API_GLES2 2
#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
#define __DRI_API_GLES2 2 /**< OpenGL ES 2.0 or 3.0 */
#define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
#define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
#define __DRI_CTX_ATTRIB_MINOR_VERSION 1
#define __DRI_CTX_ATTRIB_FLAGS 2
/**
* \requires __DRI2_ROBUSTNESS.
*/
#define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
#define __DRI_CTX_FLAG_DEBUG 0x00000001
#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
/**
* \requires __DRI2_ROBUSTNESS.
*/
#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
/**
* \name Context reset strategies.
*/
/*@{*/
#define __DRI_CTX_RESET_NO_NOTIFICATION 0
#define __DRI_CTX_RESET_LOSE_CONTEXT 1
/*@}*/
/**
* \name Reasons that __DRIdri2Extension::createContextAttribs might fail
*/
@@ -894,24 +912,77 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 4
#define __DRI_IMAGE_VERSION 5
/**
* These formats correspond to the similarly named MESA_FORMAT_*
* tokens, except in the native endian of the CPU. For example, on
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
*
* __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
* by the driver (YUV planar formats) but serve as a base image for
* creating sub-images for the different planes within the image.
*
* R8, GR88 and NONE should not be used with createImageFormName or
* createImage, and are returned by query from sub images created with
* createImageFromNames (NONE, see above) and fromPlane (R8 & GR88).
*/
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
#define __DRI_IMAGE_FORMAT_GR88 0x1007
#define __DRI_IMAGE_FORMAT_NONE 0x1008
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004
#define __DRI_IMAGE_USE_WRITE 0x0008
#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
/**
* Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
* and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
*
* \since 5
*/
#define __DRI_IMAGE_FOURCC_RGB565 0x36314752
#define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241
#define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
#define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
#define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
#define __DRI_IMAGE_FOURCC_YUV410 0x39565559
#define __DRI_IMAGE_FOURCC_YUV411 0x31315559
#define __DRI_IMAGE_FOURCC_YUV420 0x32315559
#define __DRI_IMAGE_FOURCC_YUV422 0x36315559
#define __DRI_IMAGE_FOURCC_YUV444 0x34325559
#define __DRI_IMAGE_FOURCC_NV12 0x3231564e
#define __DRI_IMAGE_FOURCC_NV16 0x3631564e
#define __DRI_IMAGE_FOURCC_YUYV 0x56595559
/**
* Queryable on images created by createImageFromNames.
*
* RGB and RGBA are may be usable directly as images but its still
* recommended to call fromPlanar with plane == 0.
*
* Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
* usable sub-images, sampling from images return raw YUV data and
* color conversion needs to be done in the shader.
*
* \since 5
*/
#define __DRI_IMAGE_COMPONENTS_RGB 0x3001
#define __DRI_IMAGE_COMPONENTS_RGBA 0x3002
#define __DRI_IMAGE_COMPONENTS_Y_U_V 0x3003
#define __DRI_IMAGE_COMPONENTS_Y_UV 0x3004
#define __DRI_IMAGE_COMPONENTS_Y_XUXV 0x3005
/**
* queryImage attributes
@@ -921,6 +992,9 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
#define __DRI_IMAGE_ATTRIB_FORMAT 0x2003 /* available in versions 3+ */
#define __DRI_IMAGE_ATTRIB_WIDTH 0x2004 /* available in versions 4+ */
#define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005
#define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
@@ -958,11 +1032,35 @@ struct __DRIimageExtensionRec {
GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
/**
* Write data into image.
* Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
* __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
* also per block and not per pixel (for non-RGB, see gallium blocks).
*
* \since 4
* \since 5
*/
int (*write)(__DRIimage *image, const void *buf, size_t count);
__DRIimage *(*createImageFromNames)(__DRIscreen *screen,
int width, int height, int fourcc,
int *names, int num_names,
int *strides, int *offsets,
void *loaderPrivate);
/**
* Create an image out of a sub-region of a parent image. This
* entry point lets us create individual __DRIimages for different
* planes in a planar buffer (typically yuv), for example. While a
* sub-image shares the underlying buffer object with the parent
* image and other sibling sub-images, the life times of parent and
* sub-images are not dependent. Destroying the parent or a
* sub-image doesn't affect other images. The underlying buffer
* object is free when no __DRIimage remains that references it.
*
* Sub-images may overlap, but rendering to overlapping sub-images
* is undefined.
*
* \since 5
*/
__DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
void *loaderPrivate);
};
@@ -1000,4 +1098,21 @@ struct __DRI2configQueryExtensionRec {
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
};
/**
* Robust context driver extension.
*
* Existence of this extension means the driver can accept the
* \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
* \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
* \c __DRIdri2ExtensionRec::createContextAttribs.
*/
#define __DRI2_ROBUSTNESS "DRI_Robustness"
#define __DRI2_ROBUSTNESS_VERSION 1
typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
struct __DRIrobustnessExtensionRec {
__DRIextension base;
};
#endif

View File

@@ -1,7 +1,7 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
/* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */
/* $Revision: 18099 $ on $Date:: 2012-06-06 09:16:19 -0700 #$ */
#ifdef __cplusplus
extern "C" {
@@ -93,6 +93,9 @@ typedef void* GLeglImageOES;
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
/* GL_OES_required_internalformat */
/* No new tokens introduced by this extension. */
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
@@ -207,6 +210,37 @@ typedef void* GLeglImageOES;
#define GL_MAX_SAMPLES_ANGLE 0x8D57
#endif
/* GL_ANGLE_instanced_arrays */
#ifndef GL_ANGLE_instanced_arrays
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
#endif
/* GL_ANGLE_pack_reverse_row_order */
#ifndef GL_ANGLE_pack_reverse_row_order
#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
#endif
/* GL_ANGLE_texture_compression_dxt3 */
#ifndef GL_ANGLE_texture_compression_dxt3
#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
#endif
/* GL_ANGLE_texture_compression_dxt5 */
#ifndef GL_ANGLE_texture_compression_dxt5
#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
#endif
/* GL_ANGLE_texture_usage */
#ifndef GL_ANGLE_texture_usage
#define GL_TEXTURE_USAGE_ANGLE 0x93A2
#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
#endif
/* GL_ANGLE_translated_shader_source */
#ifndef GL_ANGLE_translated_shader_source
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
#endif
/*------------------------------------------------------------------------*
* APPLE extension tokens
*------------------------------------------------------------------------*/
@@ -261,6 +295,29 @@ typedef void* GLeglImageOES;
#define GL_MAX_EXT 0x8008
#endif
/* GL_EXT_color_buffer_half_float */
#ifndef GL_EXT_color_buffer_half_float
#define GL_RGBA16F_EXT 0x881A
#define GL_RGB16F_EXT 0x881B
#define GL_RG16F_EXT 0x822F
#define GL_R16F_EXT 0x822D
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
#endif
/* GL_EXT_debug_label */
#ifndef GL_EXT_debug_label
#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
#define GL_PROGRAM_OBJECT_EXT 0x8B40
#define GL_SHADER_OBJECT_EXT 0x8B48
#define GL_BUFFER_OBJECT_EXT 0x9151
#define GL_QUERY_OBJECT_EXT 0x9153
#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
#endif
/* GL_EXT_debug_marker */
/* No new tokens introduced by this extension. */
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_COLOR_EXT 0x1800
@@ -268,9 +325,26 @@ typedef void* GLeglImageOES;
#define GL_STENCIL_EXT 0x1802
#endif
/* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134
#define GL_MAX_SAMPLES_EXT 0x9135
#endif
/* GL_EXT_multi_draw_arrays */
/* No new tokens introduced by this extension. */
/* GL_EXT_occlusion_query_boolean */
#ifndef GL_EXT_occlusion_query_boolean
#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
#define GL_CURRENT_QUERY_EXT 0x8865
#define GL_QUERY_RESULT_EXT 0x8866
#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
#endif
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_BGRA_EXT 0x80E1
@@ -278,9 +352,53 @@ typedef void* GLeglImageOES;
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
/* GL_EXT_robustness */
#ifndef GL_EXT_robustness
/* reuse GL_NO_ERROR */
#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
#endif
/* GL_EXT_separate_shader_objects */
#ifndef GL_EXT_separate_shader_objects
#define GL_VERTEX_SHADER_BIT_EXT 0x00000001
#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002
#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
#define GL_PROGRAM_SEPARABLE_EXT 0x8258
#define GL_ACTIVE_PROGRAM_EXT 0x8259
#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
#endif
/* GL_EXT_shader_texture_lod */
/* No new tokens introduced by this extension. */
/* GL_EXT_shadow_samplers */
#ifndef GL_EXT_shadow_samplers
#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D
#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E
#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
#endif
/* GL_EXT_sRGB */
#ifndef GL_EXT_sRGB
#define GL_SRGB_EXT 0x8C40
#define GL_SRGB_ALPHA_EXT 0x8C42
#define GL_SRGB8_ALPHA8_EXT 0x8C43
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
@@ -292,17 +410,46 @@ typedef void* GLeglImageOES;
#define GL_BGRA_EXT 0x80E1
#endif
/* GL_EXT_texture_rg */
#ifndef GL_EXT_texture_rg
#define GL_RED_EXT 0x1903
#define GL_RG_EXT 0x8227
#define GL_R8_EXT 0x8229
#define GL_RG8_EXT 0x822B
#endif
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
#define GL_ALPHA8_EXT 0x803C
#define GL_LUMINANCE8_EXT 0x8040
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
#define GL_RGBA32F_EXT 0x8814
#define GL_RGB32F_EXT 0x8815
#define GL_ALPHA32F_EXT 0x8816
#define GL_LUMINANCE32F_EXT 0x8818
#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
/* reuse GL_RGBA16F_EXT */
/* reuse GL_RGB16F_EXT */
#define GL_ALPHA16F_EXT 0x881C
#define GL_LUMINANCE16F_EXT 0x881E
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGB10_EXT 0x8052
#define GL_BGRA8_EXT 0x93A1
#define GL_R8_EXT 0x8229
#define GL_RG8_EXT 0x822B
#define GL_R32F_EXT 0x822E
#define GL_RG32F_EXT 0x8230
#define GL_R16F_EXT 0x822D
#define GL_RG16F_EXT 0x822F
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
/* GL_EXT_unpack_subimage */
#ifndef GL_EXT_unpack_subimage
#define GL_UNPACK_ROW_LENGTH 0x0CF2
@@ -319,6 +466,15 @@ typedef void* GLeglImageOES;
#define GL_SHADER_BINARY_DMP 0x9250
#endif
/*------------------------------------------------------------------------*
* FJ extension tokens
*------------------------------------------------------------------------*/
/* GL_FJ_shader_binary_GCCSO */
#ifndef GL_FJ_shader_binary_GCCSO
#define GCCSO_SHADER_BINARY_FJ 0x9260
#endif
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
@@ -631,6 +787,11 @@ typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum
#define GL_OES_packed_depth_stencil 1
#endif
/* GL_OES_required_internalformat */
#ifndef GL_OES_required_internalformat
#define GL_OES_required_internalformat 1
#endif
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_OES_rgb8_rgba8 1
@@ -790,6 +951,45 @@ GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
#ifndef GL_ANGLE_instanced_arrays
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
#endif
typedef void (GL_APIENTRYP PFLGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
typedef void (GL_APIENTRYP PFLGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
typedef void (GL_APIENTRYP PFLGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
#endif
/* GL_ANGLE_pack_reverse_row_order */
#ifndef GL_ANGLE_pack_reverse_row_order
#define GL_ANGLE_pack_reverse_row_order 1
#endif
/* GL_ANGLE_texture_compression_dxt3 */
#ifndef GL_ANGLE_texture_compression_dxt3
#define GL_ANGLE_texture_compression_dxt3 1
#endif
/* GL_ANGLE_texture_compression_dxt5 */
#ifndef GL_ANGLE_texture_compression_dxt5
#define GL_ANGLE_texture_compression_dxt5 1
#endif
/* GL_ANGLE_texture_usage */
#ifndef GL_ANGLE_texture_usage
#define GL_ANGLE_texture_usage 1
#endif
#ifndef GL_ANGLE_translated_shader_source
#define GL_ANGLE_translated_shader_source 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
#endif
typedef void (GL_APIENTRYP PFLGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
#endif
/*------------------------------------------------------------------------*
* APPLE extension functions
*------------------------------------------------------------------------*/
@@ -843,6 +1043,35 @@ typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
#define GL_EXT_blend_minmax 1
#endif
/* GL_EXT_color_buffer_half_float */
#ifndef GL_EXT_color_buffer_half_float
#define GL_EXT_color_buffer_half_float 1
#endif
/* GL_EXT_debug_label */
#ifndef GL_EXT_debug_label
#define GL_EXT_debug_label 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
#endif
typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
#endif
/* GL_EXT_debug_marker */
#ifndef GL_EXT_debug_marker
#define GL_EXT_debug_marker 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
#endif
typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
#endif
/* GL_EXT_discard_framebuffer */
#ifndef GL_EXT_discard_framebuffer
#define GL_EXT_discard_framebuffer 1
@@ -852,6 +1081,17 @@ GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numA
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
/* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_EXT_multisampled_render_to_texture 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
#ifdef GL_GLEXT_PROTOTYPES
@@ -862,16 +1102,134 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *fir
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
#endif
/* GL_EXT_occlusion_query_boolean */
#ifndef GL_EXT_occlusion_query_boolean
#define GL_EXT_occlusion_query_boolean 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
#endif
typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
#endif
/* GL_EXT_read_format_bgra */
#ifndef GL_EXT_read_format_bgra
#define GL_EXT_read_format_bgra 1
#endif
/* GL_EXT_robustness */
#ifndef GL_EXT_robustness
#define GL_EXT_robustness 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, float *params);
GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
#endif
typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
#endif
/* GL_EXT_separate_shader_objects */
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
#endif
typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
#endif
/* GL_EXT_shader_texture_lod */
#ifndef GL_EXT_shader_texture_lod
#define GL_EXT_shader_texture_lod 1
#endif
/* GL_EXT_shadow_samplers */
#ifndef GL_EXT_shadow_samplers
#define GL_EXT_shadow_samplers 1
#endif
/* GL_EXT_sRGB */
#ifndef GL_EXT_sRGB
#define GL_EXT_sRGB 1
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#endif
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
@@ -882,16 +1240,35 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_EXT_texture_format_BGRA8888 1
#endif
/* GL_EXT_texture_rg */
#ifndef GL_EXT_texture_rg
#define GL_EXT_texture_rg 1
#endif
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_EXT_texture_storage 1
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
#endif
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
#endif
/* GL_EXT_texture_type_2_10_10_10_REV */
#ifndef GL_EXT_texture_type_2_10_10_10_REV
#define GL_EXT_texture_type_2_10_10_10_REV 1
#endif
/* GL_EXT_texture_compression_dxt1 */
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#endif
/* GL_EXT_unpack_subimage */
#ifndef GL_EXT_unpack_subimage
#define GL_EXT_unpack_subimage 1
@@ -906,6 +1283,15 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_DMP_shader_binary 1
#endif
/*------------------------------------------------------------------------*
* FJ extension functions
*------------------------------------------------------------------------*/
/* GL_FJ_shader_binary_GCCSO */
#ifndef GL_FJ_shader_binary_GCCSO
#define GL_FJ_shader_binary_GCCSO 1
#endif
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/

View File

@@ -28,6 +28,37 @@ CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)
CHIPSET(0x016a, IVYBRIDGE_S_GT2, ivb_gt2)
CHIPSET(0x0402, HASWELL_GT1, hsw_gt1)
CHIPSET(0x0412, HASWELL_GT2, hsw_gt2)
CHIPSET(0x0422, HASWELL_GT2_PLUS, hsw_gt2)
CHIPSET(0x0406, HASWELL_M_GT1, hsw_gt1)
CHIPSET(0x0416, HASWELL_M_GT2, hsw_gt2)
CHIPSET(0x0A16, HASWELL_M_ULT_GT2, hsw_gt2)
CHIPSET(0x0426, HASWELL_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x040A, HASWELL_S_GT1, hsw_gt1)
CHIPSET(0x041A, HASWELL_S_GT2, hsw_gt2)
CHIPSET(0x042A, HASWELL_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C02, HASWELL_SDV_GT1, hsw_gt1)
CHIPSET(0x0C12, HASWELL_SDV_GT2, hsw_gt2)
CHIPSET(0x0C22, HASWELL_SDV_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C06, HASWELL_SDV_M_GT1, hsw_gt1)
CHIPSET(0x0C16, HASWELL_SDV_M_GT2, hsw_gt2)
CHIPSET(0x0C26, HASWELL_SDV_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0C0A, HASWELL_SDV_S_GT1, hsw_gt1)
CHIPSET(0x0C1A, HASWELL_SDV_S_GT2, hsw_gt2)
CHIPSET(0x0C2A, HASWELL_SDV_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A02, HASWELL_ULT_GT1, hsw_gt1)
CHIPSET(0x0A12, HASWELL_ULT_GT2, hsw_gt2)
CHIPSET(0x0A22, HASWELL_ULT_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A06, HASWELL_ULT_M_GT1, hsw_gt1)
CHIPSET(0x0A16, HASWELL_ULT_M_GT2, hsw_gt2)
CHIPSET(0x0A26, HASWELL_ULT_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0A0A, HASWELL_ULT_S_GT1, hsw_gt1)
CHIPSET(0x0A1A, HASWELL_ULT_S_GT2, hsw_gt2)
CHIPSET(0x0A2A, HASWELL_ULT_S_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D12, HASWELL_CRW_GT1, hsw_gt1)
CHIPSET(0x0D22, HASWELL_CRW_GT2, hsw_gt2)
CHIPSET(0x0D32, HASWELL_CRW_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D16, HASWELL_CRW_M_GT1, hsw_gt1)
CHIPSET(0x0D26, HASWELL_CRW_M_GT2, hsw_gt2)
CHIPSET(0x0D36, HASWELL_CRW_M_GT2_PLUS, hsw_gt2)
CHIPSET(0x0D1A, HASWELL_CRW_S_GT1, hsw_gt1)
CHIPSET(0x0D2A, HASWELL_CRW_S_GT2, hsw_gt2)
CHIPSET(0x0D3A, HASWELL_CRW_S_GT2_PLUS, hsw_gt2)

View File

@@ -157,6 +157,7 @@ CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
CHIPSET(0x68C7, REDWOOD_68C7, REDWOOD)
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
@@ -179,6 +180,8 @@ CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
CHIPSET(0x688C, CYPRESS_688C, CYPRESS)
CHIPSET(0x688D, CYPRESS_688D, CYPRESS)
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)

View File

@@ -12,9 +12,12 @@ CHIPSET(0x679F, TAHITI_679F, TAHITI)
CHIPSET(0x6800, PITCAIRN_6800, PITCAIRN)
CHIPSET(0x6801, PITCAIRN_6801, PITCAIRN)
CHIPSET(0x6802, PITCAIRN_6802, PITCAIRN)
CHIPSET(0x6806, PITCAIRN_6806, PITCAIRN)
CHIPSET(0x6808, PITCAIRN_6808, PITCAIRN)
CHIPSET(0x6809, PITCAIRN_6809, PITCAIRN)
CHIPSET(0x6810, PITCAIRN_6810, PITCAIRN)
CHIPSET(0x6816, PITCAIRN_6816, PITCAIRN)
CHIPSET(0x6817, PITCAIRN_6817, PITCAIRN)
CHIPSET(0x6818, PITCAIRN_6818, PITCAIRN)
CHIPSET(0x6819, PITCAIRN_6819, PITCAIRN)
CHIPSET(0x684C, PITCAIRN_684C, PITCAIRN)

5
m4/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4

309
m4/ax_pthread.m4 Normal file
View File

@@ -0,0 +1,309 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 18
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
AC_MSG_RESULT($ax_pthread_ok)
if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case ${host_os} in
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
esac
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($ax_pthread_ok)
if test "x$ax_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case ${host_os} in
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
flag="-mt -D_REENTRANT"
fi
;;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
ax_cv_PTHREAD_PRIO_INHERIT, [
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@@ -235,6 +235,15 @@ def parse_source_list(env, filename, names=None):
# parse the source list file
parser = source_list.SourceListParser()
src = env.File(filename).srcnode()
cur_srcdir = env.Dir('.').srcnode().abspath
top_srcdir = env.Dir('#').abspath
top_builddir = os.path.join(top_srcdir, env['build_dir'])
# Populate the symbol table of the Makefile parser.
parser.add_symbol('top_srcdir', top_srcdir)
parser.add_symbol('top_builddir', top_builddir)
sym_table = parser.parse(src.abspath)
if names:
@@ -249,7 +258,21 @@ def parse_source_list(env, filename, names=None):
src_lists = {}
for sym in symbols:
val = sym_table[sym]
src_lists[sym] = [f for f in val.split(' ') if f]
srcs = []
for f in val.split():
if f:
# Process source paths
if f.startswith(top_builddir + '/src'):
# Automake puts build output on a `src` subdirectory, bue
# SCons does no, so strip it here.
f = top_builddir + f[len(top_builddir + '/src'):]
if f.startswith(cur_srcdir + '/'):
# Prefer relative source paths, as absolute files tend to
# cause duplicate actions.
f = f[len(cur_srcdir + '/'):]
srcs.append(f)
src_lists[sym] = srcs
# if names are given, concatenate the lists
if names:

View File

@@ -140,6 +140,8 @@ def generate(env):
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
env['clang'] = env['CC'] == 'clang'
env['icc'] = 'icc' == os.path.basename(env['CC'])
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
@@ -153,6 +155,7 @@ def generate(env):
gcc = env['gcc']
msvc = env['msvc']
suncc = env['suncc']
icc = env['icc']
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
@@ -248,7 +251,7 @@ def generate(env):
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_PTHREAD',
'HAVE_POSIX_MEMALIGN',
]
if env['platform'] == 'darwin':
@@ -295,6 +298,10 @@ def generate(env):
cppdefines += ['BEOS_THREADS']
if env['embedded']:
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
if env['texture_float']:
print 'warning: Floating-point textures enabled.'
print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.'
cppdefines += ['TEXTURE_FLOAT_ENABLED']
env.Append(CPPDEFINES = cppdefines)
# C compiler options
@@ -368,7 +375,6 @@ def generate(env):
ccflags += [
'-Wall',
'-Wno-long-long',
'-ffast-math',
'-fmessage-length=0', # be nice to Eclipse
]
cflags += [
@@ -382,6 +388,10 @@ def generate(env):
cflags += [
'-Wdeclaration-after-statement',
]
if icc:
cflags += [
'-std=gnu99',
]
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
@@ -405,7 +415,6 @@ def generate(env):
'/GL-', # disable whole program optimization
]
ccflags += [
'/fp:fast', # fast floating point
'/W3', # warning level
#'/Wp64', # enable 64 bit porting warnings
'/wd4996', # disable deprecated POSIX name warnings
@@ -484,12 +493,12 @@ def generate(env):
env.Append(SHLINKFLAGS = shlinkflags)
# We have C++ in several libraries, so always link with the C++ compiler
if env['gcc']:
if env['gcc'] or env['clang']:
env['LINK'] = env['CXX']
# Default libs
libs = []
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
if env['platform'] in ('darwin', 'freebsd', 'linux', 'posix', 'sunos'):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
@@ -516,7 +525,7 @@ def generate(env):
createInstallMethods(env)
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1'])
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
env.PkgCheckModules('DRM', ['libdrm >= 2.4.24'])
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.30'])

View File

@@ -178,7 +178,12 @@ def generate(env):
pass
env.MergeFlags(cppflags)
env.ParseConfig('llvm-config --libs engine bitwriter')
components = ['engine', 'bitwriter', 'x86asmprinter']
if llvm_version >= distutils.version.LooseVersion('3.1'):
components.append('mcjit')
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version

View File

@@ -13,6 +13,7 @@ The goal is to allow Makefile's and SConscript's to share source listing.
class SourceListParser(object):
def __init__(self):
self.symbol_table = {}
self._reset()
def _reset(self, filename=None):
@@ -20,7 +21,6 @@ class SourceListParser(object):
self.line_no = 1
self.line_cont = ''
self.symbol_table = {}
def _error(self, msg):
raise RuntimeError('%s:%d: %s' % (self.filename, self.line_no, msg))
@@ -125,3 +125,6 @@ class SourceListParser(object):
raise
return self.symbol_table
def add_symbol(self, name, value):
self.symbol_table[name] = value

View File

@@ -27,8 +27,6 @@ if not env['embedded']:
SConscript('glx/SConscript')
if env['platform'] not in ['darwin', 'haiku', 'sunos']:
SConscript('egl/main/SConscript')
if env['platform'] not in ['darwin']:
SConscript('glu/sgi/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')

View File

@@ -30,6 +30,7 @@ AM_CFLAGS = \
$(DEFINES) \
$(LIBDRM_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBKMS_CFLAGS) \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
noinst_LTLIBRARIES = libegl_dri2.la

View File

@@ -308,7 +308,7 @@ struct dri2_extension_match {
static struct dri2_extension_match dri2_driver_extensions[] = {
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
{ __DRI_DRI2, 1, offsetof(struct dri2_egl_display, dri2) },
{ __DRI_DRI2, 2, offsetof(struct dri2_egl_display, dri2) },
{ NULL, 0, 0 }
};
@@ -322,12 +322,12 @@ static struct dri2_extension_match dri2_core_extensions[] = {
static struct dri2_extension_match swrast_driver_extensions[] = {
{ __DRI_CORE, 1, offsetof(struct dri2_egl_display, core) },
{ __DRI_SWRAST, 2, offsetof(struct dri2_egl_display, swrast) },
{ NULL }
{ NULL, 0, 0 }
};
static struct dri2_extension_match swrast_core_extensions[] = {
{ __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) },
{ NULL }
{ NULL, 0, 0 }
};
static EGLBoolean
@@ -464,16 +464,10 @@ dri2_setup_screen(_EGLDisplay *disp)
unsigned int api_mask;
if (dri2_dpy->dri2) {
if (dri2_dpy->dri2->base.version >= 2)
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
else
api_mask = 1 << __DRI_API_OPENGL;
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
} else {
assert(dri2_dpy->swrast);
if (dri2_dpy->swrast->base.version >= 2)
api_mask = 1 << __DRI_API_OPENGL | 1 << __DRI_API_GLES | 1 << __DRI_API_GLES2;
else
api_mask = 1 << __DRI_API_OPENGL;
api_mask = 1 << __DRI_API_OPENGL | 1 << __DRI_API_GLES | 1 << __DRI_API_GLES2;
}
disp->ClientAPIs = 0;
@@ -484,19 +478,14 @@ dri2_setup_screen(_EGLDisplay *disp)
if (api_mask & (1 << __DRI_API_GLES2))
disp->ClientAPIs |= EGL_OPENGL_ES2_BIT;
if (dri2_dpy->dri2) {
if (dri2_dpy->dri2->base.version >= 2) {
disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
disp->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
disp->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
}
} else {
assert(dri2_dpy->swrast);
if (dri2_dpy->swrast->base.version >= 2) {
disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
disp->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
disp->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
}
assert(dri2_dpy->dri2 || dri2_dpy->swrast);
disp->Extensions.KHR_surfaceless_context = EGL_TRUE;
if (dri2_dpy->dri2 && dri2_dpy->dri2->base.version >= 3) {
disp->Extensions.KHR_create_context = EGL_TRUE;
if (dri2_dpy->robustness)
disp->Extensions.EXT_create_context_robustness = EGL_TRUE;
}
if (dri2_dpy->image) {
@@ -535,8 +524,16 @@ dri2_create_screen(_EGLDisplay *disp)
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
unsigned i;
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
goto cleanup_dri_screen;
for (i = 0; extensions[i]; i++) {
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
}
}
} else {
assert(dri2_dpy->swrast);
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
@@ -653,6 +650,8 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
struct dri2_egl_context *dri2_ctx;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx_shared = dri2_egl_context(share_list);
__DRIcontext *shared =
dri2_ctx_shared ? dri2_ctx_shared->dri_context : NULL;
struct dri2_egl_config *dri2_config = dri2_egl_config(conf);
const __DRIconfig *dri_config;
int api;
@@ -670,11 +669,12 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
switch (dri2_ctx->base.ClientAPI) {
case EGL_OPENGL_ES_API:
switch (dri2_ctx->base.ClientVersion) {
switch (dri2_ctx->base.ClientMajorVersion) {
case 1:
api = __DRI_API_GLES;
break;
case 2:
case 3:
api = __DRI_API_GLES2;
break;
default:
@@ -683,7 +683,13 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
}
break;
case EGL_OPENGL_API:
api = __DRI_API_OPENGL;
if ((dri2_ctx->base.ClientMajorVersion >= 4
|| (dri2_ctx->base.ClientMajorVersion == 3
&& dri2_ctx->base.ClientMinorVersion >= 2))
&& dri2_ctx->base.Profile == EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR)
api = __DRI_API_OPENGL_CORE;
else
api = __DRI_API_OPENGL;
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
@@ -713,44 +719,72 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
dri_config = NULL;
if (dri2_dpy->dri2) {
if (dri2_dpy->dri2->base.version >= 2) {
if (dri2_dpy->dri2->base.version >= 3) {
unsigned error;
unsigned num_attribs = 0;
uint32_t ctx_attribs[8];
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMajorVersion;
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
ctx_attribs[num_attribs++] = dri2_ctx->base.ClientMinorVersion;
if (dri2_ctx->base.Flags != 0) {
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
* extension, don't even try to send it the robust-access flag.
* It may explode. Instead, generate the required EGL error here.
*/
if ((dri2_ctx->base.Flags & EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR) != 0
&& !dri2_dpy->robustness) {
_eglError(EGL_BAD_MATCH, "eglCreateContext");
goto cleanup;
}
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
ctx_attribs[num_attribs++] = dri2_ctx->base.Flags;
}
if (dri2_ctx->base.ResetNotificationStrategy != EGL_NO_RESET_NOTIFICATION_KHR) {
/* If the implementation doesn't support the __DRI2_ROBUSTNESS
* extension, don't even try to send it a reset strategy. It may
* explode. Instead, generate the required EGL error here.
*/
if (!dri2_dpy->robustness) {
_eglError(EGL_BAD_CONFIG, "eglCreateContext");
goto cleanup;
}
ctx_attribs[num_attribs++] = __DRI_CTX_ATTRIB_RESET_STRATEGY;
ctx_attribs[num_attribs++] = __DRI_CTX_RESET_LOSE_CONTEXT;
}
assert(num_attribs <= ARRAY_SIZE(ctx_attribs));
dri2_ctx->dri_context =
dri2_dpy->dri2->createContextAttribs(dri2_dpy->dri_screen,
api,
dri_config,
shared,
num_attribs / 2,
ctx_attribs,
& error,
dri2_ctx);
} else {
dri2_ctx->dri_context =
dri2_dpy->dri2->createNewContextForAPI(dri2_dpy->dri_screen,
api,
dri_config,
dri2_ctx_shared ?
dri2_ctx_shared->dri_context : NULL,
shared,
dri2_ctx);
} else if (api == __DRI_API_OPENGL) {
dri2_ctx->dri_context =
dri2_dpy->dri2->createNewContext(dri2_dpy->dri_screen,
dri_config,
dri2_ctx_shared ?
dri2_ctx_shared->dri_context : NULL,
dri2_ctx);
} else {
/* fail */
}
} else {
assert(dri2_dpy->swrast);
if (dri2_dpy->swrast->base.version >= 2) {
dri2_ctx->dri_context =
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
api,
dri_config,
dri2_ctx_shared ?
dri2_ctx_shared->dri_context : NULL,
dri2_ctx);
} else if (api == __DRI_API_OPENGL) {
dri2_ctx->dri_context =
dri2_dpy->core->createNewContext(dri2_dpy->dri_screen,
dri_config,
dri2_ctx_shared ?
dri2_ctx_shared->dri_context : NULL,
dri2_ctx);
} else {
/* fail */
}
dri2_ctx->dri_context =
dri2_dpy->swrast->createNewContextForAPI(dri2_dpy->dri_screen,
api,
dri_config,
shared,
dri2_ctx);
}
if (!dri2_ctx->dri_context)
@@ -958,6 +992,32 @@ dri2_release_tex_image(_EGLDriver *drv,
return EGL_TRUE;
}
static _EGLImage *
dri2_create_image(_EGLDisplay *disp, __DRIimage *dri_image)
{
struct dri2_egl_image *dri2_img;
if (dri_image == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image");
return NULL;
}
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image");
return NULL;
}
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return NULL;
}
dri2_img->dri_image = dri_image;
return &dri2_img->base;
}
static _EGLImage *
dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer,
@@ -965,79 +1025,29 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_image *dri2_img;
GLuint renderbuffer = (GLuint) (uintptr_t) buffer;
__DRIimage *dri_image;
if (renderbuffer == 0) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
return EGL_NO_IMAGE_KHR;
}
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr");
return EGL_NO_IMAGE_KHR;
}
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return EGL_NO_IMAGE_KHR;
}
dri2_img->dri_image =
dri_image =
dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context,
renderbuffer,
dri2_img);
renderbuffer, NULL);
return &dri2_img->base;
}
static _EGLImage *
dri2_create_image_drm_name(_EGLDisplay *disp, _EGLContext *ctx,
EGLint name,
const _EGLImageAttribs *attrs,
EGLint format,
EGLint pitch)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_image *dri2_img;
(void) ctx;
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image_mesa_drm");
return NULL;
}
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return NULL;
}
dri2_img->dri_image =
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
attrs->Width,
attrs->Height,
format,
name,
pitch,
dri2_img);
if (dri2_img->dri_image == NULL) {
free(dri2_img);
_eglError(EGL_BAD_ALLOC, "dri2_create_image_mesa_drm");
return NULL;
}
return &dri2_img->base;
return dri2_create_image(disp, dri_image);
}
static _EGLImage *
dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
EGLint format, name, pitch, err;
_EGLImageAttribs attrs;
__DRIimage *dri_image;
name = (EGLint) (uintptr_t) buffer;
@@ -1063,52 +1073,76 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
return NULL;
}
return dri2_create_image_drm_name (disp, ctx, name, &attrs, format, pitch);
dri_image =
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
attrs.Width,
attrs.Height,
format,
name,
pitch,
NULL);
return dri2_create_image(disp, dri_image);
}
#ifdef HAVE_WAYLAND_PLATFORM
/* This structure describes how a wl_buffer maps to one or more
* __DRIimages. A wl_drm_buffer stores the wl_drm format code and the
* offsets and strides of the planes in the buffer. This table maps a
* wl_drm format code to a description of the planes in the buffer
* that lets us create a __DRIimage for each of the planes. */
static const struct wl_drm_components_descriptor {
uint32_t dri_components;
EGLint components;
int nplanes;
} wl_drm_components[] = {
{ __DRI_IMAGE_COMPONENTS_RGB, EGL_TEXTURE_RGB, 1 },
{ __DRI_IMAGE_COMPONENTS_RGBA, EGL_TEXTURE_RGBA, 1 },
{ __DRI_IMAGE_COMPONENTS_Y_U_V, EGL_TEXTURE_Y_U_V_WL, 3 },
{ __DRI_IMAGE_COMPONENTS_Y_UV, EGL_TEXTURE_Y_UV_WL, 2 },
{ __DRI_IMAGE_COMPONENTS_Y_XUXV, EGL_TEXTURE_Y_XUXV_WL, 2 },
};
static _EGLImage *
dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer _buffer,
const EGLint *attr_list)
{
struct wl_buffer *buffer = (struct wl_buffer *) _buffer;
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
const struct wl_drm_components_descriptor *f;
__DRIimage *dri_image;
_EGLImageAttribs attrs;
EGLint format, name, stride, pitch, err;
EGLint err;
int32_t plane;
if (!wayland_buffer_is_drm(buffer))
if (!wayland_buffer_is_drm(&buffer->buffer))
return NULL;
dri_image = wayland_drm_buffer_get_buffer(buffer);
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_NAME, &name);
dri2_dpy->image->queryImage(dri_image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS)
return NULL;
attrs.Width = buffer->width;
attrs.Height = buffer->height;
switch (wayland_drm_buffer_get_format(buffer)) {
case WL_DRM_FORMAT_ARGB8888:
format = __DRI_IMAGE_FORMAT_ARGB8888;
break;
case WL_DRM_FORMAT_XRGB8888:
format = __DRI_IMAGE_FORMAT_XRGB8888;
break;
default:
_eglError(EGL_BAD_PARAMETER,
"dri2_create_image_khr: unsupported wl_buffer format");
plane = attrs.PlaneWL;
if (err != EGL_SUCCESS) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
return NULL;
}
pitch = stride / 4;
f = buffer->driver_format;
if (plane < 0 || plane >= f->nplanes) {
_eglError(EGL_BAD_PARAMETER,
"dri2_create_image_wayland_wl_buffer (plane out of bounds)");
return NULL;
}
return dri2_create_image_drm_name(disp, ctx, name, &attrs, format, pitch);
dri_image = dri2_dpy->image->fromPlanar(buffer->driver_buffer, plane, NULL);
if (dri_image == NULL) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
return NULL;
}
return dri2_create_image(disp, dri_image);
}
#endif
@@ -1261,43 +1295,46 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img,
#ifdef HAVE_WAYLAND_PLATFORM
static void *
static void
dri2_wl_reference_buffer(void *user_data, uint32_t name,
int32_t width, int32_t height,
uint32_t stride, uint32_t format)
struct wl_drm_buffer *buffer)
{
_EGLDisplay *disp = user_data;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
__DRIimage *image;
int dri_format;
__DRIimage *img;
int i, dri_components = 0;
switch (format) {
case WL_DRM_FORMAT_ARGB8888:
dri_format =__DRI_IMAGE_FORMAT_ARGB8888;
break;
case WL_DRM_FORMAT_XRGB8888:
dri_format = __DRI_IMAGE_FORMAT_XRGB8888;
break;
default:
return NULL;
}
img = dri2_dpy->image->createImageFromNames(dri2_dpy->dri_screen,
buffer->buffer.width,
buffer->buffer.height,
buffer->format, (int*)&name, 1,
buffer->stride,
buffer->offset,
NULL);
image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
width, height,
dri_format, name, stride / 4,
NULL);
if (img == NULL)
return;
return image;
dri2_dpy->image->queryImage(img, __DRI_IMAGE_ATTRIB_COMPONENTS, &dri_components);
buffer->driver_format = NULL;
for (i = 0; i < ARRAY_SIZE(wl_drm_components); i++)
if (wl_drm_components[i].dri_components == dri_components)
buffer->driver_format = &wl_drm_components[i];
if (buffer->driver_format == NULL)
dri2_dpy->image->destroyImage(img);
else
buffer->driver_buffer = img;
}
static void
dri2_wl_release_buffer(void *user_data, void *buffer)
dri2_wl_release_buffer(void *user_data, struct wl_drm_buffer *buffer)
{
_EGLDisplay *disp = user_data;
__DRIimage *image = buffer;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->image->destroyImage(image);
dri2_dpy->image->destroyImage(buffer->driver_buffer);
}
static struct wayland_drm_callbacks wl_drm_callbacks = {
@@ -1346,6 +1383,33 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_TRUE;
}
static EGLBoolean
dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_buffer *_buffer,
EGLint attribute, EGLint *value)
{
struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
const struct wl_drm_components_descriptor *format;
if (!wayland_buffer_is_drm(&buffer->buffer))
return EGL_FALSE;
format = buffer->driver_format;
switch (attribute) {
case EGL_TEXTURE_FORMAT:
*value = format->components;
return EGL_TRUE;
case EGL_WIDTH:
*value = buffer->buffer.width;
break;
case EGL_HEIGHT:
*value = buffer->buffer.height;
break;
}
return EGL_FALSE;
}
#endif
static void
@@ -1443,6 +1507,7 @@ _eglBuiltInDriverDRI2(const char *args)
#ifdef HAVE_WAYLAND_PLATFORM
dri2_drv->base.API.BindWaylandDisplayWL = dri2_bind_wayland_display_wl;
dri2_drv->base.API.UnbindWaylandDisplayWL = dri2_unbind_wayland_display_wl;
dri2_drv->base.API.QueryWaylandBufferWL = dri2_query_wayland_buffer_wl;
#endif
dri2_drv->base.Name = "DRI2";

View File

@@ -99,6 +99,7 @@ struct dri2_egl_display
__DRI2flushExtension *flush;
__DRItexBufferExtension *tex_buffer;
__DRIimageExtension *image;
__DRIrobustnessExtension *robustness;
int fd;
int own_device;
@@ -121,8 +122,10 @@ struct dri2_egl_display
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_display *wl_dpy;
struct wl_registry *wl_registry;
struct wl_drm *wl_server_drm;
struct wl_drm *wl_drm;
struct wl_event_queue *wl_queue;
int authenticated;
int formats;
#endif
@@ -173,7 +176,7 @@ struct dri2_egl_surface
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *third_buffer;
__DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers;
struct wl_callback *frame_callback;
int format;
#endif

View File

@@ -500,6 +500,14 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
struct dri2_egl_config *dri2_conf;
unsigned int double_buffered = 0;
dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
__DRI_ATTRIB_DOUBLE_BUFFER, &double_buffered);
/* support only double buffered configs */
if (!double_buffered)
continue;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
count + 1, visuals[i].size, surface_type, NULL,
@@ -525,17 +533,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
/* there is no front buffer so no OpenGL */
dri2_conf->base.RenderableType &= ~EGL_OPENGL_BIT;
dri2_conf->base.Conformant &= ~EGL_OPENGL_BIT;
/*
* We want to make sure GL_DRAW_BUFFER for windows or pbuffers is always
* GL_BACK. For EGL configs that do not have a double DRI config, clear
* the surface type.
*
* This is just to be on the safe side. dri2_add_config never sets
* EGL_WINDOW_BIT or EGL_PBUFFER_BIT for such configs.
*/
if (!dri2_conf->dri_double_config)
dri2_conf->base.SurfaceType = 0;
}
return (count != 0);
@@ -660,18 +657,29 @@ droid_open_device(void)
return (fd >= 0) ? dup(fd) : -1;
}
/* support versions < JellyBean */
#ifndef ALOGW
#define ALOGW LOGW
#endif
#ifndef ALOGD
#define ALOGD LOGD
#endif
#ifndef ALOGI
#define ALOGI LOGI
#endif
static void
droid_log(EGLint level, const char *msg)
{
switch (level) {
case _EGL_DEBUG:
LOGD("%s", msg);
ALOGD("%s", msg);
break;
case _EGL_INFO:
LOGI("%s", msg);
ALOGI("%s", msg);
break;
case _EGL_WARNING:
LOGW("%s", msg);
ALOGW("%s", msg);
break;
case _EGL_FATAL:
LOG_FATAL("%s", msg);

View File

@@ -108,6 +108,8 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
switch (type) {
case EGL_WINDOW_BIT:
if (!window)
return NULL;
surf = gbm_dri_surface((struct gbm_surface *) window);
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;

View File

@@ -45,6 +45,34 @@ enum wl_drm_format_flags {
HAS_XRGB8888 = 2
};
static void
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
int *done = data;
*done = 1;
wl_callback_destroy(callback);
}
static const struct wl_callback_listener sync_listener = {
sync_callback
};
static int
roundtrip(struct dri2_egl_display *dri2_dpy)
{
struct wl_callback *callback;
int done = 0, ret = 0;
callback = wl_display_sync(dri2_dpy->wl_dpy);
wl_callback_add_listener(callback, &sync_listener, &done);
wl_proxy_set_queue((struct wl_proxy *) callback, dri2_dpy->wl_queue);
while (ret != -1 && !done)
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
return ret;
}
static void
wl_buffer_release(void *data, struct wl_buffer *buffer)
{
@@ -80,7 +108,6 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct dri2_egl_buffer *dri2_buf;
int i;
(void) drv;
@@ -104,7 +131,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->pending_buffer = NULL;
dri2_surf->third_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE;
dri2_surf->frame_callback = NULL;
if (conf->AlphaSize == 0)
dri2_surf->format = WL_DRM_FORMAT_XRGB8888;
@@ -118,17 +145,6 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->base.Width = -1;
dri2_surf->base.Height = -1;
break;
case EGL_PIXMAP_BIT:
dri2_surf->wl_pix = (struct wl_egl_pixmap *) window;
dri2_surf->base.Width = dri2_surf->wl_pix->width;
dri2_surf->base.Height = dri2_surf->wl_pix->height;
if (dri2_surf->wl_pix->driver_private) {
dri2_buf = dri2_surf->wl_pix->driver_private;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = dri2_buf->dri_buffer;
}
break;
default:
goto cleanup_surf;
}
@@ -166,15 +182,6 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
window, attrib_list);
}
static _EGLSurface *
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
pixmap, attrib_list);
}
/**
* Called via eglDestroySurface(), drv->API.DestroySurface().
*/
@@ -197,8 +204,7 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
if (dri2_surf->dri_buffers[i] && !(i == __DRI_BUFFER_FRONT_LEFT &&
dri2_surf->base.Type == EGL_PIXMAP_BIT))
if (dri2_surf->dri_buffers[i])
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
@@ -207,27 +213,14 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_surf->third_buffer);
}
if (dri2_surf->frame_callback)
wl_callback_destroy(dri2_surf->frame_callback);
free(surf);
return EGL_TRUE;
}
static void
dri2_wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
{
struct dri2_egl_buffer *dri2_buf = egl_pixmap->driver_private;
assert(dri2_buf);
dri2_buf->dri2_dpy->dri2->releaseBuffer(dri2_buf->dri2_dpy->dri_screen,
dri2_buf->dri_buffer);
free(dri2_buf);
egl_pixmap->driver_private = NULL;
egl_pixmap->destroy = NULL;
}
static struct wl_buffer *
wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
__DRIbuffer *buffer)
@@ -267,30 +260,6 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
}
}
static void
dri2_process_front_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct dri2_egl_buffer *dri2_buf;
switch (dri2_surf->base.Type) {
case EGL_PIXMAP_BIT:
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return;
dri2_buf->dri_buffer = dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT];
dri2_buf->dri2_dpy = dri2_dpy;
dri2_surf->wl_pix->driver_private = dri2_buf;
dri2_surf->wl_pix->destroy = dri2_wl_egl_pixmap_destroy;
break;
default:
break;
}
}
static void
dri2_release_pending_buffer(void *data,
struct wl_callback *callback, uint32_t time)
@@ -333,11 +302,13 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
switch (i) {
case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer)
wl_display_roundtrip(dri2_dpy->wl_dpy);
roundtrip(dri2_dpy);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
callback = wl_display_sync(dri2_dpy->wl_dpy);
wl_callback_add_listener(callback,
&release_buffer_listener, dri2_surf);
wl_proxy_set_queue((struct wl_proxy *) callback,
dri2_dpy->wl_queue);
break;
default:
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
@@ -466,9 +437,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
if (!dri2_surf->dri_buffers[attachments[i]])
continue;
if (attachments[i] == __DRI_BUFFER_FRONT_LEFT)
dri2_process_front_buffer(dri2_surf, attachments[i+1]);
else if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
if (attachments[i] == __DRI_BUFFER_BACK_LEFT)
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
}
@@ -479,13 +448,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
dri2_surf->buffer_count++;
}
assert(dri2_surf->base.Type == EGL_PIXMAP_BIT ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
if (dri2_surf->base.Type == EGL_PIXMAP_BIT && !dri2_surf->wl_pix->buffer)
dri2_surf->wl_pix->buffer =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]);
assert(dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
*out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0)
@@ -552,7 +515,7 @@ wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
{
struct dri2_egl_surface *dri2_surf = data;
dri2_surf->block_swap_buffers = EGL_FALSE;
dri2_surf->frame_callback = NULL;
wl_callback_destroy(callback);
}
@@ -569,17 +532,18 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
struct wl_callback *callback;
int ret = 0;
if (dri2_surf->block_swap_buffers) {
wl_display_flush(dri2_dpy->wl_dpy);
while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
}
while (dri2_surf->frame_callback && ret != -1)
ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
if (ret < 0)
return EGL_FALSE;
dri2_surf->block_swap_buffers = EGL_TRUE;
callback = wl_surface_frame(dri2_surf->wl_win->surface);
wl_callback_add_listener(callback, &frame_listener, dri2_surf);
dri2_surf->frame_callback = wl_surface_frame(dri2_surf->wl_win->surface);
wl_callback_add_listener(dri2_surf->frame_callback,
&frame_listener, dri2_surf);
wl_proxy_set_queue((struct wl_proxy *) dri2_surf->frame_callback,
dri2_dpy->wl_queue);
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
pointer_swap(
@@ -611,6 +575,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
wl_surface_commit(dri2_surf->wl_win->surface);
}
_EGLContext *ctx;
@@ -626,71 +592,6 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
return EGL_TRUE;
}
/**
* Called via eglCreateImageKHR(), drv->API.CreateImageKHR().
*/
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct wl_egl_pixmap *wl_egl_pixmap = (struct wl_egl_pixmap *) buffer;
struct dri2_egl_buffer *dri2_buf;
EGLint wl_attr_list[] = {
EGL_WIDTH, 0,
EGL_HEIGHT, 0,
EGL_DRM_BUFFER_STRIDE_MESA, 0,
EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA,
EGL_NONE
};
dri2_buf = malloc(sizeof *dri2_buf);
if (!dri2_buf)
return NULL;
dri2_buf->dri2_dpy = dri2_dpy;
dri2_buf->dri_buffer =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, 32,
wl_egl_pixmap->width,
wl_egl_pixmap->height);
wl_egl_pixmap->destroy = dri2_wl_egl_pixmap_destroy;
wl_egl_pixmap->driver_private = dri2_buf;
/* FIXME: Get buffer format from attr_list somehow... or from the
wl_egl_piaxmap. */
wl_egl_pixmap->buffer =
wl_drm_create_buffer(dri2_dpy->wl_drm,
dri2_buf->dri_buffer->name,
wl_egl_pixmap->width,
wl_egl_pixmap->height,
dri2_buf->dri_buffer->pitch,
WL_DRM_FORMAT_ARGB8888);
wl_attr_list[1] = wl_egl_pixmap->width;
wl_attr_list[3] = wl_egl_pixmap->height;
wl_attr_list[5] = dri2_buf->dri_buffer->pitch / 4;
return dri2_create_image_khr(disp->Driver, disp, ctx, EGL_DRM_BUFFER_MESA,
(EGLClientBuffer)(intptr_t) dri2_buf->dri_buffer->name, wl_attr_list);
}
static _EGLImage *
dri2_wayland_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
(void) drv;
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
}
static int
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
{
@@ -700,7 +601,8 @@ dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
dri2_dpy->authenticated = 0;
wl_drm_authenticate(dri2_dpy->wl_drm, id);
wl_display_roundtrip(dri2_dpy->wl_dpy);
if (roundtrip(dri2_dpy) < 0)
ret = -1;
if (!dri2_dpy->authenticated)
ret = -1;
@@ -795,22 +697,37 @@ static const struct wl_drm_listener drm_listener = {
drm_handle_authenticated
};
static void
registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
const char *interface, uint32_t version)
{
struct dri2_egl_display *dri2_dpy = data;
if (strcmp(interface, "wl_drm") == 0) {
dri2_dpy->wl_drm =
wl_registry_bind(registry, name, &wl_drm_interface, 1);
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
}
}
static const struct wl_registry_listener registry_listener = {
registry_handle_global
};
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
const __DRIconfig *config;
uint32_t id, types;
uint32_t types;
int i;
static const unsigned int argb_masks[4] =
{ 0xff0000, 0xff00, 0xff, 0xff000000 };
static const unsigned int rgb_masks[4] = { 0xff0000, 0xff00, 0xff, 0 };
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
drv->API.Terminate = dri2_terminate;
dri2_dpy = malloc(sizeof *dri2_dpy);
@@ -829,22 +746,19 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->wl_dpy = disp->PlatformDisplay;
}
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
wl_display_roundtrip(dri2_dpy->wl_dpy);
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
dri2_dpy->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
dri2_dpy->wl_registry = wl_display_get_registry(dri2_dpy->wl_dpy);
wl_proxy_set_queue((struct wl_proxy *) dri2_dpy->wl_registry,
dri2_dpy->wl_queue);
wl_registry_add_listener(dri2_dpy->wl_registry,
&registry_listener, dri2_dpy);
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->wl_drm == NULL)
goto cleanup_dpy;
dri2_dpy->wl_drm = wl_display_bind(dri2_dpy->wl_dpy, id, &wl_drm_interface);
if (!dri2_dpy->wl_drm)
goto cleanup_dpy;
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
wl_display_roundtrip(dri2_dpy->wl_dpy);
if (dri2_dpy->fd == -1)
if (roundtrip(dri2_dpy) < 0 || dri2_dpy->fd == -1)
goto cleanup_drm;
wl_display_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->authenticated)
if (roundtrip(dri2_dpy) < 0 || !dri2_dpy->authenticated)
goto cleanup_fd;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
@@ -871,7 +785,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_driver;
types = EGL_WINDOW_BIT | EGL_PIXMAP_BIT;
types = EGL_WINDOW_BIT;
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
config = dri2_dpy->driver_configs[i];
if (dri2_dpy->formats & HAS_XRGB8888)
@@ -880,8 +794,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_add_config(disp, config, i + 1, 0, types, NULL, argb_masks);
}
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
dri2_dpy->authenticate = dri2_wayland_authenticate;

View File

@@ -778,10 +778,9 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
if (numRects > (int)ARRAY_SIZE(rectangles))
return dri2_copy_region(drv, disp, draw, dri2_surf->region);
/* FIXME: Invert y here? */
for (i = 0; i < numRects; i++) {
rectangles[i].x = rects[i * 4];
rectangles[i].y = rects[i * 4 + 1];
rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
rectangles[i].width = rects[i * 4 + 2];
rectangles[i].height = rects[i * 4 + 3];
}
@@ -798,7 +797,7 @@ static EGLBoolean
dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
EGLint x, EGLint y, EGLint width, EGLint height)
{
const EGLint rect[4] = { x, draw->Height - y - height, width, height };
const EGLint rect[4] = { x, y, width, height };
if (x < 0 || y < 0 || width < 0 || height < 0)
_eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV");

View File

@@ -19,7 +19,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
GLAPI_LIB = ../mapi/glapi/libglapi.a
GLAPI_LIB = ../mapi/glapi/libglapi.la
if HAVE_XF86VIDMODE
EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE

View File

@@ -427,9 +427,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
if (!config) {
/* config may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
if (!disp->Extensions.KHR_surfaceless_context)
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
@@ -487,9 +485,7 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read,
RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE);
if (!draw_surf || !read_surf) {
/* surfaces may be NULL if surfaceless */
if (!disp->Extensions.KHR_surfaceless_gles1 &&
!disp->Extensions.KHR_surfaceless_gles2 &&
!disp->Extensions.KHR_surfaceless_opengl)
if (!disp->Extensions.KHR_surfaceless_context)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
if ((!draw_surf && draw != EGL_NO_SURFACE) ||
@@ -940,6 +936,7 @@ eglGetProcAddress(const char *procname)
#ifdef EGL_WL_bind_wayland_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
{ "eglQueryWaylandBufferWL", (_EGLProc) eglQueryWaylandBufferWL },
#endif
{ "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
{ NULL, NULL }
@@ -1540,6 +1537,25 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
RETURN_EGL_EVAL(disp, ret);
}
EGLBoolean EGLAPIENTRY
eglQueryWaylandBufferWL(EGLDisplay dpy,struct wl_buffer *buffer,
EGLint attribute, EGLint *value)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!buffer)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.QueryWaylandBufferWL(drv, disp, buffer, attribute, value);
RETURN_EGL_EVAL(disp, ret);
}
#endif

View File

@@ -123,6 +123,7 @@ typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _
struct wl_display;
typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
#endif
typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);
@@ -199,6 +200,7 @@ struct _egl_api
#ifdef EGL_WL_bind_wayland_display
BindWaylandDisplayWL_t BindWaylandDisplayWL;
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
QueryWaylandBufferWL_t QueryWaylandBufferWL;
#endif
PostSubBufferNV_t PostSubBufferNV;

View File

@@ -49,11 +49,12 @@ _eglGetContextAPIBit(_EGLContext *ctx)
switch (ctx->ClientAPI) {
case EGL_OPENGL_ES_API:
switch (ctx->ClientVersion) {
switch (ctx->ClientMajorVersion) {
case 1:
bit = EGL_OPENGL_ES_BIT;
break;
case 2:
case 3:
bit = EGL_OPENGL_ES2_BIT;
break;
default:
@@ -78,7 +79,8 @@ _eglGetContextAPIBit(_EGLContext *ctx)
* Parse the list of context attributes and return the proper error code.
*/
static EGLint
_eglParseContextAttribList(_EGLContext *ctx, const EGLint *attrib_list)
_eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
const EGLint *attrib_list)
{
EGLenum api = ctx->ClientAPI;
EGLint i, err = EGL_SUCCESS;
@@ -86,22 +88,113 @@ _eglParseContextAttribList(_EGLContext *ctx, const EGLint *attrib_list)
if (!attrib_list)
return EGL_SUCCESS;
if (api == EGL_OPENVG_API && attrib_list[0] != EGL_NONE) {
_eglLog(_EGL_DEBUG, "bad context attribute 0x%04x", attrib_list[0]);
return EGL_BAD_ATTRIBUTE;
}
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
EGLint attr = attrib_list[i++];
EGLint val = attrib_list[i];
switch (attr) {
case EGL_CONTEXT_CLIENT_VERSION:
if (api != EGL_OPENGL_ES_API) {
err = EGL_BAD_ATTRIBUTE;
break;
}
if (val != 1 && val != 2) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->ClientVersion = val;
ctx->ClientMajorVersion = val;
break;
case EGL_CONTEXT_MINOR_VERSION_KHR:
if (!dpy->Extensions.KHR_create_context) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->ClientMinorVersion = val;
break;
case EGL_CONTEXT_FLAGS_KHR:
if (!dpy->Extensions.KHR_create_context) {
err = EGL_BAD_ATTRIBUTE;
break;
}
/* The EGL_KHR_create_context spec says:
*
* "Flags are only defined for OpenGL context creation, and
* specifying a flags value other than zero for other types of
* contexts, including OpenGL ES contexts, will generate an
* error."
*/
if (api != EGL_OPENGL_API && val != 0) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->Flags = val;
break;
case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
if (!dpy->Extensions.KHR_create_context) {
err = EGL_BAD_ATTRIBUTE;
break;
}
/* The EGL_KHR_create_context spec says:
*
* "[EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR] is only meaningful for
* OpenGL contexts, and specifying it for other types of
* contexts, including OpenGL ES contexts, will generate an
* error."
*/
if (api != EGL_OPENGL_API) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->Profile = val;
break;
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR:
/* The EGL_KHR_create_context spec says:
*
* "[EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR] is only
* meaningful for OpenGL contexts, and specifying it for other
* types of contexts, including OpenGL ES contexts, will generate
* an error."
*/
if (!dpy->Extensions.KHR_create_context
|| api != EGL_OPENGL_API) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->ResetNotificationStrategy = val;
break;
case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
/* The EGL_EXT_create_context_robustness spec says:
*
* "[EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT] is only
* meaningful for OpenGL ES contexts, and specifying it for other
* types of contexts will generate an EGL_BAD_ATTRIBUTE error."
*/
if (!dpy->Extensions.EXT_create_context_robustness
|| api != EGL_OPENGL_ES_API) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->ResetNotificationStrategy = val;
break;
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:
if (!dpy->Extensions.EXT_create_context_robustness) {
err = EGL_BAD_ATTRIBUTE;
break;
}
ctx->Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
break;
default:
err = EGL_BAD_ATTRIBUTE;
break;
@@ -113,6 +206,144 @@ _eglParseContextAttribList(_EGLContext *ctx, const EGLint *attrib_list)
}
}
if (api == EGL_OPENGL_API) {
/* The EGL_KHR_create_context spec says:
*
* "If the requested OpenGL version is less than 3.2,
* EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR is ignored and the
* functionality of the context is determined solely by the
* requested version."
*
* Since the value is ignored, only validate the setting if the version
* is >= 3.2.
*/
if (ctx->ClientMajorVersion >= 4
|| (ctx->ClientMajorVersion == 3 && ctx->ClientMinorVersion >= 2)) {
switch (ctx->Profile) {
case EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR:
case EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR:
break;
default:
/* The EGL_KHR_create_context spec says:
*
* "* If an OpenGL context is requested, the requested version
* is greater than 3.2, and the value for attribute
* EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR has no bits set; has
* any bits set other than EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
* and EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR; has
* more than one of these bits set; or if the implementation does
* not support the requested profile, then an EGL_BAD_MATCH error
* is generated."
*/
err = EGL_BAD_MATCH;
break;
}
}
/* The EGL_KHR_create_context spec says:
*
* "* If an OpenGL context is requested and the values for
* attributes EGL_CONTEXT_MAJOR_VERSION_KHR and
* EGL_CONTEXT_MINOR_VERSION_KHR, when considered together with
* the value for attribute
* EGL_CONTEXT_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
* version and feature set that are not defined, than an
* EGL_BAD_MATCH error is generated.
*
* ... Thus, examples of invalid combinations of attributes
* include:
*
* - Major version < 1 or > 4
* - Major version == 1 and minor version < 0 or > 5
* - Major version == 2 and minor version < 0 or > 1
* - Major version == 3 and minor version < 0 or > 2
* - Major version == 4 and minor version < 0 or > 2
* - Forward-compatible flag set and major version < 3"
*/
if (ctx->ClientMajorVersion < 1 || ctx->ClientMinorVersion < 0)
err = EGL_BAD_MATCH;
switch (ctx->ClientMajorVersion) {
case 1:
if (ctx->ClientMinorVersion > 5
|| (ctx->Flags & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) != 0)
err = EGL_BAD_MATCH;
break;
case 2:
if (ctx->ClientMinorVersion > 1
|| (ctx->Flags & EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR) != 0)
err = EGL_BAD_MATCH;
break;
case 3:
/* Note: The text above is incorrect. There *is* an OpenGL 3.3!
*/
if (ctx->ClientMinorVersion > 3)
err = EGL_BAD_MATCH;
break;
case 4:
default:
/* Don't put additional version checks here. We don't know that
* there won't be versions > 4.2.
*/
break;
}
} else if (api == EGL_OPENGL_ES_API) {
/* The EGL_KHR_create_context spec says:
*
* "* If an OpenGL ES context is requested and the values for
* attributes EGL_CONTEXT_MAJOR_VERSION_KHR and
* EGL_CONTEXT_MINOR_VERSION_KHR specify an OpenGL ES version that
* is not defined, than an EGL_BAD_MATCH error is generated.
*
* ... Examples of invalid combinations of attributes include:
*
* - Major version < 1 or > 2
* - Major version == 1 and minor version < 0 or > 1
* - Major version == 2 and minor version != 0
*/
if (ctx->ClientMajorVersion < 1 || ctx->ClientMinorVersion < 0)
err = EGL_BAD_MATCH;
switch (ctx->ClientMajorVersion) {
case 1:
if (ctx->ClientMinorVersion > 1)
err = EGL_BAD_MATCH;
break;
case 2:
if (ctx->ClientMinorVersion > 0)
err = EGL_BAD_MATCH;
break;
case 3:
default:
/* Don't put additional version checks here. We don't know that
* there won't be versions > 3.0.
*/
break;
}
}
switch (ctx->ResetNotificationStrategy) {
case EGL_NO_RESET_NOTIFICATION_KHR:
case EGL_LOSE_CONTEXT_ON_RESET_KHR:
break;
default:
err = EGL_BAD_ATTRIBUTE;
break;
}
if ((ctx->Flags & ~(EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
| EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
| EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) != 0) {
err = EGL_BAD_ATTRIBUTE;
}
return err;
}
@@ -137,10 +368,15 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
ctx->ClientAPI = api;
ctx->Config = conf;
ctx->WindowRenderBuffer = EGL_NONE;
ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
ctx->ClientVersion = 1; /* the default, per EGL spec */
ctx->ClientMajorVersion = 1; /* the default, per EGL spec */
ctx->ClientMinorVersion = 0;
ctx->Flags = 0;
ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
ctx->ResetNotificationStrategy = EGL_NO_RESET_NOTIFICATION_KHR;
err = _eglParseContextAttribList(ctx, attrib_list);
err = _eglParseContextAttribList(ctx, dpy, attrib_list);
if (err == EGL_SUCCESS && ctx->Config) {
EGLint api_bit;
@@ -191,7 +427,7 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
*value = c->Config->ConfigID;
break;
case EGL_CONTEXT_CLIENT_VERSION:
*value = c->ClientVersion;
*value = c->ClientMajorVersion;
break;
case EGL_CONTEXT_CLIENT_TYPE:
*value = c->ClientAPI;
@@ -244,7 +480,6 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
_EGLThreadInfo *t = _eglGetCurrentThread();
_EGLDisplay *dpy;
EGLint conflict_api;
EGLBoolean surfaceless;
if (_eglIsCurrentThreadDummy())
return _eglError(EGL_BAD_ALLOC, "eglMakeCurrent");
@@ -257,22 +492,8 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
}
dpy = ctx->Resource.Display;
switch (_eglGetContextAPIBit(ctx)) {
case EGL_OPENGL_ES_BIT:
surfaceless = dpy->Extensions.KHR_surfaceless_gles1;
break;
case EGL_OPENGL_ES2_BIT:
surfaceless = dpy->Extensions.KHR_surfaceless_gles2;
break;
case EGL_OPENGL_BIT:
surfaceless = dpy->Extensions.KHR_surfaceless_opengl;
break;
default:
surfaceless = EGL_FALSE;
break;
}
if (!surfaceless && (draw == NULL || read == NULL))
if (!dpy->Extensions.KHR_surfaceless_context
&& (draw == NULL || read == NULL))
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
/*

View File

@@ -52,7 +52,11 @@ struct _egl_context
_EGLConfig *Config;
EGLint ClientAPI; /**< EGL_OPENGL_ES_API, EGL_OPENGL_API, EGL_OPENVG_API */
EGLint ClientVersion; /**< 1 = OpenGLES 1.x, 2 = OpenGLES 2.x */
EGLint ClientMajorVersion;
EGLint ClientMinorVersion;
EGLint Flags;
EGLint Profile;
EGLint ResetNotificationStrategy;
/* The real render buffer when a window surface is bound */
EGLint WindowRenderBuffer;

View File

@@ -42,7 +42,7 @@
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
#if PTHREADS
#if HAVE_PTHREAD
#include <pthread.h>
static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
@@ -108,7 +108,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
return EGL_TRUE;
}
#else /* PTHREADS */
#else /* HAVE_PTHREAD */
static const _EGLThreadInfo *_egl_TSD;
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
@@ -137,7 +137,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
return EGL_TRUE;
}
#endif /* !PTHREADS */
#endif /* !HAVE_PTHREAD */
static void

View File

@@ -103,9 +103,8 @@ struct _egl_extensions
EGLBoolean KHR_reusable_sync;
EGLBoolean KHR_fence_sync;
EGLBoolean KHR_surfaceless_gles1;
EGLBoolean KHR_surfaceless_gles2;
EGLBoolean KHR_surfaceless_opengl;
EGLBoolean KHR_surfaceless_context;
EGLBoolean KHR_create_context;
EGLBoolean NOK_swap_region;
EGLBoolean NOK_texture_from_pixmap;
@@ -113,6 +112,8 @@ struct _egl_extensions
EGLBoolean ANDROID_image_native_buffer;
EGLBoolean NV_post_sub_buffer;
EGLBoolean EXT_create_context_robustness;
};

View File

@@ -88,6 +88,11 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
attrs->DRMBufferStrideMESA = val;
break;
/* EGL_WL_bind_wayland_display */
case EGL_WAYLAND_PLANE_WL:
attrs->PlaneWL = val;
break;
default:
/* unknown attrs are ignored */
break;

View File

@@ -50,6 +50,9 @@ struct _egl_image_attribs
EGLint DRMBufferFormatMESA;
EGLint DRMBufferUseMESA;
EGLint DRMBufferStrideMESA;
/* EGL_WL_bind_wayland_display */
EGLint PlaneWL;
};
/**

View File

@@ -107,15 +107,16 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
_EGL_CHECK_EXTENSION(KHR_fence_sync);
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles1);
_EGL_CHECK_EXTENSION(KHR_surfaceless_gles2);
_EGL_CHECK_EXTENSION(KHR_surfaceless_opengl);
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
_EGL_CHECK_EXTENSION(KHR_create_context);
_EGL_CHECK_EXTENSION(NOK_swap_region);
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
#undef _EGL_CHECK_EXTENSION
}

View File

@@ -31,7 +31,7 @@
#include "eglcompiler.h"
#ifdef PTHREADS
#ifdef HAVE_PTHREAD
#include <pthread.h>
typedef pthread_mutex_t _EGLMutex;

View File

@@ -12,4 +12,11 @@ BUILT_SOURCES = wayland-drm-protocol.c \
wayland-drm-server-protocol.h
CLEANFILES = $(BUILT_SOURCES)
@wayland_scanner_rules@
%-protocol.c : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
%-server-protocol.h : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
%-client-protocol.h : %.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@

View File

@@ -36,17 +36,6 @@
#include "wayland-drm.h"
#include "wayland-drm-server-protocol.h"
/* Git master of Wayland is moving towards a stable version of the
* protocol, but breaking from 0.85 in the process. For the time
* being, it's convenient to be able to build Mesa against both master
* and 0.85.x of Wayland. To make this work we'll do a compile-time
* version check and work around the difference in API and protocol */
#if defined (WAYLAND_VERSION_MAJOR) && \
WAYLAND_VERSION_MAJOR == 0 && \
WAYLAND_VERSION_MINOR == 85
#define HAS_WAYLAND_0_85
#endif
struct wl_drm {
struct wl_display *display;
@@ -56,69 +45,37 @@ struct wl_drm {
struct wayland_drm_callbacks *callbacks;
};
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
uint32_t format;
void *driver_buffer;
};
static void
destroy_buffer(struct wl_resource *resource)
{
struct wl_drm_buffer *buffer = resource->data;
struct wl_drm *drm = buffer->drm;
drm->callbacks->release_buffer(drm->user_data,
buffer->driver_buffer);
drm->callbacks->release_buffer(drm->user_data, buffer);
free(buffer);
}
static void
buffer_destroy(struct wl_client *client, struct wl_resource *resource)
{
#ifdef HAS_WAYLAND_0_85
wl_resource_destroy(resource, 0);
#else
wl_resource_destroy(resource);
#endif
}
#ifdef HAS_WAYLAND_0_85
static void
buffer_damage(struct wl_client *client, struct wl_resource *buffer,
int32_t x, int32_t y, int32_t width, int32_t height)
{
}
#endif
const static struct wl_buffer_interface drm_buffer_interface = {
#ifdef HAS_WAYLAND_0_85
buffer_damage,
#endif
buffer_destroy
};
static void
drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
uint32_t id, uint32_t name, int32_t width, int32_t height,
uint32_t stride, uint32_t format)
create_buffer(struct wl_client *client, struct wl_resource *resource,
uint32_t id, uint32_t name, int32_t width, int32_t height,
uint32_t format,
int32_t offset0, int32_t stride0,
int32_t offset1, int32_t stride1,
int32_t offset2, int32_t stride2)
{
struct wl_drm *drm = resource->data;
struct wl_drm_buffer *buffer;
switch (format) {
case WL_DRM_FORMAT_ARGB8888:
case WL_DRM_FORMAT_XRGB8888:
break;
default:
wl_resource_post_error(resource,
WL_DRM_ERROR_INVALID_FORMAT,
"invalid format");
return;
}
buffer = calloc(1, sizeof *buffer);
if (buffer == NULL) {
wl_resource_post_no_memory(resource);
@@ -129,12 +86,14 @@ drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
buffer->buffer.width = width;
buffer->buffer.height = height;
buffer->format = format;
buffer->offset[0] = offset0;
buffer->stride[0] = stride0;
buffer->offset[1] = offset1;
buffer->stride[1] = stride1;
buffer->offset[2] = offset2;
buffer->stride[2] = stride2;
buffer->driver_buffer =
drm->callbacks->reference_buffer(drm->user_data, name,
width, height,
stride, format);
drm->callbacks->reference_buffer(drm->user_data, name, buffer);
if (buffer->driver_buffer == NULL) {
wl_resource_post_error(resource,
WL_DRM_ERROR_INVALID_NAME,
@@ -154,6 +113,56 @@ drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
wl_client_add_resource(resource->client, &buffer->buffer.resource);
}
static void
drm_create_buffer(struct wl_client *client, struct wl_resource *resource,
uint32_t id, uint32_t name, int32_t width, int32_t height,
uint32_t stride, uint32_t format)
{
switch (format) {
case WL_DRM_FORMAT_ARGB8888:
case WL_DRM_FORMAT_XRGB8888:
case WL_DRM_FORMAT_YUYV:
break;
default:
wl_resource_post_error(resource,
WL_DRM_ERROR_INVALID_FORMAT,
"invalid format");
return;
}
create_buffer(client, resource, id,
name, width, height, format, 0, stride, 0, 0, 0, 0);
}
static void
drm_create_planar_buffer(struct wl_client *client,
struct wl_resource *resource,
uint32_t id, uint32_t name,
int32_t width, int32_t height, uint32_t format,
int32_t offset0, int32_t stride0,
int32_t offset1, int32_t stride1,
int32_t offset2, int32_t stride2)
{
switch (format) {
case WL_DRM_FORMAT_YUV410:
case WL_DRM_FORMAT_YUV411:
case WL_DRM_FORMAT_YUV420:
case WL_DRM_FORMAT_YUV422:
case WL_DRM_FORMAT_YUV444:
case WL_DRM_FORMAT_NV12:
case WL_DRM_FORMAT_NV16:
break;
default:
wl_resource_post_error(resource,
WL_DRM_ERROR_INVALID_FORMAT,
"invalid format");
return;
}
create_buffer(client, resource, id, name, width, height, format,
offset0, stride0, offset1, stride1, offset2, stride2);
}
static void
drm_authenticate(struct wl_client *client,
struct wl_resource *resource, uint32_t id)
@@ -170,7 +179,8 @@ drm_authenticate(struct wl_client *client,
const static struct wl_drm_interface drm_interface = {
drm_authenticate,
drm_create_buffer
drm_create_buffer,
drm_create_planar_buffer
};
static void
@@ -186,6 +196,14 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)
WL_DRM_FORMAT_ARGB8888);
wl_resource_post_event(resource, WL_DRM_FORMAT,
WL_DRM_FORMAT_XRGB8888);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV410);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV411);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV420);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV422);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUV444);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_NV12);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_NV16);
wl_resource_post_event(resource, WL_DRM_FORMAT, WL_DRM_FORMAT_YUYV);
}
struct wl_drm *

View File

@@ -1,22 +1,91 @@
#ifndef WAYLAND_DRM_H
#define WAYLAND_DRM_H
#include "egldisplay.h"
#include "eglimage.h"
#include <wayland-server.h>
#include "wayland-drm-server-protocol.h"
#ifndef WL_DRM_FORMAT_ENUM
#define WL_DRM_FORMAT_ENUM
enum wl_drm_format {
WL_DRM_FORMAT_C8 = 0x20203843,
WL_DRM_FORMAT_RGB332 = 0x38424752,
WL_DRM_FORMAT_BGR233 = 0x38524742,
WL_DRM_FORMAT_XRGB4444 = 0x32315258,
WL_DRM_FORMAT_XBGR4444 = 0x32314258,
WL_DRM_FORMAT_RGBX4444 = 0x32315852,
WL_DRM_FORMAT_BGRX4444 = 0x32315842,
WL_DRM_FORMAT_ARGB4444 = 0x32315241,
WL_DRM_FORMAT_ABGR4444 = 0x32314241,
WL_DRM_FORMAT_RGBA4444 = 0x32314152,
WL_DRM_FORMAT_BGRA4444 = 0x32314142,
WL_DRM_FORMAT_XRGB1555 = 0x35315258,
WL_DRM_FORMAT_XBGR1555 = 0x35314258,
WL_DRM_FORMAT_RGBX5551 = 0x35315852,
WL_DRM_FORMAT_BGRX5551 = 0x35315842,
WL_DRM_FORMAT_ARGB1555 = 0x35315241,
WL_DRM_FORMAT_ABGR1555 = 0x35314241,
WL_DRM_FORMAT_RGBA5551 = 0x35314152,
WL_DRM_FORMAT_BGRA5551 = 0x35314142,
WL_DRM_FORMAT_RGB565 = 0x36314752,
WL_DRM_FORMAT_BGR565 = 0x36314742,
WL_DRM_FORMAT_RGB888 = 0x34324752,
WL_DRM_FORMAT_BGR888 = 0x34324742,
WL_DRM_FORMAT_XRGB8888 = 0x34325258,
WL_DRM_FORMAT_XBGR8888 = 0x34324258,
WL_DRM_FORMAT_RGBX8888 = 0x34325852,
WL_DRM_FORMAT_BGRX8888 = 0x34325842,
WL_DRM_FORMAT_ARGB8888 = 0x34325241,
WL_DRM_FORMAT_ABGR8888 = 0x34324241,
WL_DRM_FORMAT_RGBA8888 = 0x34324152,
WL_DRM_FORMAT_BGRA8888 = 0x34324142,
WL_DRM_FORMAT_XRGB2101010 = 0x30335258,
WL_DRM_FORMAT_XBGR2101010 = 0x30334258,
WL_DRM_FORMAT_RGBX1010102 = 0x30335852,
WL_DRM_FORMAT_BGRX1010102 = 0x30335842,
WL_DRM_FORMAT_ARGB2101010 = 0x30335241,
WL_DRM_FORMAT_ABGR2101010 = 0x30334241,
WL_DRM_FORMAT_RGBA1010102 = 0x30334152,
WL_DRM_FORMAT_BGRA1010102 = 0x30334142,
WL_DRM_FORMAT_YUYV = 0x56595559,
WL_DRM_FORMAT_YVYU = 0x55595659,
WL_DRM_FORMAT_UYVY = 0x59565955,
WL_DRM_FORMAT_VYUY = 0x59555956,
WL_DRM_FORMAT_AYUV = 0x56555941,
WL_DRM_FORMAT_NV12 = 0x3231564e,
WL_DRM_FORMAT_NV21 = 0x3132564e,
WL_DRM_FORMAT_NV16 = 0x3631564e,
WL_DRM_FORMAT_NV61 = 0x3136564e,
WL_DRM_FORMAT_YUV410 = 0x39565559,
WL_DRM_FORMAT_YVU410 = 0x39555659,
WL_DRM_FORMAT_YUV411 = 0x31315559,
WL_DRM_FORMAT_YVU411 = 0x31315659,
WL_DRM_FORMAT_YUV420 = 0x32315559,
WL_DRM_FORMAT_YVU420 = 0x32315659,
WL_DRM_FORMAT_YUV422 = 0x36315559,
WL_DRM_FORMAT_YVU422 = 0x36315659,
WL_DRM_FORMAT_YUV444 = 0x34325559,
WL_DRM_FORMAT_YVU444 = 0x34325659,
};
#endif /* WL_DRM_FORMAT_ENUM */
struct wl_drm;
struct wl_drm_buffer {
struct wl_buffer buffer;
struct wl_drm *drm;
uint32_t format;
const void *driver_format;
int32_t offset[3];
int32_t stride[3];
void *driver_buffer;
};
struct wayland_drm_callbacks {
int (*authenticate)(void *user_data, uint32_t id);
void *(*reference_buffer)(void *user_data, uint32_t name,
int32_t width, int32_t height,
uint32_t stride, uint32_t format);
void (*reference_buffer)(void *user_data, uint32_t name,
struct wl_drm_buffer *buffer);
void (*release_buffer)(void *user_data, void *buffer);
void (*release_buffer)(void *user_data, struct wl_drm_buffer *buffer);
};
struct wl_drm *

View File

@@ -119,6 +119,22 @@
<arg name="format" type="uint"/>
</request>
<!-- Create a wayland buffer for the named DRM buffer. The DRM
surface must have a name using the flink ioctl -->
<request name="create_planar_buffer">
<arg name="id" type="new_id" interface="wl_buffer"/>
<arg name="name" type="uint"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="format" type="uint"/>
<arg name="offset0" type="int"/>
<arg name="stride0" type="int"/>
<arg name="offset1" type="int"/>
<arg name="stride1" type="int"/>
<arg name="offset2" type="int"/>
<arg name="stride2" type="int"/>
</request>
<!-- Notification of the path of the drm device which is used by
the server. The client should use this device for creating
local buffers. Only buffers created from this device should

View File

@@ -26,17 +26,6 @@ struct wl_egl_window {
int attached_height;
};
struct wl_egl_pixmap {
struct wl_buffer *buffer;
int width;
int height;
void (*destroy) (struct wl_egl_pixmap *egl_pixmap);
void *driver_private;
};
#ifdef __cplusplus
}
#endif

View File

@@ -48,36 +48,3 @@ wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
if (height)
*height = egl_window->attached_height;
}
WL_EGL_EXPORT struct wl_egl_pixmap *
wl_egl_pixmap_create(int width, int height, uint32_t flags)
{
struct wl_egl_pixmap *egl_pixmap;
egl_pixmap = malloc(sizeof *egl_pixmap);
if (egl_pixmap == NULL)
return NULL;
egl_pixmap->width = width;
egl_pixmap->height = height;
egl_pixmap->destroy = NULL;
egl_pixmap->buffer = NULL;
egl_pixmap->driver_private = NULL;
return egl_pixmap;
}
WL_EGL_EXPORT void
wl_egl_pixmap_destroy(struct wl_egl_pixmap *egl_pixmap)
{
if (egl_pixmap->destroy)
egl_pixmap->destroy(egl_pixmap);
free(egl_pixmap);
}
WL_EGL_EXPORT struct wl_buffer *
wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
{
return egl_pixmap->buffer;
}

View File

@@ -44,8 +44,7 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@
$(intermediates)/indices/u_indices_gen.c \
$(intermediates)/indices/u_unfilled_gen.c \
$(intermediates)/util/u_format_srgb.c \
$(intermediates)/util/u_half.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py
$(intermediates)/util/u_format_srgb.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py
$(transform-generated-source)
$(intermediates)/util/u_format_table.c: $(intermediates)/%.c: $(LOCAL_PATH)/%.py $(LOCAL_PATH)/util/u_format.csv

View File

@@ -39,6 +39,4 @@ util/u_format_srgb.c: util/u_format_srgb.py
util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
$(PYTHON2) util/u_format_table.py util/u_format.csv > $@
util/u_half.c: util/u_half.py
$(PYTHON2) util/u_half.py > $@
# DO NOT DELETE

View File

@@ -155,8 +155,7 @@ GENERATED_SOURCES := \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
util/u_format_srgb.c \
util/u_format_table.c \
util/u_half.c
util/u_format_table.c
GALLIVM_SOURCES := \
gallivm/lp_bld_arit.c \
@@ -166,6 +165,7 @@ GALLIVM_SOURCES := \
gallivm/lp_bld_conv.c \
gallivm/lp_bld_flow.c \
gallivm/lp_bld_format_aos.c \
gallivm/lp_bld_format_aos_array.c \
gallivm/lp_bld_format_soa.c \
gallivm/lp_bld_format_yuv.c \
gallivm/lp_bld_gather.c \
@@ -188,7 +188,6 @@ GALLIVM_SOURCES := \
gallivm/lp_bld_type.c \
draw/draw_llvm.c \
draw/draw_llvm_sample.c \
draw/draw_llvm_translate.c \
draw/draw_vs_llvm.c \
draw/draw_pt_fetch_shade_pipeline_llvm.c

View File

@@ -35,13 +35,6 @@ env.CodeGenerate(
command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
)
env.CodeGenerate(
target = 'util/u_half.c',
script = 'util/u_half.py',
source = [],
command = python_cmd + ' $SCRIPT > $TARGET'
)
env.Depends('util/u_format_table.c', [
'#src/gallium/auxiliary/util/u_format_parse.py',
'util/u_format_pack.py',

View File

@@ -27,7 +27,7 @@
/**
* @file
*
*
* Wrap the cso cache & hash mechanisms in a simplified
* pipe-driver-specific interface.
*
@@ -84,8 +84,7 @@ struct cso_context {
boolean has_geometry_shader;
boolean has_streamout;
struct sampler_info fragment_samplers;
struct sampler_info vertex_samplers;
struct sampler_info samplers[PIPE_SHADER_TYPES];
uint nr_vertex_buffers;
struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
@@ -105,8 +104,9 @@ struct cso_context {
void *blend, *blend_saved;
void *depth_stencil, *depth_stencil_saved;
void *rasterizer, *rasterizer_saved;
void *fragment_shader, *fragment_shader_saved, *geometry_shader;
void *vertex_shader, *vertex_shader_saved, *geometry_shader_saved;
void *fragment_shader, *fragment_shader_saved;
void *vertex_shader, *vertex_shader_saved;
void *geometry_shader, *geometry_shader_saved;
void *velements, *velements_saved;
struct pipe_clip_state clip;
@@ -115,7 +115,7 @@ struct cso_context {
struct pipe_framebuffer_state fb, fb_saved;
struct pipe_viewport_state vp, vp_saved;
struct pipe_blend_color blend_color;
unsigned sample_mask;
unsigned sample_mask, sample_mask_saved;
struct pipe_stencil_ref stencil_ref, stencil_ref_saved;
};
@@ -135,7 +135,8 @@ static boolean delete_blend_state(struct cso_context *ctx, void *state)
static boolean delete_depth_stencil_state(struct cso_context *ctx, void *state)
{
struct cso_depth_stencil_alpha *cso = (struct cso_depth_stencil_alpha *)state;
struct cso_depth_stencil_alpha *cso =
(struct cso_depth_stencil_alpha *)state;
if (ctx->depth_stencil == cso->data)
return FALSE;
@@ -189,19 +190,14 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
switch (type) {
case CSO_BLEND:
return delete_blend_state(ctx, state);
break;
case CSO_SAMPLER:
return delete_sampler_state(ctx, state);
break;
case CSO_DEPTH_STENCIL_ALPHA:
return delete_depth_stencil_state(ctx, state);
break;
case CSO_RASTERIZER:
return delete_rasterizer_state(ctx, state);
break;
case CSO_VELEMENTS:
return delete_vertex_elements(ctx, state);
break;
default:
assert(0);
FREE(state);
@@ -209,8 +205,9 @@ static INLINE boolean delete_cso(struct cso_context *ctx,
return FALSE;
}
static INLINE void sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
int max_size, void *user_data)
static INLINE void
sanitize_hash(struct cso_hash *hash, enum cso_cache_type type,
int max_size, void *user_data)
{
struct cso_context *ctx = (struct cso_context *)user_data;
/* if we're approach the maximum size, remove fourth of the entries
@@ -259,8 +256,6 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
if (ctx == NULL)
goto out;
assert(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
ctx->cache = cso_cache_create();
if (ctx->cache == NULL)
goto out;
@@ -269,6 +264,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
ctx);
ctx->pipe = pipe;
ctx->sample_mask_saved = ~0;
cso_init_vbuf(ctx);
@@ -287,7 +283,7 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
return ctx;
out:
cso_destroy_context( ctx );
cso_destroy_context( ctx );
return NULL;
}
@@ -296,8 +292,7 @@ out:
*/
void cso_release_all( struct cso_context *ctx )
{
unsigned i;
struct sampler_info *info;
unsigned i, shader;
if (ctx->pipe) {
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
@@ -317,17 +312,12 @@ void cso_release_all( struct cso_context *ctx )
}
/* free fragment samplers, views */
info = &ctx->fragment_samplers;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
}
/* free vertex samplers, views */
info = &ctx->vertex_samplers;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
for (shader = 0; shader < Elements(ctx->samplers); shader++) {
struct sampler_info *info = &ctx->samplers[shader];
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
pipe_sampler_view_reference(&info->views_saved[i], NULL);
}
}
util_unreference_framebuffer_state(&ctx->fb);
@@ -383,10 +373,12 @@ enum pipe_error cso_set_blend(struct cso_context *ctx,
struct cso_hash_iter iter;
void *handle;
key_size = templ->independent_blend_enable ? sizeof(struct pipe_blend_state) :
(char *)&(templ->rt[1]) - (char *)templ;
key_size = templ->independent_blend_enable ?
sizeof(struct pipe_blend_state) :
(char *)&(templ->rt[1]) - (char *)templ;
hash_key = cso_construct_key((void*)templ, key_size);
iter = cso_find_state_template(ctx->cache, hash_key, CSO_BLEND, (void*)templ, key_size);
iter = cso_find_state_template(ctx->cache, hash_key, CSO_BLEND,
(void*)templ, key_size);
if (cso_hash_iter_is_null(iter)) {
struct cso_blend *cso = MALLOC(sizeof(struct cso_blend));
@@ -435,28 +427,33 @@ void cso_restore_blend(struct cso_context *ctx)
enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
const struct pipe_depth_stencil_alpha_state *templ)
enum pipe_error
cso_set_depth_stencil_alpha(struct cso_context *ctx,
const struct pipe_depth_stencil_alpha_state *templ)
{
unsigned key_size = sizeof(struct pipe_depth_stencil_alpha_state);
unsigned hash_key = cso_construct_key((void*)templ, key_size);
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
hash_key,
hash_key,
CSO_DEPTH_STENCIL_ALPHA,
(void*)templ, key_size);
void *handle;
if (cso_hash_iter_is_null(iter)) {
struct cso_depth_stencil_alpha *cso = MALLOC(sizeof(struct cso_depth_stencil_alpha));
struct cso_depth_stencil_alpha *cso =
MALLOC(sizeof(struct cso_depth_stencil_alpha));
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_depth_stencil_alpha_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_depth_stencil_alpha_state;
cso->data = ctx->pipe->create_depth_stencil_alpha_state(ctx->pipe,
&cso->state);
cso->delete_state =
(cso_state_callback)ctx->pipe->delete_depth_stencil_alpha_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_DEPTH_STENCIL_ALPHA, cso);
iter = cso_insert_state(ctx->cache, hash_key,
CSO_DEPTH_STENCIL_ALPHA, cso);
if (cso_hash_iter_is_null(iter)) {
FREE(cso);
return PIPE_ERROR_OUT_OF_MEMORY;
@@ -465,7 +462,8 @@ enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
handle = cso->data;
}
else {
handle = ((struct cso_depth_stencil_alpha *)cso_hash_iter_data(iter))->data;
handle = ((struct cso_depth_stencil_alpha *)
cso_hash_iter_data(iter))->data;
}
if (ctx->depth_stencil != handle) {
@@ -485,7 +483,8 @@ void cso_restore_depth_stencil_alpha(struct cso_context *ctx)
{
if (ctx->depth_stencil != ctx->depth_stencil_saved) {
ctx->depth_stencil = ctx->depth_stencil_saved;
ctx->pipe->bind_depth_stencil_alpha_state(ctx->pipe, ctx->depth_stencil_saved);
ctx->pipe->bind_depth_stencil_alpha_state(ctx->pipe,
ctx->depth_stencil_saved);
}
ctx->depth_stencil_saved = NULL;
}
@@ -498,7 +497,8 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
unsigned key_size = sizeof(struct pipe_rasterizer_state);
unsigned hash_key = cso_construct_key((void*)templ, key_size);
struct cso_hash_iter iter = cso_find_state_template(ctx->cache,
hash_key, CSO_RASTERIZER,
hash_key,
CSO_RASTERIZER,
(void*)templ, key_size);
void *handle = NULL;
@@ -509,7 +509,8 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_rasterizer_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_rasterizer_state;
cso->delete_state =
(cso_state_callback)ctx->pipe->delete_rasterizer_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_RASTERIZER, cso);
@@ -690,6 +691,16 @@ enum pipe_error cso_set_sample_mask(struct cso_context *ctx,
return PIPE_OK;
}
void cso_save_sample_mask(struct cso_context *ctx)
{
ctx->sample_mask_saved = ctx->sample_mask;
}
void cso_restore_sample_mask(struct cso_context *ctx)
{
cso_set_sample_mask(ctx, ctx->sample_mask_saved);
}
enum pipe_error cso_set_stencil_ref(struct cso_context *ctx,
const struct pipe_stencil_ref *sr)
{
@@ -708,7 +719,8 @@ void cso_save_stencil_ref(struct cso_context *ctx)
void cso_restore_stencil_ref(struct cso_context *ctx)
{
if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved, sizeof(ctx->stencil_ref))) {
if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved,
sizeof(ctx->stencil_ref))) {
ctx->stencil_ref = ctx->stencil_ref_saved;
ctx->pipe->set_stencil_ref(ctx->pipe, &ctx->stencil_ref);
}
@@ -800,9 +812,10 @@ cso_restore_clip(struct cso_context *ctx)
}
}
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
unsigned count,
const struct pipe_vertex_element *states)
enum pipe_error
cso_set_vertex_elements(struct cso_context *ctx,
unsigned count,
const struct pipe_vertex_element *states)
{
struct u_vbuf *vbuf = ctx->vbuf;
unsigned key_size, hash_key;
@@ -815,15 +828,18 @@ enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
return PIPE_OK;
}
/* need to include the count into the stored state data too.
Otherwise first few count pipe_vertex_elements could be identical even if count
is different, and there's no guarantee the hash would be different in that
case neither */
/* Need to include the count into the stored state data too.
* Otherwise first few count pipe_vertex_elements could be identical
* even if count is different, and there's no guarantee the hash would
* be different in that case neither.
*/
key_size = sizeof(struct pipe_vertex_element) * count + sizeof(unsigned);
velems_state.count = count;
memcpy(velems_state.velems, states, sizeof(struct pipe_vertex_element) * count);
memcpy(velems_state.velems, states,
sizeof(struct pipe_vertex_element) * count);
hash_key = cso_construct_key((void*)&velems_state, key_size);
iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)&velems_state, key_size);
iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS,
(void*)&velems_state, key_size);
if (cso_hash_iter_is_null(iter)) {
struct cso_velements *cso = MALLOC(sizeof(struct cso_velements));
@@ -831,8 +847,10 @@ enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
return PIPE_ERROR_OUT_OF_MEMORY;
memcpy(&cso->state, &velems_state, key_size);
cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state.velems[0]);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_vertex_elements_state;
cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count,
&cso->state.velems[0]);
cso->delete_state =
(cso_state_callback) ctx->pipe->delete_vertex_elements_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_VELEMENTS, cso);
@@ -970,7 +988,8 @@ single_sampler(struct cso_context *ctx,
memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
cso->delete_state =
(cso_state_callback) ctx->pipe->delete_sampler_state;
cso->context = ctx->pipe;
iter = cso_insert_state(ctx->cache, hash_key, CSO_SAMPLER, cso);
@@ -993,26 +1012,19 @@ single_sampler(struct cso_context *ctx,
enum pipe_error
cso_single_sampler(struct cso_context *ctx,
unsigned shader_stage,
unsigned idx,
const struct pipe_sampler_state *templ)
{
return single_sampler(ctx, &ctx->fragment_samplers, idx, templ);
}
enum pipe_error
cso_single_vertex_sampler(struct cso_context *ctx,
unsigned idx,
const struct pipe_sampler_state *templ)
{
return single_sampler(ctx, &ctx->vertex_samplers, idx, templ);
return single_sampler(ctx, &ctx->samplers[shader_stage], idx, templ);
}
static void
single_sampler_done(struct cso_context *ctx,
struct sampler_info *info)
single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
/* find highest non-null sampler */
@@ -1026,39 +1038,39 @@ single_sampler_done(struct cso_context *ctx,
if (info->hw.nr_samplers != info->nr_samplers ||
memcmp(info->hw.samplers,
info->samplers,
info->nr_samplers * sizeof(void *)) != 0)
info->nr_samplers * sizeof(void *)) != 0)
{
memcpy(info->hw.samplers,
info->samplers,
info->nr_samplers * sizeof(void *));
info->hw.nr_samplers = info->nr_samplers;
if (info == &ctx->fragment_samplers) {
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->bind_fragment_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
}
else if (info == &ctx->vertex_samplers) {
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->bind_vertex_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
}
else {
assert(0);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->bind_geometry_sampler_states(ctx->pipe,
info->nr_samplers,
info->samplers);
break;
default:
assert(!"bad shader type in single_sampler_done()");
}
}
}
void
cso_single_sampler_done( struct cso_context *ctx )
cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
single_sampler_done(ctx, &ctx->fragment_samplers);
}
void
cso_single_vertex_sampler_done(struct cso_context *ctx)
{
single_sampler_done(ctx, &ctx->vertex_samplers);
single_sampler_done(ctx, shader_stage);
}
@@ -1067,12 +1079,13 @@ cso_single_vertex_sampler_done(struct cso_context *ctx)
* last one. Done to always try to set as many samplers
* as possible.
*/
static enum pipe_error
set_samplers(struct cso_context *ctx,
struct sampler_info *info,
unsigned nr,
const struct pipe_sampler_state **templates)
enum pipe_error
cso_set_samplers(struct cso_context *ctx,
unsigned shader_stage,
unsigned nr,
const struct pipe_sampler_state **templates)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
enum pipe_error temp, error = PIPE_OK;
@@ -1091,82 +1104,38 @@ set_samplers(struct cso_context *ctx,
error = temp;
}
single_sampler_done(ctx, info);
single_sampler_done(ctx, shader_stage);
return error;
}
enum pipe_error
cso_set_samplers(struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates)
{
return set_samplers(ctx, &ctx->fragment_samplers, nr, templates);
}
enum pipe_error
cso_set_vertex_samplers(struct cso_context *ctx,
unsigned nr,
const struct pipe_sampler_state **templates)
{
return set_samplers(ctx, &ctx->vertex_samplers, nr, templates);
}
static void
save_samplers(struct cso_context *ctx, struct sampler_info *info)
void
cso_save_samplers(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
info->nr_samplers_saved = info->nr_samplers;
memcpy(info->samplers_saved, info->samplers, sizeof(info->samplers));
}
void
cso_save_samplers(struct cso_context *ctx)
{
save_samplers(ctx, &ctx->fragment_samplers);
}
void
cso_save_vertex_samplers(struct cso_context *ctx)
{
save_samplers(ctx, &ctx->vertex_samplers);
}
static void
restore_samplers(struct cso_context *ctx, struct sampler_info *info)
cso_restore_samplers(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
info->nr_samplers = info->nr_samplers_saved;
memcpy(info->samplers, info->samplers_saved, sizeof(info->samplers));
single_sampler_done(ctx, info);
single_sampler_done(ctx, shader_stage);
}
void
cso_restore_samplers(struct cso_context *ctx)
cso_set_sampler_views(struct cso_context *ctx,
unsigned shader_stage,
unsigned count,
struct pipe_sampler_view **views)
{
restore_samplers(ctx, &ctx->fragment_samplers);
}
void
cso_restore_vertex_samplers(struct cso_context *ctx)
{
restore_samplers(ctx, &ctx->vertex_samplers);
}
static void
set_sampler_views(struct cso_context *ctx,
struct sampler_info *info,
void (*set_views)(struct pipe_context *,
unsigned num_views,
struct pipe_sampler_view **),
uint count,
struct pipe_sampler_view **views)
{
uint i;
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
/* reference new views */
for (i = 0; i < count; i++) {
@@ -1180,36 +1149,27 @@ set_sampler_views(struct cso_context *ctx,
info->nr_views = count;
/* bind the new sampler views */
set_views(ctx->pipe, count, info->views);
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->set_fragment_sampler_views(ctx->pipe, count, info->views);
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->set_vertex_sampler_views(ctx->pipe, count, info->views);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->set_geometry_sampler_views(ctx->pipe, count, info->views);
break;
default:
assert(!"bad shader type in cso_set_sampler_views()");
}
}
void
cso_set_fragment_sampler_views(struct cso_context *ctx,
uint count,
struct pipe_sampler_view **views)
cso_save_sampler_views(struct cso_context *ctx, unsigned shader_stage)
{
set_sampler_views(ctx, &ctx->fragment_samplers,
ctx->pipe->set_fragment_sampler_views,
count, views);
}
void
cso_set_vertex_sampler_views(struct cso_context *ctx,
uint count,
struct pipe_sampler_view **views)
{
set_sampler_views(ctx, &ctx->vertex_samplers,
ctx->pipe->set_vertex_sampler_views,
count, views);
}
static void
save_sampler_views(struct cso_context *ctx,
struct sampler_info *info)
{
uint i;
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
info->nr_views_saved = info->nr_views;
@@ -1219,29 +1179,14 @@ save_sampler_views(struct cso_context *ctx,
}
}
void
cso_save_fragment_sampler_views(struct cso_context *ctx)
{
save_sampler_views(ctx, &ctx->fragment_samplers);
}
void
cso_save_vertex_sampler_views(struct cso_context *ctx)
cso_restore_sampler_views(struct cso_context *ctx, unsigned shader_stage)
{
save_sampler_views(ctx, &ctx->vertex_samplers);
}
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i, nr_saved = info->nr_views_saved;
static void
restore_sampler_views(struct cso_context *ctx,
struct sampler_info *info,
void (*set_views)(struct pipe_context *,
unsigned num_views,
struct pipe_sampler_view **))
{
uint i;
for (i = 0; i < info->nr_views_saved; i++) {
for (i = 0; i < nr_saved; i++) {
pipe_sampler_view_reference(&info->views[i], NULL);
/* move the reference from one pointer to another */
info->views[i] = info->views_saved[i];
@@ -1252,26 +1197,24 @@ restore_sampler_views(struct cso_context *ctx,
}
/* bind the old/saved sampler views */
set_views(ctx->pipe, info->nr_views_saved, info->views);
switch (shader_stage) {
case PIPE_SHADER_FRAGMENT:
ctx->pipe->set_fragment_sampler_views(ctx->pipe, nr_saved, info->views);
break;
case PIPE_SHADER_VERTEX:
ctx->pipe->set_vertex_sampler_views(ctx->pipe, nr_saved, info->views);
break;
case PIPE_SHADER_GEOMETRY:
ctx->pipe->set_geometry_sampler_views(ctx->pipe, nr_saved, info->views);
break;
default:
assert(!"bad shader type in cso_restore_sampler_views()");
}
info->nr_views = info->nr_views_saved;
info->nr_views = nr_saved;
info->nr_views_saved = 0;
}
void
cso_restore_fragment_sampler_views(struct cso_context *ctx)
{
restore_sampler_views(ctx, &ctx->fragment_samplers,
ctx->pipe->set_fragment_sampler_views);
}
void
cso_restore_vertex_sampler_views(struct cso_context *ctx)
{
restore_sampler_views(ctx, &ctx->vertex_samplers,
ctx->pipe->set_vertex_sampler_views);
}
void
cso_set_stream_outputs(struct cso_context *ctx,

View File

@@ -69,39 +69,29 @@ void cso_save_rasterizer(struct cso_context *cso);
void cso_restore_rasterizer(struct cso_context *cso);
enum pipe_error
cso_set_samplers(struct cso_context *cso,
unsigned shader_stage,
unsigned count,
const struct pipe_sampler_state **states);
enum pipe_error cso_set_samplers( struct cso_context *cso,
unsigned count,
const struct pipe_sampler_state **states );
void cso_save_samplers(struct cso_context *cso);
void cso_restore_samplers(struct cso_context *cso);
void
cso_save_samplers(struct cso_context *cso, unsigned shader_stage);
void
cso_restore_samplers(struct cso_context *cso, unsigned shader_stage);
/* Alternate interface to support state trackers that like to modify
* samplers one at a time:
*/
enum pipe_error cso_single_sampler( struct cso_context *cso,
unsigned nr,
const struct pipe_sampler_state *states );
void cso_single_sampler_done( struct cso_context *cso );
enum pipe_error cso_set_vertex_samplers(struct cso_context *cso,
unsigned count,
const struct pipe_sampler_state **states);
void
cso_save_vertex_samplers(struct cso_context *cso);
void
cso_restore_vertex_samplers(struct cso_context *cso);
enum pipe_error
cso_single_vertex_sampler(struct cso_context *cso,
unsigned nr,
const struct pipe_sampler_state *states);
cso_single_sampler(struct cso_context *cso,
unsigned shader_stage,
unsigned count,
const struct pipe_sampler_state *states);
void
cso_single_vertex_sampler_done(struct cso_context *cso);
cso_single_sampler_done(struct cso_context *cso, unsigned shader_stage);
enum pipe_error cso_set_vertex_elements(struct cso_context *ctx,
@@ -126,6 +116,13 @@ void cso_save_stream_outputs(struct cso_context *ctx);
void cso_restore_stream_outputs(struct cso_context *ctx);
/*
* 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 internally-generated texenv programs), it will be up to
* the state tracker to implement their own specialized caching.
*/
enum pipe_error cso_set_fragment_shader_handle(struct cso_context *ctx,
void *handle );
void cso_delete_fragment_shader(struct cso_context *ctx, void *handle );
@@ -164,6 +161,8 @@ enum pipe_error cso_set_blend_color(struct cso_context *cso,
enum pipe_error cso_set_sample_mask(struct cso_context *cso,
unsigned stencil_mask);
void cso_save_sample_mask(struct cso_context *ctx);
void cso_restore_sample_mask(struct cso_context *ctx);
enum pipe_error cso_set_stencil_ref(struct cso_context *cso,
const struct pipe_stencil_ref *sr);
@@ -184,39 +183,21 @@ void
cso_restore_clip(struct cso_context *cso);
/* fragment sampler view state */
/*
* 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 internally-generated texenv programs), it will be up to
* the state tracker to implement their own specialized caching.
*/
/* sampler view state */
void
cso_set_fragment_sampler_views(struct cso_context *cso,
uint count,
struct pipe_sampler_view **views);
cso_set_sampler_views(struct cso_context *cso,
unsigned shader_stage,
unsigned count,
struct pipe_sampler_view **views);
void
cso_save_fragment_sampler_views(struct cso_context *cso);
cso_save_sampler_views(struct cso_context *cso, unsigned shader_stage);
void
cso_restore_fragment_sampler_views(struct cso_context *cso);
cso_restore_sampler_views(struct cso_context *cso, unsigned shader_stage);
/* vertex sampler view state */
void
cso_set_vertex_sampler_views(struct cso_context *cso,
uint count,
struct pipe_sampler_view **views);
void
cso_save_vertex_sampler_views(struct cso_context *cso);
void
cso_restore_vertex_sampler_views(struct cso_context *cso);
/* drawing */

View File

@@ -42,6 +42,7 @@
#if HAVE_LLVM
#include "gallivm/lp_bld_init.h"
#include "gallivm/lp_bld_limits.h"
#include "draw_llvm.h"
static boolean
@@ -69,8 +70,7 @@ draw_get_option_use_llvm(void)
* Create new draw module context with gallivm state for LLVM JIT.
*/
static struct draw_context *
draw_create_context(struct pipe_context *pipe, boolean try_llvm,
struct gallivm_state *gallivm)
draw_create_context(struct pipe_context *pipe, boolean try_llvm)
{
struct draw_context *draw = CALLOC_STRUCT( draw_context );
if (draw == NULL)
@@ -78,16 +78,7 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm,
#if HAVE_LLVM
if (try_llvm && draw_get_option_use_llvm()) {
if (!gallivm) {
gallivm = gallivm_create();
draw->own_gallivm = gallivm;
}
if (!gallivm)
goto err_destroy;
draw->llvm = draw_llvm_create(draw, gallivm);
draw->llvm = draw_llvm_create(draw);
if (!draw->llvm)
goto err_destroy;
}
@@ -113,7 +104,7 @@ err_out:
struct draw_context *
draw_create(struct pipe_context *pipe)
{
return draw_create_context(pipe, TRUE, NULL);
return draw_create_context(pipe, TRUE);
}
@@ -123,17 +114,7 @@ draw_create(struct pipe_context *pipe)
struct draw_context *
draw_create_no_llvm(struct pipe_context *pipe)
{
return draw_create_context(pipe, FALSE, NULL);
}
/**
* Create new draw module context with gallivm state for LLVM JIT.
*/
struct draw_context *
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm)
{
return draw_create_context(pipe, TRUE, gallivm);
return draw_create_context(pipe, FALSE);
}
@@ -212,9 +193,6 @@ void draw_destroy( struct draw_context *draw )
#ifdef HAVE_LLVM
if (draw->llvm)
draw_llvm_destroy( draw->llvm );
if (draw->own_gallivm)
gallivm_destroy(draw->own_gallivm);
#endif
FREE( draw );
@@ -598,7 +576,7 @@ draw_num_shader_outputs(const struct draw_context *draw)
/**
* Provide TGSI sampler objects for vertex/geometry shaders that use
* texture fetches.
* texture fetches. This state only needs to be set once per context.
* This might only be used by software drivers for the time being.
*/
void
@@ -608,12 +586,12 @@ draw_texture_samplers(struct draw_context *draw,
struct tgsi_sampler **samplers)
{
if (shader == PIPE_SHADER_VERTEX) {
draw->vs.num_samplers = num_samplers;
draw->vs.samplers = samplers;
draw->vs.tgsi.num_samplers = num_samplers;
draw->vs.tgsi.samplers = samplers;
} else {
debug_assert(shader == PIPE_SHADER_GEOMETRY);
draw->gs.num_samplers = num_samplers;
draw->gs.samplers = samplers;
draw->gs.tgsi.num_samplers = num_samplers;
draw->gs.tgsi.samplers = samplers;
}
}
@@ -643,7 +621,7 @@ draw_set_indexes(struct draw_context *draw,
elem_size == 2 ||
elem_size == 4);
draw->pt.user.elts = elements;
draw->pt.user.eltSize = elem_size;
draw->pt.user.eltSizeIB = elem_size;
}
@@ -776,45 +754,50 @@ draw_set_so_state(struct draw_context *draw,
void
draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
struct pipe_sampler_view **views,
unsigned num)
{
unsigned i;
debug_assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
debug_assert(shader_stage < PIPE_SHADER_TYPES);
debug_assert(num <= PIPE_MAX_SAMPLERS);
for (i = 0; i < num; ++i)
draw->sampler_views[i] = views[i];
for (i = num; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
draw->sampler_views[i] = NULL;
draw->sampler_views[shader_stage][i] = views[i];
for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
draw->sampler_views[shader_stage][i] = NULL;
draw->num_sampler_views = num;
draw->num_sampler_views[shader_stage] = num;
}
void
draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
struct pipe_sampler_state **samplers,
unsigned num)
{
unsigned i;
debug_assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
debug_assert(shader_stage < PIPE_SHADER_TYPES);
debug_assert(num <= PIPE_MAX_SAMPLERS);
for (i = 0; i < num; ++i)
draw->samplers[i] = samplers[i];
for (i = num; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
draw->samplers[i] = NULL;
draw->samplers[shader_stage][i] = samplers[i];
for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
draw->samplers[shader_stage][i] = NULL;
draw->num_samplers = num;
draw->num_samplers[shader_stage] = num;
#ifdef HAVE_LLVM
if (draw->llvm)
if (draw->llvm && shader_stage == PIPE_SHADER_VERTEX)
draw_llvm_set_sampler_state(draw);
#endif
}
void
draw_set_mapped_texture(struct draw_context *draw,
unsigned shader_stage,
unsigned sampler_idx,
uint32_t width, uint32_t height, uint32_t depth,
uint32_t first_level, uint32_t last_level,
@@ -822,11 +805,53 @@ draw_set_mapped_texture(struct draw_context *draw,
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS],
const void *data[PIPE_MAX_TEXTURE_LEVELS])
{
if (shader_stage == PIPE_SHADER_VERTEX) {
#ifdef HAVE_LLVM
if(draw->llvm)
draw_llvm_set_mapped_texture(draw,
sampler_idx,
width, height, depth, first_level, last_level,
row_stride, img_stride, data);
if (draw->llvm)
draw_llvm_set_mapped_texture(draw,
sampler_idx,
width, height, depth, first_level, last_level,
row_stride, img_stride, data);
#endif
}
}
/**
* XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
* different ways of setting textures, and drivers typically only support one.
*/
int
draw_get_shader_param_no_llvm(unsigned shader, enum pipe_shader_cap param)
{
switch(shader) {
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
return tgsi_exec_get_shader_param(param);
default:
return 0;
}
}
/**
* XXX: Results for PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS because there are two
* different ways of setting textures, and drivers typically only support one.
*/
int
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param)
{
#ifdef HAVE_LLVM
if (draw_get_option_use_llvm()) {
switch(shader) {
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
return gallivm_get_shader_param(param);
default:
return 0;
}
}
#endif
return draw_get_shader_param_no_llvm(shader, param);
}

View File

@@ -48,7 +48,6 @@ struct draw_vertex_shader;
struct draw_geometry_shader;
struct draw_fragment_shader;
struct tgsi_sampler;
struct gallivm_state;
/*
* structure to contain driver internal information
@@ -67,9 +66,6 @@ struct draw_context *draw_create( struct pipe_context *pipe );
struct draw_context *draw_create_no_llvm(struct pipe_context *pipe);
struct draw_context *
draw_create_gallivm(struct pipe_context *pipe, struct gallivm_state *gallivm);
void draw_destroy( struct draw_context *draw );
void draw_flush(struct draw_context *draw);
@@ -143,15 +139,18 @@ draw_texture_samplers(struct draw_context *draw,
void
draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
struct pipe_sampler_view **views,
unsigned num);
void
draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
struct pipe_sampler_state **samplers,
unsigned num);
void
draw_set_mapped_texture(struct draw_context *draw,
unsigned shader_stage,
unsigned sampler_idx,
uint32_t width, uint32_t height, uint32_t depth,
uint32_t first_level, uint32_t last_level,
@@ -277,16 +276,10 @@ boolean draw_need_pipeline(const struct draw_context *draw,
const struct pipe_rasterizer_state *rasterizer,
unsigned prim );
static INLINE int
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param)
{
switch(shader) {
case PIPE_SHADER_VERTEX:
case PIPE_SHADER_GEOMETRY:
return tgsi_exec_get_shader_param(param);
default:
return 0;
}
}
int
draw_get_shader_param(unsigned shader, enum pipe_shader_cap param);
int
draw_get_shader_param_no_llvm(unsigned shader, enum pipe_shader_cap param);
#endif /* DRAW_CONTEXT_H */

View File

@@ -45,15 +45,15 @@
boolean
draw_gs_init( struct draw_context *draw )
{
draw->gs.machine = tgsi_exec_machine_create();
if (!draw->gs.machine)
draw->gs.tgsi.machine = tgsi_exec_machine_create();
if (!draw->gs.tgsi.machine)
return FALSE;
draw->gs.machine->Primitives = align_malloc(
draw->gs.tgsi.machine->Primitives = align_malloc(
MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector), 16);
if (!draw->gs.machine->Primitives)
if (!draw->gs.tgsi.machine->Primitives)
return FALSE;
memset(draw->gs.machine->Primitives, 0,
memset(draw->gs.tgsi.machine->Primitives, 0,
MAX_PRIMITIVES * sizeof(struct tgsi_exec_vector));
return TRUE;
@@ -61,12 +61,12 @@ draw_gs_init( struct draw_context *draw )
void draw_gs_destroy( struct draw_context *draw )
{
if (!draw->gs.machine)
if (!draw->gs.tgsi.machine)
return;
align_free(draw->gs.machine->Primitives);
align_free(draw->gs.tgsi.machine->Primitives);
tgsi_exec_machine_destroy(draw->gs.machine);
tgsi_exec_machine_destroy(draw->gs.tgsi.machine);
}
void
@@ -121,7 +121,7 @@ draw_create_geometry_shader(struct draw_context *draw,
gs->max_output_vertices = gs->info.properties[i].data[0];
}
gs->machine = draw->gs.machine;
gs->machine = draw->gs.tgsi.machine;
if (gs)
{
@@ -483,7 +483,7 @@ void draw_geometry_shader_prepare(struct draw_geometry_shader *shader,
if (shader && shader->machine->Tokens != shader->state.tokens) {
tgsi_exec_machine_bind_shader(shader->machine,
shader->state.tokens,
draw->gs.num_samplers,
draw->gs.samplers);
draw->gs.tgsi.num_samplers,
draw->gs.tgsi.samplers);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -36,11 +36,6 @@
#include "pipe/p_context.h"
#include "util/u_simple_list.h"
#include <llvm-c/Core.h>
#include <llvm-c/Analysis.h>
#include <llvm-c/Target.h>
#include <llvm-c/ExecutionEngine.h>
struct draw_llvm;
struct llvm_vertex_shader;
@@ -102,7 +97,7 @@ struct draw_jit_context
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
float *viewport;
struct draw_jit_texture textures[PIPE_MAX_VERTEX_SAMPLERS];
struct draw_jit_texture textures[PIPE_MAX_SAMPLERS];
};
@@ -189,7 +184,7 @@ struct draw_llvm_variant_key
#define DRAW_LLVM_MAX_VARIANT_KEY_SIZE \
(sizeof(struct draw_llvm_variant_key) + \
PIPE_MAX_VERTEX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
PIPE_MAX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
(PIPE_MAX_ATTRIBS-1) * sizeof(struct pipe_vertex_element))
@@ -220,6 +215,14 @@ struct draw_llvm_variant_list_item
struct draw_llvm_variant
{
struct gallivm_state *gallivm;
/* LLVM JIT builder types */
LLVMTypeRef context_ptr_type;
LLVMTypeRef buffer_ptr_type;
LLVMTypeRef vb_ptr_type;
LLVMTypeRef vertex_header_ptr_type;
LLVMValueRef function;
LLVMValueRef function_elts;
draw_jit_vert_func jit_func;
@@ -249,16 +252,8 @@ struct draw_llvm {
struct draw_jit_context jit_context;
struct gallivm_state *gallivm;
struct draw_llvm_variant_list_item vs_variants_list;
int nr_variants;
/* LLVM JIT builder types */
LLVMTypeRef context_ptr_type;
LLVMTypeRef buffer_ptr_type;
LLVMTypeRef vb_ptr_type;
LLVMTypeRef vertex_header_ptr_type;
};
@@ -270,7 +265,7 @@ llvm_vertex_shader(struct draw_vertex_shader *vs)
struct draw_llvm *
draw_llvm_create(struct draw_context *draw, struct gallivm_state *gallivm);
draw_llvm_create(struct draw_context *draw);
void
draw_llvm_destroy(struct draw_llvm *llvm);
@@ -286,11 +281,6 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant);
struct draw_llvm_variant_key *
draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store);
LLVMValueRef
draw_llvm_translate_from(struct gallivm_state *gallivm,
LLVMValueRef vbuffer,
enum pipe_format from_format);
struct lp_build_sampler_soa *
draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
LLVMValueRef context_ptr);

View File

@@ -98,7 +98,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
LLVMValueRef ptr;
LLVMValueRef res;
debug_assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
debug_assert(unit < PIPE_MAX_SAMPLERS);
/* context[0] */
indices[0] = lp_build_const_int32(gallivm, 0);
@@ -173,15 +173,14 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
unsigned unit,
unsigned num_coords,
const LLVMValueRef *coords,
const LLVMValueRef *ddx,
const LLVMValueRef *ddy,
const struct lp_derivatives *derivs,
LLVMValueRef lod_bias, /* optional */
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *texel)
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
assert(unit < PIPE_MAX_SAMPLERS);
lp_build_sample_soa(gallivm,
&sampler->dynamic_state.static_state[unit],
@@ -189,7 +188,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
type,
unit,
num_coords, coords,
ddx, ddy,
derivs,
lod_bias, explicit_lod,
texel);
}
@@ -201,17 +200,19 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
static void
draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct gallivm_state *gallivm,
struct lp_type type,
unsigned unit,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out)
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
assert(unit < PIPE_MAX_SAMPLERS);
lp_build_size_query_soa(gallivm,
&sampler->dynamic_state.static_state[unit],
&sampler->dynamic_state.base,
type,
unit,
explicit_lod,
sizes_out);

View File

@@ -1,506 +0,0 @@
#include "draw_private.h"
#include "draw_context.h"
#include "draw_llvm.h"
#include "gallivm/lp_bld_const.h"
#include "gallivm/lp_bld_struct.h"
#include "gallivm/lp_bld_format.h"
#include "gallivm/lp_bld_debug.h"
#include "gallivm/lp_bld_type.h"
#include "util/u_memory.h"
#include "util/u_format.h"
#include "pipe/p_state.h"
#define DRAW_DBG 0
static LLVMValueRef
from_64_float(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMDoubleTypeInContext(gallivm->context), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildFPTrunc(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static LLVMValueRef
from_32_float(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMFloatTypeInContext(gallivm->context), 0) , "");
return LLVMBuildLoad(gallivm->builder, bc, "");
}
static INLINE LLVMValueRef
from_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
return LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
}
static INLINE LLVMValueRef
from_8_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 255.), "");
}
static INLINE LLVMValueRef
from_16_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65535.), "");
}
static INLINE LLVMValueRef
from_32_unorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildUIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 4294967295.), "");
}
static INLINE LLVMValueRef
from_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 127.0), "");
}
static INLINE LLVMValueRef
from_16_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 16), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 32767.0f), "");
}
static INLINE LLVMValueRef
from_32_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 2147483647.0), "");
}
static INLINE LLVMValueRef
from_32_fixed(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef bc = LLVMBuildBitCast(gallivm->builder, val,
LLVMPointerType(LLVMIntTypeInContext(gallivm->context, 32), 0) , "");
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, bc, "");
LLVMValueRef uscaled = LLVMBuildSIToFP(gallivm->builder, l, LLVMFloatTypeInContext(gallivm->context), "");
return LLVMBuildFDiv(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65536.0), "");
}
static LLVMValueRef
to_64_float(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPExt(gallivm->builder, l, LLVMDoubleTypeInContext(gallivm->context), "");
}
static LLVMValueRef
to_32_float(struct gallivm_state *gallivm, LLVMValueRef fp)
{
return LLVMBuildLoad(gallivm->builder, fp, "");
}
static INLINE LLVMValueRef
to_8_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
}
static INLINE LLVMValueRef
to_16_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
}
static INLINE LLVMValueRef
to_32_uscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToUI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
}
static INLINE LLVMValueRef
to_8_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 8), "");
}
static INLINE LLVMValueRef
to_16_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 16), "");
}
static INLINE LLVMValueRef
to_32_sscaled(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
return LLVMBuildFPToSI(gallivm->builder, l, LLVMIntTypeInContext(gallivm->context, 32), "");
}
static INLINE LLVMValueRef
to_8_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 8), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 255.), "");
}
static INLINE LLVMValueRef
to_16_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65535.), "");
}
static INLINE LLVMValueRef
to_32_unorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToUI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 4294967295.), "");
}
static INLINE LLVMValueRef
to_8_snorm(struct gallivm_state *gallivm, LLVMValueRef val)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, val, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 8), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 127.0), "");
}
static INLINE LLVMValueRef
to_16_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 16), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 32767.0f), "");
}
static INLINE LLVMValueRef
to_32_snorm(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 2147483647.0), "");
}
static INLINE LLVMValueRef
to_32_fixed(struct gallivm_state *gallivm, LLVMValueRef fp)
{
LLVMValueRef l = LLVMBuildLoad(gallivm->builder, fp, "");
LLVMValueRef uscaled = LLVMBuildFPToSI(gallivm->builder, l,
LLVMIntTypeInContext(gallivm->context, 32), "");
return LLVMBuildFMul(gallivm->builder, uscaled,
lp_build_const_float(gallivm, 65536.0), "");
}
typedef LLVMValueRef (*from_func)(struct gallivm_state *, LLVMValueRef);
typedef LLVMValueRef (*to_func)(struct gallivm_state *, LLVMValueRef);
/* so that underneath can avoid function calls which are prohibited
* for static initialization we need this conversion */
enum ll_type {
LL_Double,
LL_Float,
LL_Int32,
LL_Int16,
LL_Int8
};
static INLINE LLVMTypeRef
ll_type_to_llvm(struct gallivm_state *gallivm, enum ll_type type)
{
switch (type) {
case LL_Double:
return LLVMDoubleTypeInContext(gallivm->context);
case LL_Float:
return LLVMFloatTypeInContext(gallivm->context);
case LL_Int32:
return LLVMInt32TypeInContext(gallivm->context);
case LL_Int16:
return LLVMIntTypeInContext(gallivm->context, 16);
case LL_Int8:
return LLVMIntTypeInContext(gallivm->context, 8);
}
return LLVMIntTypeInContext(gallivm->context, 8);
}
static INLINE int
ll_type_size(enum ll_type type)
{
switch (type) {
case LL_Double:
return 8;
case LL_Float:
return 4;
case LL_Int32:
return 4;
case LL_Int16:
return 2;
case LL_Int8:
return 1;
}
return 1;
}
struct draw_llvm_translate {
int format;
from_func from;
to_func to;
enum ll_type type;
int num_components;
} translates[] =
{
{PIPE_FORMAT_R64_FLOAT, from_64_float, to_64_float, LL_Double, 1},
{PIPE_FORMAT_R64G64_FLOAT, from_64_float, to_64_float, LL_Double, 2},
{PIPE_FORMAT_R64G64B64_FLOAT, from_64_float, to_64_float, LL_Double, 3},
{PIPE_FORMAT_R64G64B64A64_FLOAT, from_64_float, to_64_float, LL_Double, 4},
{PIPE_FORMAT_R32_FLOAT, from_32_float, to_32_float, LL_Float, 1},
{PIPE_FORMAT_R32G32_FLOAT, from_32_float, to_32_float, LL_Float, 2},
{PIPE_FORMAT_R32G32B32_FLOAT, from_32_float, to_32_float, LL_Float, 3},
{PIPE_FORMAT_R32G32B32A32_FLOAT, from_32_float, to_32_float, LL_Float, 4},
{PIPE_FORMAT_R32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 1},
{PIPE_FORMAT_R32G32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 2},
{PIPE_FORMAT_R32G32B32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 3},
{PIPE_FORMAT_R32G32B32A32_UNORM, from_32_unorm, to_32_unorm, LL_Int32, 4},
{PIPE_FORMAT_R32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 1},
{PIPE_FORMAT_R32G32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 2},
{PIPE_FORMAT_R32G32B32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 3},
{PIPE_FORMAT_R32G32B32A32_USCALED, from_32_uscaled, to_32_uscaled, LL_Int32, 4},
{PIPE_FORMAT_R32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 1},
{PIPE_FORMAT_R32G32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 2},
{PIPE_FORMAT_R32G32B32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 3},
{PIPE_FORMAT_R32G32B32A32_SNORM, from_32_snorm, to_32_snorm, LL_Int32, 4},
{PIPE_FORMAT_R32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 1},
{PIPE_FORMAT_R32G32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 2},
{PIPE_FORMAT_R32G32B32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 3},
{PIPE_FORMAT_R32G32B32A32_SSCALED, from_32_sscaled, to_32_sscaled, LL_Int32, 4},
{PIPE_FORMAT_R16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 1},
{PIPE_FORMAT_R16G16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 2},
{PIPE_FORMAT_R16G16B16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 3},
{PIPE_FORMAT_R16G16B16A16_UNORM, from_16_unorm, to_16_unorm, LL_Int16, 4},
{PIPE_FORMAT_R16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 1},
{PIPE_FORMAT_R16G16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 2},
{PIPE_FORMAT_R16G16B16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 3},
{PIPE_FORMAT_R16G16B16A16_USCALED, from_16_uscaled, to_16_uscaled, LL_Int16, 4},
{PIPE_FORMAT_R16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 1},
{PIPE_FORMAT_R16G16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 2},
{PIPE_FORMAT_R16G16B16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 3},
{PIPE_FORMAT_R16G16B16A16_SNORM, from_16_snorm, to_16_snorm, LL_Int16, 4},
{PIPE_FORMAT_R16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 1},
{PIPE_FORMAT_R16G16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 2},
{PIPE_FORMAT_R16G16B16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 3},
{PIPE_FORMAT_R16G16B16A16_SSCALED, from_16_sscaled, to_16_sscaled, LL_Int16, 4},
{PIPE_FORMAT_R8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 1},
{PIPE_FORMAT_R8G8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 2},
{PIPE_FORMAT_R8G8B8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 3},
{PIPE_FORMAT_R8G8B8A8_UNORM, from_8_unorm, to_8_unorm, LL_Int8, 4},
{PIPE_FORMAT_R8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 1},
{PIPE_FORMAT_R8G8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 2},
{PIPE_FORMAT_R8G8B8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 3},
{PIPE_FORMAT_R8G8B8A8_USCALED, from_8_uscaled, to_8_uscaled, LL_Int8, 4},
{PIPE_FORMAT_R8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 1},
{PIPE_FORMAT_R8G8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 2},
{PIPE_FORMAT_R8G8B8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 3},
{PIPE_FORMAT_R8G8B8A8_SNORM, from_8_snorm, to_8_snorm, LL_Int8, 4},
{PIPE_FORMAT_R8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 1},
{PIPE_FORMAT_R8G8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 2},
{PIPE_FORMAT_R8G8B8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 3},
{PIPE_FORMAT_R8G8B8A8_SSCALED, from_8_sscaled, to_8_sscaled, LL_Int8, 4},
{PIPE_FORMAT_R32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 1},
{PIPE_FORMAT_R32G32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 2},
{PIPE_FORMAT_R32G32B32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 3},
{PIPE_FORMAT_R32G32B32A32_FIXED, from_32_fixed, to_32_fixed, LL_Int32, 4},
};
static LLVMValueRef
fetch(struct gallivm_state *gallivm,
LLVMValueRef ptr, int val_size, int nr_components,
from_func func)
{
int i;
int offset = 0;
LLVMValueRef res =
LLVMConstNull(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), 4));
LLVMValueRef defaults[4];
defaults[0] =
defaults[1] =
defaults[2] = lp_build_const_float(gallivm, 0.0);
defaults[3] = lp_build_const_float(gallivm, 1.0);
for (i = 0; i < nr_components; ++i) {
LLVMValueRef src_index = lp_build_const_int32(gallivm, offset);
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
LLVMValueRef src_tmp;
LLVMValueRef component;
src_tmp = LLVMBuildGEP(gallivm->builder, ptr, &src_index, 1, "src_tmp");
/* convert src_tmp to float */
component = func(gallivm, src_tmp);
/* vec.comp = component */
res = LLVMBuildInsertElement(gallivm->builder,
res,
component,
dst_index, "");
offset += val_size;
}
for (; i < 4; ++i) {
LLVMValueRef dst_index = lp_build_const_int32(gallivm, i);
res = LLVMBuildInsertElement(gallivm->builder,
res,
defaults[i],
dst_index, "");
}
return res;
}
LLVMValueRef
draw_llvm_translate_from(struct gallivm_state *gallivm,
LLVMValueRef vbuffer,
enum pipe_format from_format)
{
const struct util_format_description *format_desc;
LLVMValueRef zero;
int i;
struct lp_type type = lp_float32_vec4_type();
/*
* The above can only cope with straight arrays: no bitfields,
* swizzles, or half floats.
*/
for (i = 0; i < Elements(translates); ++i) {
if (translates[i].format == from_format) {
/*LLVMTypeRef type = ll_type_to_llvm(translates[i].type);*/
return fetch(gallivm,
vbuffer,
ll_type_size(translates[i].type),
translates[i].num_components,
translates[i].from);
}
}
/*
* This doesn't handle anything bigger than 32bits, or half floats
* yet.
*
* TODO: unify all this code into lp_build_fetch_rgba_aos().
*/
format_desc = util_format_description(from_format);
zero = LLVMConstNull(LLVMInt32TypeInContext(gallivm->context));
return lp_build_fetch_rgba_aos(gallivm, format_desc, type, vbuffer, zero, zero, zero);
}

View File

@@ -47,8 +47,8 @@
#include "tgsi/tgsi_scan.h"
#ifdef HAVE_LLVM
#include <llvm-c/ExecutionEngine.h>
struct draw_llvm;
struct gallivm_state;
#endif
@@ -174,6 +174,7 @@ struct draw_context
/** vertex element/index buffer (ex: glDrawElements) */
const void *elts;
/** bytes per index (0, 1, 2 or 4) */
unsigned eltSizeIB;
unsigned eltSize;
int eltBias;
unsigned min_index;
@@ -240,12 +241,14 @@ struct draw_context
uint edgeflag_output;
uint clipvertex_output;
uint clipdistance_output[2];
/** TGSI program interpreter runtime state */
struct tgsi_exec_machine *machine;
uint num_samplers;
struct tgsi_sampler **samplers;
/** Fields for TGSI interpreter / execution */
struct {
struct tgsi_exec_machine *machine;
struct tgsi_sampler **samplers;
uint num_samplers;
} tgsi;
const void *aligned_constants[PIPE_MAX_CONSTANT_BUFFERS];
@@ -265,11 +268,14 @@ struct draw_context
uint num_gs_outputs; /**< convenience, from geometry_shader */
uint position_output;
/** TGSI program interpreter runtime state */
struct tgsi_exec_machine *machine;
/** Fields for TGSI interpreter / execution */
struct {
struct tgsi_exec_machine *machine;
struct tgsi_sampler **samplers;
uint num_samplers;
} tgsi;
uint num_samplers;
struct tgsi_sampler **samplers;
} gs;
/** Fragment shader state */
@@ -301,13 +307,17 @@ struct draw_context
#ifdef HAVE_LLVM
struct draw_llvm *llvm;
struct gallivm_state *own_gallivm;
#endif
struct pipe_sampler_view *sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
unsigned num_sampler_views;
const struct pipe_sampler_state *samplers[PIPE_MAX_VERTEX_SAMPLERS];
unsigned num_samplers;
/** Texture sampler and sampler view state.
* Note that we have arrays indexed by shader type. At this time
* we only handle vertex and geometry shaders in the draw module, but
* there may be more in the future (ex: hull and tessellation).
*/
struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
unsigned num_sampler_views[PIPE_SHADER_TYPES];
const struct pipe_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
unsigned num_samplers[PIPE_SHADER_TYPES];
void *driver_private;
};

View File

@@ -362,7 +362,7 @@ draw_pt_arrays_restart(struct draw_context *draw,
assert(info->primitive_restart);
if (draw->pt.user.elts) {
if (draw->pt.user.eltSize) {
/* indexed prims (draw_elements) */
cur_start = start;
cur_count = 0;
@@ -433,12 +433,8 @@ draw_arrays_instanced(struct draw_context *draw,
info.count = count;
info.start_instance = startInstance;
info.instance_count = instanceCount;
info.indexed = (draw->pt.user.elts != NULL);
if (!info.indexed) {
info.min_index = start;
info.max_index = start + count - 1;
}
info.min_index = start;
info.max_index = start + count - 1;
draw_vbo(draw, &info);
}
@@ -465,6 +461,7 @@ draw_vbo(struct draw_context *draw,
draw->pt.user.eltBias = info->index_bias;
draw->pt.user.min_index = info->min_index;
draw->pt.user.max_index = info->max_index;
draw->pt.user.eltSize = info->indexed ? draw->pt.user.eltSizeIB : 0;
if (0)
debug_printf("draw_vbo(mode=%u start=%u count=%u):\n",

View File

@@ -230,7 +230,7 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle,
llvm_vert_info.stride = fpme->vertex_size;
llvm_vert_info.verts =
(struct vertex_header *)MALLOC(fpme->vertex_size *
align(fetch_info->count, 4));
align(fetch_info->count, lp_native_vector_width / 32));
if (!llvm_vert_info.verts) {
assert(0);
return;
@@ -423,7 +423,7 @@ draw_pt_fetch_pipeline_or_emit_llvm(struct draw_context *draw)
{
struct llvm_middle_end *fpme = 0;
if (!draw->llvm || !draw->llvm->gallivm->engine)
if (!draw->llvm)
return NULL;
fpme = CALLOC_STRUCT( llvm_middle_end );

View File

@@ -193,8 +193,8 @@ draw_vs_init( struct draw_context *draw )
{
draw->dump_vs = debug_get_option_gallium_dump_vs();
draw->vs.machine = tgsi_exec_machine_create();
if (!draw->vs.machine)
draw->vs.tgsi.machine = tgsi_exec_machine_create();
if (!draw->vs.tgsi.machine)
return FALSE;
draw->vs.emit_cache = translate_cache_create();
@@ -225,7 +225,7 @@ draw_vs_destroy( struct draw_context *draw )
}
}
tgsi_exec_machine_destroy(draw->vs.machine);
tgsi_exec_machine_destroy(draw->vs.tgsi.machine);
}

View File

@@ -69,8 +69,8 @@ vs_exec_prepare( struct draw_vertex_shader *shader,
if (evs->machine->Tokens != shader->state.tokens) {
tgsi_exec_machine_bind_shader(evs->machine,
shader->state.tokens,
draw->vs.num_samplers,
draw->vs.samplers);
draw->vs.tgsi.num_samplers,
draw->vs.tgsi.samplers);
}
}
@@ -235,7 +235,7 @@ draw_create_vs_exec(struct draw_context *draw,
vs->base.run_linear = vs_exec_run_linear;
vs->base.delete = vs_exec_delete;
vs->base.create_variant = draw_vs_create_variant_generic;
vs->machine = draw->vs.machine;
vs->machine = draw->vs.tgsi.machine;
return &vs->base;
}

View File

@@ -75,9 +75,9 @@ lp_build_min_simple(struct lp_build_context *bld,
LLVMValueRef a,
LLVMValueRef b)
{
LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
const char *intrinsic = NULL;
unsigned intr_size = 0;
LLVMValueRef cond;
assert(lp_check_value(type, a));
@@ -85,31 +85,71 @@ lp_build_min_simple(struct lp_build_context *bld,
/* TODO: optimize the constant case */
if(type.width * type.length == 128) {
if(type.floating) {
if(type.width == 32 && util_cpu_caps.has_sse)
if (type.floating && util_cpu_caps.has_sse) {
if (type.width == 32) {
if (type.length == 1) {
intrinsic = "llvm.x86.sse.min.ss";
intr_size = 128;
}
else if (type.length <= 4 || !util_cpu_caps.has_avx) {
intrinsic = "llvm.x86.sse.min.ps";
if(type.width == 64 && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.min.pd";
intr_size = 128;
}
else {
intrinsic = "llvm.x86.avx.min.ps.256";
intr_size = 256;
}
}
else {
if(type.width == 8 && !type.sign && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.pminu.b";
if(type.width == 8 && type.sign && util_cpu_caps.has_sse4_1)
if (type.width == 64 && util_cpu_caps.has_sse2) {
if (type.length == 1) {
intrinsic = "llvm.x86.sse2.min.sd";
intr_size = 128;
}
else if (type.length == 2 || !util_cpu_caps.has_avx) {
intrinsic = "llvm.x86.sse2.min.pd";
intr_size = 128;
}
else {
intrinsic = "llvm.x86.avx.min.pd.256";
intr_size = 256;
}
}
}
else if (util_cpu_caps.has_sse2 && type.length >= 2) {
intr_size = 128;
if ((type.width == 8 || type.width == 16) &&
(type.width * type.length <= 64) &&
(gallivm_debug & GALLIVM_DEBUG_PERF)) {
debug_printf("%s: inefficient code, bogus shuffle due to packing\n",
__FUNCTION__);
}
if (type.width == 8 && !type.sign) {
intrinsic = "llvm.x86.sse2.pminu.b";
}
else if (type.width == 16 && type.sign) {
intrinsic = "llvm.x86.sse2.pmins.w";
}
if (util_cpu_caps.has_sse4_1) {
if (type.width == 8 && type.sign) {
intrinsic = "llvm.x86.sse41.pminsb";
if(type.width == 16 && !type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 16 && !type.sign) {
intrinsic = "llvm.x86.sse41.pminuw";
if(type.width == 16 && type.sign && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.pmins.w";
if(type.width == 32 && !type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 32 && !type.sign) {
intrinsic = "llvm.x86.sse41.pminud";
if(type.width == 32 && type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 32 && type.sign) {
intrinsic = "llvm.x86.sse41.pminsd";
}
}
}
if(intrinsic)
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
if(intrinsic) {
return lp_build_intrinsic_binary_anylength(bld->gallivm, intrinsic,
type,
intr_size, a, b);
}
cond = lp_build_cmp(bld, PIPE_FUNC_LESS, a, b);
return lp_build_select(bld, cond, a, b);
@@ -125,9 +165,9 @@ lp_build_max_simple(struct lp_build_context *bld,
LLVMValueRef a,
LLVMValueRef b)
{
LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
const char *intrinsic = NULL;
unsigned intr_size = 0;
LLVMValueRef cond;
assert(lp_check_value(type, a));
@@ -135,31 +175,72 @@ lp_build_max_simple(struct lp_build_context *bld,
/* TODO: optimize the constant case */
if(type.width * type.length == 128) {
if(type.floating) {
if(type.width == 32 && util_cpu_caps.has_sse)
if (type.floating && util_cpu_caps.has_sse) {
if (type.width == 32) {
if (type.length == 1) {
intrinsic = "llvm.x86.sse.max.ss";
intr_size = 128;
}
else if (type.length <= 4 || !util_cpu_caps.has_avx) {
intrinsic = "llvm.x86.sse.max.ps";
if(type.width == 64 && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.max.pd";
intr_size = 128;
}
else {
intrinsic = "llvm.x86.avx.max.ps.256";
intr_size = 256;
}
}
else {
if(type.width == 8 && !type.sign && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.pmaxu.b";
if(type.width == 8 && type.sign && util_cpu_caps.has_sse4_1)
if (type.width == 64 && util_cpu_caps.has_sse2) {
if (type.length == 1) {
intrinsic = "llvm.x86.sse2.max.sd";
intr_size = 128;
}
else if (type.length == 2 || !util_cpu_caps.has_avx) {
intrinsic = "llvm.x86.sse2.max.pd";
intr_size = 128;
}
else {
intrinsic = "llvm.x86.avx.max.pd.256";
intr_size = 256;
}
}
}
else if (util_cpu_caps.has_sse2 && type.length >= 2) {
intr_size = 128;
if ((type.width == 8 || type.width == 16) &&
(type.width * type.length <= 64) &&
(gallivm_debug & GALLIVM_DEBUG_PERF)) {
debug_printf("%s: inefficient code, bogus shuffle due to packing\n",
__FUNCTION__);
}
if (type.width == 8 && !type.sign) {
intrinsic = "llvm.x86.sse2.pmaxu.b";
intr_size = 128;
}
else if (type.width == 16 && type.sign) {
intrinsic = "llvm.x86.sse2.pmaxs.w";
}
if (util_cpu_caps.has_sse4_1) {
if (type.width == 8 && type.sign) {
intrinsic = "llvm.x86.sse41.pmaxsb";
if(type.width == 16 && !type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 16 && !type.sign) {
intrinsic = "llvm.x86.sse41.pmaxuw";
if(type.width == 16 && type.sign && util_cpu_caps.has_sse2)
intrinsic = "llvm.x86.sse2.pmaxs.w";
if(type.width == 32 && !type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 32 && !type.sign) {
intrinsic = "llvm.x86.sse41.pmaxud";
if(type.width == 32 && type.sign && util_cpu_caps.has_sse4_1)
}
if (type.width == 32 && type.sign) {
intrinsic = "llvm.x86.sse41.pmaxsd";
}
}
}
if(intrinsic)
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
if(intrinsic) {
return lp_build_intrinsic_binary_anylength(bld->gallivm, intrinsic,
type,
intr_size, a, b);
}
cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, b);
return lp_build_select(bld, cond, a, b);
@@ -265,15 +346,20 @@ lp_build_add(struct lp_build_context *bld,
}
/** Return the scalar sum of the elements of a */
/** Return the scalar sum of the elements of a.
* Should avoid this operation whenever possible.
*/
LLVMValueRef
lp_build_sum_vector(struct lp_build_context *bld,
LLVMValueRef a)
lp_build_horizontal_add(struct lp_build_context *bld,
LLVMValueRef a)
{
LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
LLVMValueRef index, res;
unsigned i;
unsigned i, length;
LLVMValueRef shuffles1[LP_MAX_VECTOR_LENGTH / 2];
LLVMValueRef shuffles2[LP_MAX_VECTOR_LENGTH / 2];
LLVMValueRef vecres, elem2;
assert(lp_check_value(type, a));
@@ -283,26 +369,191 @@ lp_build_sum_vector(struct lp_build_context *bld,
assert(!bld->type.norm);
index = lp_build_const_int32(bld->gallivm, 0);
res = LLVMBuildExtractElement(builder, a, index, "");
/*
* for byte vectors can do much better with psadbw.
* Using repeated shuffle/adds here. Note with multiple vectors
* this can be done more efficiently as outlined in the intel
* optimization manual.
* Note: could cause data rearrangement if used with smaller element
* sizes.
*/
for (i = 1; i < type.length; i++) {
index = lp_build_const_int32(bld->gallivm, i);
if (type.floating)
res = LLVMBuildFAdd(builder, res,
LLVMBuildExtractElement(builder,
a, index, ""),
"");
else
res = LLVMBuildAdd(builder, res,
LLVMBuildExtractElement(builder,
a, index, ""),
"");
vecres = a;
length = type.length / 2;
while (length > 1) {
LLVMValueRef vec1, vec2;
for (i = 0; i < length; i++) {
shuffles1[i] = lp_build_const_int32(bld->gallivm, i);
shuffles2[i] = lp_build_const_int32(bld->gallivm, i + length);
}
vec1 = LLVMBuildShuffleVector(builder, vecres, vecres,
LLVMConstVector(shuffles1, length), "");
vec2 = LLVMBuildShuffleVector(builder, vecres, vecres,
LLVMConstVector(shuffles2, length), "");
if (type.floating) {
vecres = LLVMBuildFAdd(builder, vec1, vec2, "");
}
else {
vecres = LLVMBuildAdd(builder, vec1, vec2, "");
}
length = length >> 1;
}
/* always have vector of size 2 here */
assert(length == 1);
index = lp_build_const_int32(bld->gallivm, 0);
res = LLVMBuildExtractElement(builder, vecres, index, "");
index = lp_build_const_int32(bld->gallivm, 1);
elem2 = LLVMBuildExtractElement(builder, vecres, index, "");
if (type.floating)
res = LLVMBuildFAdd(builder, res, elem2, "");
else
res = LLVMBuildAdd(builder, res, elem2, "");
return res;
}
/**
* Return the horizontal sums of 4 float vectors as a float4 vector.
* This uses the technique as outlined in Intel Optimization Manual.
*/
static LLVMValueRef
lp_build_horizontal_add4x4f(struct lp_build_context *bld,
LLVMValueRef src[4])
{
struct gallivm_state *gallivm = bld->gallivm;
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef shuffles[4];
LLVMValueRef tmp[4];
LLVMValueRef sumtmp[2], shuftmp[2];
/* lower half of regs */
shuffles[0] = lp_build_const_int32(gallivm, 0);
shuffles[1] = lp_build_const_int32(gallivm, 1);
shuffles[2] = lp_build_const_int32(gallivm, 4);
shuffles[3] = lp_build_const_int32(gallivm, 5);
tmp[0] = LLVMBuildShuffleVector(builder, src[0], src[1],
LLVMConstVector(shuffles, 4), "");
tmp[2] = LLVMBuildShuffleVector(builder, src[2], src[3],
LLVMConstVector(shuffles, 4), "");
/* upper half of regs */
shuffles[0] = lp_build_const_int32(gallivm, 2);
shuffles[1] = lp_build_const_int32(gallivm, 3);
shuffles[2] = lp_build_const_int32(gallivm, 6);
shuffles[3] = lp_build_const_int32(gallivm, 7);
tmp[1] = LLVMBuildShuffleVector(builder, src[0], src[1],
LLVMConstVector(shuffles, 4), "");
tmp[3] = LLVMBuildShuffleVector(builder, src[2], src[3],
LLVMConstVector(shuffles, 4), "");
sumtmp[0] = LLVMBuildFAdd(builder, tmp[0], tmp[1], "");
sumtmp[1] = LLVMBuildFAdd(builder, tmp[2], tmp[3], "");
shuffles[0] = lp_build_const_int32(gallivm, 0);
shuffles[1] = lp_build_const_int32(gallivm, 2);
shuffles[2] = lp_build_const_int32(gallivm, 4);
shuffles[3] = lp_build_const_int32(gallivm, 6);
shuftmp[0] = LLVMBuildShuffleVector(builder, sumtmp[0], sumtmp[1],
LLVMConstVector(shuffles, 4), "");
shuffles[0] = lp_build_const_int32(gallivm, 1);
shuffles[1] = lp_build_const_int32(gallivm, 3);
shuffles[2] = lp_build_const_int32(gallivm, 5);
shuffles[3] = lp_build_const_int32(gallivm, 7);
shuftmp[1] = LLVMBuildShuffleVector(builder, sumtmp[0], sumtmp[1],
LLVMConstVector(shuffles, 4), "");
return LLVMBuildFAdd(builder, shuftmp[0], shuftmp[1], "");
}
/*
* partially horizontally add 2-4 float vectors with length nx4,
* i.e. only four adjacent values in each vector will be added,
* assuming values are really grouped in 4 which also determines
* output order.
*
* Return a vector of the same length as the initial vectors,
* with the excess elements (if any) being undefined.
* The element order is independent of number of input vectors.
* For 3 vectors x0x1x2x3x4x5x6x7, y0y1y2y3y4y5y6y7, z0z1z2z3z4z5z6z7
* the output order thus will be
* sumx0-x3,sumy0-y3,sumz0-z3,undef,sumx4-x7,sumy4-y7,sumz4z7,undef
*/
LLVMValueRef
lp_build_hadd_partial4(struct lp_build_context *bld,
LLVMValueRef vectors[],
unsigned num_vecs)
{
struct gallivm_state *gallivm = bld->gallivm;
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef ret_vec;
LLVMValueRef tmp[4];
const char *intrinsic = NULL;
assert(num_vecs >= 2 && num_vecs <= 4);
assert(bld->type.floating);
/* only use this with at least 2 vectors, as it is sort of expensive
* (depending on cpu) and we always need two horizontal adds anyway,
* so a shuffle/add approach might be better.
*/
tmp[0] = vectors[0];
tmp[1] = vectors[1];
tmp[2] = num_vecs > 2 ? vectors[2] : vectors[0];
tmp[3] = num_vecs > 3 ? vectors[3] : vectors[0];
if (util_cpu_caps.has_sse3 && bld->type.width == 32 &&
bld->type.length == 4) {
intrinsic = "llvm.x86.sse3.hadd.ps";
}
else if (util_cpu_caps.has_avx && bld->type.width == 32 &&
bld->type.length == 8) {
intrinsic = "llvm.x86.avx.hadd.ps.256";
}
if (intrinsic) {
tmp[0] = lp_build_intrinsic_binary(builder, intrinsic,
lp_build_vec_type(gallivm, bld->type),
tmp[0], tmp[1]);
if (num_vecs > 2) {
tmp[1] = lp_build_intrinsic_binary(builder, intrinsic,
lp_build_vec_type(gallivm, bld->type),
tmp[2], tmp[3]);
}
else {
tmp[1] = tmp[0];
}
return lp_build_intrinsic_binary(builder, intrinsic,
lp_build_vec_type(gallivm, bld->type),
tmp[0], tmp[1]);
}
if (bld->type.length == 4) {
ret_vec = lp_build_horizontal_add4x4f(bld, tmp);
}
else {
LLVMValueRef partres[LP_MAX_VECTOR_LENGTH/4];
unsigned j;
unsigned num_iter = bld->type.length / 4;
struct lp_type parttype = bld->type;
parttype.length = 4;
for (j = 0; j < num_iter; j++) {
LLVMValueRef partsrc[4];
unsigned i;
for (i = 0; i < 4; i++) {
partsrc[i] = lp_build_extract_range(gallivm, tmp[i], j*4, 4);
}
partres[j] = lp_build_horizontal_add4x4f(bld, partsrc);
}
ret_vec = lp_build_concat(gallivm, partres, parttype, num_iter);
}
return ret_vec;
}
/**
* Generate a - b
@@ -553,7 +804,7 @@ lp_build_mul_imm(struct lp_build_context *bld,
if(bld->type.floating) {
#if 0
/*
* Power of two multiplication by directly manipulating the mantissa.
* Power of two multiplication by directly manipulating the exponent.
*
* XXX: This might not be always faster, it will introduce a small error
* for multiplication by zero, and it will produce wrong results
@@ -612,7 +863,8 @@ lp_build_div(struct lp_build_context *bld,
return LLVMConstUDiv(a, b);
}
if(util_cpu_caps.has_sse && type.width == 32 && type.length == 4 &&
if(((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) &&
type.floating)
return lp_build_mul(bld, a, lp_build_rcp(bld, b));
@@ -871,6 +1123,12 @@ lp_build_abs(struct lp_build_context *bld,
return lp_build_intrinsic_unary(builder, "llvm.x86.ssse3.pabs.d.128", vec_type, a);
}
}
else if (type.width*type.length == 256 && util_cpu_caps.has_ssse3 &&
(gallivm_debug & GALLIVM_DEBUG_PERF) &&
(type.width == 8 || type.width == 16 || type.width == 32)) {
debug_printf("%s: inefficient code, should split vectors manually\n",
__FUNCTION__);
}
return lp_build_max(bld, a, LLVMBuildNeg(builder, a, ""));
}
@@ -934,6 +1192,7 @@ lp_build_sgn(struct lp_build_context *bld,
else
{
/* signed int/norm/fixed point */
/* could use psign with sse3 and appropriate vectors here */
LLVMValueRef minus_one = lp_build_const_vec(bld->gallivm, type, -1.0);
cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, bld->zero);
res = lp_build_select(bld, cond, bld->one, minus_one);
@@ -1000,7 +1259,16 @@ lp_build_int_to_float(struct lp_build_context *bld,
return LLVMBuildSIToFP(builder, a, vec_type, "");
}
static boolean
sse41_rounding_available(const struct lp_type type)
{
if ((util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) ||
(util_cpu_caps.has_avx && type.width*type.length == 256))
return TRUE;
return FALSE;
}
enum lp_build_round_sse41_mode
{
@@ -1065,18 +1333,34 @@ lp_build_round_sse41(struct lp_build_context *bld,
res = LLVMBuildExtractElement(builder, res, index0, "");
}
else {
assert(type.width*type.length == 128);
if (type.width * type.length == 128) {
switch(type.width) {
case 32:
intrinsic = "llvm.x86.sse41.round.ps";
break;
case 64:
intrinsic = "llvm.x86.sse41.round.pd";
break;
default:
assert(0);
return bld->undef;
}
}
else {
assert(type.width * type.length == 256);
assert(util_cpu_caps.has_avx);
switch(type.width) {
case 32:
intrinsic = "llvm.x86.sse41.round.ps";
break;
case 64:
intrinsic = "llvm.x86.sse41.round.pd";
break;
default:
assert(0);
return bld->undef;
switch(type.width) {
case 32:
intrinsic = "llvm.x86.avx.round.ps.256";
break;
case 64:
intrinsic = "llvm.x86.avx.round.pd.256";
break;
default:
assert(0);
return bld->undef;
}
}
res = lp_build_intrinsic_binary(builder, intrinsic,
@@ -1125,10 +1409,15 @@ lp_build_iround_nearest_sse2(struct lp_build_context *bld,
ret_type, arg);
}
else {
assert(type.width*type.length == 128);
intrinsic = "llvm.x86.sse2.cvtps2dq";
if (type.width* type.length == 128) {
intrinsic = "llvm.x86.sse2.cvtps2dq";
}
else {
assert(type.width*type.length == 256);
assert(util_cpu_caps.has_avx);
intrinsic = "llvm.x86.avx.cvt.ps2dq.256";
}
res = lp_build_intrinsic_unary(builder, intrinsic,
ret_type, a);
}
@@ -1152,8 +1441,7 @@ lp_build_trunc(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_TRUNCATE);
}
else {
@@ -1183,8 +1471,7 @@ lp_build_round(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_NEAREST);
}
else {
@@ -1212,8 +1499,7 @@ lp_build_floor(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
}
else {
@@ -1241,8 +1527,7 @@ lp_build_ceil(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
return lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_CEIL);
}
else {
@@ -1268,6 +1553,34 @@ lp_build_fract(struct lp_build_context *bld,
}
/**
* Prevent returning a fractional part of 1.0 for very small negative values of
* 'a' by clamping against 0.99999(9).
*/
static inline LLVMValueRef
clamp_fract(struct lp_build_context *bld, LLVMValueRef fract)
{
LLVMValueRef max;
/* this is the largest number smaller than 1.0 representable as float */
max = lp_build_const_vec(bld->gallivm, bld->type,
1.0 - 1.0/(1LL << (lp_mantissa(bld->type) + 1)));
return lp_build_min(bld, fract, max);
}
/**
* Same as lp_build_fract, but guarantees that the result is always smaller
* than one.
*/
LLVMValueRef
lp_build_fract_safe(struct lp_build_context *bld,
LLVMValueRef a)
{
return clamp_fract(bld, lp_build_fract(bld, a));
}
/**
* Return the integer part of a float (vector) value (== round toward zero).
* The returned value is an integer (vector).
@@ -1307,12 +1620,12 @@ lp_build_iround(struct lp_build_context *bld,
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse2 &&
((type.width == 32) && (type.length == 1 || type.length == 4))) {
if ((util_cpu_caps.has_sse2 &&
((type.width == 32) && (type.length == 1 || type.length == 4))) ||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) {
return lp_build_iround_nearest_sse2(bld, a);
}
else if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_NEAREST);
}
else {
@@ -1362,14 +1675,12 @@ lp_build_ifloor(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
}
else {
res = a;
if (type.sign) {
res = a;
if (type.sign) {
if (sse41_rounding_available(type)) {
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_FLOOR);
}
else {
/* Take the sign bit and add it to 1 constant */
LLVMTypeRef vec_type = bld->vec_type;
unsigned mantissa = lp_mantissa(type);
@@ -1423,8 +1734,7 @@ lp_build_iceil(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
res = lp_build_round_sse41(bld, a, LP_BUILD_ROUND_SSE41_CEIL);
}
else {
@@ -1470,7 +1780,7 @@ lp_build_iceil(struct lp_build_context *bld,
* Combined ifloor() & fract().
*
* Preferred to calling the functions separately, as it will ensure that the
* stratergy (floor() vs ifloor()) that results in less redundant work is used.
* strategy (floor() vs ifloor()) that results in less redundant work is used.
*/
void
lp_build_ifloor_fract(struct lp_build_context *bld,
@@ -1485,8 +1795,7 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
assert(type.floating);
assert(lp_check_value(type, a));
if (util_cpu_caps.has_sse4_1 &&
(type.length == 1 || type.width*type.length == 128)) {
if (sse41_rounding_available(type)) {
/*
* floor() is easier.
*/
@@ -1507,6 +1816,21 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
}
/**
* Same as lp_build_ifloor_fract, but guarantees that the fractional part is
* always smaller than one.
*/
void
lp_build_ifloor_fract_safe(struct lp_build_context *bld,
LLVMValueRef a,
LLVMValueRef *out_ipart,
LLVMValueRef *out_fpart)
{
lp_build_ifloor_fract(bld, a, out_ipart, out_fpart);
*out_fpart = clamp_fract(bld, *out_fpart);
}
LLVMValueRef
lp_build_sqrt(struct lp_build_context *bld,
LLVMValueRef a)
@@ -1518,11 +1842,15 @@ lp_build_sqrt(struct lp_build_context *bld,
assert(lp_check_value(type, a));
/* TODO: optimize the constant case */
/* TODO: optimize the constant case */
assert(type.floating);
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.v%uf%u", type.length, type.width);
if (type.length == 1) {
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.f%u", type.width);
}
else {
util_snprintf(intrinsic, sizeof intrinsic, "llvm.sqrt.v%uf%u", type.length, type.width);
}
return lp_build_intrinsic_unary(builder, intrinsic, vec_type, a);
}
@@ -1586,19 +1914,28 @@ lp_build_rcp(struct lp_build_context *bld,
* - it doesn't even get the reciprocate of 1.0 exactly
* - doing Newton-Rapshon steps yields wrong (NaN) values for 0.0 or Inf
* - for recent processors the benefit over DIVPS is marginal, a case
* depedent
* dependent
*
* We could still use it on certain processors if benchmarks show that the
* RCPPS plus necessary workarounds are still preferrable to DIVPS; or for
* particular uses that require less workarounds.
*/
if (FALSE && util_cpu_caps.has_sse && type.width == 32 && type.length == 4) {
if (FALSE && ((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8))){
const unsigned num_iterations = 0;
LLVMValueRef res;
unsigned i;
const char *intrinsic = NULL;
res = lp_build_intrinsic_unary(builder, "llvm.x86.sse.rcp.ps", bld->vec_type, a);
if (type.length == 4) {
intrinsic = "llvm.x86.sse.rcp.ps";
}
else {
intrinsic = "llvm.x86.avx.rcp.ps.256";
}
res = lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);
for (i = 0; i < num_iterations; ++i) {
res = lp_build_rcp_refine(bld, a, res);
@@ -1653,12 +1990,22 @@ lp_build_rsqrt(struct lp_build_context *bld,
assert(type.floating);
if (util_cpu_caps.has_sse && type.width == 32 && type.length == 4) {
if ((util_cpu_caps.has_sse && type.width == 32 && type.length == 4) ||
(util_cpu_caps.has_avx && type.width == 32 && type.length == 8)) {
const unsigned num_iterations = 1;
LLVMValueRef res;
unsigned i;
const char *intrinsic = NULL;
if (type.length == 4) {
intrinsic = "llvm.x86.sse.rsqrt.ps";
}
else {
intrinsic = "llvm.x86.avx.rsqrt.ps.256";
}
res = lp_build_intrinsic_unary(builder, intrinsic, bld->vec_type, a);
res = lp_build_intrinsic_unary(builder, "llvm.x86.sse.rsqrt.ps", bld->vec_type, a);
for (i = 0; i < num_iterations; ++i) {
res = lp_build_rsqrt_refine(bld, a, res);

View File

@@ -57,8 +57,13 @@ lp_build_add(struct lp_build_context *bld,
LLVMValueRef b);
LLVMValueRef
lp_build_sum_vector(struct lp_build_context *bld,
LLVMValueRef a);
lp_build_horizontal_add(struct lp_build_context *bld,
LLVMValueRef a);
LLVMValueRef
lp_build_hadd_partial4(struct lp_build_context *bld,
LLVMValueRef vectors[],
unsigned num_vecs);
LLVMValueRef
lp_build_sub(struct lp_build_context *bld,
@@ -156,6 +161,10 @@ LLVMValueRef
lp_build_fract(struct lp_build_context *bld,
LLVMValueRef a);
LLVMValueRef
lp_build_fract_safe(struct lp_build_context *bld,
LLVMValueRef a);
LLVMValueRef
lp_build_ifloor(struct lp_build_context *bld,
LLVMValueRef a);
@@ -177,6 +186,12 @@ lp_build_ifloor_fract(struct lp_build_context *bld,
LLVMValueRef *out_ipart,
LLVMValueRef *out_fpart);
void
lp_build_ifloor_fract_safe(struct lp_build_context *bld,
LLVMValueRef a,
LLVMValueRef *out_ipart,
LLVMValueRef *out_fpart);
LLVMValueRef
lp_build_sqrt(struct lp_build_context *bld,
LLVMValueRef a);

View File

@@ -37,6 +37,7 @@
#include "util/u_debug.h"
#include "util/u_math.h"
#include "util/u_half.h"
#include "lp_bld_type.h"
#include "lp_bld_const.h"
@@ -50,10 +51,12 @@ lp_mantissa(struct lp_type type)
if(type.floating) {
switch(type.width) {
case 16:
return 10;
case 32:
return 23;
case 64:
return 53;
return 52;
default:
assert(0);
return 0;
@@ -136,6 +139,8 @@ lp_const_min(struct lp_type type)
if (type.floating) {
switch(type.width) {
case 16:
return -65504;
case 32:
return -FLT_MAX;
case 64:
@@ -169,6 +174,8 @@ lp_const_max(struct lp_type type)
if (type.floating) {
switch(type.width) {
case 16:
return 65504;
case 32:
return FLT_MAX;
case 64:
@@ -196,6 +203,8 @@ lp_const_eps(struct lp_type type)
{
if (type.floating) {
switch(type.width) {
case 16:
return 2E-10;
case 32:
return FLT_EPSILON;
case 64:
@@ -247,7 +256,9 @@ lp_build_one(struct gallivm_state *gallivm, struct lp_type type)
elem_type = lp_build_elem_type(gallivm, type);
if(type.floating)
if(type.floating && type.width == 16)
elems[0] = LLVMConstInt(elem_type, util_float_to_half(1.0f), 0);
else if(type.floating)
elems[0] = LLVMConstReal(elem_type, 1.0);
else if(type.fixed)
elems[0] = LLVMConstInt(elem_type, 1LL << (type.width/2), 0);
@@ -292,7 +303,9 @@ lp_build_const_elem(struct gallivm_state *gallivm,
LLVMTypeRef elem_type = lp_build_elem_type(gallivm, type);
LLVMValueRef elem;
if(type.floating) {
if(type.floating && type.width == 16) {
elem = LLVMConstInt(elem_type, util_float_to_half((float)val), 0);
} else if(type.floating) {
elem = LLVMConstReal(elem_type, val);
}
else {
@@ -364,20 +377,10 @@ lp_build_const_aos(struct gallivm_state *gallivm,
if(swizzle == NULL)
swizzle = default_swizzle;
if(type.floating) {
elems[swizzle[0]] = LLVMConstReal(elem_type, r);
elems[swizzle[1]] = LLVMConstReal(elem_type, g);
elems[swizzle[2]] = LLVMConstReal(elem_type, b);
elems[swizzle[3]] = LLVMConstReal(elem_type, a);
}
else {
double dscale = lp_const_scale(type);
elems[swizzle[0]] = LLVMConstInt(elem_type, round(r*dscale), 0);
elems[swizzle[1]] = LLVMConstInt(elem_type, round(g*dscale), 0);
elems[swizzle[2]] = LLVMConstInt(elem_type, round(b*dscale), 0);
elems[swizzle[3]] = LLVMConstInt(elem_type, round(a*dscale), 0);
}
elems[swizzle[0]] = lp_build_const_elem(gallivm, type, r);
elems[swizzle[1]] = lp_build_const_elem(gallivm, type, g);
elems[swizzle[2]] = lp_build_const_elem(gallivm, type, b);
elems[swizzle[3]] = lp_build_const_elem(gallivm, type, a);
for(i = 4; i < type.length; ++i)
elems[i] = elems[i % 4];
@@ -452,7 +455,7 @@ lp_build_const_string(struct gallivm_state *gallivm,
/**
* Build a callable function pointer.
*
* We this casts instead of LLVMAddGlobalMapping()
* We use function pointer constants instead of LLVMAddGlobalMapping()
* to work around a bug in LLVM 2.6, and for efficiency/simplicity.
*/
LLVMValueRef

View File

@@ -70,6 +70,66 @@
#include "lp_bld_arit.h"
#include "lp_bld_pack.h"
#include "lp_bld_conv.h"
#include "lp_bld_logic.h"
/**
* Converts int16 half-float to float32
* Note this can be performed in 1 instruction if vcvtph2ps exists (sse5 i think?)
* [llvm.x86.vcvtph2ps / _mm_cvtph_ps]
*
* @param src_type <vector> type of int16
* @param src value to convert
*
* ref http://fgiesen.wordpress.com/2012/03/28/half-to-float-done-quic/
*/
LLVMValueRef
lp_build_half_to_float(struct gallivm_state *gallivm,
struct lp_type src_type,
LLVMValueRef src)
{
struct lp_type f32_type = lp_type_float_vec(32, 32 * src_type.length);
struct lp_type i32_type = lp_type_int_vec(32, 32 * src_type.length);
LLVMBuilderRef builder = gallivm->builder;
LLVMTypeRef int_vec_type = lp_build_vec_type(gallivm, i32_type);
LLVMTypeRef float_vec_type = lp_build_vec_type(gallivm, f32_type);
/* Constants */
LLVMValueRef i32_13 = lp_build_const_int_vec(gallivm, i32_type, 13);
LLVMValueRef i32_16 = lp_build_const_int_vec(gallivm, i32_type, 16);
LLVMValueRef i32_mask_nosign = lp_build_const_int_vec(gallivm, i32_type, 0x7fff);
LLVMValueRef i32_was_infnan = lp_build_const_int_vec(gallivm, i32_type, 0x7bff);
LLVMValueRef i32_exp_infnan = lp_build_const_int_vec(gallivm, i32_type, 0xff << 23);
LLVMValueRef f32_magic = LLVMBuildBitCast(builder,
lp_build_const_int_vec(gallivm, i32_type, (254 - 15) << 23),
float_vec_type, "");
/* Convert int16 vector to int32 vector by zero ext */
LLVMValueRef h = LLVMBuildZExt(builder, src, int_vec_type, "");
/* Exponent / mantissa bits */
LLVMValueRef expmant = LLVMBuildAnd(builder, i32_mask_nosign, h, "");
LLVMValueRef shifted = LLVMBuildBitCast(builder, LLVMBuildShl(builder, expmant, i32_13, ""), float_vec_type, "");
/* Exponent adjust */
LLVMValueRef scaled = LLVMBuildBitCast(builder, LLVMBuildFMul(builder, shifted, f32_magic, ""), int_vec_type, "");
/* Make sure Inf/NaN survive */
LLVMValueRef b_wasinfnan = lp_build_compare(gallivm, i32_type, PIPE_FUNC_GREATER, expmant, i32_was_infnan);
LLVMValueRef infnanexp = LLVMBuildAnd(builder, b_wasinfnan, i32_exp_infnan, "");
/* Sign bit */
LLVMValueRef justsign = LLVMBuildXor(builder, h, expmant, "");
LLVMValueRef sign = LLVMBuildShl(builder, justsign, i32_16, "");
/* Combine result */
LLVMValueRef sign_inf = LLVMBuildOr(builder, sign, infnanexp, "");
LLVMValueRef final = LLVMBuildOr(builder, scaled, sign_inf, "");
/* Cast from int32 vector to float32 vector */
return LLVMBuildBitCast(builder, final, float_vec_type, "");
}
/**
@@ -334,64 +394,113 @@ lp_build_conv(struct gallivm_state *gallivm,
dst_type.width == 8 &&
dst_type.length == 16 &&
4 * num_dsts == num_srcs &&
util_cpu_caps.has_sse2)
{
int i;
struct lp_build_context bld;
struct lp_type int16_type = dst_type;
struct lp_type int32_type = dst_type;
LLVMValueRef const_255f;
unsigned i, j;
for (i = 0; i < num_dsts; i++, src += 4) {
struct lp_type int16_type = dst_type;
struct lp_type int32_type = dst_type;
lp_build_context_init(&bld, gallivm, src_type);
int16_type.width *= 2;
int16_type.length /= 2;
int16_type.sign = 1;
int32_type.width *= 4;
int32_type.length /= 4;
int32_type.sign = 1;
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
for (i = 0; i < num_dsts; ++i, src += 4) {
LLVMValueRef lo, hi;
LLVMValueRef src_int0;
LLVMValueRef src_int1;
LLVMValueRef src_int2;
LLVMValueRef src_int3;
LLVMTypeRef int32_vec_type;
LLVMTypeRef src_vec_type;
LLVMValueRef const_255f;
LLVMValueRef a, b, c, d;
int16_type.width *= 2;
int16_type.length /= 2;
int16_type.sign = 1;
for (j = 0; j < 4; ++j) {
tmp[j] = LLVMBuildFMul(builder, src[j], const_255f, "");
tmp[j] = lp_build_iround(&bld, tmp[j]);
}
int32_type.width *= 4;
int32_type.length /= 4;
int32_type.sign = 1;
/* relying on clamping behavior of sse2 intrinsics here */
lo = lp_build_pack2(gallivm, int32_type, int16_type, tmp[0], tmp[1]);
hi = lp_build_pack2(gallivm, int32_type, int16_type, tmp[2], tmp[3]);
dst[i] = lp_build_pack2(gallivm, int16_type, dst_type, lo, hi);
}
src_vec_type = lp_build_vec_type(gallivm, src_type);
int32_vec_type = lp_build_vec_type(gallivm, int32_type);
return;
}
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
/* Special case 2x8f --> 1x16ub
*/
else if (src_type.floating == 1 &&
src_type.fixed == 0 &&
src_type.sign == 1 &&
src_type.norm == 0 &&
src_type.width == 32 &&
src_type.length == 8 &&
dst_type.floating == 0 &&
dst_type.fixed == 0 &&
dst_type.sign == 0 &&
dst_type.norm == 1 &&
dst_type.width == 8 &&
dst_type.length == 16 &&
2 * num_dsts == num_srcs &&
util_cpu_caps.has_avx) {
struct lp_build_context bld;
struct lp_type int16_type = dst_type;
struct lp_type int32_type = dst_type;
LLVMValueRef const_255f;
unsigned i;
lp_build_context_init(&bld, gallivm, src_type);
int16_type.width *= 2;
int16_type.length /= 2;
int16_type.sign = 1;
int32_type.width *= 4;
int32_type.length /= 4;
int32_type.sign = 1;
const_255f = lp_build_const_vec(gallivm, src_type, 255.0f);
for (i = 0; i < num_dsts; ++i, src += 2) {
LLVMValueRef lo, hi, a, b;
a = LLVMBuildFMul(builder, src[0], const_255f, "");
b = LLVMBuildFMul(builder, src[1], const_255f, "");
c = LLVMBuildFMul(builder, src[2], const_255f, "");
d = LLVMBuildFMul(builder, src[3], const_255f, "");
{
struct lp_build_context bld;
a = lp_build_iround(&bld, a);
b = lp_build_iround(&bld, b);
bld.gallivm = gallivm;
bld.type = src_type;
bld.vec_type = src_vec_type;
bld.int_elem_type = lp_build_elem_type(gallivm, int32_type);
bld.int_vec_type = int32_vec_type;
bld.undef = lp_build_undef(gallivm, src_type);
bld.zero = lp_build_zero(gallivm, src_type);
bld.one = lp_build_one(gallivm, src_type);
tmp[0] = lp_build_extract_range(gallivm, a, 0, 4);
tmp[1] = lp_build_extract_range(gallivm, a, 4, 4);
tmp[2] = lp_build_extract_range(gallivm, b, 0, 4);
tmp[3] = lp_build_extract_range(gallivm, b, 4, 4);
src_int0 = lp_build_iround(&bld, a);
src_int1 = lp_build_iround(&bld, b);
src_int2 = lp_build_iround(&bld, c);
src_int3 = lp_build_iround(&bld, d);
}
/* relying on clamping behavior of sse2 intrinsics here */
lo = lp_build_pack2(gallivm, int32_type, int16_type, src_int0, src_int1);
hi = lp_build_pack2(gallivm, int32_type, int16_type, src_int2, src_int3);
lo = lp_build_pack2(gallivm, int32_type, int16_type, tmp[0], tmp[1]);
hi = lp_build_pack2(gallivm, int32_type, int16_type, tmp[2], tmp[3]);
dst[i] = lp_build_pack2(gallivm, int16_type, dst_type, lo, hi);
}
return;
return;
}
/* Pre convert half-floats to floats
*/
else if (src_type.floating && src_type.width == 16)
{
for(i = 0; i < num_tmps; ++i)
tmp[i] = lp_build_half_to_float(gallivm, src_type, tmp[i]);
tmp_type.width = 32;
}
/*
@@ -603,7 +712,7 @@ lp_build_conv(struct gallivm_state *gallivm,
* This will convert the integer masks that match the given types.
*
* The mask values should 0 or -1, i.e., all bits either set to zero or one.
* Any other value will likely cause in unpredictable results.
* Any other value will likely cause unpredictable results.
*
* This is basically a very trimmed down version of lp_build_conv.
*/
@@ -614,8 +723,6 @@ lp_build_conv_mask(struct gallivm_state *gallivm,
const LLVMValueRef *src, unsigned num_srcs,
LLVMValueRef *dst, unsigned num_dsts)
{
/* Register width must remain constant */
assert(src_type.width * src_type.length == dst_type.width * dst_type.length);
/* We must not loose or gain channels. Only precision */
assert(src_type.length * num_srcs == dst_type.length * num_dsts);
@@ -640,16 +747,5 @@ lp_build_conv_mask(struct gallivm_state *gallivm,
* Truncate or expand bit width
*/
if(src_type.width > dst_type.width) {
assert(num_dsts == 1);
dst[0] = lp_build_pack(gallivm, src_type, dst_type, TRUE, src, num_srcs);
}
else if(src_type.width < dst_type.width) {
assert(num_srcs == 1);
lp_build_unpack(gallivm, src_type, dst_type, src[0], dst, num_dsts);
}
else {
assert(num_srcs == num_dsts);
memcpy(dst, src, num_dsts * sizeof *dst);
}
lp_build_resize(gallivm, src_type, dst_type, src, num_srcs, dst, num_dsts);
}

View File

@@ -42,6 +42,10 @@
struct lp_type;
LLVMValueRef
lp_build_half_to_float(struct gallivm_state *gallivm,
struct lp_type src_type,
LLVMValueRef src);
LLVMValueRef
lp_build_clamped_float_to_unsigned_norm(struct gallivm_state *gallivm,

View File

@@ -35,10 +35,8 @@
#if HAVE_LLVM >= 0x0300
#include <llvm/Support/TargetRegistry.h>
#include <llvm/Support/TargetSelect.h>
#else /* HAVE_LLVM < 0x0300 */
#include <llvm/Target/TargetRegistry.h>
#include <llvm/Target/TargetSelect.h>
#endif /* HAVE_LLVM < 0x0300 */
#if HAVE_LLVM >= 0x0209
@@ -83,8 +81,12 @@ lp_check_alignment(const void *ptr, unsigned alignment)
class raw_debug_ostream :
public llvm::raw_ostream
{
private:
uint64_t pos;
public:
raw_debug_ostream() : pos(0) { }
void write_impl(const char *Ptr, size_t Size);
#if HAVE_LLVM >= 0x207
@@ -183,7 +185,7 @@ lp_disassemble(const void* func)
/*
* Limit disassembly to this extent
*/
const uint64_t extent = 0x10000;
const uint64_t extent = 96 * 1024;
uint64_t max_pc = 0;
@@ -200,24 +202,6 @@ lp_disassemble(const void* func)
std::string Error;
const Target *T = TargetRegistry::lookupTarget(Triple, Error);
#if HAVE_LLVM >= 0x0208
InitializeNativeTargetAsmPrinter();
#elif defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
LLVMInitializeX86AsmPrinter();
#elif defined(PIPE_ARCH_ARM)
LLVMInitializeARMAsmPrinter();
#elif defined(PIPE_ARCH_PPC)
LLVMInitializePowerPCAsmPrinter();
#endif
#if HAVE_LLVM >= 0x0301
InitializeNativeTargetDisassembler();
#elif defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
LLVMInitializeX86Disassembler();
#elif defined(PIPE_ARCH_ARM)
LLVMInitializeARMDisassembler();
#endif
#if HAVE_LLVM >= 0x0300
OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
#else

Some files were not shown because too many files have changed in this diff Show More