Compare commits

...

3688 Commits

Author SHA1 Message Date
Jonas Maebe
1bdf31e8da 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:07:14 -07:00
Jeremy Huddleston
ecf0bef4cd darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d65bd195ec)
2012-05-16 18:59:30 -07:00
Jeremy Huddleston
60fa18b90f darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit a73a800b32)
2012-05-16 18:59:28 -07:00
Jeremy Huddleston
62058968e7 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
(cherry picked from commit 1a33c1b2b8)
2012-04-24 00:27:44 -07:00
Jonas Maebe
1fa6c87c88 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit c60ffd2840)
2012-04-23 16:18:36 -07:00
Jonas Maebe
00d310a130 glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 8d09f4d0cc)
2012-04-22 20:41:36 -07:00
Jeremy Huddleston
906f670f1a configure.ac: Don't use $CLANG since it will collide with the static analyzer.
We just prefix the $CLANG environment variable in configure.ac with acv_mesa_

Found by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b728eefb06)
2012-01-27 09:05:10 -08:00
Anuj Phogat
9ae2499be2 mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D()
with width = 0. Texture with zero size skips miptree allocation due to a
condition in function _mesa_store_teximage3d(). While calling glGetTexImage()
it results in assertion failure in intel_map_texture_image() due to null mt
pointer.

This patch fixes the issue by detecting the zero size texture early in
glGetTexImage and glGetCompressedTexImage functions. In such a case function
simply returns doing nothing.
Verified that below mentioned bug is fixed by this patch.

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

NOTE: This is a candidate for stable branches

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

Conflicts:

	src/mesa/main/teximage.h
2012-01-19 12:56:15 -08:00
Anuj Phogat
9b3ac17991 intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation
fault in function intelDRI2Flush. All the gl calls should be
ignored after setting the current context to null. So the contents
of framebuffer stay unchanged. But the driver should not seg fault.

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

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Yi Sun <yi.sun@intel.com>
(cherry picked from commit dd7220652e)

Conflicts:

	src/mesa/drivers/dri/intel/intel_screen.c
2012-01-19 12:56:15 -08:00
Vinson Lee
d7d47d6c0b i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e18ad7fd7)
2012-01-19 12:56:15 -08:00
Paul Berry
29f07f6461 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f6f43bd5a2)
2012-01-19 12:56:15 -08:00
Brian Paul
1f18137d28 glw: s/lighgrey/lightgrey/
http://bugs.freedesktop.org/show_bug.cgi?id=44844
2012-01-16 15:07:23 -07:00
Ian Romanick
7722a54e60 glsl: Don't use base type for bit-not when there's an error
Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit 3946448951)
2012-01-04 12:44:49 -08:00
Ian Romanick
bc507471db glsl: Clamp vector indices when lowering to swizzles
This prevents other code from seeing a swizzle of the 16th component
of a vector, for example.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Christian Holler <choller@mozilla.com>
(cherry picked from commit 6f5c737970)
2012-01-03 19:23:15 -08:00
Ian Romanick
42d1a7b3de glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"
ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f0dd21ac88)
2011-12-22 17:01:53 -08:00
Marcin Slusarz
237d6fa97a nv50/nvc0: fix crash when channel allocation fails 2011-12-11 17:00:42 +01:00
Christoph Bumiller
0e9b79c22a nv50,nvc0: use screen instead of context for flush notifier
Context may become NULL and we still have to be able to flush
pending fences.

(Cherry picked from commit 3069a7eaa5)
Fixes crash on screen shutdown: https://bugs.freedesktop.org/show_bug.cgi?id=43428
2011-12-11 16:58:09 +01:00
Brian Paul
7a18f005ed gallivm: fix build with llvm 3.0svn
https://bugs.freedesktop.org/show_bug.cgi?id=41065
(cherry picked from commit 51002968c9)
2011-12-05 08:58:18 -07:00
Tobias Droste
95a3724c69 gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn added SubtargetInfo as additional parameter to
createMCDisassembler() and createMCInstPrinter().
See revision 139237 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 1795372fee)
2011-12-05 08:58:12 -07:00
Tobias Droste
98e8fb84de gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn moved TargetRegistry.h and TargetSelect.h.
See revision 138450 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
(cherry picked from commit 4a468de2d7)
2011-12-05 08:58:06 -07:00
Tobias Droste
5b5c436c65 llvmpipe: fix build with LLVM 3.0svn
LLVM 3.0svn introduced a new type system. It defines a new way to create
named structs and removes the (now not needed) LLVMInvalidateStructLayout
function.  See revision 134829 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3143e95353)
2011-12-05 08:58:00 -07:00
Vinson Lee
970df845ef gallivm: Rename createAsmInfo to createMCAsmInfo with llvm-3.0.
llvm-3.0svn r135219 renamed createAsmInfo to createMCAsmInfo in
include/llvm/Target/TargetRegistry.h.
(cherry picked from commit 9228bfb375)
2011-12-05 08:57:49 -07:00
Vinson Lee
32f4a83fe8 gallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.
LLVMUnionTypeKind is not in llvm-2.6, llvm-2.8, llvm-2.9, or llvm-3.0svn.
(cherry picked from commit 1844ae7e7e)
2011-12-05 08:57:42 -07:00
Vinson Lee
2c1998b3b9 gallivm: Remove LLVMOpaqueKindType case with llvm-3.0.
llvm-3.0svn r134829 removed LLVMOpaqueKindType from enum LLVMTypeKind in
include/llvm-c/Core.h.
(cherry picked from commit e4189f2e2e)
2011-12-05 08:57:11 -07:00
Vinson Lee
a3337a66ef gallivm: Rename TargetInstrDesc to MCInstrDesc when using llvm-3.0.
llvm-3.0svn revision 134021 renamed TargetInstrDesc to MCInstrDesc.
(cherry picked from commit b61e56756c)
2011-12-05 08:57:00 -07:00
Brian Paul
25ba654229 docs: update news, relnotes list for 7.11.2 release 2011-11-28 08:24:19 -07:00
Ian Romanick
733478975d docs: Add 7.11.2 release md5sums 2011-11-27 14:06:59 -08:00
Ian Romanick
ea72e3cda8 docs: Add 7.11.2 release notes 2011-11-27 14:04:48 -08:00
Ian Romanick
835205e295 mesa: Bump version to 7.11.2 (final) 2011-11-27 14:04:05 -08:00
Chad Versace
2a45566587 intel: Fix separate stencil in builtin DRI2 backend
intelAllocateBuffer() was oblivious to separate stencil buffers.  This
patch fixes it to allocate a non-tiled stencil buffer with special pitch,
just as the DDX does.

Without this, any app that attempted to create an EGL surface with stencil
bits would crash. Of course, this affected only environments that used the
builtin DRI2 backend, such as Android and Wayland.

Fixes GLBenchmark2.1 on Android on gen7.

Note: This is a candidate for the 7.11 branch.
Tested-by: Louie Tsaie <louie.tsai@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 79653c12d6)

Conflicts:

	src/mesa/drivers/dri/intel/intel_screen.c
2011-11-21 16:11:50 -08:00
Chad Versace
68060d6bfd intel: Fix region dimensions for stencil buffers received from DDX
I changed the dimensions of the stencil buffer's region, as allocated by
the DDX, at xf86-video-intel commit
   commit 3e55f3e88b40471706d5cd45c4df4010f8675c75
   dri: Do not tile stencil buffer
But I forgot to make the analogous update to the Intel DRI2 glue in Mesa.
This patch makes that update.

Surprisingly, the mismatch did not cause any bugs. But the mismatch, if
left unfixed, *would* create bugs in the next commit.

Note: This is a candidate for the 7.11 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 50b3356078)
2011-11-21 16:10:49 -08:00
Chad Versace
fd35fab340 intel: Simplify stencil detiling arithmetic
When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit dc4c3a31c6)

Conflicts:

	src/mesa/drivers/dri/intel/intel_fbo.c
	src/mesa/drivers/dri/intel/intel_span.c
2011-11-21 16:10:22 -08:00
Brian Paul
658d994473 mesa: use format string in _mesa_error() call to silence warning
(cherry picked from commit 5485192fc8)
2011-11-21 19:49:48 +01:00
Brian Paul
8a8ccc00b5 docs: update news.html and relnotes.html for 7.11.1 release 2011-11-21 09:16:38 -07:00
Brian Paul
21364bd09d mesa: fix format selection for meta CopyTexSubImage()
When we do a glReadPixels into the temporary buffer, we don't want to
use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will
compute L=R+G+B which is not what we want.

This bug has existed all along but was only exposed by the elimination
of the driver hook for glCopyTexImage() in
5874890c26.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e4fdc95277)

(cherry-pick note: This patch and the one before it combine to fix
CopyTexImage from RGBA window to LA texture.  This was believed to
already be fixed by commit 296e6b9, but these changes were also
necessary.)
2011-11-18 12:18:19 -08:00
Brian Paul
6b2c771ddd mesa: stop using ctx->Driver.CopyTexImage1D/2D() hooks
(cherry picked from commit 5874890c26)
2011-11-18 12:12:22 -08:00
Ian Romanick
22ff4ec969 mesa: set version string to 7.11.2-devel 2011-11-18 11:06:33 -08:00
Ian Romanick
228da884c9 docs: Add 7.11.1 release md5sums 2011-11-17 12:12:34 -08:00
Ian Romanick
c0009739bf docs: Add 7.11.1 release notes 2011-11-17 11:45:06 -08:00
Ian Romanick
bb7d993953 mesa: set version string to 7.11.1 2011-11-17 11:44:08 -08:00
Eric Anholt
172de77b12 glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.
A driver trying to set up builtin uniforms is faced with a problem:
How do I walk the ir_variable structure (representing an array of
structs, or array of matrices, or struct, or whatever), and set up
driver structures so that dereference of that uniform gets the
corresponding ParameterValues[] entry.  The rule in general is that
each corresponding vector-sized field of an array of structs is one
builtin uniform state slot.  i965 relied on another invariant: each
state slot has a number of unique channel swizzles corresponding to
the number of elements in the field's vector, to avoid needing to walk
the glsl_type in parallel to get at vector_elements.

All of the builtin uniforms followed this behavior, except for
gl_NormalMatrix.  That's a mat3 (so 3 vec3s), but it was swizzled as 3
vec4s.

Fixes piglit glsl-fs-normalmatrix.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit cc4ddc3a1e)
2011-11-10 10:36:52 -08:00
Kenneth Graunke
6b151886fd mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.
It's required for ES 1.0 and 1.1, and isn't specified for ES 2.

While the comment says Mesa depends on it internally, removing it from
ES2 doesn't seem to regress any Piglit or ES2 conformance tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 5785cd2bf5)
2011-11-10 10:21:14 -08:00
José Fonseca
436db5df9c docs: Update llvmpipe docs.
Recommend LLVM 2.9, it has been working quite well, and unlike earlier
versions, it works out-of-the-box without patches.

Update Windows instructions.
2011-11-05 11:03:11 +00:00
Yuanhan Liu
5459781715 intel: don't call unmap pbo if pbo is not mapped
The PBO only needs to be unmapped if one of the previous calls to
_mesa_validate_pbo_* succeeded.  In this case, pixels will be
non-NULL.  Various paths through _mesa_unmap_texmiage_pbo can hit
assertion failures or segfaults if the buffer is not mapped.

To work around this, move the call to _mesa_unmap_teximage_pbo inside
the last 'if (pixels)' block.

NOTE: this is just for 7.11 stable branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42268
2011-11-03 11:55:39 -07:00
Michel Dänzer
b95767a57a r300g: Fix queries on big endian hosts.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-11-02 22:29:14 +01:00
Michel Dänzer
f60e81ecb2 gallium/util: Add macros for converting from little endian to CPU byte order.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4a3be16fd2)
2011-11-02 22:29:07 +01:00
Marek Olšák
d15ce8dd29 r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo
This was dead code anyway.
(cherry picked from commit 21e3c585f7)
2011-11-02 22:27:05 +01:00
Tom Fogal
449b301eec Only use gcc visibility support with gcc4+.
I had a colleague hitting issues compiling with an old gcc3.2
system.  These patches got them through.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry-picked from commit cbb2b4149b)
2011-11-02 12:58:34 -06:00
Adam Jackson
4464ee1a9a glx: Don't enable INTEL_swap_event unconditionally
DRI2 supports this now - and already enables it explicitly - but drisw
does not and should not.  Otherwise toolkits like clutter will only ever
SwapBuffers once and wait forever for an event that's not coming.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 25620eb1d2)
2011-10-28 20:41:45 -04:00
Kenneth Graunke
439628318b i965: Apply post-sync non-zero workaround to homebrew workaround.
In commit 3e5d3626, Eric added a homebrew workaround to fix GPU hangs in
the Mesa "engine" demo and oglc's api-texcoord test.

Unfortunately, his PIPE_CONTROL contains a Depth Stall, which
necessitates the post-sync non-zero workaround,

Fixes GPU hangs in Civilization 4, PlaneShift, Minecraft, Neverwinter
Nights, 3DMMES, and hopefully Heroes of Newerth as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41096
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Joel <k00_fol@k.kth.se> (Neverwinter Nights)
Tested-by: brot <brot@minad.de> (Minecraft)
Tested-by: Eric Anholt <eric@anholt.net> (3DMMES)
Tested-by: Kenneth Graunke <kenneth@whitecape.org> (Civ 4 & PlaneShift)

(cherry-picked from commit 3cc0a7be23)
2011-10-27 10:37:40 -07:00
Marek Olšák
00c44de1a6 r600g: set correct tiling flags in depth info
The kernel currently overwrites the flags, but if we stopped doing that,
this would break badly.
(cherry picked from commit faa16dc456)

BTW, this may be an actual fix for very old kernels.
https://bugs.freedesktop.org/show_bug.cgi?id=42175

Conflicts:

	src/gallium/drivers/r600/evergreen_state.c
	src/gallium/drivers/r600/r600_state.c
2011-10-26 14:51:30 +02:00
Brian Paul
e4f88bcad3 mesa: fix format/type check in unpack_image() for bitmaps
Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.
(cherry picked from commit 2ce8c3553b)
2011-10-25 18:41:29 -07:00
Brian Paul
0092375714 mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()
The spec says GL_INVALID_OPERATION is generated when texture!=0 and
textarget is not a legal value.  We had this right for the 2D function.
(cherry picked from commit ccecc08f79)
2011-10-25 18:41:29 -07:00
Ben Widawsky
c4d37ed43a intel: GetBuffer fix
After copy buffer on preGEN6, it is necessary to wait for the blit to
complete before returning data to the user.

This should fix the piglit test: copy_buffer_coherency (pre-GEN6).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit fa351bd2e0)
2011-10-25 18:41:29 -07:00
Eric Anholt
242a18dc46 mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)
The existing error result doesn't appear in the GL 2.1 or 3.2
compatibility specs, and triggers an unexpected GL error in Intel's
oglconform when it tries to reset the feedback state after usage so
that the "diff the state at error time vs. context init time" code
doesn't generate spurious diffs.  The unexpected GL error then
translates into testcase failure.  Brian wants the safety check on
buffer = NULL, though, so that people can't as easily set up a broken
buffer.
(cherry picked from commit 07e5295b6f)
2011-10-25 18:41:29 -07:00
Ian Romanick
0abee468f8 mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 24a113093b)
2011-10-25 18:41:29 -07:00
Ian Romanick
72ea656dad mesa: Remove redundant compressed paletted texture error checks
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 13757f7080)
2011-10-25 18:41:29 -07:00
Ian Romanick
30b199f867 mesa: Refactor compressed texture error checks to work with paletted textures
This code was really broken before.  A lot of the error checks were
done much later (too late), and some of the error checks would fail.
The underlying problem is that Mesa doesn't ever keep compressed paletted
textures in their original format.  The textures are immediately
converted to some RGB or RGBA format.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39991
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit 3ebbfc8372)
2011-10-25 18:41:29 -07:00
Ian Romanick
9b242a03d5 mesa: Add _mesa_cpal_compressed_format_type
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit b433e7ba07)
2011-10-25 18:41:29 -07:00
Ian Romanick
8317a43a75 mesa: Refactor expected texture size check in cpal_get_info
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit a2cab751be)
2011-10-25 18:41:29 -07:00
Ian Romanick
625fdf58c6 mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit fc0fa16be3)
2011-10-25 18:41:29 -07:00
Ian Romanick
5f776f2a7d mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
(cherry picked from commit a454c835fa)
2011-10-25 18:41:29 -07:00
Chia-I Wu
d2e633a8bd intel: fix GLESv1 support
Add intelInitExtensionsES1 to enable required and optional GLESv1
extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6b9e4b6ca7)
2011-10-25 18:41:29 -07:00
Chia-I Wu
135501c201 intel: rename intel_extensions_es2.c to intel_extensions_es.c
We'd like to add intelInitExtensionsES1 to it later.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 820789ac69)
2011-10-25 18:41:29 -07:00
Jeremy Huddleston
681f4820ab apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5c44c1348e)
2011-10-24 16:26:17 -07:00
Yuanhan Liu
4b7ad91990 mesa: handle PBO access error in display list mode
Simply generate GL_INVALID_OPERATION error at display list mode. As
explained by Brian, we are going to access PBO data at compile time.
No need to defer the error at execution time.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 46d5fb576a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
cd114ba503 mesa: handle the pbo case for save_Bitmap
Wrap _mesa_unpack_bitmap to handle the case that data is stored in pixel
buffer object.

This would make calling Bitmap with data stored in PBO by display list work.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 02b801c1ed)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
b8cc97ed26 mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB
It seems like a typo.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 403cf7c56f)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
53a3e743ae mesa: generate error if pbo offset is not aligned with the size of specified type
v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
    more readable. (comments from Ian)

v3: Cast the offset by GLintptr to remove the compile warning(comments
    from Brian).

    I also found that I should use _mesa_sizeof_packed_type() instead,
    as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9024d8af0a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
a31eec0d10 i965: setup address rounding enable bits
The patch(based on the reading of the emulator) came from while I was
trying to fix the oglc pbo texImage.1PBODefaults fail. This case
generates a texture with the width and height equal to window's width
and height respectively, then try to texture it on the whole window.
So, it's exactly one texel for one pixel.  And, the min filter and mag
filter are GL_LINEAR. It runs with swrast OK, as expected. But it failed
with i965 driver.

Well, you can't tell the difference from the screen, as the error is
quite tiny. From my digging, it seems that there are some tiny error
happened while getting tex address. This will break the one texel for
one pixel rule in this case. Thus the linear result is taken, with tiny
error.

This patch would fix all oglc pbo subcase fail with the same issue on
both ILK, SNB and IVB.

v2: comments from Ian, make the address_round filed assignment consistent.
    (the sampler is alread memset to 0 by the xxx_update_samper_state
     caller, so need to assign 0 first)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit 76669381c0)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
6c85918159 mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image
Introuduce a simple function called copy_data to do the image data copy
stuff for all the save_CompressedTex*Image function. The function check
the NULL data case to avoid some potential segfault. This also would
make the code a bit simpler and less redundance.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e9edcf8b1d)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
eaad245418 intel: fix the wrong code to detect null texture.
There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a662e7c18)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
0a77734c62 mesa: fix error handling for glMaterial*
Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

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

v2: fix the max shininess value.

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

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a11b4c1e7a)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
8d0d4381da mesa: fix error handling for glMapBufferRange
Accroding the man page, GL_INVALID_VALUE would generated if access has any
bits set other than those valid defined bits.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 099af9e9df)
2011-10-24 15:54:31 -07:00
Brian Paul
a0eefc9bd0 mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End
(cherry picked from commit 386ec5e80e)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
2af0708c85 mesa: fix error handling for glSelectBuffer
According the man page, trigger a GL_INVALID_VALUE if size < 0.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 57b8f13aa4)
2011-10-24 15:54:31 -07:00
Yuanhan Liu
8fb8b8528d mesa: fix error handling for glPixelZoom
According the man page, GL_INVALID_OPERATION should generated if
glPixelZoom is executed between the execution of glBegin and the
corresponding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7a9a8bbabd)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
0ebdfa31bc mesa: fix error handling for glIsEnabled
According the man page, GL_INVALID_OPERATION should be generated if
glIsEnabled is executed betwwen the execution of glBegin and the
correspoding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6a98802243)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
ab68b00453 mesa: fix error handling for glTexEnv
Fix error handling while calling glTexEnv with invalid texture
environment parameters.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b020b111a8)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
a895cce693 mesa: fix error handling for some glGet* functions
According to the man page, it should trigger a GL_INVALID_OPERATION
while calling some glGet* functions inside glBegin and glEnd.

This patch dose handle the following functions:
 glGetBooleanv
 glGetFloatv
 glGetIntegerv
 glGetInteger64v
 glGetDoublev

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f1ddde5c16)
2011-10-24 15:54:30 -07:00
Yuanhan Liu
23a3753a28 mesa: fix error handling for glEvalMesh1/2D
According man page, trigger error when calling glEvalMesh1/2D inside
glBegin/glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 21b2895bd0)
2011-10-24 15:54:30 -07:00
Brian Paul
b53035e10d mesa: fix error handling for dlist image unpacking
When compiling glDrawPixels, glTexImage(), etc. and we're copying
the user's image we need to be careful about GL error checking.
Previously, we were incorrectly generating GL_OUT_OF_MEMORY in
unpack_image() if width <= 0 or height <= 0 or for invalid format/type
values.  We now check those arguments in unpack_image() and return NULL
if there's a bad value.  The command will get compiled with the
arguments as-is and image=NULL.  Later, when the command is executed the
correct errors will be generated.

This issue was reported by Yuanhan Liu <yuanhan.liu@linux.intel.com>

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit 6fd6efa7bf)
2011-10-24 15:54:30 -07:00
Adam Jackson
b2fbf8225b drisw: Remove cargo culting that breaks GLX 1.3 ctors
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit d44f821213)
2011-10-24 13:56:46 -04:00
Jeremy Huddleston
bf7b347c10 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 9f2abbee62)
2011-10-21 00:35:34 -07:00
Jeremy Huddleston
7e90db0ddc apple: Silence some debug spew
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 098ecfad83)
2011-10-21 00:35:29 -07:00
Marek Olšák
521819f29c r300g: don't return NULL in resource_from_handle if the resource is too small
The DDX may allocate a buffer with a too small size.
Instead of failing, let's pretend everything's alright.

Such bugs should be fixed in the DDX, of course.

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

Conflicts:

	src/gallium/drivers/r300/r300_texture.c
	src/gallium/drivers/r300/r300_texture.h
	src/gallium/drivers/r300/r300_texture_desc.c
2011-10-21 00:31:06 +02:00
Marek Olšák
8b4315cb47 pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 39d7de69b1)
2011-10-20 23:47:51 +02:00
Neil Roberts
986319cd20 meta: Fix saving the active program
When saving the active program in _mesa_meta_begin, it was actually
saving the fragment program instead. This means that if the
application binds a program that only has a vertex shader then when
the meta saved state is restored it will forget the bound program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41969
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 5625f78cd7)
2011-10-18 11:15:05 -07:00
Yuanhan Liu
c3fd76ce09 i965: fix the constant interp bitmask for flat mode
Fix the constant interpolation enable bit mask for flat light mode.
FRAG_BIT_COL0 attribute bit might be 0, in which case we need to
shift one more bit right.

This would fix the oglc specularColor test fail on both Sandybridge and
Ivybridge.

v2: move the constant interp bitmask setup code into for(; attr <
FRAG_ATTRIB_MAX; attr++) loop suggested by Eric.

Also fixes the Civilization 4 intro videos.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit cd6b8421ca)
2011-10-17 14:22:03 -07:00
Marcin Slusarz
08fa61dab6 nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

(commit 9849f366cb in master)
2011-10-17 23:01:41 +02:00
Marcin Slusarz
8d1f1eae93 nouveau: fix crash during fence emission
Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.

Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush

This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.

This issue was reported by Maxim Levitsky.

(commit e1e03ce492 in master)
2011-10-17 23:00:39 +02:00
Marek Olšák
b9cc9166cf Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"
This reverts commit b9c7773e0d.

It breaks more things than it fixes.
2011-10-16 03:21:02 +02:00
Kenneth Graunke
07210d5c77 intel: Depth format fixes
This is a squash of:

    intel: Recognize all depth formats in get_teximage_readbuffer.

    The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
    wrongly returning the color buffer instead of the depth buffer.

    Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
    CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
    format, which (prior to this patch) resulted in an attempt to copy
    ARGB8888 to X8_Z24.

    Instead of adding the missing enumeration directly, convert the code to
    use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
    should catch any newly added depth formats in the future.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry-picked from commit 440224ab73)

And:

    i915: Fix depth texturing since 86e62b2357

    The 965 driver already had the X8_Z24 case, but 915 was missing it.

    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 6aae729d6e)
2011-10-14 17:28:45 -07:00
Eric Anholt
57a6e6092f intel: Mark MESA_FORMAT_X8_Z24 as always supported.
This prevents developer surprise at seeing a GL_DEPTH_COMPONENT
texture have stencil bits, and avoids the metaops path accidentally
copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and
being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is
broken).

Acked-by: Chad Versace <chad@chad-versace.us>

(cherry-picked from commit 86e62b2357)
2011-10-14 17:28:45 -07:00
Chris Wilson
5b09cf5c57 i915: out-of-bounds write in calc_live_regs()
From a Coverity defect report.

src/mesa/drivers/dri/i915/i915_fragprog.c
   301  /*
   302   * TODO: consider moving this into core
   303   */
   304  static bool calc_live_regs( struct i915_fragment_program *p )
   305  {
   306      const struct gl_fragment_program *program = &p->FragProg;
   307      GLuint regsUsed = 0xffff0000;
-> 308      uint8_t live_components[16] = { 0, };
   309      GLint i;
   310
   311      for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
   312          struct prog_instruction *inst =
&program->Base.Instructions[i];
   313          int opArgs = _mesa_num_inst_src_regs(inst->Opcode);
   314          int a;
   315
   316          /* Register is written to: unmark as live for this and
preceeding ops */
   317          if (inst->DstReg.File == PROGRAM_TEMPORARY) {
-> 318              if (inst->DstReg.Index > 16)
   319                 return false;
   320
-> 321              live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask;
   322              if (live_components[inst->DstReg.Index] == 0)
   323                  regsUsed &= ~(1 << inst->DstReg.Index);
   324          }
   325
   326          for (a = 0; a < opArgs; a++) {
   327              /* Register is read from: mark as live for this and preceeding ops */
   328              if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) {
   329                  unsigned c;
   330
   331                  if (inst->SrcReg[a].Index > 16)
   332                     return false;
   333
   334                  regsUsed |= 1 << inst->SrcReg[a].Index;
   335
   336                  for (c = 0; c < 4; c++) {
   337                      const unsigned field = GET_SWZ(inst->SrcReg[a].Swizzle, c);
   338
   339                      if (field <= SWIZZLE_W)
   340                          live_components[inst->SrcReg[a].Index] |= (1U << field);
   341                  }
   342              }
   343          }
   344
   345          p->usedRegs[i] = regsUsed;
   346      }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40022
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 67582e6eef)
2011-10-14 17:28:45 -07:00
Carl Worth
eb0fd67f6a glcpp: Add a test for #elif with an undefined macro.
As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

	#ifndef MAYBE_UNDEFINED
	#elif MAYBE_UNDEFINED < 5
	...
	#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 201485bae0)
2011-10-14 17:28:45 -07:00
Carl Worth
c6dfde2136 glcpp: Raise error if defining any macro containing two consecutive underscores
The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

	spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
	spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit c4aaf7943c)
2011-10-14 17:28:45 -07:00
Carl Worth
71bd5d424c glcpp: Implement token pasting for non-function-like macros
This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

	spec/glsl-1.30/preprocessor/concat/concat-01.frag
	spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 28842c2331)
2011-10-14 17:28:45 -07:00
Carl Worth
33e1019d95 glcpp: Test a non-function-like macro using the token paste operator
Apparently we never implemented this, (but we've got a GLSL 1.30 test
in piglit that is exercising this case).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 7bb3403e01)
2011-10-14 17:28:45 -07:00
Carl Worth
ab94d6f902 glcpp: Fix two (or more) successive applications of token pasting
There was already a loop here to look for multiple token pastes, but
it was mistakenly incrementing the iterator counter after performing
one paste.

Instead, leave the loop iterator in place to coalesce as many tokens
as necessary into one.

This fixes the recently add 096-paste-twice test as well as the
following piglit test:

	spec/glsl-1.30/preprocessor/concat/concat-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 3c01a58944)
2011-10-14 17:28:45 -07:00
Ian Romanick
5becf89a17 i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks
This makes piglit a lot more happy.  The errors are logged when
INTEL_DEBUG=fallbacks because the application is about to hit a big
software fallback.  We frequently ask people to run applications that
are hitting software fallbacks with INTEL_DEBUG=fallbacks so the we
can help them debug the reason for the software fallback.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 0290a018a5)
2011-10-14 17:28:45 -07:00
Ian Romanick
13a2d4a985 i915: Fail without crashing if a Mesa IR program uses too many registers
This can only happen in GLSL shaders because assembly shaders that use
too many temps are rejected by core Mesa.  It is easiest to make this
happen with shaders that contain flow-control that could not be lowered.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3bb2f0dde1)
2011-10-14 17:28:45 -07:00
Ian Romanick
f2d166583d ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered
Rely on the driver to do the right thing.  This probably means falling
back to software.  Page 88 of the OpenGL 2.1 spec specifically says:

    "A shader should not fail to compile, and a program object should
    not fail to link due to lack of instruction space or lack of
    temporary variables. Implementations should ensure that all valid
    shaders and program objects may be successfully compiled, linked
    and executed."

There is no provision for saying "No" to a valid shader that is
difficult for the hardware to handle, so stop doing that.

On i915 this causes a large number of piglit tests to change from FAIL
to WARN.  The warning is because the driver still emits messages to
stderr like "i915_program_error: Unsupported opcode: BGNLOOP".

It also fixes ES2 conformance CorrectFull_frag and CorrectParse1_frag
on i915 (and probably other hardware that can't handle loops).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 322c3bf9dc)
2011-10-14 17:28:42 -07:00
Ian Romanick
49d2c552a5 ir_to_mesa: Use Add linker_error instead of fail_link
The functions were almost identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8aadd89d07)
2011-10-14 17:28:03 -07:00
Ian Romanick
a864b15b83 mesa: Ensure that gl_shader_program::InfoLog is never NULL
This prevents assertion failures in ralloc_strcat.  The ralloc_free in
_mesa_free_shader_program_data can be omitted because freeing the
gl_shader_program in _mesa_delete_shader_program will take care of
this automatically.

A bunch of this code could use a refactor to use ralloc a bit more
effectively.  A bunch of the things that are allocated with malloc and
owned by the gl_shader_program should be allocated with ralloc (using
the gl_shader_program as the context).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 89193933cb)
2011-10-14 17:27:17 -07:00
Ian Romanick
e458c3ddbb linker: Make linker_{error,warning} generally available
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 379a32f42e)
2011-10-14 17:27:17 -07:00
Ian Romanick
b8a46f910d linker: Make linker_error set LinkStatus to false
Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error.  The function linker_error
was previously known as linker_error_printf.  The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 586e741ac1)
2011-10-14 17:27:17 -07:00
Kenneth Graunke
eca2a91a9b i965: Fix inconsistent indentation in brw_eu_emit.c.
Most of these functions used three spaces for the first level of
indentation, but four spaces for the next level.  One used tabs and then
three spaces.  Some used 3/4 in a then block but 3/3 in the else block.

Normally I try to avoid field days like this, but since the functions
were so inconsistent, even internally, it was making it difficult to
edit without introducing spurious whitespace changes.

So, just get it over with.  git diff -b shows 0 lines changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b861479f83)
2011-10-13 16:35:40 -07:00
Kenneth Graunke
1f083e1839 i965: Allow SIMD16 color writes on Ivybridge.
Again, the check was needlessly specific: this works fine on Gen7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7db874bf4c4273d2d46218b1490d312fe2654284)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
9bbf2a343f i965/fs: Allow SIMD16 with control flow on Ivybridge.
The check was designed to forbid it on old generations (Gen5/Ironlake),
not on new ones.  It just works on Gen7/Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ae5da817e2aeb9f9447fdd6d2eb4b22d6f8f6a87)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
38dfedccb2 i965: Emit depth stalls and flushes before changing depth state on Gen6+.
Fixes OpenArena on Gen7.  Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 02c4dc807e91640c69c8addc3c797300a3c536ad)
2011-10-13 14:06:11 -07:00
Kenneth Graunke
1e0e116d6d i965: Fix incorrect maximum PS thread count shift on Ivybridge.
At one point, the documentation said that max thread count in 3DSTATE_PS
was at bit offset 23, but it's actually 24 on Ivybridge.  Not only did
this halve our thread count, it caused us to write 1 into a bit 23, which
is marked as MBZ (must be zero).  Furthermore, it made us write an even
number into this field, which is apparently not allowed.  Apparently we
were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 556e7eea80de778b44a37d51cb757ce32221d1e3)
2011-10-13 14:06:11 -07:00
Eric Anholt
aaadd4c111 i965: Fix polygon stipple offset state flagging.
_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit d598851d401f7f34d623c9cfbd85d7f5faccd7c2)
2011-10-13 13:59:06 -07:00
Eric Anholt
0d31b130bb i965: Add missing _NEW_POLYGON flag to polygon stipple upload.
Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
(cherry picked from commit e19541aa2ad05f687c859001b62713209787c9c8)
2011-10-13 13:58:57 -07:00
Kenneth Graunke
e4b1dce9ec i965: Use proper texture alignment units for cubemaps on Gen5+.
In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e0e688ca5441e2c8bc59ec7488bc1bc4ba196602)
2011-10-13 13:58:51 -07:00
Kenneth Graunke
0f87fe948a i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.
For power-of-two sizes, h0 == mt->height0 since it's already a multiple
of two.  However, for NPOT, they're different; h1 should be computed
based on the original size.

Fixes piglit test "cubemap npot" and oglconform test "textureNPOT".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit bebc19448f45dbe8c3b016d440403f52e1036e15)
2011-10-13 13:58:45 -07:00
Eric Anholt
f484fc7476 i965/fs: Respect ARB_color_buffer_float clamping.
This was done in the old codegen path, but not the new one.  Caught by
piglit fbo tests after the conversion to GLSL ff_fragment_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit da53ca641106e47f1d74386d8dc0f7eebeec5225)
2011-10-13 13:58:37 -07:00
Marek Olšák
b9c7773e0d r300g: fix rendering with a non-zero index bias in draw_elements_immediate
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 5506f6ef96)
2011-10-04 17:48:33 +02:00
Paul Berry
7d2ff4ae77 glsl: improve the accuracy of the asin() builtin function.
The previous formula for asin(x) was algebraically equivalent to:

sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2))

where A, B, and C were arbitrary constants determined by a curve fit.

This formula had a worst case absolute error of 0.00448, an unbounded
worst case relative error, and a discontinuity near x=0.

Changed the formula to:

sign(x)*(pi/2 - sqrt(1-|x|)*(pi/2 + (pi/4-1)|x| + A|x|^2 + B|x|^3))

where A and B are arbitrary constants determined by a curve fit.  This
has a worst case absolute error of 0.00039, a worst case relative
error of 0.000405, and no discontinuities.

I don't expect a significant performance degradation, since the extra
multiply-accumulate should be fast compared to the sqrt() computation.

Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-*
(cherry picked from commit d4c80f5f85)
2011-10-02 21:39:30 +02:00
Paul Berry
1bbf124ff8 glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.
This patch fixes a bug in ir_hirearchical_visitor: when traversing an
exec_list representing the formal or actual parameters of a function,
it modified base_ir to point to each parameter in turn, rather than
leaving it as a pointer to the enclosing statement.  This was a
problem, since base_ir is used by visitor classes to locate the
statement containing the node being visited (usually so that
additional statements can be inserted before or after it).  Without
this fix, visitors might attempt to insert statements into parameter
lists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit cc81eb09b9)
2011-10-02 19:57:57 +02:00
Eric Anholt
ca7560765c glsl: When assiging from a whole array, mark it as used.
Fixes piglit link-uniform-array-size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 407a1001ae)
2011-10-02 19:57:57 +02:00
Eric Anholt
878d701da4 glsl: When assigning to a whole array, mark the array as accessed.
The vs-varying-array-mat2-col-row-wr test writes a mat2[3] constant to
a mat2[3] varying out array, and also statically accesses element 1 of
it on the VS and FS sides.  At link time it would get trimmed down to
just 2 elements, and then codegen of the VS would end up generating
assignments to the unallocated last entry of the array.  On the new
i965 VS backend, that happened to land on the vertex position.

Some issues remain in this test on softpipe, i965/old-vs and
i965/new-vs on visual inspection, but i965 is passing because only one
green pixel is probed, not the whole split green/red quad.
2011-10-02 19:57:56 +02:00
Paul Berry
c19b963ad6 glsl: Remove field array_lvalue from ir_variable.
The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.

However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).

This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).

This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation.  Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.

Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 00792e3586)
2011-10-02 19:57:08 +02:00
Eric Anholt
95185c7fe2 glsl: Clarify error message about whole-array assignment in GLSL 1.10.
Previously, it would produce:

    Failed to compile FS: 0:6(7): error: non-lvalue in assignment

and now it produces:

    Failed to compile FS: 0:5(7): error: whole array assignment is not
    allowed in GLSL 1.10 or GLSL ES 1.00.

Also, add spec quotation to the two places we have code for array
lvalues in GLSL 1.10.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 525cec98a5)
2011-10-02 19:56:53 +02:00
Paul Berry
e1221a8811 glsl: Rework oversize array check for gl_TexCoord.
The check now applies both when explicitly declaring the size of
gl_TexCoord and when implicitly setting the size of gl_TexCoord by
accessing it using integral constant expressions.

This is prep work for adding similar size checks to gl_ClipDistance.

Fixes piglit tests texcoord/implicit-access-max.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 93b9758d01)
2011-10-02 19:21:49 +02:00
Paul Berry
f732b5a999 glsl: Fix type error when lowering integer divisions
This patch fixes a bug when lowering an integer division:

  x/y

to a multiplication by a reciprocal:

  int(float(x)*reciprocal(float(y)))

If x was a plain int and y was an ivecN, the lowering pass
incorrectly assigned the type of the product to be float, when in fact
it should be vecN.  This caused mesa to abort with an IR validation
error.

Fixes piglit tests {fs,vs}-op-div-int-ivec{2,3,4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit af501e2b29)
2011-10-02 19:19:49 +02:00
Paul Berry
0129d5297b glsl: Perform implicit type conversions on function call out parameters.
When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value.  In other words, we convert code like the
following:

void f(out int x);
float value;
f(value);

Into IR that's equivalent to this:

void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);

This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.

Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.

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

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 67b5a3267d)
2011-10-02 19:19:08 +02:00
Paul Berry
27f00df2b7 glsl: Check array size is const before asserting that no IR was generated.
process_array_type() contains an assertion to verify that no IR
instructions are generated while processing the expression that
specifies the size of the array.  This assertion needs to happen
_after_ checking whether the expression is constant.  Otherwise we may
crash on an illegal shader rather than reporting an error.

Fixes piglit tests array-size-non-builtin-function.vert and
array-size-with-side-effect.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d4144a123b)
2011-10-02 19:17:42 +02:00
Paul Berry
8dcfe15a9a glsl: Constant-fold built-in functions before outputting IR
Rearranged the logic for converting the ast for a function call to
hir, so that we constant fold before emitting any IR.  Previously we
would emit some IR, and then only later detect whether we could
constant fold.  The unnecessary IR would usually get cleaned up by a
later optimization step, however in the case of a builtin function
being used to compute an array size, it was causing an assertion.

Fixes Piglit test array-size-constant-relational.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38625
(cherry picked from commit 789ee6516b)
2011-10-02 19:16:47 +02:00
Paul Berry
2c0e00de23 glsl: Emit function signatures at toplevel, even for built-ins.
The ast-to-hir conversion needs to emit function signatures in two
circumstances: when a function declaration (or definition) is
encountered, and when a built-in function is encountered.

To avoid emitting a function signature in an illegal place (such as
inside a function), emit_function() checked whether we were inside a
function definition, and if so, emitted the signature before the
function definition.

However, this didn't cover the case of emitting function signatures
for built-in functions when those built-in functions are called from
inside the constant integer expression that specifies the length of a
global array.  This failed because when processing an array length, we
are emitting IR into a dummy exec_list (see process_array_type() in
ast_to_hir.cpp).  process_array_type() later checks (via an assertion)
that no instructions were emitted to the dummy exec_list, based on the
reasonable assumption that we shouldn't need to emit instructions to
calculate the value of a constant.

This patch changes emit_function() so that it emits function
signatures at toplevel in all cases.

This partially fixes bug 38625
(https://bugs.freedesktop.org/show_bug.cgi?id=38625).  The remainder
of the fix is in the patch that follows.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0d81b0e184)
2011-10-02 19:03:22 +02:00
Paul Berry
1895de7a32 Revert "glsl: Skip processing the first function's body in do_dead_functions()."
opt_dead_functions contained a shortcut to skip processing the first
function's body, based on the assumption that IR functions are
topologically sorted, with callees always coming before their callers
(therefore the first function cannot contain any calls).

This assumption turns out not to be true in general.  For example, the
following code snippet gets translated to IR that violates this
assumption:

    void f();
    void g();
    void f() { g(); }
    void g() { ... }

In practice, the shortcut didn't cause bugs because of a coincidence
of the circumstances in which opt_dead_functions is called:

(a) we do inlining right before dead function elimination, and
    inlining (when successful) eliminates all calls.

(b) for user-defined functions, inlining is always successful, because
    previous optimization passes (during compilation) have reduced
    them to a form that is eligible for inlining.

(c) the function that appears first in the IR can't possibly call a
    built-in function, because built-in functions are always emitted
    before the function that calls them.

It seems unnecessarily fragile to have opt_dead_functions depend on
these coincidences.  And the next patch in this series will break (c).
So I'm reverting the shortcut.  The consequence will be a slight
increase in link time for complex shaders.

This reverts commit c75427f4c8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 482338842d)
2011-10-02 19:02:30 +02:00
Paul Berry
7dc636dd77 glsl: improve the accuracy of the atan(x,y) builtin function.
The previous formula for atan(x,y) returned a value of +/- pi whenever
|x|<0.0001, and used a formula based on atan(y/x) otherwise.  This
broke in cases where both x and y were small (e.g. atan(1e-5, 1e-5)).

This patch modifies the formula so that it returns a value of +/- pi
whenever |x|<1e-8*|y|, and uses the formula based on atan(y/x)
otherwise.
(cherry picked from commit b1b4ea0b36)
2011-10-02 19:00:31 +02:00
Paul Berry
e42b822fec glsl: improve the accuracy of the radians() builtin function
The constant used in the radians() function didn't have enough
precision, causing a relative error of 1.676e-5, which is far worse
than the precision of 32-bit floats.  This patch reduces the relative
error to 1.14e-9, which is the best we can do in 32 bits.

Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit fe33c886a7)
2011-10-02 18:50:28 +02:00
Paul Berry
0501cee136 glsl: Lower break instructions when necessary at the end of a loop.
Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.
(cherry picked from commit 067c9d7bd7)

Conflicts:

	src/glsl/lower_jumps.cpp
2011-10-02 18:48:27 +02:00
Paul Berry
38ae26b709 glsl: In lower_jumps.cpp, lower both branches of a conditional.
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.
(cherry picked from commit e71b4ab8a6)
2011-10-02 18:45:10 +02:00
Paul Berry
de798938d4 glsl: Use foreach_list in lower_jumps.cpp
The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 382cee91a4)
2011-10-02 18:44:50 +02:00
Paul Berry
acd2a03ffb glsl: lower unconditional returns and continues in loops.
Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.
(cherry picked from commit 03145ba655)

Conflicts:

	src/glsl/lower_jumps.cpp
2011-10-02 18:44:31 +02:00
Paul Berry
d1786cea1c glsl: Refactor logic for determining whether to lower return statements.
Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.
(cherry picked from commit dbaa2e627e)
2011-10-02 18:43:00 +02:00
Paul Berry
934c7a0661 glsl: Lower unconditional return statements.
Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.
(cherry picked from commit afc9a50fba)
2011-10-02 18:35:00 +02:00
Brian Paul
2ba0d0a5e8 mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()
If color material mode is enabled, constant buffer entries related
to the material coefficients will depend on glColor.  So add
_NEW_CURRENT_ATTRIB to the bitset returned for material-related
constants in _mesa_program_state_flags().

This fixes a bug exercised by the new piglit draw-arrays-colormaterial
test.

Note: This is a candidate for the 7.11 branch.
(cherry picked from commit 57169c4694)
2011-10-02 18:10:40 +02:00
Marek Olšák
1cf8f9599c r600g: add index_bias to index buffer bounds
This fixes ARB_draw_elements_base_vertex with max_index != ~0.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 44afac04ea)
2011-10-02 18:10:19 +02:00
Brian Paul
2781baaa64 meta: fix broken sRGB mipmap generation
If we're generating a mipmap for an sRGB texture we need to bypass
sRGB->linear conversion.  Otherwise the destination mipmap level
(drawn with a textured quad) will have the wrong colors.
If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode)
we need to use the software fallback for mipmap generation.

Note: This is a candidate for the 7.11 branch.
(cherry picked from commit 1e939f5374)
2011-10-02 18:09:22 +02:00
Brian Paul
a74400ca30 mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros
The 1-bit alpha channel was incorrectly encoded.  Previously, any non-zero
alpha value for the ubyte alpha value would set A=1.  Instead, use the
most significant bit of the ubyte alpha to determine the A bit.  This is
consistent with the other channels and other OpenGL implementations.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
(cherry picked from commit 4731a598f0)
2011-10-02 18:08:31 +02:00
Tom Stellard
a5e2074fdd r300/compiler: Fix regalloc for values with multiple writers
https://bugs.freedesktop.org/show_bug.cgi?id=40062
https://bugs.freedesktop.org/show_bug.cgi?id=36939

Note: This is a candidate for the 7.11 branch.
(applied diff manually from 2d1004d9aa)
2011-10-02 18:07:53 +02:00
Brian Paul
fad6e2ea5a meta: fix/add checks for GL_EXT_framebuffer_sRGB
This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension
is not supported.

Note: This is a candidate for the 7.11 branch
(cherry picked from commit 6e423253e7)
2011-10-02 18:05:03 +02:00
Vadim Girlin
a73c667069 r600g: fix replace_gpr_with_pv_ps
Instructions with 3 source operands have no write mask, so we may replace their
destinations with PV/PS in the next group even if their dst.write is 0.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit fdb62ef3f5)
2011-10-02 18:04:38 +02:00
Vadim Girlin
e87f79c8a4 r600g: fix check_and_set_bank_swizzle
Need to do full check when not all bank swizzles in the group are forced
(e.g. when trying to merge interp_* group with the next instruction)

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6ba68c7654)

Conflicts:

	src/gallium/drivers/r600/r600_asm.c
2011-10-02 18:04:22 +02:00
Chad Versace
fa8cfbfb64 x86-64: Fix compile error with clang
Remove the 'f' suffix from a float literal.
    - .float 0.0f+1.0
    + .float 1.0

This fixes the following compile error with clang:
    error: unexpected token in directive
    .float 0.0f+1.0
              ^

Note: This is a candidate for the stable branches.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 9cd64ec35a)
2011-10-02 18:00:27 +02:00
Brian Paul
446a67b74e swrast: don't try to do depth testing if there's no depth buffer
Fixes piglit hiz-depth-stencil-test-fbo-d0-s8 crash.
See http://bugs.freedesktop.org/show_bug.cgi?id=37907

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 37a64baea8)
2011-10-02 18:00:13 +02:00
Kenneth Graunke
d5c84929a7 mesa: In validate_program(), initialize errMsg for safety.
validate_program relies on validate_shader_program to fill in errMsg;
empirically, there exist cases where that doesn't happen.

While tracking those down may be worthwhile, initializing the string so
we don't try to ralloc_strdup random garbage also seems wise.

Fixes issues caught by valgrind while running some test case.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit db726b048e)
2011-10-02 18:00:03 +02:00
Christopher James Halse Rogers
dd9b78e212 glx/dri2: Paper over errors in DRI2Connect when indirect
DRI2 will throw BadRequest for this when the client is not local, but
DRI2 is an implementation detail and not something callers should have
to know about.  Silently swallow errors in this case, and just propagate
the failure through DRI2Connect's return code.

Note: This is a candidate for the stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
(cherry picked from commit fbc2fcf685)
2011-10-02 17:59:54 +02:00
Chia-I Wu
2cadae90c0 glsl: empty declarations should be valid
Unlike C++, empty declarations such as

  float;

should be valid.  The spec is not explicit about this actually.

Some apps that generate their shader sources may rely on this.  This was
noted when porting one of them to Linux from Windows.

Reviewed-by: Chad Versace <chad@chad-versace.us>

Note: this is a candidate for the 7.11 branch.
(cherry picked from commit 547212d963)
2011-10-02 17:59:26 +02:00
Vadim Girlin
ffb0f94136 r600g: take into account force_add_cf in pops
When we have two ENDIFs in a row, we shouldn't modify the pop_count
for the same alu clause twice.

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

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2bde0cc95d)
2011-10-02 17:58:50 +02:00
Vadim Girlin
badd2900ea r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6eb94fc344)
2011-10-02 17:58:40 +02:00
Chad Versace
6c032dd837 glsl: Fix conversions in array constructors
Array constructors obey narrower conversion rules than other constructors
[1] --- they use the implicit conversion rules [2] instead of the scalar
constructor conversions [3].  But process_array_constructor() was
incorrectly applying the broader rules.

[1] GLSL 1.50 spec, Section 5.4.4 Array Constructors, page 52 (58 of pdf)
[2] GLSL 1.50 spec, Section 4.1.10 Implicit Conversions, page 25 (31 of pdf)
[3] GLSL 1.50 spec, Section 5.4.1 Conversion, page 48 (54 of pdf)

To fix this, first check (with glsl_type::can_be_implicitly_converted_to)
if an implicit conversion is legal before performing the conversion.

Fixes:
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec*-vec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit a5ab9398e3)
2011-10-02 17:58:28 +02:00
Chad Versace
70c5be6c91 glsl: Remove ir_function.cpp:type_compare()
The function is no longer used and has been replaced by
glsl_type::can_implicitly_convert_to().

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 6efe1a8495)
2011-10-02 17:00:59 +02:00
Chad Versace
3b92831fab glsl: Fix implicit conversions in non-constructor function calls
Context
-------
In ast_function_expression::hir(), parameter_lists_match() checks if the
function call's actual parameter list matches the signature's parameter
list, where the match may require implicit conversion of some arguments.
To check if an implicit conversion exists between individual arguments,
type_compare() is used.

Problems
--------
type_compare() allowed the following illegal implicit conversions:
    bool -> float
    bvecN -> vecN

    int -> uint
    ivecN -> uvecN

    uint -> int
    uvecN -> ivecN

Change
------
type_compare() is buggy, so replace it with glsl_type::can_be_implicitly_converted_to().
This comprises a rewrite of parameter_lists_match().

Fixes piglit:spec/glsl-1.20/compiler/built-in-functions/outerProduct-bvec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 8b3627fd7b)
2011-10-02 17:00:45 +02:00
Chad Versace
e6d07585f8 glsl: Add method glsl_type::can_implicitly_convert_to()
This method checks if a source type is identical to or can be implicitly
converted to a target type according to the GLSL 1.20 spec, Section 4.1.10
Implicit Conversions.

The following commits use the method for a bugfix:
    glsl: Fix implicit conversions in non-constructor function calls
    glsl: Fix implicit conversions in array constructors

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 200e4972c1)
2011-10-02 16:57:32 +02:00
Brian Paul
4bd0f04531 mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
And fix indentation.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit dc1f32deae)
2011-10-02 16:53:57 +02:00
Alex Deucher
45716cffbe r600g: fix up vs export handling
Certain attributes (position, psize, etc.) don't
count as params; they are handled separately by the hw.
However, the VS is required to export at least one param
and r600_shader_from_tgsi() takes care of adding a dummy
export if there is none.  Make sure the VS param export
count in the SPI properly accounts for this.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit dc1c0ca22a)
2011-10-02 16:53:44 +02:00
Marek Olšák
ae633fa0ef configure.ac: fix xlib-based softpipe build
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit c6f59fcd00)

Conflicts:

	configure.ac
2011-10-02 16:53:21 +02:00
Kenneth Graunke
25861dc7f3 glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.
When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes.  Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol.  It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations.  Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol.  While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine.  Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
      make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3875526926)
2011-10-02 16:50:39 +02:00
Marcin Baczyński
3fc660e896 configure: allow C{,XX}FLAGS override
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ff2efdf599)
2011-10-02 16:49:56 +02:00
Marcin Baczyński
0fbf3562d1 configure: fix gcc version check
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fa013419de)
2011-10-02 16:49:49 +02:00
Vadim Girlin
13476840a6 st/mesa: flush bitmap cache on query and conditional render boundaries
Bitmap caching shouldn't affect the results of the queries and
conditional render.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4f4855b249)
2011-10-02 16:49:34 +02:00
Henri Verbeet
5336f7f5a5 mesa: Fix a couple of TexEnv unit limits.
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit bfe284fd26)
2011-10-02 16:46:10 +02:00
Henri Verbeet
a470104763 mesa: Use the Elements macro for the sampler index assert in validate_samplers().
This is probably nicer if the array size ever changes.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 4744195628)
2011-10-02 16:46:02 +02:00
Henri Verbeet
338cf7128c mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.
The total number of units used by a shader is limited to MAX_TEXTURE_UNITS,
but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS,
since they're shared between vertex and fragment shaders.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 86adc2b29e)
2011-10-02 16:45:54 +02:00
Henri Verbeet
36dab12726 mesa: Check the texture against all units in unbind_texobj_from_texunits().
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2e35d90fb9)
2011-10-02 16:45:46 +02:00
Brian Paul
dc253d3100 mesa: fix texstore addressing bugs for depth/stencil formats
Using GLuint pointers worked when the pixel size was four bytes
or the row stride was a multiple of four but was otherwise broken.
Fixes failures found with the piglit fbo-stencil test.

This helps to fix https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b786db0654)
2011-10-02 16:43:08 +02:00
Brian Paul
9f362a587e softpipe: add missing stencil format case in convert_quad_stencil()
Part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch
(cherry picked from commit 057a107d44)

Conflicts:

	src/gallium/drivers/softpipe/sp_quad_depth_test.c
2011-10-02 16:42:54 +02:00
Henri Verbeet
8b5257a96f r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 39fecd3229)
2011-10-02 16:38:09 +02:00
Eric Anholt
94e12df164 glsl: Allow ir_assignment() constructor to not specify condition.
We almost never want to specify a condition, and when we do we're
already thinking about it (because we're writing a lowering pass
generating the condition), so a default argument should make the code
more pleasant to read.

NOTE: This is a candidate for the 7.11 branch (we want to be able to
cherry-pick future code).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e617a53a74)
2011-10-02 16:31:16 +02:00
Eric Anholt
ac6a24001b mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.
Like the previous commit, but fixes
ARB_vertex_program/getlocal4d-with-error.

v2: Move the success case line into the conditional, use ASSIGN_4V more.
(cherry picked from commit c9aac11713)
2011-10-02 15:33:05 +02:00
Eric Anholt
b7e69912fa mesa: Throw an error when starting conditional render on an active query.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-while-active.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fd17de2123)
2011-10-02 15:33:05 +02:00
Eric Anholt
268a2c1a8a mesa: Throw an error instead of asserting for condrender with query == 0.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7371224c06)
2011-10-02 15:33:05 +02:00
Eric Anholt
28b95b2b01 mesa: Add support for Begin/EndConditionalRender in display lists.
Fixes piglit nv_conditional_render-dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 8899f6e93c)
2011-10-02 15:33:05 +02:00
Ian Romanick
0a6ef34741 mesa: Make _mesa_get_compressed_formats match the texture compression specs
The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations.  A giant comment block was added to
justify the somewhat odd behavior of this function.

In addition, the interface had unnecessary cruft.  The 'all' parameter
was false at all callers, so it has been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b189d1635d)
2011-10-02 15:33:04 +02:00
Ian Romanick
545ecf6542 mesa: Return the correct internal fmt when a generic compressed fmt was used
If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 143b65f761)
2011-10-02 15:33:04 +02:00
Ian Romanick
a88f4914a3 mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 09916e877f)
2011-10-02 15:33:04 +02:00
Eric Anholt
ad2b567f51 mesa: Fix glGetUniform() type conversions.
We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9fa41f0742)

Conflicts:

	src/mesa/main/uniforms.c
2011-10-02 15:33:04 +02:00
Marek Olšák
37c2c9688c u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 60a77cf316)
2011-10-02 15:33:04 +02:00
Marek Olšák
012b2057e8 u_vbuf_mgr: rework user buffer uploads
- first determine the buffer range to upload for each buffer by walking over
  vertex elements
- take buffer_offset into account
- take src_offset into account
- take src_format into account in more places
- don't just blindly upload (stride*count) bytes

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit cd9bbb3935)
2011-10-02 15:33:03 +02:00
Marek Olšák
eb2a04b467 u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED
(cherry picked from commit 315300e444)
2011-10-02 15:33:03 +02:00
Marek Olšák
060e22c212 u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_
(cherry picked from commit 28fb798911)

Conflicts:

	src/gallium/auxiliary/util/u_vbuf_mgr.c
	src/gallium/drivers/r600/r600_state_common.c
2011-10-02 15:33:03 +02:00
Marek Olšák
2330b7267c u_vbuf_mgr: fix max_index computation for large src_offset
NOTE: This is a candidate for the 7.11 branch.
2011-10-02 15:33:02 +02:00
Marek Olšák
7a7377a090 u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index
NOTE: This is a candidate for the 7.11 branch.
2011-10-02 15:33:02 +02:00
Marek Olšák
d79d69c933 u_vbuf_mgr: cleanup original vs real vertex buffer arrays
It can now override both buffer offsets and strides in additions to resources.
Overriding buffer offsets was kinda hackish and could cause issues with
non-native vertex formats.
2011-10-02 15:33:02 +02:00
Henri Verbeet
d072260921 mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().
Without this we'd miss the last update in a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called
updated_drawbuffers() when the buffer count changed, but later realized that
was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for
output colors beyond <n> is set to NONE.", and this is queryable state.
This fixes piglit arb_draw_buffers-state_change.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a4d72189b2)
2011-10-02 15:33:02 +02:00
Michel Dänzer
942c1b8de1 glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
As already done in dri2CopySubBuffer().

Should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=36371
https://bugs.freedesktop.org/show_bug.cgi?id=40533

Might fix:

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d8c443ddde)
2011-10-02 03:54:02 +02:00
Kristian Høgsberg
0502da1ade glx: Don't flush twice if we fallback to dri2CopySubBuffer
The flush extensions flush call indicates end of frame and should only
be called once per frame.  However, in the dri2SwapBuffer fallback
path, we call flush and then call dri2CopySubBuffer, which also calls
flush.  Refactor the code to only call flush once.
(cherry picked from commit 4a7667b96b)
2011-10-02 03:53:55 +02:00
Michel Dänzer
bb38f931a8 st/mesa: Finalize texture on render-to-texture.
This makes sure that stObj->pt exists and is up to date.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit
fbo-incomplete-texture-03.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit de414f4915)
2011-10-02 03:45:43 +02:00
Brian Paul
726ce042f8 st/mesa: Convert size assertions to conditionals in st_texture_image_copy.
Prevents potential assertion failures in piglit fbo-incomplete-texture-03 test.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 4beb8f9e9d)
2011-10-02 03:45:36 +02:00
Eric Anholt
4ebd2c7c09 mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.
Fixes a bug caught by oglconform, and now piglit
ARB_vertex_program/getenv4d-with-error.  The wrapping of an existing
GL function made it so that we couldn't distinguish an error in
looking up our arguments from an existing error.  Instead, make a
helper function to choose the param, and use it from multiple callers.

v2: Move the success case line into the conditional, use COPY_4V more.
(cherry picked from commit e9d563e3ff)
2011-10-02 03:25:03 +02:00
Marcin Slusarz
e7794048ca nouveau: fix nouveau_fence leak
(commit 96054375b1 in master)
2011-09-13 15:36:01 +02:00
Carl Simonson
e20346bfc8 i830: Add missing vtable entry for i830 from the hiz work.
(cherry picked from commit 09eeb0ff27)
2011-09-10 18:33:13 -07:00
David Reveman
2217a70aaf i915g: Fix off-by-one in scissors. 2011-08-26 17:43:20 -07:00
Tobias Droste
6c1a9a327d r300/compiler: simplify code in peephole_add_presub_add
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 84f8548dfc)
2011-08-07 18:36:17 +02:00
Marek Olšák
e33f306d67 r300/compiler: remove an unused-but-set variable and simplify the code
(cherry picked from commit ed5e95ada6)
2011-08-07 18:36:10 +02:00
Marek Olšák
f69357d77a r300/compiler: fix a warning that a variable may be uninitialized
(cherry picked from commit 2ce6c3ea6e)
2011-08-07 18:36:03 +02:00
Marek Olšák
d8a0c1b4bc winsys/radeon: fix space checking
We should remove the relocations which caused a validation failure
from the list, so that the kernel receives only the validated ones.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 64ab39b035)

Conflicts:

	src/gallium/winsys/radeon/drm/radeon_drm_cs.c
2011-08-07 18:35:06 +02:00
Marek Olšák
f396e43b7d vbo: do not call _mesa_max_buffer_index in debug builds
That code drops performance in Unigine Heaven and Tropics
by a factor of 10. That's too crazy even for a debug build.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c251d83d91)
2011-08-07 18:28:51 +02:00
Brian Paul
aedfd07fb2 docs: news item for 7.11 release 2011-08-02 10:38:17 -06:00
Brian Paul
9e669d9f28 docs: add 7.11 md5 sums 2011-08-02 10:38:03 -06:00
Marc Pignat
4258e9b3a5 drisw: Fix 24bpp software rendering, take 2
This patch add the support for 24bpp in the dri/swrast implementation.
See http://bugs.freedesktop.org/show_bug.cgi?id=23525

Signed-off-by: Marc Pignat <marc at pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfec000e75)
2011-08-02 10:03:15 -06:00
Ian Romanick
de8f22af28 mesa: Bump version to 7.11 (final) 2011-07-31 22:48:10 -07:00
Ian Romanick
6ee71bab94 docs: More bits of 7.11 release notes 2011-07-31 22:47:26 -07:00
Jeremy Huddleston
6c72801c2b darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 5b3c719983)
2011-07-31 09:47:56 -07:00
Jeremy Huddleston
0d2c369535 Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e737a99a6f)
2011-07-31 09:47:51 -07:00
Ian Romanick
fffd20cdc1 Merge remote-tracking branch 'origin/7.11' into 7.11 2011-07-28 16:18:51 -07:00
Ian Romanick
fad610fec9 mesa: Bump version to 7.11-rc4 2011-07-28 16:08:42 -07:00
Vadim Girlin
9ca791d380 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 19:05:59 -04:00
Kenneth Graunke
69720cb0c4 i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f73caddd33)
2011-07-28 14:23:08 -07:00
Kenneth Graunke
8589ca000a i965: Check actual tile offsets in Gen4 miptree workaround.
The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 15c0bc5eef)
2011-07-28 14:22:59 -07:00
Kenneth Graunke
dcbd00e73c i965/gen4: Fix message parameter loading for 1D TXD sampling.
We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e1fd13f60)
2011-07-28 14:22:48 -07:00
Fredrik Höglund
bba1600531 st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-28 11:56:45 -07:00
Ian Romanick
f4c55ea016 mesa: Ensure that r300 compiler files only appear once in the tarballs
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Cc: Andreas Radke <a.radke@arcor.de>
2011-07-28 11:47:46 -07:00
Ian Romanick
aa05fbe14d mesa: Bump version to 7.11-rc3 2011-07-28 11:47:45 -07:00
Ian Romanick
0a7574f62c mesa: Use --dereference to avoid symlinks in tarballs 2011-07-28 11:47:45 -07:00
Eric Anholt
1098f9228d i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3daa2d97eb)
2011-07-28 11:47:45 -07:00
Eric Anholt
5238303790 i965: Fix many of the trivial WebGL demos that broke due to IB optimization.
The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.
(cherry picked from commit 818db3848b)
2011-07-28 11:47:45 -07:00
Eric Anholt
a03974ffb9 i965: Emit texture cache flushes on gen6 along with render cache flushes.
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.
(cherry picked from commit 185868c9c2)
2011-07-28 11:47:45 -07:00
Paul Berry
2d64d34cb9 i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d92463d5dc)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
66b41af391 i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 572f631895)
2011-07-28 11:47:45 -07:00
Kenneth Graunke
67aa20d9d5 i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156cef0fba)
2011-07-28 11:47:45 -07:00
Ian Romanick
7d6c37b0c2 glsl: Treat ir_dereference_array of non-var as a constant for lowering
Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 156f85336f)
2011-07-28 11:47:45 -07:00
Ian Romanick
32c7224edb i965: When emitting a src/dst read of an output, keep the swizzle and neg
Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1d3f09f159)
2011-07-28 11:47:45 -07:00
Ian Romanick
788acd552e i965: When emitting a src/dst write of an output, keep the write mask
Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 337e2dfad0)
2011-07-28 11:47:45 -07:00
Ian Romanick
a2b8802ed5 prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit fbeb68e880)
2011-07-28 11:47:45 -07:00
Ian Romanick
8b41ae0b2a ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f7cd9a858c)
2011-07-28 11:47:44 -07:00
Ian Romanick
b00b5fe267 ir_to_mesa: Add each relative address to the previous
This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d6e1a8f714)
2011-07-28 11:47:44 -07:00
Ian Romanick
3a5a7cfd2a glsl: When lowering non-constant vector indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 601428d2bb)
2011-07-28 11:47:44 -07:00
Ian Romanick
aad12d15bb glsl: When lowering non-constant array indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5f83dfe5b7)
2011-07-28 11:47:44 -07:00
Ian Romanick
977db7cc65 glsl: Rework lowering of non-constant array indexing
The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1731ac3086)

To make bisects work, this also squashes in:

glsl: Correctly return progress from lower_variable_index_to_cond_assign

lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c1e591eed4)
2011-07-28 11:47:44 -07:00
Ian Romanick
d31c1c33ed glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d2296e784a)
2011-07-28 11:47:44 -07:00
Ian Romanick
3481a5a1e6 glsl: Move is_array_or_matrix outside visitor class
There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8d5f3cef79)
2011-07-28 11:47:44 -07:00
Marek Olšák
a26b6cc001 configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 0aed27ee37)
2011-07-28 00:29:07 +02:00
Benjamin Franzke
7d992b8471 wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
(cherry picked from commit 79dcfb266a)
2011-07-27 10:08:01 +02:00
Tobias Droste
0bfa310049 egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit d4d5e3a336)
2011-07-27 09:43:03 +02:00
Benjamin Franzke
7555eb7478 Fix broken merge in cherry-pick from 42cdf407
Was cherry-picked to 337102684b.
2011-07-27 09:25:54 +02:00
Bryan Cain
fd461c5888 util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:18 -05:00
Bryan Cain
208bae4251 st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 13:23:15 -05:00
Marek Olšák
13d12b35e9 configure.ac: do not check for llvm-config if llvm is disabled 2011-07-25 23:54:28 +02:00
Benjamin Franzke
337102684b configure: Move gbm before egl in SRC_DIRS
egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
(cherry picked from commit 42cdf4074e)
2011-07-25 09:47:39 +02:00
Marek Olšák
b305c956be configure.ac: check for libdrm_radeon only when building classic
(cherry picked from commit 50e32fefb1)
2011-07-23 16:00:27 +02:00
Ian Romanick
7c98381ed4 glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 02c5ae1b3f)

This also squashes in the following commit to make sure that bisects
in scons builds work:

glsl: Add ir_function_detect_recursion.cpp to SConscript.
(cherry picked from commit 76bccaff0c)
2011-07-23 01:55:25 -07:00
Ian Romanick
0ce6506d6e glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ad3ba4ad9)
2011-07-23 01:53:59 -07:00
Stéphane Marchesin
7fc66f0bed Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
(cherry picked from commit 3c0c624879)
2011-07-23 01:53:40 -07:00
Chia-I Wu
e24c3575e4 u_vbuf_mgr: restore buffer offsets
u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
(cherry picked from commit afc160e1c8)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-21 22:18:56 +02:00
Marek Olšák
2e50a93cf3 r600g: more valgrind fixes
(cherry picked from commit dc9d789d1b)
2011-07-21 15:03:03 +02:00
Marek Olšák
2c29c24543 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
(cherry picked from commit daf6604435)
2011-07-21 15:02:53 +02:00
Marek Olšák
4cbaa2283c configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit c2426bbf86)

Conflicts:

	configure.ac
2011-07-21 14:57:19 +02:00
Marek Olšák
e29d44eacd mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 000896c0bb)
2011-07-21 14:54:09 +02:00
Andrew Randrianasulu
f29208aa9b dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Broken accidentally in f4efc256fd,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.
2011-07-21 10:33:33 +02:00
David Heidelberger
7af4e18dcd nvfx: handle PIPE_CAP_SM3
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2011-07-21 10:33:03 +02:00
Eric Anholt
344db29ede i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3e5d36267d)
2011-07-20 12:50:06 -07:00
Eric Anholt
680c468f61 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
(cherry picked from commit 407785d0e9)
2011-07-20 12:50:06 -07:00
Eric Anholt
7ee4cb453b i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dc7422405f)
2011-07-20 12:50:06 -07:00
Eric Anholt
a152ab6df1 i915: Simplify intel_wpos_* with a helper function.
(cherry picked from commit cb5e0ba2aa)
2011-07-20 12:50:06 -07:00
Eric Anholt
a99914509e i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
(cherry picked from commit fceda4342c)
2011-07-20 12:50:06 -07:00
Eric Anholt
891073fea3 i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
(cherry picked from commit debf751aea)
2011-07-20 12:50:06 -07:00
Eric Anholt
dcaec739ea i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
(cherry picked from commit 79fee3a76b)
2011-07-20 12:50:06 -07:00
Eric Anholt
ea241750f7 i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
(cherry picked from commit fc4fba52cf)
2011-07-20 12:50:06 -07:00
Eric Anholt
9efd6dc677 i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 4c47fce92e)
2011-07-20 12:50:06 -07:00
Eric Anholt
c6ddeeed7a i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 94efc350b4)
2011-07-20 12:50:05 -07:00
Eric Anholt
108e807b7b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit c68270a26b)
2011-07-20 12:50:05 -07:00
Eric Anholt
421bca32fb i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 15af0f54b8)
2011-07-20 12:50:05 -07:00
Eric Anholt
0f0ab15a46 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit dd898c3e89)
2011-07-20 12:50:05 -07:00
Eric Anholt
b3c2438d4e intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit f34ec6169d)
2011-07-20 12:50:05 -07:00
Brian Paul
25287008b6 glsl: silence warning in linker.cpp
(cherry picked from commit 4470ff2ebf)
2011-07-20 09:02:22 -07:00
Jørgen Lind
62b282e749 Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
(cherry picked from commit 496bf3822a)
2011-07-20 09:02:18 -07:00
Paul Berry
9aa8c02ae2 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 3097715d41)
2011-07-20 08:15:32 -07:00
Paul Berry
b0ecde7f39 glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 9c4445de6e)
2011-07-20 08:15:21 -07:00
Marek Olšák
fe70a40e47 prog_optimize: fix a warning that a variable may be uninitialized
(cherry picked from commit dade65505b)
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-20 08:01:47 -06:00
Ian Romanick
73b68316f4 mesa: Bump version to 7.11-rc2 2011-07-19 16:39:57 -07:00
Brian Paul
7ba7531929 mesa: remove depend files from tarballs
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-19 16:39:57 -07:00
Kenneth Graunke
2826e3a000 glsl: Correctly handle function matching when there are multiple inexact matches
This is a squash cherry pick commit of:

    glsl: Find the "closest" signature when there are multiple matches.

    Previously, ir_function::matching_signature had a fatal bug: if a
    function had more than one non-exact match, it would simply return NULL.

    This occured, for example, when looking for max(uvec3, uvec3):
    - max(vec3, vec3)   -> score 1 (found first)
    - max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
    - max(uvec3, uvec3) -> score 0 (exact match...the right answer)

    This did not occur for max(ivec3, ivec3) since the second match found
    was an exact match.

    The new behavior is to return a match with the lowest score.  If there
    is an exact match, that will be returned.  Otherwise, a match with the
    least number of implicit conversions is chosen.

    Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 60eb63a855)

    glsl: Suppress warning from matching_signature change.

    gcc isn't smart enough to see that we only look at matched_score after
    we've initialized it (because match != NULL happens at the same time)
    (cherry picked from commit b043409adf)

    glsl: Reject ambiguous function calls (multiple inexact matches).

    According to the GLSL 1.20 specification, "it is a semantic error if
    there are multiple ways to apply [implicit] conversions [...] such that
    the call can be made to match multiple signatures."

    Fixes a regression caused by 60eb63a855,
    which implemented the wrong policy of finding a "closest" match.
    However, this is not a revert, since the original code failed to
    continue looking for an exact match once it found two inexact matches.

    It's OK to have multiple inexact matches if there's also an exact match.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 7304909d65)
2011-07-19 16:39:56 -07:00
Paul Berry
f80ae99cbd glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f07221056e)
2011-07-19 16:39:56 -07:00
Paul Berry
ae11fb02dd glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
(cherry picked from commit ddc1c96390)
2011-07-19 16:39:56 -07:00
Ian Romanick
a90b88f354 linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d)
2011-07-19 16:39:56 -07:00
Ian Romanick
0e699cc0e8 configure.ac: Make --{without,with}-gallium-drivers work as expected
This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit db311b45be)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
e6e7c456de i965/gen7: Add support for gl_PointCoord.
This is exactly analogous to Eric's Gen6 change in commit
6861a70177.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 186e37c754)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
31f4ab790f i965/gen7: Fix point sprite texture coordinate overrides.
This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 147d010295)
2011-07-19 16:39:56 -07:00
Kenneth Graunke
9f978104d8 i965/gen7: Refactor SF setup a bit to handle overrides in one place.
This is exactly analogous to Eric's Gen6 change in commit
e7280b16d6.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 5edb3ddf41)
2011-07-19 16:39:55 -07:00
Kenneth Graunke
9d78935100 i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

(cherry-picked from commit 57b57f6d1c)
2011-07-19 16:39:55 -07:00
Henri Verbeet
d469ebaa0a glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
(cherry picked from commit 0f20e2e18f)
2011-07-19 23:29:16 +02:00
Chad Versace
f5fa4606ea intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f7dbcba280)
2011-07-19 13:15:00 -07:00
Vadim Girlin
89ed95ad3d r600g: fix corner case checks for the queries 2011-07-18 09:00:42 -04:00
Christoph Bumiller
3b605cb0d6 nv50,nvc0: add correct storage type for Z32_FLOAT 2011-07-18 13:48:19 +02:00
Christoph Bumiller
9bfb79923f nv50,nvc0: don't advertise unaligned texture format support
Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.
2011-07-18 13:45:52 +02:00
Vadim Girlin
7d8a04643f r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:43:48 -04:00
Alex Deucher
3065bae508 r600c/g: add new NI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-15 10:56:31 -04:00
Chia-I Wu
443ff6024d targets/egl-static: fix a linking error
rbug is always linked in and it needs libpthread.
(cherry picked from commit 5fe5d236c2)
2011-07-14 11:56:39 +08:00
Eric Anholt
a20a950829 i915: Add support for gl_FragData[0] for output color.
We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
(cherry picked from commit 556a47a262)
2011-07-13 13:14:09 -07:00
Eric Anholt
9279c1e556 i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f2fd0d6304)
2011-07-13 13:14:09 -07:00
Eric Anholt
b8f722a82e i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6e6b388604)
2011-07-13 13:14:09 -07:00
Eric Anholt
9304645a07 i965: Fix fp-dst-aliasing-[12].vpfp.
There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 46a7639174)
2011-07-13 13:14:09 -07:00
Eric Anholt
c3b3719096 i965: Fix fp-lit-src-equals-dst.
We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e3ea5bc08e)
2011-07-13 13:14:09 -07:00
Eric Anholt
55a75856fb intel: Remove gratuitous context checks in intel_delete_renderbuffer().
Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 007c2d6cd2)
2011-07-13 13:14:09 -07:00
Eric Anholt
e3e99be131 intel: Allow intel_region_reference() with *dst != NULL.
This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
(cherry picked from commit 036b74a7f8)
(cherry picked from commit d8f65c07e9)
2011-07-13 13:12:55 -07:00
Eric Anholt
5a7d1c9710 glsl: Fix make clean for dricore.
(cherry picked from commit abbbd14dd4)
2011-07-13 13:08:23 -07:00
Eric Anholt
6ac5554298 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
(cherry picked from commit a09c5c2e30)
2011-07-13 13:08:23 -07:00
Eric Anholt
9eace71048 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
(cherry picked from commit cd7bfd5d44)
2011-07-13 13:08:23 -07:00
Stéphane Marchesin
8d9202c162 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 12:08:10 -07:00
Alex Deucher
ef9f16f632 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

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

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:04:57 -04:00
Brian Paul
d739434af8 glx: add a few missing glXChooseFBConfig() attributes
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit d60880db35)
2011-07-12 09:46:50 -06:00
Brian Paul
72f2bd2a41 glext.h: update to version 71
(cherry picked from commit bb0d5cae00)
2011-07-12 09:46:42 -06:00
Benjamin Franzke
b0549fab5c configure: Require libudev for drm & wayland egl platforms
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 7ed1826e2e)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
ac88916978 configure: Fix typo in gbm check for egl drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 9b8cd49930)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
336b2c7fbd configure: Enable st/gbm if st/egl has drm platform
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b18b2994ef)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
a8907c6005 egl_dri2: Fix compilation if udev devel files are not installed
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit b2d6375e6a)
2011-07-12 09:58:11 +02:00
Benjamin Franzke
89af428aea egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 992680c8b4)
2011-07-12 09:58:11 +02:00
Marek Olšák
8a77029f4c swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit d1214cca08)
2011-07-11 23:03:34 +02:00
Marek Olšák
928bf189ff mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
(cherry picked from commit 83478e5d59)
2011-07-11 23:03:25 +02:00
Vadim Girlin
a9e34ada26 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:30:20 -04:00
Eric Anholt
804995807d i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d03fdc4cde)
2011-07-09 07:52:35 -07:00
Ian Romanick
b033f050fd mesa: Fix the parsers build rule so that 'make tarballs' can work
You'd think that with all the commit messages about adding stuff to
tarballs or fixing 'make tarballs' that someone would have noticed
that it was completely broken for 4 months (3158cc7).
2011-07-08 18:47:21 -07:00
Ian Romanick
c66982f7dc mesa: Bump version to 7.11-rc1 2011-07-08 18:26:39 -07:00
Ian Romanick
530c68d616 glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d2c6cef18a)
2011-07-08 16:02:20 -07:00
Vadim Girlin
576f489dad r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:54 -04:00
Vadim Girlin
270de51f1d r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:34 -04:00
Vadim Girlin
57fe695a17 r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:21 -04:00
Vadim Girlin
189303fb30 r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:23:07 -04:00
Brian Paul
c4da12e74f glsl: use casts to silence warning
(cherry picked from commit 7eb7d67d50)
2011-07-08 08:03:56 -06:00
Brian Paul
8428b48673 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit fc98444bd5)

Conflicts:

	src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
2011-07-08 08:03:40 -06:00
Marek Olšák
b0a4f34ea8 st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7de28e80dc)
2011-07-08 13:24:50 +02:00
Marek Olšák
efd0ffd1b0 st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 292148dc4b)
2011-07-08 13:24:42 +02:00
Stéphane Marchesin
dc062db95d i915g: Improve flushing using heuristics. 2011-07-08 00:28:29 -07:00
Stéphane Marchesin
b292ef8f88 i915g: Move back to the old method for target format fixup.
Conflicts:

	src/gallium/drivers/i915/i915_state_emit.c
2011-07-08 00:27:59 -07:00
Eric Anholt
d3bfa9bb4a intel: Fix use of freed buffer if glBitmap is called after a swap.
Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
(cherry picked from commit 066bee64e1)
2011-07-07 15:05:24 -07:00
Paul Berry
98af042079 glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
(cherry picked from commit b078aad8ab)
2011-07-07 14:23:08 -07:00
Ian Romanick
127bd9d5b6 linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
(cherry picked from commit d32d4f780f)
2011-07-06 17:06:29 -07:00
Ian Romanick
b8972db223 glsl: Don't choke when printing an anonymous function parameter
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 174cef7fee)
2011-07-06 17:06:19 -07:00
Ian Romanick
f28cf18609 ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit dbda466fc0)
2011-07-06 17:05:50 -07:00
Ian Romanick
42cd6192a2 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
(cherry picked from commit 0eb9797958)
2011-07-06 17:05:36 -07:00
Vadim Girlin
1ae00c5960 r600g: fix buffer overflow check in r600_query_begin 2011-07-05 16:16:54 -04:00
Vadim Girlin
65d0d69c91 r600g: fix bo map usage flags in r600_query_begin 2011-07-05 16:16:40 -04:00
Vadim Girlin
433afb7352 r600g: reduce flushes for queries 2011-07-05 16:16:23 -04:00
Vadim Girlin
f70c2f8521 r600g: fix buffer offset in r600_query_begin 2011-07-05 16:16:05 -04:00
Chia-I Wu
e4cef07b87 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
(cherry picked from commit f2001df508)
2011-07-02 18:25:28 +09:00
Vadim Girlin
2196feb47f r600g: fix check for empty cs 2011-06-30 16:40:45 -04:00
Chia-I Wu
b90c710c6c target/egl-static: fix a compiler warning
(cherry picked from commit 3e3df5fcd1)
2011-06-30 15:01:17 +09:00
Chia-I Wu
bd1ceb5c5b targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
(cherry picked from commit 24137afb31)
2011-06-30 15:01:17 +09:00
Chia-I Wu
567778e49a targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
(cherry picked from commit 56ec8e17d3)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0fafcc6919 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
(cherry picked from commit 1e9f0b1736)
2011-06-30 15:01:17 +09:00
Chia-I Wu
29574af377 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
(cherry picked from commit 8ea5330200)
2011-06-30 15:01:17 +09:00
Chia-I Wu
0eb780262c st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
(cherry picked from commit aa281dd392)
2011-06-30 15:01:16 +09:00
Chia-I Wu
e43a096f0c st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
(cherry picked from commit 3a07d9594a)
2011-06-30 15:01:16 +09:00
Chia-I Wu
52aa06a2cd st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
(cherry picked from commit ed47d65c7c)
2011-06-30 15:01:16 +09:00
Chia-I Wu
5d1561b4ab st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
(cherry picked from commit 73df31eedd)
2011-06-30 15:01:16 +09:00
Kenneth Graunke
a8d7f36d65 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry-picked from commit 5ddc518401)
2011-06-29 11:00:16 -07:00
Emil Velikov
82ebfa6387 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 9b5c538726)
2011-06-29 07:20:08 -06:00
Andre Maasikas
ee416c6ffe st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 19789e403c)
2011-06-29 06:59:46 -06:00
Marek Olšák
ebc884d3dd r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
(cherry picked from commit bc517d64da)
2011-06-25 20:05:08 +02:00
Brian Paul
9383cfb4ba Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:20:32 -06:00
Stéphane Marchesin
ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt
773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin
7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin
3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin
1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul
6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry
95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher
3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher
feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace
6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace
e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace
951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace
1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin
407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák
100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák
e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák
2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul
09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

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

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke
629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin
eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin
d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin
8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt
0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt
3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt
6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt
18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul
d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat
c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul
08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul
b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy
c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu
febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu
875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu
b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu
7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00
Chia-I Wu
a000745f80 targets/egl-static: add support for driver lookup
Use pci id to driver map to look up the driver name.  This is based on
a433755ec5.
2011-06-24 16:43:03 +09:00
Chia-I Wu
f36d210c93 targets/gbm: build pipe drivers
Build pipe drivers here instead of using those built by the
soon-to-be-removed targets/egl.

[with an update by Benjamin Franzke to use --{start|end}-group]
2011-06-24 16:43:03 +09:00
Benjamin Franzke
15e64242f9 configure: Disable drm egl platform by default
So that gbm(_dri) which pulls in shared-glapi is not needed.
2011-06-24 09:37:19 +02:00
Stéphane Marchesin
d3d3fea720 dri/r200: properly spell current_atom. 2011-06-23 21:00:26 -07:00
Stéphane Marchesin
5f691ba36f dri/r200: rename __atom to current_atom.
__atom is defined by gcc when the atom compile optimizations are used.
2011-06-23 20:58:05 -07:00
Vinson Lee
ad7387fe12 gallivm: Fix x86 build with llvm-3.0svn.
LLVM revision 133739 renamed StackAlignment to StackAlignmentOverride.
2011-06-23 20:48:05 -07:00
Chia-I Wu
45aecf0114 st/egl: drop guess_gl_api from egl_g3d_loader
It is not used and confusing.
2011-06-24 12:18:52 +09:00
Chia-I Wu
cb29ee91a2 st/egl: use a helper to get st_api from the loader 2011-06-24 12:18:52 +09:00
Brian Paul
ca7510bbf9 mesa: fix incorrect error string 2011-06-23 17:09:13 -06:00
Christoph Bumiller
9c5d15e929 nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned
libdrm_nouveau/winsys changes which are likely to cause major
changes to this bo validation code too.
2011-06-24 00:15:58 +02:00
Brian Paul
1f544cc587 st/mesa: fix format selection regression
Note all gallium formats are supported by Mesa so disable them.
Fixes regression from 1a339b6c71.

See https://bugs.freedesktop.org/show_bug.cgi?id=38602
2011-06-23 16:06:42 -06:00
Eric Anholt
d631c19db4 vbo: Don't discount stride == 0 for testing all varyings in VBOs.
In fixed function, stride == 0 (e.g. glColor4f() outside of the draw
call) would get turned into uniform inputs, which is why it was
ignored originally in this test.  For shaders, drivers end up seeing a
need to upload stride == 0 data, and get confused by needing to upload
when vbo_all_varyings_in_vbos() returned true.  In the 965 driver
case, it wouldn't bother to compute the min/max index, and uploaded
nothing if the min/max wasn't known.

We've talked about removing the ff stride=0-into-uniforms code, so
this check shouldn't be missed once that's gone.

Fixes ARB_vertex_buffer_object/mixed-immediate-and-vbo
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37934
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:23 -07:00
Eric Anholt
8f28c05d07 vbo: Don't bother checking for stride == 0 for "any varying in a VBO".
We would still want to consider that data as being in a VBO even if we
managed to produce this case, which as far as I know we can't.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-23 13:43:17 -07:00
Eric Anholt
babe1fc004 i965/gen6: Add a couple more packets to the nonpipelined workaround list.
All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined.  We
could stand a review by looking at all packets emitted and identifying
what kind they are.
2011-06-23 13:41:42 -07:00
Paul Berry
935e7e4126 glsl: Flagged extension EXT_texture3D as "supported" in the builtin compiler.
Previously, the builtins in OES_texture_3D.{frag,vert} were only
compiling properly as a consequence of bug 38015, which allows
unsupported extensions to be enabled.  This fix eliminates the builtin
compiler's reliance on bug 38015, so that bug 38015 can be fixed.
2011-06-23 13:39:47 -07:00
Benjamin Franzke
e9d49d282d st/egl: Fix scons build 2011-06-23 22:23:57 +02:00
Benjamin Franzke
737bd7367e st/egl: Hookup gbm for drm backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
e5fc4c81ce egl_dri2: Hookup gbm as drm platform 2011-06-23 21:07:17 +02:00
Benjamin Franzke
48d4a001b3 gbm: Add gallium (drm) backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
2ff797060d gbm: Add dri backend 2011-06-23 21:07:17 +02:00
Benjamin Franzke
eddcecbf74 Add gbm (generic/graphics buffer manager) 2011-06-23 21:07:17 +02:00
Benjamin Franzke
15d7f1c1c7 st/dri: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
3af3c58dfd intel: Implement DRIimageExtension::dupImage 2011-06-23 21:07:17 +02:00
Benjamin Franzke
5fbbd4c19f dri: Add dupImage to DRIimageExtension 2011-06-23 21:07:17 +02:00
Benjamin Franzke
fa5478c5fe r600g: Add R8G8B8A8_UNORM to evergreen colorswap table
Fixes broken glTexImage2D with format=GL_RGBA since
1a339b6c71

The origin for this behaviour is that r600_is_format_supported
checks only against r600_state_inline.h tables not evergreens.
2011-06-23 21:06:36 +02:00
Marek Olšák
1e5cef96d1 r600g: bump shader input limits 2011-06-23 15:58:49 +02:00
Brian Paul
8a5a28b731 st/wgl: return height, not width for WGL_PBUFFER_HEIGHT_ARB
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38599
2011-06-23 06:54:53 -06:00
Benjamin Franzke
87c3bb65bb st/egl/wayland: Take resize parameters only if size changes
This matches what we do in egl_dri2, and clients should
behave like this anyway.
2011-06-23 12:17:48 +02:00
Chia-I Wu
7587c140cd st/mesa: use a helper for st_framebuffer creation
In st_api_make_current, we would like to reuse the exising
st_framebuffer if possible.  Use a helper function to make the code
clearer.
2011-06-23 10:36:00 +09:00
Stéphane Marchesin
1a339b6c71 st/mesa: prefer native texture formats when possible.
If possible, we want to match the hardware format to what the app uses. By
doing so, we avoid the need for pixel conversions and therefore greatly speed
up texture uploads.
2011-06-22 17:02:21 -07:00
Stéphane Marchesin
98ce1373e4 i915g: Add draw point sprites.
It's not that much work; hopefully blend func separate also works and we get GL 2.0 for real.
2011-06-22 16:51:02 -07:00
Stéphane Marchesin
468c2c0841 i915g: Fix comment.
Reported-by: Marcin Baczynski <marbacz@gmail.com>
2011-06-22 16:47:36 -07:00
Stéphane Marchesin
465183c6ae i915g: Support more texture and render target formats. 2011-06-22 16:44:54 -07:00
Alex Deucher
5ff22ab229 r600c: add missing bank tiling case for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:38:29 -04:00
Alex Deucher
c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Michel Dänzer
eb2c9b5814 r600g: Fix use of uninitialized local variable extra_size.
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=38566 .
2011-06-22 16:23:36 +02:00
Thierry Vignaud
76bd1c1818 mesa: add missing DRI Makefiles to tarball
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-22 08:22:02 -06:00
Brian Paul
9786688672 mesa: comments and 80-column wrapping 2011-06-22 08:12:10 -06:00
Brian Paul
3c95ff209f mesa: update comments in update_program_enables() 2011-06-22 08:12:10 -06:00
Brian Paul
79dddedfd1 mesa: update/fix comments in update_program() 2011-06-22 08:12:10 -06:00
Brian Paul
f3f080e526 mesa: update comment for gl_texture_unit 2011-06-22 08:12:10 -06:00
Marcin Slusarz
50d7d03a79 xorg/nouveau: blacklist all pre NV30 cards
Bail out early in probe, so other driver can take control of the card.
Doing it in screen_create would be too late.
2011-06-22 12:35:40 +02:00
Andre Maasikas
63e8cda9f1 r600c: use BASE_VTX_LOC & AUTO_INDEX for drawing nonindexed with offset
Saves cmd buffer space as we were generating indexes into cs  in this case.
This was laying around in https://bugs.freedesktop.org/show_bug.cgi?id=32768
for a long time.
2011-06-22 12:40:12 +03:00
Alex Deucher
21972c85ea r600g: fix fbo depth/stencil texture allocation for evergreen+
evergreen+ stores depth and stencil separately so when we
allocate a depth/stencil fbo, make sure we allocate enough
memory for both depth and stencil buffers.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-21 17:32:42 -04:00
Chad Versace
3db27d4a4a intel: Allocate s8_z24 non-texture renderbuffers when using separate stencil
Now all infrastructure is in place to support s8_z24 non-texture
renderbuffers for gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:22:05 -07:00
Chad Versace
36e05c6870 intel: Unobfuscate intel_alloc_renderbuffer_storage
Hiz buffer allocation can only occur if the 'else' branch has been taken,
so move the hiz buffer allocation into the 'else' branch.

Having the hiz buffer allocation dangling outside of the if-tree was just
damn confusing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
39d0e3632a intel: Add fields to intel_renderbuffer for unwrapping packed depth/stencil buffers
Add the following fields:
    intel_renderbuffer.wrapped_depth;
    intel_renderbuffer.wrapped_stencil

If the intel_context is using separate stencil and the renderbuffer has
a packed depth/stencil format, then wrapped_depth and wrapped_stencil are
the real renderbuffers.

Alter the following functions to accomodate the wrapped buffers:
    intel_delete_renderbuffer
    intel_draw_buffer
    intel_get_renderbuffer
    intel_renderbuffer_map
    intel_renderbuffer_unmap

Subsequent commits allocate renderbuffer storage for wrapped_depth and
wrapped_stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Chad Versace
23ed3b90c7 intel: Unconditionally enable support for S8_Z24 texture format
Commit b5c847c7ca erroneously disabled
support for S8_Z24 texture format when the context required separate
stencil (intel_context.must_use_separate_stencil).

But the GL spec requires implementations to support GL_DEPTH24_STENCIL8.
So we better find a way to fake it...

From page 180 (196 of pdf) of the OpenGL 3.0 spec:
    In addition, implementations are required to support the following
    sized internal [texture] formats.

    [...]

    - Combined depth+stencil formats: DEPTH32F_STENCIL8 and and
      DEPTH24_STENCIL8.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-21 11:21:57 -07:00
Benjamin Franzke
0cb356dd5c egl_dri2/wayland: Hook up new buffer.release event 2011-06-21 13:11:43 -04:00
Benjamin Franzke
8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Benjamin Franzke
0c74091591 st/mesa: Invalidate drawables on context switch 2011-06-21 15:09:55 +02:00
Dave Airlie
e251b3903a r600g: use maths instead of a loop to work out mask.
This is equivalent results with less looping.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 15:18:44 +10:00
Dave Airlie
59a402cecd r600g: optimise draw vbo function a bit more.
this drop a bunch of unnecessary checks (i.e. should be trapped
at gallium level), and also removes the switch statement in favour
of some calculated values for the vgt values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 14:20:49 +10:00
Pierre-Eric Pelloux-Prayer
abe74a9820 r600g: reorder LIT instructions to support src == dst
the attached patch should be an improvement over Vadim Girlin's patch
fixing LIT instruction for r600g (commit
2fe39b46e7).

Instructions used in tgsi_lit have been reordered to always write to a
dst channel after the same channel in src has been read (so if src ==
dst, input values are not overwritten before being used).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-21 12:50:44 +10:00
Ben Skeggs
4112ca54e3 nvfx: nasty hack to make glFinish() actually finish..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-21 12:59:53 +10:00
Stéphane Marchesin
75be6b76ee glx: Fix compile. 2011-06-20 17:19:00 -07:00
Stéphane Marchesin
649d03d54d st/mesa: Remove unneeded texture format terminators.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-20 18:15:50 -06:00
Brian Paul
bc60a7515a st/mesa: put const qualifer on format_map table 2011-06-20 18:15:50 -06:00
Jeremy Huddleston
4fbdde889c glx: Bind to our context before __glXSetCurrentContext
We want to bind to our context before calling __glXSetCurrentContext or
messing with the gc rect in order to properly handle error conditions.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
517614141b glx: Destroy the old context only after the new one has been bound
This fixes a regression introduced by 49d7e48b33

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston
fbd7448977 glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT
FramebufferTextureLayer is an alias of FramebufferTextureLayerEXT, so
FramebufferTextureLayerARB needs to be listed as an alias of
FramebufferTextureLayerEXT rather than FramebufferTextureLayer.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Ian Romanick
de77324d8f linker: Reject shaders that use too many varyings
Previously it was up to the driver or later code generator to reject
these shaders.  It turns out that nobody did this.

This will need changes to support geometry shaders.

NOTE: This is a candidate for the stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37743
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 15:01:10 -07:00
Dan Nicholson
4e5c51a05e glw: Mark all extern symbols GLAPI to regain default visibility (#31294)
Since switching to hidden visibility on gcc, GLw apps were failing to
link. Use the GLAPI definition to use default visibility where necessary.

$ nm lib/libGLw.so | grep DrawingArea
0000000000004020 T GLwCreateMDrawingArea
0000000000003430 T GLwDrawingAreaMakeCurrent
0000000000003410 T GLwDrawingAreaSwapBuffers
0000000000204c60 D glwDrawingAreaClassRec
0000000000204d48 D glwDrawingAreaWidgetClass
00000000002053c0 D glwMDrawingAreaClassRec
00000000002054e0 D glwMDrawingAreaWidgetClass

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Tested-by: justin <jlec@gentoo.org>
2011-06-20 12:31:01 -07:00
Eric Anholt
f6e5230b26 i965/gen6: Apply documented workaround for nonpipelined state packets.
Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-20 08:42:16 -07:00
Eric Anholt
0ab7d6f437 i965/gen6: Limit the workaround flush to once per primitive.
We're about to call this function in a bunch of state emits, so let's
not spam the hardware with flushes too hard.
2011-06-20 08:37:43 -07:00
Eric Anholt
dfada714f8 i965/gen6: Use an BO instead of writing to address 0 for PIPE_CONTROL W/A.
This was spectacularly unsafe.  On my system, address 0 happens to be
the hardware status page for the render ring, and the first quadword
of that happens to contain nothing we ever look at, but I sure didn't
look forward to having to debug some day when, for example, the kernel
happened to bind the ringbuffer before binding the hwsp.
2011-06-20 08:37:43 -07:00
Eric Anholt
8f9e8d79c8 i965/gen6: Factor the PIPE_CONTROL workaround to a separate function.
We're need this workaorund a lot more than we're currently doing, so
let's reuse it.
2011-06-20 08:37:43 -07:00
Eric Anholt
911768700e i965/gen6: Remove state flagging on BRW_NEW_CURBE_OFFSETS.
That flag was leftover from gen4, where brw_curbe.c is choosing ranges
of the CURBE space for constants to live in, and the unit state tells
where to load them from.  That's not the case on gen6 -- we don't set
this flag (since constants aren't in the URB), nor do we have any
state like that to upload.
2011-06-20 08:37:43 -07:00
Eric Anholt
c860f48f11 i965/gen4: Remove old VS unit state key structure.
We're streaming VS state out now, not caching it.
2011-06-20 08:37:42 -07:00
Eric Anholt
7d4d608240 i965/gen6: Add missing state flag for VS push constants.
It was already annotated up above and everything.
2011-06-20 08:37:42 -07:00
Eric Anholt
b46dc45cee i965/gen6+: Correct gratuitous dependency on NEW_POLYGONSTIPPLE.
That flag is for the contents of the stipple, not the enable flag.
2011-06-20 08:37:42 -07:00
Eric Anholt
416a698b3c i965/gen6+: Add a missing state flag for WM constants. 2011-06-20 08:37:42 -07:00
Kristian Høgsberg
16a04e019d wayland: Pass use_invalidate extension to driver 2011-06-20 11:05:26 -04:00
Benjamin Franzke
80636ff2da egl_dri2/x11: Check availability of the dri2 extension
Do this before query versions, or xcb will shutdown
and the connection can not be used for swrast.
2011-06-20 10:06:24 -04:00
Chia-I Wu
8eea050f5a docs: update EGL for changed configure options 2011-06-20 11:19:16 +09:00
Chia-I Wu
66c71d150a configure.ac: remove deprecated EGL options 2011-06-20 11:19:16 +09:00
Marcin Slusarz
c772d4e6f3 xorg/nouveau: rename to nouveau2
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:29:28 +02:00
Marcin Slusarz
a97b40a886 st/xorg: initialize drm_mode.type
it's uninitialized, but used by kernel (drm_mode_setcrtc -> drm_mode_set_crtcinfo)

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:28:02 +02:00
Marcin Slusarz
21c0556b61 st/xorg: add GALLIUM_AUXILIARIES to target dependencies
Without it changes to GALLIUM_AUXILIARIES don't induce target rebuild

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-06-20 02:26:53 +02:00
Marcin Slusarz
2f6a9687cf gallium/nouveau: remove unused nouveau_screen_bo_user 2011-06-20 02:23:12 +02:00
Marcin Slusarz
fe20edf959 st/xorg: fix crash triggered by rendercheck -t composite -f a8r8g8b8 -o Src, Saturate
samplers[0] may remain uninititialized if src picture/pixmap is null
2011-06-20 02:20:26 +02:00
Marcin Slusarz
54d1b718b8 st/xorg: fix crash triggered by rendercheck -t blend -f a8r8g8b8 -o Clear 2011-06-20 02:11:12 +02:00
Marek Olšák
badf0335ef r600g: implement seamless_cube_map on r600-r700
st/mesa guarantees that all bound sampler states have the same value
in seamless_cube_map.
2011-06-20 00:19:07 +02:00
Marek Olšák
9bcce02f47 r600g: remove some magic numbers 2011-06-19 23:28:33 +02:00
Marek Olšák
1251e1df0f configure.ac: add back --enable-gallium-egl 2011-06-19 21:15:55 +02:00
Cyril Brulebois
9ba2907f2e configure.ac: Avoid running llvm-config when it hadn't been checked for.
If --disable-gallium is passed, llvm-config isn't checked for, so mark
it explicitly as absent, through LLVM_CONFIG=no.

Passing --disable-gallium would result in:
| ../configure: line 9739: --version: command not found
| ../configure: line 9740: --cppflags: command not found
| ../configure: line 9741: --libs: command not found
| ../configure: line 9743: --ldflags: command not found

With this commit, one gets that instead:
| configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-06-19 21:15:55 +02:00
Marek Olšák
0c7c5b6876 configure.ac: build r600g by default
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:52 +02:00
Marek Olšák
58b6a19ea4 configure.ac: add option --with-gallium-drivers=DIRS
This removes all the --enable-gallium-$driver options and --disable-gallium.

Gallium can be disabled by --with-gallium-drivers= (without parameters).

Default is:
--with-gallium-drivers=r300,swrast

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:48 +02:00
Marek Olšák
440d71db78 configure.ac: remove --with-state-trackers
There is an obvious redundancy:

--with-driver=dri VS --with-state-trackers=dri
--with-driver=xlib VS --with-state-trackers=glx
--enable-openvg VS --with-state-trackers=vega
--enable-egl VS --with-state-trackers=egl

This patch adds two new options for the remaining state trackers:
--enable-xorg
--enable-d3d1x

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:15:45 +02:00
Marek Olšák
ad50abbac9 configure.ac: remove redundant option --enable-gallium-egl
We already have --enable-gallium, --enable-egl, and --with-state-trackers=egl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-19 21:13:57 +02:00
Marek Olšák
d1f66a9424 u_vbuf_mgr: make u_vbuf_mgr_draw_begin return flags in a bitmask 2011-06-19 21:09:18 +02:00
Marek Olšák
8623c68aec r600g: fix warning: assignment discards qualifiers from pointer target type 2011-06-19 21:09:18 +02:00
Marek Olšák
0d58723cde u_vbuf_mgr: fix uploading if format size is greater than stride 2011-06-19 21:09:18 +02:00
Kenneth Graunke
dd3b812962 i965: Enable extension GL_ARB_shader_texture_lod.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36987

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:54:01 -07:00
Kenneth Graunke
6430df3773 i965/fs: Add support for TXD with shadow comparisons.
Our hardware doesn't have a sample_d_c message, so we have to do a
regular sample_d and emit instructions to manually perform the
comparison.

This requires a state dependent recompile whenever the sampler's compare
mode or function change.  This adds the per-sampler comparison functions
to brw_wm_prog_key, but only sets them when the sampler's compare mode
is GL_COMPARE_R_TO_TEXTURE (i.e. only for shadow sampling).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:57 -07:00
Kenneth Graunke
01fa9addf4 i965/fs: Refactor texture result swizzling into a helper function.
The next patch will add a few additional uses.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:55 -07:00
Kenneth Graunke
f1622cfe9c i965/fs: Move sampler fetch to the top of the ir_texture visit function.
This makes it available earlier, which will soon be necessary.
(Separating code motion from actual changes.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:53 -07:00
Kenneth Graunke
6c947cfd19 i965/fs: Add support for non-shadow textureGrad (TXD) on gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:52 -07:00
Kenneth Graunke
2f4a4b943f i965/fs: Add support for non-shadow textureGrad (TXD) on gen5/6.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:50 -07:00
Kenneth Graunke
3fa910fff9 i965/fs: Add support for non-shadow textureGrad (TXD) on Ivybridge.
This is somewhat ugly, but I couldn't think of a nicer way to handle the
interleaved coordinate/derivative parameter loading.

Ironlake and Sandybridge will still hit an assertion in visit().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:47 -07:00
Kenneth Graunke
ad9481e128 i965/fs: Check for compilation failure and bail before optimizing.
Prior to this patch, it would attempt to optimize and allocate registers
for the program even if it failed to compile.  This seems wasteful.

More importantly, the "message length > 11" failure seems to choke the
instruction scheduler, making it somehow use an undefined value and
segmentation fault.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-18 17:53:24 -07:00
Eric Anholt
c173541d97 i965: Use state streaming on programs, and state base address on gen5+.
There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6).  No statistically significant performance difference
on nexuiz (n=5).
2011-06-18 16:00:45 -07:00
Eric Anholt
962dab9486 i965: Only flag the new-batch related state as dirty at new batch time.
This was debug code from the initial import of the driver.  No
statistically significant performance difference on cairo-gl or
nexuiz (n=6).
2011-06-18 16:00:45 -07:00
Eric Anholt
6f998b58bc mesa: Fix render-to-texture regression.
Accidentally introduced in fc8c4a3a7b.
Fixes fbo-drawbuffers-maxtargets and friends.
2011-06-18 15:59:00 -07:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Eric Anholt
a5a36d9b15 i965: Don't try to continue space before the start of a VBO.
This loop is trying to see if all the buffers to be uploaded happen to
be the same increment from the start of the 3DSTATE_VERTEX_BUFFERS
currently loaded in the hardware.  However, we might be at a smaller
offset than the previous set of VERTEX_BUFFERS, so we can't reuse
because that packet made the first entry be its starting offset (you
can't access outside the given bounds).

Fixes piglit ARB_vertex_buffer_object/elements-negative-offset.
2011-06-18 15:20:36 -07:00
Eric Anholt
5c2c60175d i965: Add missing state flag for vertex elements on current VS program.
Fixes a missing 3DSTATE_VERTEX_ELEMENTS on topogun.trace.
2011-06-18 15:20:35 -07:00
Marek Olšák
a4f4e24f07 r300g: rename AOS -> VARRAYS 2011-06-18 21:09:08 +02:00
Marek Olšák
7df7eaf845 r300g: fix handling PREP_* options
This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
2011-06-18 21:09:08 +02:00
Vadim Girlin
2fe39b46e7 r600g: fix LIT to handle src==dst properly
Current LIT implementation uses dst components for storing temp
results, possibly overwriting still needed values (depends on the
swizzles).
This patch uses temp reg for one of such cases (found in etqw) and
fixes "LIT R.z, R.xyzz".

Tested on evergreen. Fixes some etqw-demo rendering glitches when
"Lighting" is set to "High" in the settings.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:03:04 +10:00
Vadim Girlin
8ab1c5328b r600g: fix RSQ to use abs value of operand on evergreen
fixes https://bugs.freedesktop.org/show_bug.cgi?id=36917

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 16:01:03 +10:00
Vadim Girlin
a916d4279a r600g: fix source box in r600_resource_copy_region
Source box needs to be adjusted for blitting from compressed formats.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-18 15:45:59 +10:00
Brian Paul
753660780a mesa: allow depth texture arrays
The GL_EXT_texture_array spec allows this (Section 3.8.1).
Fixes failing piglit fbo-depth-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-06-17 13:44:59 -06:00
Brian Paul
da5c852d63 st/mesa: remove unneeded test for GL_TRUE 2011-06-17 13:44:59 -06:00
Brian Paul
15750d89b9 st/mesa: remove redundant _mesa_is_depth_format() call
The _mesa_is_depth_or_stencil_format() call covers all depth
format cases too.
2011-06-17 13:44:59 -06:00
Brian Paul
3ea6fdfdf1 st/mesa: remove trailing whitespace in st_format.c 2011-06-17 13:44:59 -06:00
Brian Paul
befaab8fa1 st/mesa: move comment for ChooseTextureFormat() to right place 2011-06-17 13:44:59 -06:00
Jeremy Huddleston
cb5a5f055b apple: Use apple_cgl_get_dl_handle() rather than opening a new handle
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-17 12:20:57 -07:00
José Fonseca
10562fbc5c scons: List all targets. 2011-06-17 20:13:16 +01:00
José Fonseca
ef4bf40db0 scons: Remember the options set on the command line.
Save them in config.py
2011-06-17 20:13:16 +01:00
José Fonseca
c9be435c79 scons: Don't list MSVS_VERSION option outside windows platforms. 2011-06-17 20:13:16 +01:00
José Fonseca
d6a0fe19e8 scons: Correct glapi USE_xxx_ASM flags. 2011-06-17 20:13:16 +01:00
José Fonseca
c7bd0fa485 scons: Accept verbose=yes instead of quiet=no.
'verbose' is affirmative, and much more common name for this sort of option.
2011-06-17 20:13:16 +01:00
Stéphane Marchesin
bf69ce37f0 glx: implement drawable refcounting.
The current dri context unbind logic will leak drawables until the process
dies (they will then get released by the GEM code). There are two ways to fix
this: either always call driReleaseDrawables every time we unbind a context
(but that costs us round trips to the X server at getbuffers() time) or
implement proper drawable refcounting. This patch implements the latter.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-06-17 11:20:19 -07:00
José Fonseca
8173471fc2 scons: Move all env setup to scons/gallium.py 2011-06-17 16:41:05 +01:00
José Fonseca
4175010749 scons: make embedding orthogonal to the platform
To enable embedding in platforms other than linux.
2011-06-17 14:50:37 +01:00
Brian Paul
fc8c4a3a7b mesa: use helper functions to distinguish between user/winsys FBOs
And replace IS_CUBE_FACE() macro w/ inline function.
2011-06-16 07:31:58 -06:00
Brian Paul
37e6ab7b2d mesa: refactor, create _mesa_update_draw_buffers() helper
Move this code out of _mesa_make_current() and put it into a
helper function.
2011-06-16 07:31:58 -06:00
Brian Paul
2960526816 mesa: updated comments in _make_current() 2011-06-16 07:31:58 -06:00
Vadim Girlin
016621ee14 r600: fix SPI inputs setup on r600/r700
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-16 15:23:06 +10:00
Chad Versace
8875dd5871 intel: Fix typo in intel_offset_S8 comments
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:50:45 -07:00
Chad Versace
d105f6684d i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer
When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
    fbo-alphatest-nocolor
    fbo-depth-sample-compare
    fbo
    hiz-depth-read-fbo-d24-s0
    hiz-depth-stencil-test-fbo-d24-s0
    hiz-depth-test-fbo-d24-s0
    hiz-stencil-read-fbo-d0-s8
    hiz-stencil-test-fbo-d0-s8
    fbo-missing-attachment-clear
    fbo-clear-formats
    fbo-depth-*

Changes piglit test result from crash to fail:
    hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-15 15:47:59 -07:00
Marek Olšák
6f243ec25d r600g: disable render condition for some blitter operations 2011-06-15 15:24:37 +02:00
Mike Kaplinskiy
40aec11b75 r600g: fix TXD src regs needing fetching.
[airlied: final chunk of Mike's patch from bug 37476
this uses a loop to emit the GRADIENTS and does a check to
see if we need to fetch to a temporary register. It also
increases the context src gpr to 4 which is needed here.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Mike Kaplinskiy
6415f25663 r600g: use inlines for some common tex instr setup code.
[airlied: taken from Mike's patch in bug 37476]

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 16:58:40 +10:00
Kenneth Graunke
ef8f6a8c59 glsl/builtins: Actually implement int/ivec variants of abs().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches (and don't forget
      to re-run "make builtins" after cherry-picking.)
2011-06-14 23:41:16 -07:00
Mike Kaplinskiy
de91ea1c06 r600g: fix TXD when shadowing is enabled.
Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:54:21 +10:00
Dave Airlie
13c9a8552b r600g: add TXD support.
This at least passes the piglit arb_shader_texture_lod-texgrad test,
the AMD shader analyzer seems to multiply the V component by an unspecified
constant value no idea why.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-15 15:18:42 +10:00
Brian Paul
34a774797c i915g: add const qualifier to silence warning 2011-06-14 20:47:47 -06:00
Marek Olšák
d9ca94836e r600g: also set TILE_MODE of the base level 2011-06-15 04:16:05 +02:00
Marek Olšák
677a4406d2 r600g: force OpenGL's BASE_LEVEL behavior on r600-r700
This sets the base level as the zero level, which fixes
piglit/texturing/tex-miplevel-selection*.

The r600 hardware ignores the BASE_LEVEL field in some cases, so we can't
use it.

Evergreen might need this too.
2011-06-15 03:39:24 +02:00
Kenneth Graunke
7c7a8a38e5 glsl/generate_builtins.py: Remove regexp to kill pointer addresses.
Commit 56ef62d988
"glsl: Generate readable unique names at print time."
changed ir_print_visitor to not generate @0x1234567 suffixes except
where necessary.  So there's no need to manually remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-14 18:29:48 -07:00
Jeremy Huddleston
1e16c34c5c glapi: _glapi_create_table_from_handle: Set missing pointers to NoOp rather than NULL
This change to _glapi_create_table_from_handle causes it to fill the dispatch
table with NoOps for unimplemented functionality.  This matches what is done
in indirect_init.c and also allows us to enable logging (when built with
-DDEBUG and the MESA_DEBUG or LIBGL_DEBUG environment variables are set) to
catch cases where clients are trying to use these unimplemented extentions.

Additionally, this fixes some gcc -pedantic warnings.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 18:22:01 -07:00
Brian Paul
3751aa4592 st/mesa: fix indentation, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
99feecc7d1 st/mesa: replace st->ctx with ctx 2011-06-14 17:19:53 -06:00
Brian Paul
c1477f6ffe st/mesa: fix comments, whitespace 2011-06-14 17:19:53 -06:00
Brian Paul
cbad86841b docs: 7.10.3 updates 2011-06-14 17:19:53 -06:00
Brian Paul
ee231b30a8 st/mesa: improved is_interleaved_arrays() checking
Check that the difference in array pointers/offsets from the 0th
array are less than the stride, for both VBOs and user-space arrays.
Previously, we were only doing this for the later.

This tightens up the interleaved array test and fixes a problem with
the llvmpipe driver where we were creating way too many vertex fetch
variants only because the pipe_vertex_element::src_offset values were
changing frequently.  This change results in a 5x speed-up for one of
the viewperf tests.

Also, clean up the function to make it easier to understand.
2011-06-14 17:19:53 -06:00
Alex Deucher
24a760e9cb r600c: add tiling support for evergreen+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-14 18:40:37 -04:00
Marek Olšák
7d488ade23 r600g: fix RGB32F texturing 2011-06-14 20:47:57 +02:00
Marek Olšák
df6355512a r600g: fix indentation and comments 2011-06-14 20:37:57 +02:00
Eric Anholt
10e418f381 mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
2011-06-14 11:17:39 -07:00
Eric Anholt
b0c4db68b2 mesa: Remove uncompressed code from generate_mipmaps_compressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
2bfd81df0a mesa: Remove compressed code from generate_mipmaps_uncompressed(). 2011-06-14 11:17:39 -07:00
Eric Anholt
ba55ccd312 mesa: Split _mesa_generate_mipmap along compressed/uncompressed lines.
The path taken is wildly different based on this (do we generate from
a temporary image, or from level-1's data), and we appear to have
stride bugs in the compressed case that are tough to disentangle.

This just duplicates the code for the moment, the followon commit will
do the actual changes.  Only real code change here is handling
maxLevel in one common place.
2011-06-14 11:17:39 -07:00
Eric Anholt
b9fbb9df22 intel: Fix miptree height alignment for compressed NPOT textures.
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.
2011-06-14 11:17:39 -07:00
Eric Anholt
56965aa007 intel: Drop dead preinitialization of align_w, align_h. 2011-06-14 11:17:39 -07:00
Eric Anholt
f94fef83db intel: Drop the cpp argument to intel_miptree_create(). 2011-06-14 11:17:39 -07:00
Eric Anholt
6dcc398ac0 intel: Calculate compress_byte in intel_miptree_create.
One less argument and thing to get wrong.
2011-06-14 11:17:39 -07:00
Eric Anholt
9c5fdbb721 intel: Use the gl_format to get the base_format for miptree create.
One less argument to this insanely long function call.
2011-06-14 11:17:39 -07:00
Eric Anholt
9a523a48af intel: Drop the internal_format field of the mipmap tree.
This has been replaced with the gl_format now.
2011-06-14 11:17:38 -07:00
Eric Anholt
0fac09a87c intel: Make the intel_miptree_match_image format check more specific.
We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen.  We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification.  However, we should be making
consistent decisions for this check anyway.
2011-06-14 11:17:38 -07:00
Eric Anholt
afbe605eff i915: Drop dead argument to translate_texture_format(). 2011-06-14 11:17:38 -07:00
Eric Anholt
4a60b0c8d2 intel: Add block alignment for RGTC textures.
We were using the default 4x2 alignment instead of the 4x4 required
for RGTC textures.
2011-06-14 11:17:26 -07:00
Eric Anholt
d5809115b5 intel: Add the MESA_FORMAT as a field of the miptree.
We only had internal_format before, which is way more irritating to
work with.
2011-06-14 11:15:43 -07:00
Eric Anholt
51ce86b781 intel: Fix 2x2 and 1x1 compressed teximages from _mesa_generate_mipmap()
Generally image uploads to a the region occur at TexImage time, but
that's not the case for fallback _mesa_generate_mipmap(), and in this
path we were forgetting to align the width when dividing height.  We
were just leaving out parts of the compressed block at 2x2 and 1x1
levels.

Fixes gen-compressed-teximage.
2011-06-14 11:15:29 -07:00
Marek Olšák
13dcf3f20d r600g: disable shader_texture_lod until there is driver support 2011-06-14 20:03:04 +02:00
Adam Jackson
130e7ead87 llvmpipe: SSE2 fastpaths for b8g8r8x8 {un,}swizzle
Copy-and-paste from the bgra cases.  The C paths attempt to avoid
copying the 'x' channel, but it's harmless, you might as well.  Good for
about 5% in glxgears (740 to 780 fps).

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-14 11:51:13 -04:00
Christoph Bumiller
a8b9a75b92 nv50: fix copy/paste error in nv50_gmtyprog_validate
Used the vertprog instead of gmtyprog.
2011-06-14 17:15:08 +02:00
Jeremy Huddleston
a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Marek Olšák
c17fb8539f configure.ac: cleanup the gallium-r300 option 2011-06-14 04:11:26 +02:00
Marek Olšák
e823ab1b00 st/xorg: remove unused variable 2011-06-14 03:49:26 +02:00
Marek Olšák
f318a15f45 r600g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
b5b7d2acc6 r300g: do not link with softpipe 2011-06-14 01:45:11 +02:00
Marek Olšák
be2b9bdcee xorg-radeon: rename to xorg-r300 2011-06-14 01:45:11 +02:00
Marek Olšák
63e38bd0f6 target-helpers: remove copy-pasted function inline_noop_helper 2011-06-14 01:45:11 +02:00
Vadim Girlin
9346d895e7 r600g: skip SPI setup for position and face inputs
fixes fdo bug 38145

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Dave Airlie
2743851c1a r600g: move depth texture flushing out of line.
this needs a piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-14 09:17:16 +10:00
Eric Anholt
296e6b9038 meta: Fix glCopyTexImage(GL_LUMINANCE) from non-GL_LUMINANCE source.
glReadPixels() was performing RGB -> L conversion differently from the
glTexImage() style conversion appropriate for glCopyTexImage().

Fixes gles2conform copy_texture.
2011-06-13 15:56:36 -07:00
Eric Anholt
df46eb8ec0 intel: Fix mipmap and format handling of blit glCopyPixels().
Fixes fbo-mipmap-copypix.
2011-06-13 15:56:36 -07:00
Eric Anholt
ef0d548838 intel: Do the drawable x/y offset in intel_renderbuffer_map() for spans.
We were mapping the renderbuffer once, then walking over all the
buffers to map just the texture ones using the other texture mapping
function that handled the x/y offset to the image in the region.  But
then we would go and overwrite *those* mappings with the original
mappings for depth/stencil, which was wrong.

Instead, just walk over the attachments once and map the attachments.
Wasn't that easy?
2011-06-13 15:56:36 -07:00
Eric Anholt
fb60e2061b intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
d29117752f intel: Clean up intel_render_texture with a rename and a helper function.
The "newImage" isn't particularly new -- it might be the same texture
that was attached to the same attachment point before.  This function
also gets called when just rebinding back to an FBO with a texture
attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Eric Anholt
b17aab5753 intel: Move the draw_x/draw_y to the renderbuffer where it belongs.
It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky.  Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-13 15:56:36 -07:00
Brian Paul
4fa01d705f dri: include swrast.h, not s_texrender.h 2011-06-13 16:07:55 -06:00
Jeremy Huddleston
816b8acfe8 glx: Remove check for gc->vtable->destroy
gc->vtable->destroy is always set and is used unconditionally
in other places, so don't bother checking for it first.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston
b44d13e67b glapi: Add check for NULL symbol_prefix in gentable and fix warnings
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:50:37 -07:00
Daniel Vetter
df8d26ec09 i915g: add a few more render target formats
Snatched from xvmc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-13 23:05:43 +02:00
Brian Paul
755f2e2ae5 mesa: move texrender.c to swrast
This stuff is really for software rendering, it's not core Mesa.
A small step toward pushing the FetchTexel() stuff down into swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-13 13:45:39 -06:00
Brian Paul
8852e35e29 vbo: minor simplification in print_draw_arrays() debug function 2011-06-13 13:45:39 -06:00
Brian Paul
e6e1864f1c mesa: move invariant code out of loop in get_tex_rgba() 2011-06-13 13:45:39 -06:00
Mathias Fröhlich
2f0b44f981 r600g: Put shaders into immutable buffers.
Put the shader programs into an immutable buffer object.
Also make sure that those object can be taken from the user
space buffer object pool.
2011-06-13 11:33:20 -04:00
Mathias Fröhlich
b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich
e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Mathias Fröhlich
e2529442e6 r600g: Fix typo.
Fix an obvious typo in the yet unused part of the shader setup.
2011-06-13 11:31:13 -04:00
Pierre-Eric Pelloux-Prayer
92563476e4 r600g: remove useless call to u_upload_flush
No regressions found with :
- piglit (quick.tests)
- Unigine Heaven
- Lightsmark
- openarena
- Imprudence (Second Life fork)

agd5f Note: this patch was previously reverted due to piglit
regressions, but I'm not able to reproduce them here.
See this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=34008
and discussion:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011996.html

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-13 11:26:54 -04:00
Marek Olšák
317247390a st/mesa: rebind vertex arrays if _NEW_BUFFER_OBJECT is dirty
This fixes piglit/vbo-bufferdata. It's a regression in 7.11.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-13 17:03:56 +02:00
Pierre-Eric Pelloux-Prayer
b19d86701e r600g: fixed bo memory leak issue
pipe_resource_reference call was miossing, thus creating massive memory under certain conditions.
Fix : https://bugs.freedesktop.org/show_bug.cgi?id=37168
2011-06-13 10:47:07 -04:00
Chia-I Wu
77b7e1b58f mapi: declare x86_entry_start/end static
x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.
2011-06-13 12:19:47 +08:00
Benjamin Franzke
3e1caf5d26 mapi: Fix tls with shared/es-glapi on x86-64
x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).
2011-06-13 12:19:47 +08:00
Chia-I Wu
982cb36584 wayland-drm: remove depend on "make clean" 2011-06-13 12:19:47 +08:00
Chia-I Wu
77e031a1c4 egl_dri2: try swrastg_dri if swrast_dri fails
Per libGL.
2011-06-13 12:19:39 +08:00
Chia-I Wu
cf69eeacc6 egl_dri2: add dri2_load_driver_swrast
Refactor dri2_load_driver and add dri2_load_driver_swrast for loading
swrast DRI driver.
2011-06-13 11:11:43 +08:00
Benjamin Franzke
16e30276e8 egl_dri2: Compare configs before matching them
This compares attribs like buffer size, and will prevent merging
unequal configs because of match criterion is e.g. ATLEAST.
2011-06-12 08:56:35 -04:00
Benjamin Franzke
a23bf646bd st/eglwayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Benjamin Franzke
b8325fd255 egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY 2011-06-12 08:56:35 -04:00
Jeremy Huddleston
9a00dd9746 apple: Request OpenGL 3.2 from OpenGL.framework if available
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:38 -07:00
Jeremy Huddleston
df1dacf093 apple: Store the CGL API version number for future reference
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 23:43:03 -07:00
Jeremy Huddleston
02b6e97c75 apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 22:54:59 -07:00
Jeremy Huddleston
f35913b96e apple: Use _glapi_create_table_from_handle to initialize our dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Jeremy Huddleston
85937f4c0d glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:

void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle, "gl");

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-11 21:55:01 -07:00
Marek Olšák
837dc61011 r300g: max_anisotropy of 1 is not anisotropic filtering 2011-06-11 23:03:20 +02:00
Daniel Vetter
219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Eric Anholt
4176025d46 i965: Add support for GL_FIXED vertex attributes.
This sadly requires work in the VS to rescale them, because the
hardware doesn't support this format natively.

Fixes arb_es2_compatibility-fixed-type and gtf/fixed_data_type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-10 13:17:10 -07:00
Eric Anholt
20f087863d glsl: Fix incorrect optimization of instructions before discard statements.
The function was named "find_unconditional_discard", but didn't
actually check that the discard statement found was unconditional.
Fixes piglit glsl-fs-discard-04.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 13:17:01 -07:00
Eugeni Dodonov
23ef4a6063 Fix format not a string literal error with -Werror=format-security
A trivial fix for error: format not a string literal and no format
arguments with compiling with -Werror=format-security flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-10 12:20:07 -07:00
Chad Versace
97d230b0bc i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached
If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-10 10:37:30 -07:00
Alex Deucher
eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher
8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Eric Anholt
6861a70177 i965/gen6: Add support for gl_PointCoord.
This is just like PointSprite overrides, but it's always on for that
attribute.

Fixes glsl-fs-pointcoord, gtf/point_sprites.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:54 -07:00
Eric Anholt
f304bb8a5d i965/gen6: Fix point sprite texture coordinate overrides.
We were assuming that the input attribute n to the FS was
FRAG_ATTRIB_TEXn, which happened to be true often enough for our
testcases.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:51 -07:00
Eric Anholt
e7280b16d6 i965/gen6: Refactor SF setup a bit to handle overrides in one place.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-09 08:41:45 -07:00
Marek Olšák
da8b4c0798 r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture
isn't 3D, r300 always samples the border color regardless of texture
coordinates.

I HATE THIS HARDWARE.

NOTE: This is a candidate for the 7.10 branch.
2011-06-09 04:19:03 +02:00
Marek Olšák
466ce95ddf r300g: don't enable aniso with nearest filtering 2011-06-09 04:19:03 +02:00
Dave Airlie
04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Marek Olšák
d56fe67c62 r600g: remove unused variable 2011-06-09 01:34:24 +02:00
Marek Olšák
578d4539ba r300g: fix draw_vbo splitting on r3xx-r4xx
NOTE: This is a candidate for the 7.10 branch.
2011-06-09 01:25:52 +02:00
Marek Olšák
f48412c39f r300g: make translate_primitive table-driven 2011-06-09 01:25:52 +02:00
Roland Scheidegger
d302804deb util: fix strict aliasing issues in u_format_r11g11b10f.h 2011-06-09 01:14:51 +02:00
Roland Scheidegger
c1090f3019 mesa: get rid of homegrown logbase2 implementation in drivers
Some of the logbase2 functions did just the same as _mesa_logbase2,
though they were taking signed numbers (but it shouldn't matter for them).
2011-06-09 01:14:51 +02:00
Roland Scheidegger
da009212fe mesa: fix gcc version check for _mesa_bitcount
The version check was bogus, and only inside a non-gcc block anyway.
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b537f54b3a mesa: use __builtin_clz for logbase2 when available
Also rename to _mesa_logbase2 and move to imports.h to keep the ugly
ifdef GNUC stuff outside other files (also to allow reuse).
2011-06-09 01:14:50 +02:00
Roland Scheidegger
b3d5822e93 util: add gcc version check for builtins
Looks like only next_power_of_two, logbase2 and bitcount use builtins
requiring gcc 3.4, so maybe everything else compiles with older gcc.
2011-06-09 01:14:50 +02:00
Benjamin Bellec
894db40f12 util: better logbase2/next_power_of_two implementations
Use __builtin_clz when available for logbase/next_power_of_two,
and replace next_power_of_two with faster implementation otherwise.
2011-06-09 01:14:50 +02:00
José Fonseca
9f865646f1 glx/xlib: Handle glXCreateContextAttribsARB in glXGetProcAddress. 2011-06-08 22:53:27 +01:00
Kenneth Graunke
4ef8464068 i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2

Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
acf82657f4 i965/gen7: Enable SIMD16 fragment shader dispatch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
2a63807616 i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.
According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
626440add5 i965/gen7: Program stencil buffers on Ivybridge.
Thanks to Chad's hard work implementing separate stencil and HiZ
support, this is entirely straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:51:11 -07:00
Kenneth Graunke
53b53a141e i965/gen7: Add a prepare_depthbuffer function.
We need to call add_validated_bo to do proper aperture space accounting.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:50:38 -07:00
Kenneth Graunke
a00ca90815 i965/gen7: gen7_emit_depthbuffer needs the _NEW_DEPTH dirty bit.
For ctx->Depth.Mask.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:12 -07:00
Kenneth Graunke
bd265201da i965/gen7: Remove stencil renderbuffer from gen7_depth_format.
Since Gen7 doesn't support packed depth/stencil, the stencil buffer
can't possibly be relevant for determining the depth format.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-08 14:31:04 -07:00
Brian Paul
e37e196151 st/mesa: more helpful debug message in destroy_program_variants_cb() 2011-06-08 15:15:07 -06:00
Brian Paul
2d22186ca8 svga: fix typos, update comments 2011-06-08 15:08:19 -06:00
Jeremy Huddleston
3b23cf43a4 glx: Remove some GLX_USE_APPLEGL guards around glapi
Now that we're using glapi, we don't need some GLX_USE_APPLEGL ifdef-foo

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 12:03:10 -07:00
Jeremy Huddleston
1b90d7d36b darwin: Use -fvisibility=hidden to set default symbol visibility
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:47:00 -07:00
Jeremy Huddleston
2835c5112d darwin: mklib: Make the real file match the id
This makes mesa more consistent with glibtool and XCode where the
generated file matches the dylib id rather using an extra symlink

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-08 11:24:26 -07:00
Chad Versace
aea2236af6 intel: Request DRI2 buffers for separate stencil and hiz
When it is sensible to do so,
    1) intelCreateBuffer() now attaches separate depth and stencil
       buffers
       to the framebuffer it creates.
    2) intel_update_renderbuffers() requests for the framebuffer
       a separate stencil buffer (DRI2BufferStencil).

The criteria for "sensible" is:
    - The GLX config has nonzero depth and stencil bits.
    - The hardware supports separate stencil.
    - The X driver supports separate stencil, or its support has not yet
      been determined.

If the hardware supports hiz too, then intel_update_renderbuffers()
also requests DRI2BufferHiz.

If after requesting DRI2BufferStencil we determine that X driver did not
actually support separate stencil, we clean up the mistake and never ask
for DRI2BufferStencil again.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
f4efb7ff4f intel: Add assertions to intelCreateBuffer()
Assert that the GLX config has an expected depth/stencil bit combination:
one of d24/s8, d16/s0, d0/s0. These are the only depth/stencil
configurations that we advertise.

Remove the check for software stencil, because given the assertions'
constraints the check always fails.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
89d34cfd3e intel: Refactor intel_update_renderbuffers()
Extract the code that queries DRI2 to obtain the DRIdrawable's buffers
into intel_query_dri2_buffers_no_separate_stencil().

Extract the code that assigns the DRI buffer's DRM region to the
corresponding renderbuffer into
intel_process_dri2_buffer_no_separate_stencil().

Rationale
---------
The next commit enables intel_update_renderbuffers() to query for separate
stencil and hiz buffers. Without separating the separate-stencil and
no-separate-stencil paths, intel_update_renderbuffers() degenerates into
an impenetrable labyrinth of if-trees.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
84294fe26c intel: Add function intel_renderbuffer_set_hiz_region()
It's the analog of intel_renderbuffer_set_region(), but for the hiz region
of course.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
beb8b7da20 intel/intel_context.c: Remove unused functions
Remove functions intel_override_hiz() and
intel_override_separate_stencil(). They are now located in intel_screen.c.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
6b2bf272ee intel: Add flags to intel_screen for hiz and separate stencil
Add the fields below to intel_screen. The expression in parens is the
value to which intelInitScreen2() currently sets the field.
    GLboolean hw_has_separate_stencil      (true iff gen >= 7)
    GLboolean hw_must_use_separate_stencil (true iff gen >= 7)
    GLboolean hw_has_hiz                   (always false)
    enum intel_dri2_has_hiz dri2_has_hiz   (INTEL_DRI2_HAS_HIZ_UNKNOWN)

The analogous fields in intel_context now inherit their values from
intel_screen.

When hiz and separate stencil become completely implemented for a given
chipset, then the respective fields need to be enabled.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
df9f533c67 intel: Define enum intel_dri2_has_hiz
... which indicates if the X driver supports DRI2BufferHiz and
DRI2BufferStencil.

I'm placing this in its own commit due to the large comment block.

CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
4501a5d6e8 dri2: Add token for DRI2BufferHiz
CC: Ian Romanick <idr@freedesktop.org>
CC: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:40 -07:00
Chad Versace
ff99103c0a intel: Define span functions for S8 renderbuffers
Since the stencil buffer is interleaved, the generic Mesa renderbuffer
accessors do not suffice. Custom span functions are necessary.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chad Versace
2abc8cae87 i965/brw: Emit state for hiz and separate stencil buffers
When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-08 10:06:39 -07:00
Chia-I Wu
6b492d0976 st/egl: set EGL_ALPHA_MASK_SIZE 2011-06-09 00:23:24 +08:00
Chia-I Wu
4bb748b609 mesa: merge glapidispatch.h into dispatch.h
glapidispatch.h was located in glapi and shared with mesa core.  Because
the way it was shared, mesa core must include it indirectly via
main/dispatch.h.

Now that it is no longer needed by glapi and is located in core mesa,
merging it with main/dispatch.h to avoid wrong uses.
2011-06-08 23:19:01 +08:00
Chia-I Wu
0dc45374f2 mesa: fix function remapping for dlist
glapidispatch.h should not be included directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36282
2011-06-08 23:18:57 +08:00
Chia-I Wu
fed482f5e3 mesa: fix GLES remap table setup again
Generate different glapidispatch.h's for GL and GLES.  For GLES, we want
a local remap table.

This reverts commit 5af46e8360.  The
commit will break GL remap table setup when main/glapidispatch.h is
regenerated.
2011-06-08 23:17:57 +08:00
Alex Deucher
fe3a343441 r600g: fix mixup in GPR resource reg setup
GLOBAL_GPR regs should be 0.  Need to set the
number of temp regs in SQ_GPR_RESOURCE_MGMT_1.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-08 10:50:18 -04:00
Brian Paul
7c2847a972 vbo: run 'indent' on vbo_save_api.c 2011-06-08 08:05:41 -06:00
Brian Paul
9404835ccd mesa: add include/c99/*.h files to tarballs
See https://bugs.freedesktop.org/show_bug.cgi?id=36238

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1733d16de vbo: rename DO_FALLBACK -> dlist_fallback 2011-06-08 08:05:41 -06:00
Brian Paul
62811057f4 vbo: remove node->count > 0 test in vbo_save_playback_vertex_list()
See piglit dlist-fdo31590.c test and
http://bugs.freedesktop.org/show_bug.cgi?id=31590

In this case we had node->prim_count=1 but node->count==0 because the
display list started with glBegin() but had no vertices.  The call to
glEvalCoord1f() triggered the DO_FALLBACK() path.  When replaying the
display list, the old condition basically no-op'd the call to
vbo_save_playback_vertex_list call().  That led to the invalid operation
error being raised in glEnd().

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
f1cdce95f6 vbo: check array indexes to prevent negative indexing
See the piglit dlist-fdo31590.c test

NOTE: This is a candidate for the 7.10 branch.
2011-06-08 08:05:41 -06:00
Brian Paul
a25271fcb8 st: use _mesa_is_bufferobj() 2011-06-08 08:05:41 -06:00
Brian Paul
d329b68f35 vbo: added a comment 2011-06-08 08:05:41 -06:00
Brian Paul
713fb50759 gallium: fix comments for pipe_stream_output_state 2011-06-08 08:05:40 -06:00
Brian Paul
3d75c42bbf mesa: remove old comment 2011-06-08 08:05:40 -06:00
Brian Paul
f9c2feb96b mesa: add more sampler types to is_sampler_type() 2011-06-08 08:05:40 -06:00
Brian Paul
5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Brian Paul
f6572017b9 draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)
Previously, we were errantly drawing some interior edges of clipped
polygons and quads.  Also, we were introducing extra edges where
polygons intersected the view frustum clip planes.

The main problem was that we were ignoring the edgeflags encoded in
the primitive header's 'flags' field which are set during polygon/quad
->tri decomposition.  We need to observe those during clipping.  Since
we can't modify the existing vert's edgeflag fields, we need to store
them in a parallel array.

Edge flags also need to be handled differently for view frustum planes
vs. user-defined clip planes.  In the former case we don't want to draw
new clip edges but in the later case we do.  This matches NVIDIA's
behaviour and it just looks right.

Finally, note that the LLVM draw code does not properly set vertex
edge flags.  It's OK on the regular software path though.
2011-06-08 08:05:40 -06:00
Jeremy Huddleston
0e8d045bf8 osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3a71f880d2 apple: Update dispatch table to current OpenGL specs
This updates the apple dispatch table to match the current glapi.
Aliases are still not handled very well.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:37 -07:00
Jeremy Huddleston
3871e74733 apple: Dead code removal
Now that we're using glapi, all of this is no longer needed.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
e157f381f2 apple: Remove apple_glx_get_proc_address
Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:36 -07:00
Jeremy Huddleston
7d215e7c4d apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch.  In this implementation, two dispatch tables are created:

__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used.  It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework

The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.

This is a good step towards supporting both indirect and direct rendering
on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Jeremy Huddleston
88cec59170 apple: Rename __gl_api to __ogl_framework_api
In starting the migration to using mapi, rename __gl_api to
__ogl_framework_api since it is a vtable for OpenGL.framework

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 23:06:35 -07:00
Dave Airlie
19b9e523c5 r600g: missed one line in eg dyn gpr fallback.
need more sleep or something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:53:11 +10:00
Dave Airlie
9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
190bfea2de r600g: condition evergreen dyn gpr resource management
So only with kernel version 2.7 can this work, thanks to Alex
for pointing that out. Also add a workaround for a hw bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie
e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie
c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie
f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie
a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie
745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie
e66053d01c r600g: take alpha ref update out of line.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie
4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie
e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Ian Romanick
bb4758669c mesa: Ignore blits to/from missing buffers
The EXT_framebuffer_object spec (and later specs) say:

     "If a buffer is specified in <mask> and does not exist in both
     the read and draw framebuffers, the corresponding bit is silently
     ignored."

Check for color, depth, and stencil that the source and destination
FBOs have the specified buffers.  If the buffer is missing, remove the
bit from the blit request mask and continue.

Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and
fixes 'fbo-missing-attachment-blit es2 from'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Ian Romanick
7f9c17aaa8 mesa: Don't try to clear a NULL renderbuffer
In an ES2 context (or if GL_ARB_ES2_compatibility) is supported, the
framebuffer can be complete with some attachments be missing.  In this
case the _ColorDrawBuffers pointer will be NULL.

Fixes the crash in piglit test fbo-missing-attachment-clear.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>

NOTE: This is a candidate for the stable branches.
2011-06-07 18:29:52 -07:00
Nicolas Kaiser
1d71bbed3b mga: enable GL_ARB_vertex_array_object extension
Tested on a Matrox G550 AGP.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-07 16:32:30 -06:00
Benjamin Franzke
ac3c2c8ece egl_dri2: Add missing header 2011-06-07 17:59:16 -04:00
Benjamin Franzke
3b11d67ef6 egl_dri2: Add missing license 2011-06-07 17:58:59 -04:00
Benjamin Franzke
ec2b08de77 egl_dri2: Use libudev only if available
Broken since 7f881c43df.
2011-06-07 17:58:47 -04:00
Pierre-Eric Pelloux-Prayer
bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

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

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher
5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher
7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Marek Olšák
d7111353bd r300g: consolidate deducing chipset info
Use the new PCI ID table, make it simpler.
2011-06-07 21:02:52 +02:00
Marek Olšák
4123131f3c r300_pci_ids: set families to match r300g 2011-06-07 21:02:52 +02:00
Marek Olšák
eaae63b715 r600g: add missing r300 families
Wondering why r600g needs to include r300_pci_ids.h
2011-06-07 21:02:52 +02:00
Eric Anholt
6d894f68af intel: Update intel-decode.c from intel-gpu-tools. 2011-06-07 11:44:11 -07:00
Eric Anholt
23b6f9606d intel: Implement glFinish() correctly by waiting on all previous rendering.
Before, we were waiting for (most of) the current framebuffer to be
done, which is not quite the same thing.
2011-06-07 10:46:04 -07:00
Jeremy Huddleston
6ea70600b9 darwin: Fix VG_LIB_GLOB to also match the unversioned symlink
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Jeremy Huddleston
cebdffaa2a darwin: Don't link against libGL when building libOSMesa
Everything should be resolved through glapi.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07 13:27:42 -04:00
Marek Olšák
ed0e4bb4c1 r300_pci_ids: add missing 4B48
Found in r300_chipset.h.
2011-06-07 18:45:23 +02:00
Benjamin Franzke
42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
6b82193677 radeon: Use pciid list to generate PCI_CHIP_<FAMILY>_<ID> defines
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
a433755ec5 targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke
7f881c43df egl_dri2: Use external driver pci list
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
88fd16d548 Add radeon pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Benjamin Franzke
09f83ce4da Add intel pci id lists
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:19 -04:00
Brian Paul
681ed756c0 tgsi: s/varient/variant/ 2011-06-07 07:57:26 -06:00
Brian Paul
b3e75a61ee draw: rename draw_vs_varient.c to draw_vs_variant.c 2011-06-07 07:57:26 -06:00
Brian Paul
47f3d5d42d draw/llvm: whitespace, formatting fixes 2011-06-07 07:57:26 -06:00
Brian Paul
57f2f84f0e draw: s/1/TRUE/ 2011-06-07 07:57:26 -06:00
Eric Anholt
ef59049c52 i965: Fix flipped GT1 vs GT2 URB VS entry count limits. 2011-06-07 00:08:42 -07:00
Stéphane Marchesin
7d2cb9a53c Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-06-06 20:42:30 -07:00
Stéphane Marchesin
abb4365269 i915g: Do generic remapping.
With complex shaders there are often "holes" in the fs inputs, and we only
have 8 tex coorsd to map those to. To fix this, we remap fs inputs to [0..8].
This lets us to run many more GLSL programs.
2011-06-06 20:40:16 -07:00
Jeremy Huddleston
22c320aa2c darwin: Set VG_LIB_{NAME,GLOB} to fix make install
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 19:56:19 -04:00
Dave Airlie
ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie
63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie
f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie
be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie
cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie
eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie
6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Stéphane Marchesin
2292025c49 i915g: implement more opcodes. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0f091333d1 i915g: implement TGSI_OPCODE_SEQ. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
0ce977a66e i915g: handle varyings properly. 2011-06-06 12:36:00 -07:00
Stéphane Marchesin
893b92adff i915g: add missing and unsupported PIPE_CAPs to avoid debug messages. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3d3ecb8520 dri2: protect dri2FlushFrontBuffer against NULL buffers. 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
cec2082ae5 Gallium: fix indentation in u_blitter.c 2011-06-06 12:35:59 -07:00
Stéphane Marchesin
3103c08ae9 i915g: don't destroy a texture buffer if it's NULL. 2011-06-06 12:35:58 -07:00
Stéphane Marchesin
1af8b7250f llvmpipe: use $(CXX) instead of g++ for linking.
This allows setting the path to the C++ compiler.
2011-06-06 12:35:58 -07:00
Kenneth Graunke
c2e659037f i965: Update SURFACE_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
4ba9cfe4b8 i965: Update SAMPLER_STATE dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:05 -07:00
Kenneth Graunke
f9a3200adb i965: Update SF_CLIP_VIEWPORT state dumping for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-06 11:06:04 -07:00
Jeremy Huddleston
e5d241ddb2 apple: Package applegl source into MesaLib tarball
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 12:48:08 -04:00
Jeremy Huddleston
d563009cd1 darwin: Define GALLIUM_DRIVERS_DIRS in darwin config
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:38:05 -04:00
Jeremy Huddleston
2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston
7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Andreas Faenger
f4537f99cc softpipe: Anisotropic filtering extension.
Reference implementation which produces high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-06 08:21:09 -06:00
Brian Paul
b438005d96 st/mesa: fix renderbuffer internal format for accum buffer
Fixes an accum buffer regression since switching to the table-based
format selection code.
2011-06-06 08:06:34 -06:00
Marcin Slusarz
155cf15ce2 util: add \n to debug_checkpoint_full
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-06-06 12:41:07 +01:00
Marcin Slusarz
fb40f1f532 nv50: fix nv50_sampler_state_delete array overflow
num_samplers is array of 3 elements, not 5
2011-06-06 11:20:54 +02:00
Jeremy Huddleston
5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Jeremy Huddleston
1885cf27c9 apple: Build darwin using applegl rather than indirect
This reverts portions of 6849916170 that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
3843bbcb4c glx: Dead code removal
Remove a redundant ifndef GLX_USE_APPLEGL

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:15 -04:00
Jeremy Huddleston
8593bb32ea apple: ifdef out come glapi-foo on darwin
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Jeremy Huddleston
7cdf969527 apple: Change from XExtDisplayInfo to struct glx_display
Fixes regression introduced by: ab434f6b76 and
                                c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 20:52:14 -04:00
Ben Skeggs
1d24e6ec1d dri/nouveau: fix gnome-shell segfault
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-06-06 10:17:59 +10:00
Jeremy Huddleston
279e471750 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:22:47 -04:00
Jeremy Huddleston
b7f0ed8444 apple: Rename _gl_context_modes_find_visual to glx_config_find_visual
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:19:59 -04:00
Jeremy Huddleston
488d6c739f apple: Re-add driContext and do_destroy
Fixes regression introduced by: c491e585e4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
22613d1670 apple: Rename GLXcontext
Fixes regression introduced by: c356f5867f

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:10:55 -04:00
Jeremy Huddleston
bb621cb61e apple: Rename __GLcontextModes to struct glx_config
Fixes regression introduced by: 6ddf66e923

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:07:05 -04:00
Jeremy Huddleston
4c9bab78a1 apple: Rename glcontextmodes.[ch] to glxconfig.[ch]
Fixes regression introduced by: 65d98e2577

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:45 -04:00
Jeremy Huddleston
8e89d0bea7 apple: Update GL specs
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 18:03:44 -04:00
Eric Anholt
e8ea8793e3 meta: Don't do sRGB encode for framebuffer blits on sRGB-enabled framebuffers.
Fixes fbo-srgb-blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35373
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:29:00 -07:00
Eric Anholt
a513bee2f2 meta: Don't do srgb to linear decode when blitting srgb textures.
Fixes the GL_SRGB8_ALPHA8 -> GL_RGBA8 blits in fbo-srgb-blit.c

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-05 11:28:59 -07:00
Eric Anholt
164108e3db glx: Fix use-before-null-check in dri2InvalidateBuffers().
The compiler used our dereference here to skip the NULL check below.
Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
OpenJDK 6.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-03 16:03:34 -07:00
Eric Anholt
836a595594 i965: Drop remaining strict conformance fallback for GL_POINT_SMOOTH.
We actually could do this in hardware in the fragment shader using
gl_PointCoord and the point's size.
2011-06-03 16:03:18 -07:00
Eric Anholt
e9868979c5 i965: Drop strict conformance fallback for GL_LINE_STIPPLE.
We implement line stipples, just not *quite* correctly.  We have a
piglit testcase to use when we want to fix it, if we do.  Until then,
don't lie to our test suites.
2011-06-03 16:03:18 -07:00
Eric Anholt
d313346db6 i965: Drop strict conformance fallback for GL_LINE_SMOOTH.
We do have hardware antialised lines.  If we care, we should actually
fix them to be conformant (or as close as possible) instead of using
this knob to fool testcases using swrast.

For some interesting reading on the state of GL_*_SMOOTH across
several drivers, see:
http://homepage.mac.com/arekkusu/bugs/invariance/HWAA.html
2011-06-03 16:03:18 -07:00
Eric Anholt
d8b733643d i965: Drop strict conformance fallback for GL_POLYGON_SMOOTH.
From my reading of the GL 2.1 spec, no antialiasing is strictly
conformant for polygon smoothing.  Yes, it's absurd, but then,
hardware doesn't support this so maybe it's not so absurd.
2011-06-03 16:03:18 -07:00
Eric Anholt
3f05374574 i965: Drop INTEL_CONFORMANCE=2 fallback code.
This was just a duplicate of no_rast=true driconf option, which is
relatively standard across drivers.
2011-06-03 16:03:18 -07:00
Paul Berry
6491e9593d glsl: fixed printing of structure constants.
ir_print_visitor::visit(ir_constant *) was failing to index properly
into ir->type->fields.structure, so the first field name was being
reprinted for every field in the structure.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 12:48:49 -06:00
Paul Berry
26b566e19c AST dump: fixed printing of conditionals.
ast_expression::print() had an incorrect index into the subexpressions
array, so (a ? b : c) was being incorrectly rendered as (a ? b : b).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-03 11:07:00 -06:00
Dave Airlie
4077336fc7 r600g: move spi update to only when states change.
This updates the spi state after ps/vs binding or rasteriser state
change.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:27:00 +10:00
Dave Airlie
1dbcb83881 cso: move cso hashes to a more table driven scheme
this removes a bad branch pain in the hash table lookup fn.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
970726dd6f u_prim: convert u_trim_pipe_prim to table driven.
This makes this function not be an always miss for the branch predictor.

Noticed using cachegrind, makes a minor difference to gears numbers on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Dave Airlie
de0adb691f r600g: make conv pipe prim table driven.
This is a lot more branch predictor friendly, it actually
showed up in cachegrind profiles.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 15:26:59 +10:00
Brian Paul
aaeb9a8216 mesa: fix typo (s/GLGL/GLSL/) 2011-06-02 21:49:49 -06:00
Brian Paul
52f6e79b7c mesa: 80-column wrapping 2011-06-02 21:49:49 -06:00
Brian Paul
9653acc52a mesa: consolidate glGetUniform code 2011-06-02 21:49:49 -06:00
Brian Paul
bbce18c647 mesa: refactor/consolidate uniform lookup code 2011-06-02 21:49:49 -06:00
Brian Paul
230c71d9ee mesa: add some minor fixes for geometry shaders 2011-06-02 21:49:49 -06:00
Brian Paul
b03296c1e9 dri: add missing files from 873379a881 2011-06-02 18:27:10 -06:00
Pierre-Eric Pelloux-Prayer
09201cc7a0 mesa: add implementation of glDrawElementsInstancedBaseVertex
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:48 -06:00
Pierre-Eric Pelloux-Prayer
0dae94610e glapi: regenerated files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:55:13 -06:00
Brian Paul
898f4c5133 glapi: add glDrawElementsInstancedBaseVertex() function to xml
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:54:55 -06:00
Johannes Obermayr
873379a881 dri/nouveau: Fix build with --enable-shared-dricore.
- Based on the work of Себастьян Gliţa Κατινα <cglita@yahoo.com>
- Split Makefile.template into Makefile.defines and Makefile.targets
- Adapt other drivers to new situation
- Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35441

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 17:21:26 -06:00
Brian Paul
a9c5efb111 r300: remove MIN3 macro, already defined in macros.h 2011-06-02 17:21:26 -06:00
Dave Airlie
51d0892ee2 r600g: sampler and texture state doesn't need a range/block.
These are handled separately in the winsys, so don't need the calculations
done at this point. this manifested as a crash in point-sprite,

Thanks to XoD on #radeon for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-03 08:54:25 +10:00
Adam Jackson
e09e5cb7d8 glx: Remove (unused, broken) fastImageUnpack fast path
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:22 -04:00
Adam Jackson
776a2a5447 glx: Fix another case of using req outside of the display lock
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-02 15:37:21 -04:00
Marek Olšák
bddf275db4 softpipe: add a better fake implementation of fences
The flush function, when asked for, should not return a NULL fence.

NULL can only be returned if fences are not implemented, and st/mesa
doesn't call any of the fence functions if it receives a NULL fence
(because some drivers don't even set the fence hooks).

ARB_sync is exposed if fence_finish is set.
2011-06-02 16:50:46 +02:00
Brian Paul
f62e1f41b4 util: faster logbase2 2011-06-02 08:45:27 -06:00
Benjamin Bellec
bab3b4a758 mesa: faster logbase2
With minor clean-ups by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-02 08:31:20 -06:00
Brian Paul
029ea39fb9 st/mesa: add GL_R11F_G11F_B10F to format table
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-02 08:01:28 -06:00
Christoph Bumiller
d1fd740bb7 d3d1x/sm4: don't reset 1st index of multi-dimensional operands to 0 2011-06-02 14:10:37 +02:00
Christoph Bumiller
a531513b06 d3d1x/sm4: fix swizzle for 1 component operands
For example, "mov o0.w, l(1)" would use imm_values[3], which is
not valid.
2011-06-02 14:10:34 +02:00
Chris Wilson
f61d1deac7 i965: Raise const.MaxTextureLevels to 14 (8192)
Mesa now limits, by default, the max number of texture levels to 15 so we
can now support the architectural maximum for gen4-6 of 14.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-02 08:30:21 +01:00
Dave Airlie
b0dc2d0c3b r600g: add spi state and move spi/vgt to modify register
This modifies the VGT state and move the SPI setup to its own discrete state.

It then just sets the SPI state up and the VGT state up once and modifies
them thereafter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:08:24 +10:00
Dave Airlie
573758fd09 r600g: decrease CPU time on set buffer resources
This splits the initialisation and the setting of values in the resource
buffers. We only should end up initialising once and updateing with new values
when needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 15:03:52 +10:00
Dave Airlie
4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie
42502b6f03 r600g: deinline r600_pipe_state_add_reg.
This is going to get too big to be a forced inline. Also going to remove it
from some hotpaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:53:15 +10:00
Dave Airlie
7f6672f6a7 r600g: prepare for passing ctx into _r600_pipe_state_add_reg
This moves the functions down the file, and also adds a ctx parameter.

This is precursor patch just moving stuff around and getting it ready.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:50:18 +10:00
Dave Airlie
991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie
c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie
8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie
9eb86f89a9 r600g: optimise state setting in r600_draw_vbo.
This drop the r600_draw_vbo CPU usage on a run of nexuiz from 1.40% to 0.72%
in sysprof for me on my Fusion APU.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Dave Airlie
8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Brian Paul
57242715cb st/mesa: add format table entry for GL_RGB9_E5
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37839
2011-06-01 16:25:42 -06:00
Nathan Kidd
f3652f0983 glapi: Make xserver location error more helpful
glx code hasn't lived under xserver/GL for a long time now.

Signed-off-by: Nathan Kidd <nkidd@opentext.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-01 08:30:59 -06:00
Marek Olšák
b9e9df78a0 mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449:

If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no
framebuffer is bound to target. In this case querying pname FRAMEBUFFER_-
ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate
an INVALID_OPERATION error.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-06-01 16:07:58 +02:00
Marek Olšák
d69dc2e203 mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End
I couldn't find this being required by the spec.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-01 16:03:26 +02:00
Marek Olšák
37a85b1830 r300g: remove unused debug option DBG_UPLOAD
And renumber the options.
2011-06-01 04:47:41 +02:00
Alex Deucher
c5903ed454 r600c: add support for llano
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher
414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Eric Anholt
c331b3123e i965/fs: Use the embedded compare in SEL on gen6+.
This avoids the extra CMP and the predication on SEL, so in addition
to one less instruction, it makes scheduling less constrained.

Improves glbenchmark Egypt performance 0.6% +/- 0.2% (n=3).  Reduces
FS instruction count across affected shaders in shader-db by 1.3%
without regressing any.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:23:50 -07:00
Benjamin Franzke
089aa313b4 wayland-drm: Check visual for being NULL 2011-05-31 15:13:37 -04:00
Benjamin Franzke
fc5aec9342 Fiuxp make tarballs for wayland-egl/drm 2011-05-31 15:13:37 -04:00
Benjamin Franzke
a7cd65fb38 st/egl: Fix udev linkage when egl_dri2 is not build 2011-05-31 15:13:37 -04:00
Benjamin Franzke
aa87a938fb egl_dri2: Fix usage of bool values 2011-05-31 15:13:36 -04:00
Benjamin Franzke
5bf6cc95c1 wayland-egl: Remove left-over headers and struct 2011-05-31 15:13:36 -04:00
Eric Anholt
f04765922c i965: Remove brw_surface_state struct that is now unused.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
ee643b23ff i965: Switch brw_state_dump to using bitshifting for surface state.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
e764f10ea5 i965: Replace struct with bit shifting for WM null surfaces.
Reduces compiled size of brw_wm_surface_state.o another 1.9%.

Overall, this brw_wm_surface_state reduction series cuts
firefox-talos-gfx runtime by 0.68% +/- 0.42% (n=6).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:29 -07:00
Eric Anholt
9bdc44a528 i965: Replace struct with bit shifting for WM pull constant surfaces.
This reduces compiled size (4.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ac11c01dde i965: Replace struct with bit shifting for WM render target surfaces.
This massively reduces compiled size (6.7% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
ae5c1fceba i965: Replace structs with bitfield shifting for WM texture surfaces.
This massively reduces compiled size (4.9% of brw_wm_surface_state.o).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
7d437b1f7f i965: Add defines for surface state setup using bitfield shifting.
It turns out that gcc is just awful at generating code for
brw_structs.h style state setup, and using bitshifting on u32s
generates better code while being similarly readable (and more
verifiable compared to the specs, using the INTEL_MASK macro).
2011-05-31 12:07:28 -07:00
Eric Anholt
3412069e23 i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection
when w is always 1.  We do want to do this in the new path pre-gen6
too, but we'll probably do it through the ir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-31 12:07:28 -07:00
Eric Anholt
bcbb1a536f i965: Drop a gratuitous "if" that the compiler didn't eliminate at -O2.
Oddly, this increases compiled code size.  (marking the 'if' as likely
also increases code size, but not as much).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Eric Anholt
d1946f5348 i965: Move prepare_wm_surfaces texobj declarations inside of _ReallyEnabled.
Interestingly, the compiler wasn't doing this for us at -O2, so we
were doing the computation for every non-_ReallyEnabled unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-31 12:07:28 -07:00
Ian Romanick
f29bc77572 intel: Remove unused NO_TILE macro
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-31 11:46:29 -07:00
Marek Olšák
b1246cf13b r300g: set squared microtiling for the dummy zbuffer
The pitch of 4 is allowed for squared microtiling only.
2011-05-31 18:19:27 +02:00
Alex Deucher
b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Marek Olšák
c4175c811e r300g: log when getting unsupported texture format 2011-05-31 15:20:38 +02:00
Dave Airlie
d2ede5e648 gallium: include limits.h in p_config.h
We are getting inconsistent methods for endian detection (same answer when
it works, just doesn't work on some platforms) depending on whether __GLIBC__
is defined, which of course depends on include ordering before p_config.h

Just make p_config.h include limits.h to solve this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-31 17:28:48 +10:00
Dave Airlie
0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie
65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Marek Olšák
29ceeeba20 mesa: forbid UseProgram to be called inside Begin/End
The spec doesn't state it should be an error, but. We have this piglit test
useprogram-inside-begin that passes with this commit. No idea what's correct.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 16:26:02 +02:00
Marek Olšák
1b37a41661 st/mesa: don't use resource_copy_region for CopyPixels with conditional render
The conditional rendering should be able to kill CopyPixels.
I assume the render condition has no effect on resource_copy_region.

This fixes piglit:
- NV_conditional_render/copypixels

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:06 +02:00
Marek Olšák
8d45bbc422 st/mesa: conditional rendering should not kill texture decompression via blit
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:03 +02:00
Marek Olšák
91e56c8897 st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:51:01 +02:00
Marek Olšák
ccfeb90b75 st/mesa: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:58 +02:00
Marek Olšák
c0277d9539 swrast: BlitFramebuffer should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:53 +02:00
Marek Olšák
1c95c3ef9c st/mesa: GenerateMipmap should not be killed by conditional rendering
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:50:43 +02:00
Marek Olšák
24ed0b384b st/mesa: fix typos and add some format fallbacks in format_map
Always default to DEFAULT_*_FORMATS for mandatory GL formats.
   (st_choose_format must not fail for those)
Use DEFAULT_RGBA when alpha is required instead of RGB.
Use DEFAULT_RGB otherwise.

These are more or less the remaining differences between the old code and
the new one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:35 +02:00
Marek Olšák
6c638b7ca1 st/mesa: consolidate listing of depth formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:31 +02:00
Marek Olšák
26d718ff71 st/mesa: add GL_DEPTH_COMPONENT32 fallback formats
This makes D32 work again on chipsets which can't do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:27 +02:00
Marek Olšák
49d4e803d3 st/mesa: fix changing internal format via RenderbufferStorage
The problem is: The second time the function is called with a new
internal format, strb->format is usually not PIPE_FORMAT_NONE.

RenderbufferStorage(... GL_RGBA8 ...);
RenderbufferStorage(... GL_RGBA16 ...); // had no effect on the format

Broken with: fd6f2d6e57
Test: piglit/fbo-storage-completeness

NOTE: This is a candidate for the 7.10 branch.
(if fd6f2d6e57 is cherry-picked as well)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:49:21 +02:00
Marek Olšák
ff038170ff tgsi/ureg: bump the limit of immediates
Lowered indirect addressing can create lots of immediates.

Fixes piglit/glsl-fs-uniform-array-7 on r300g.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-30 10:48:03 +02:00
Marek Olšák
f133ff51a2 trace: implement texture_barrier 2011-05-29 16:17:11 +02:00
Marek Olšák
b9e8cb0a59 trace: implement render_condition 2011-05-29 16:17:11 +02:00
Marek Olšák
76056510bc r300g: clear can be killed by render condition
Fixes piglit:
- NV_conditional_render/clear
2011-05-29 16:17:11 +02:00
Tom Stellard
aae56150f5 r300g: Fix non-dri builds
This is just a temporary solution for now until there is a better way
to share code between mesa and gallium.
2011-05-28 21:16:00 -07:00
Marek Olšák
f76787b3ea r300g: fix occlusion queries when depth test is disabled or zbuffer is missing
From now on, depth test is always enabled in hardware.

If depth test is disabled in Gallium, the hardware Z function is set to ALWAYS.

If there is no zbuffer set, the colorbuffer0 memory is set as a zbuffer
to silence the CS checker.

This fixes piglit:
- occlusion-query-discard
- NV_conditional_render/bitmap
- NV_conditional_render/drawpixels
- NV_conditional_render/vertex_array
2011-05-29 05:15:27 +02:00
Marek Olšák
d18792f93d r300g: cleanup render_condition a bit 2011-05-29 05:15:27 +02:00
Marek Olšák
70b86fb273 r300g: remove fake occlusion queries (debug option) 2011-05-29 05:15:27 +02:00
Marek Olšák
2397f20b6b r300g: remove debug option DBG_FALL 2011-05-29 05:15:27 +02:00
Marek Olšák
9a3f861faf r300g: print some HyperZ debug info 2011-05-29 03:03:14 +02:00
Stéphane Marchesin
fc48de4fab glx: Fix glXGetFBConfigFromVisualSGIX.
We want to check for Success, otherwise it will fail even with the right visual.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Antoine Labour <piman@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Pierre-Eric Pelloux-Prayer
4eeabd5a3d mesa: set parameter list StateFlags field in _mesa_layout_parameters()
When using _mesa_layout_parameters, all params copied in the 'layout'
output in the PASS 1 don't modify StateFlags (because they are simply
memcpy'ed).
This patch fixes the problem, assuring output gl_prog_param_list
StateFlags field is the same as the input one.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-27 11:58:36 -06:00
Eric Anholt
0653c450cc i965/fs: Fix up for 8752764076.
I failed to commit and squash before pushing.
2011-05-27 09:51:28 -07:00
Eric Anholt
9bd7e9c6b2 mesa: Include shader target in dumps of GLSL source.
This makes automatic parsing of MESA_GLSL=dump output easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 09:07:32 -07:00
Eric Anholt
8752764076 i965/fs: Do a FS compile up front at link time to produce link errors.
At glLinkShaders time, a fail() call in FS compile in 8-wide (the one
that's required to succeed, though we may relax that at some point for
pre-Ironlake performance) will now report out as a link error.
2011-05-27 09:07:32 -07:00
Eric Anholt
d1f70a8a6c i965/fs: Split the GLSL IR -> FS LIR visitor to brw_fs_visitor.cpp.
We now have:
brw_fs.cpp handles calling out to everything and optimization.
brw_fs_visitor.cpp handles translating to our LIR.
brw_fs_emit.cpp handles emitting from our LIR to native code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:40 -07:00
Eric Anholt
11dd9e9c0f i965/fs: Split the BRW native code emit to brw_fs_emit.cpp
This is all separate from the visitor and the optimization passes
which feed into it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:39 -07:00
Eric Anholt
b7b700aeb0 i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:30 -07:00
Eric Anholt
14b86f3c91 i965: Move non-FS-specific shader support to brw_shader.cpp.
These only existed in brw_fs.cpp because it was the only .cpp file in
the area when I wrote them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:51:05 -07:00
Eric Anholt
53c89c67f3 i965: Avoid generating MOVs for assignments of expressions.
No statistically significant difference measured in 3dbenchmark
egypt/pro.  It does reduce fragment shader instructions across
shader-db by 0.3%.
2011-05-27 08:19:52 -07:00
Eric Anholt
1791857d7d i965/fs: Move the computation of register block count from unit to compile.
No net code size change, but unit update is down 0.8% code size
pre-gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:19:27 -07:00
Eric Anholt
615117ce4e i965/fs: Track fixed GRF regs separate from allocated GRF file in scheduling.
There's an assumption here that fixed GRFs will never intersect with
the allocated GRFs.  That's true today, though it might change some
day if we decide to register-allocate the regs containing push
constants once they're dead.

This fixes a regression in 0f7325b890 in
Lightsmark from the texture instructions now containing g0 references
instead of having that be implied.  Performance is improved 15.2% +/-
3.6% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34968
2011-05-27 08:08:23 -07:00
Eric Anholt
40540cc517 i965/fs: Add a helper function for add_dep(before, after, before->latency).
This lets us avoid a bunch of before==NULL checks in the callers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-27 08:08:23 -07:00
Trevor Davenport
828b26b7eb nv50: fix emit_add_a16 to emit correct source reg
emit_add_a16 was using the incorrect source.
This caused adds in the form of:

   add u16 $a0 s32 $a1 u32 0x00000200

to have a source AREG of $a0 instead of $a1.

Fixes World of Warcraft in OpenGL and D3D without GLSL.
2011-05-27 10:25:40 +02:00
Brian Paul
4609e80288 mesa: s/height/depth/ in texsubimage()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=37648
2011-05-26 19:25:44 -06:00
Brian Paul
e401c1f57f mesa: plug _mesa_GetObjectParameterivAPPLE into display list dispatch table 2011-05-26 19:25:44 -06:00
Brian Paul
6126d50e75 mesa: plug in GL_ARB_vertex_array_object display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
e00481586c mesa: more geometry shader display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
3b0f431820 mesa: more transform feedback display list functions 2011-05-26 19:25:44 -06:00
Brian Paul
919e260bff mesa: make query object API functions static
Only directly referenced by the _mesa_init_queryobj_dispatch() function.
2011-05-26 19:25:44 -06:00
Brian Paul
848bcd2e8c mesa: simplify query object display list dispatch setup 2011-05-26 19:25:44 -06:00
Eric Anholt
f7b3f40b70 i965: Pack the lookup and line_aa bits into the first dword of the key.
They were occupying whole 32-bit words, despite being only 10 or so
bits.  Reduces code size slightly (80/3300 bytes).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
9a729ab4b2 i965: Remove dead shadowtex_mask entry in the WM key.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
f147599ef4 i965: Remove linear_color for GL_PERSPECTIVE_CORRECTION_HINT.
From the GL 2.1 spec:

   "Required perspective-correct interpolation for all fragment
    attributes except depth in sections 3.4.1 and 3.5.1, effectively
    making GL PERSPECTIVE CORRECT HINT a no-op."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-26 10:07:38 -07:00
Eric Anholt
c095335fa5 intel: Drop doubly irrelevant code in intelReadBuffers.
First, FBO read/draw == NULL validation happens in mesa core not
intelReadBuffers -> intel_draw_buffers.  Second, that condition is no
longer tested for in our driver since ARB_ES2_compatibility was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
6d4b974e89 mesa: Flush vertices before updating drawbuffer computed state.
Otherwise, the driver is likely to draw the flushed vertices to the
new drawbuffer instead of the old one, missing the point of the flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
d3451f7f9c mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.
From the ARB_ES2_compatibility spec:

    "(8) How should we handle draw buffer completeness?

    RESOLVED: Remove draw/readbuffer completeness checks, and treat
    drawbuffers referring to missing attachments as if they were NONE."

Fixes arb_es2_compatibility-drawbuffers when the short-circuit for
ARB_ES2_compatibility in the previous commit is dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Eric Anholt
f73ff463a2 mesa: Trigger FBO validation on DrawBuffers change in non-ES2 mode.
glDrawBuffers pointing at an unattached buffer is supposed to be
incomplete without ARB_ES2_compatibility.  The testcase to catch the
bug of not implementing that bit of the spec was tricked by this
missing piece of state update.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-26 08:54:29 -07:00
Brian Paul
179a88d52c mesa: minor whitespace fixes 2011-05-25 21:07:50 -06:00
Brian Paul
f84be846ca mesa: plug in sync object display list functions
Most just dispatch through to the immediate mode functions, except
for glWaitSync(), per the extension spec.
2011-05-25 21:06:51 -06:00
Brian Paul
95fa22c864 mesa: display list support for glProgramParameteriARB() 2011-05-25 20:44:35 -06:00
Brian Paul
001aa6c979 mesa: plug shader object functions into display list dispatch 2011-05-25 20:39:08 -06:00
Brian Paul
4535c98cdb mesa: plug in GL 3.0 ClearBuffer() display list functions 2011-05-25 20:27:44 -06:00
Brian Paul
8f7c815568 mesa: fill in missing sampler object display list functions 2011-05-25 20:20:22 -06:00
Brian Paul
3e06803c2c st/mesa: simplify some st_context(ctx)->pipe code 2011-05-25 18:16:03 -06:00
Brian Paul
bf14ab417c st/mesa: fix incorrect texture level/face/slice accesses
If we use FBOs to access mipmap levels with glRead/Draw/CopyPixels()
we need to be sure to access the correct mipmap level/face/slice.
Before, we were just passing zero in quite a few places.

This fixes the new piglit fbo-mipmap-copypix test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-25 18:07:35 -06:00
Jakob Bornecrantz
1697dac642 i915g: Bump texture sizes
Spotted and tested by Christopher Egert.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-05-25 22:06:11 +02:00
Eric Anholt
b5846865de i965: Warnings cleanup.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Eric Anholt
fa42de5ad7 i965: Fix assertion failures in unused brw_reg setup by deleting it.
I was using undefined values to create an unused value.  Go me.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37366
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-25 11:16:36 -07:00
Alex Deucher
5ed7a7b720 r600g: remove duplicate opcode in r600_opcodes.h
V_SQ_CF_WORD1_SQ_CF_INST_HALT is 0x1f on both
evergreen and cayman.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 11:04:25 -04:00
Chad Versace
e7bcfadc22 intel: Change FBO validation criteria to accomodate hiz and seprate stencil
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
ce8fdf666f intel: Fix intel_draw_buffer() to accomodate hiz and separate stencil
The logic of intel_draw_buffers() expected that stencil buffers were
always combined depth/stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
c270f1a628 intel: Add hiz_region to intel_mipmap_tree
When a texture is attached to multiple FBO's, a separate renderbuffer
wrapper is created for each attachment. This necessitates storing the hiz
region for these renderbuffers in the texture itself instead of the
renderbuffer wrapper.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
6ed829fe50 intel: Refactor the wrapping of textures with renderbuffers
Before this commit, the renderbuffer's region was updated in
intel_renderbuffer_texture(). This commit moves the update into
intel_update_wrapper(), which is a more logical location for updates.

This is in preparation for the next commit, which allocates and
updates the texture's hiz region in intel_update_wrapper(). Having the two
region updates located in the same function makes good form.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
7c0e6d9bbc intel: Add hiz_region to intel_renderbuffer
A hiz surface must be supplied to the hardware when rendering to a depth
buffer with hiz. There are three potential places to store that surface:
    1. Allocate a larger intel_region for the depthbuffer, and let the
       region's tail be the hiz surface.
    2. Allocate a separate intel_region for hiz, and store it as
       brw_context state.
    3. Allocate a separate intel_region for hiz, and store it in
       intel_renderbuffer.

We choose method 3.

Method 1 has not been chosen due to future complications it might cause
when requesting a DRI drawable's depth buffer attachment from X.

Method 2 has not been chosen because storing the hiz region apart from
the depth region makes lazy hiz/depth resolves difficult to implement.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
a9e6509785 intel: Add is_hiz_depth_format() to intel_contex.vtbl
Given a format, is_hiz_depth_format() indicates if HiZ can be enabled on
a depthbuffer of that format.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Chad Versace
b5c847c7ca intel: Change supported texture formats for separate stencil
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
4e0654ec29 mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Chad Versace
76f77cb07e intel: Add flags to intel_context for hiz and separate stencil
Add the following flags:
    intel_context.has_separate_stencil
    intel_context.must_use_separate_stencil
    intel_context.has_hiz

The flags are currently set to false, and will be enabled for a given
chipset once the feature is completely implemented.

Since it may be some time before these features are completed, their
values can be overridden with environment variables INTEL_HIZ and
INTEL_SEPARATE_STENCIL. Valid values for these environment variables are
"0" and "1".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:31 -07:00
Adam Jackson
a95ec18549 glx: Don't refer to the request buffer outside of {L,Unl}ockDisplay
... because that's not a safe thing to do.  The request buffer is shared
storage among all threads, and after UnlockDisplay the 'req' pointer may
point into someone else's request.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-25 06:19:29 -04:00
Alex Deucher
c44dad559a egl_dri2: add new cayman pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-25 01:27:34 -04:00
Alex Deucher
017cd5dcc3 r600g: fix eg/cayman scissor workaround
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-24 22:44:16 -04:00
Dave Airlie
868c04205c r600g: add workaround for buggy hw scissor on eg/cayman.
This is ported from the same fix to the DDX.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:50:17 +10:00
Dave Airlie
7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie
d1b8f8e8b3 r600g: don't lookup a vs semantic for position/face.
These don't need one, and I was seeing 0xff being returned and set in
the GPU registers with some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 10:01:25 +10:00
Dave Airlie
ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Adam Jackson
3869be74af glx: More comment cleanup
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:45:02 -04:00
Adam Jackson
a3aecd190b glx: Remove some misleading comments
These functions have already been modified for direct rendering.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:33 -04:00
Adam Jackson
5a6897ff0b drisw: Namespace better for ease of navigation
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:44:21 -04:00
Adam Jackson
b24f291e42 drisw: dead store removal
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-24 16:43:53 -04:00
Mike Kaplinskiy
d3b6e8a2b8 mesa: fix glGetTexImage for cases when srgb decode is skipped
See http://bugs.freedesktop.org/show_bug.cgi?id=37150

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-24 09:06:04 -06:00
Brian Paul
cd5417aac7 st/mesa: prefer formats without stencil for DEPTH_COMPONENT
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.
2011-05-24 09:00:17 -06:00
Brian Paul
d57e95f22a st/mesa: rewrite st_choose_format() to be table driven
Instead of using a giant switch statement with lots of code, use a
table to convert GL format enums to pipe formats.

Tested by running the old code next to the new and asserting that
the return value was the same for piglit tests.

We're doing a linear search, but if that ever appears to be too slow
the table could easily be sorted or hashed.
2011-05-24 08:49:01 -06:00
José Fonseca
c3c1976f52 wgl: Don't hold on to user supplied HDC.
Certain applications (e.g., Bernina My Label, and the Windows
implementation of Processing language) destroy the device context used when
creating the frame-buffer, causing presents to fail because we were still
referring to the old device context internally.

This change ensures we always use the same HDC passed to the ICD
entry-points when available, or our own HDC when not available (necessary
only when flushing on single buffered visuals).
2011-05-24 13:12:39 +01:00
Thierry Reding
5af46e8360 mesa: Fix remap_table setup.
Since the SET_xxx and GET_xxx macros used to initialize the remap_table
have been replaced by inline functions, the missing late macro expansion
leads to driDispatchRemapTable not being redefined to remap_table, which
in turn causes the remap_table not to be setup properly.

This commit fixes the issue by moving the table redefinition after the
definition of driDispatchRemapTable but in front of the inline function
definitions.
2011-05-23 16:19:44 +01:00
Adam Jackson
e8b1c6d6f5 mesa: Fix return type of _mesa_get_format_bytes() (#37351)
Despite that negative values aren't sensible here, making this unsigned
is dangerous.  Consider get_pointer_generic, which computes a value of
the form:

    void *base + (int x * int stride + int y) * unsigned bpp

The usual arithmetic conversions will coerce the (x*stride + y)
subexpression to unsigned.  Since stride can be negative, this is
disastrous.

Fixes at least the following piglit tests on Ironlake:

    fbo/fbo-blit-d24s8
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-05-23 11:07:34 -04:00
Kenneth Graunke
d0c6d24a9e i965/gen7: Fix miptree layout for cube surfaces.
Volume 1a section 8.20.4.7.3 gives new equations which multiply by 12
instead of 11.

Fixes 8 piglit tests:
- fbo-cubemap
- texCube
- glsl-fs-texturecube
- glsl-fs-texturecube-2
- glsl-fs-texturecube-2-bias
- glsl-fs-texturecube-bias
- arb_seamless_cubemap
- cubemap

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
Kenneth Graunke
b522eb0717 i965: Remove comments about pre-965 hardware.
They're irrelevant for this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-22 15:01:16 -07:00
pepp
fd6f2d6e57 st/mesa: assign renderbuffer's format field when allocating storage
See http://bugs.freedesktop.org/show_bug.cgi?id=36173

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-21 09:49:14 -06:00
Christian König
3c5e741862 r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 16:40:20 +02:00
Kenneth Graunke
9be8524af7 i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
24de02acac i965: Remove "TXD" from justification of sampler message headers.
The coordinate offsets set in the m1 header are for textureOffset;
they have nothing to do with textureGrad (TXD).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:33:43 -07:00
Kenneth Graunke
5e48560926 i965/gen7: Add support for rendering to depthbuffer mipmap levels > 0.
The same as 3e43adef95 but for Gen7.

This doesn't quite fix GL_ARB_depth_texture/fbo-clear-formats; there's
still a 1 pixel wide black line on the right edge of the smaller squares.

The results were entirely wrong before, and are at least close now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-20 16:31:18 -07:00
Benjamin Franzke
733fa000ce st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ea90eca44b st/dri: Support dri2 useflags in dri2_create_image 2011-05-20 19:10:22 +02:00
Benjamin Franzke
ca79036fe8 st/egl/wayland: Deal with wayland visual changes
Since wayland 4bde293ff8109d55eeaee8732f5a6ee0c8cd4bd9 we cant
lookup visuals, as we dont receive the visual token events.

The format for pixmap-images thus has to default to argb for now.
2011-05-20 13:05:14 -04:00
Thierry Reding
8e7d4d4e0c mesa: Emit definition of GLAPIENTRYP in es_generator.py.
GLES uses GL_APIENTRYP instead of GLAPIENTRYP, which breaks with the
latest API table generation code. This fixes the issue by emitting a
definition for GL_APIENTRYP when generating the GLES files.
2011-05-20 12:59:23 +01:00
José Fonseca
075d2bfb72 glapi: More type-checking in Get_xxx too. 2011-05-20 12:59:23 +01:00
José Fonseca
a436b3b2d4 gallivm: Fix for dynamically linked LLVM 2.8 library.
This prevents the error

    prog: for the -disable-mmx option: may only occur zero or one times!

when creating a new context after XCloseDisplay with DRI drivers linked
with a shared LLVM 2.8 library.
2011-05-20 11:54:52 +01:00
Brian Paul
4f59b32178 r300: move declaration before code 2011-05-19 21:23:39 -06:00
Brian Paul
38f89c7008 st/glx: define/set new ST_CONTEXT_FLAG_bits 2011-05-19 21:18:33 -06:00
Brian Paul
1929d52fd9 st/glx: pass major, minor, context flags, etc to XMesaCreateContext() 2011-05-19 21:18:33 -06:00
Brian Paul
d1cd1cc871 st/glx: implement glXCreateContextAttribsARB() 2011-05-19 21:18:33 -06:00
Brian Paul
81183b1e3e st/glx: pass version, context flags, etc to create_context() 2011-05-19 21:18:33 -06:00
Brian Paul
7be3e50731 st/glx: refactor create-context functions 2011-05-19 21:18:33 -06:00
Brian Paul
43bdabd47d mesa: fix vertex array enable checking in check_valid_to_render()
In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th).  Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
2011-05-19 21:18:33 -06:00
Roland Scheidegger
be0a2f62f3 mesa: handle some srgb cases in the fast path in _mesa_get_teximage
Previously, always did unorm8->float/nonlinear-to-linear conversion (using
lookup table), then convert back to nonlinear (using the expensive math
func pow among others), and finally convert back to int (assuming caller
wants unorm8), because the float texture fetch function is used for getting
the actual texel values. This should probably all be changed at some point,
but for now simply enable the memcpy path also for srgb formats (but if for
instance swizzling is required, still the whole conversion will be done).
2011-05-20 01:43:40 +02:00
Kristian Høgsberg
339544f4bb wayland-drm: Use new generic error event 2011-05-19 12:07:00 -04:00
José Fonseca
ec4dfc2aad glapi: Implement SET_xxx as inline functions instead of macros.
In order to have the benefit of type checking, and detect missing
GLAPIENTRY keywords on public entrypoints.
2011-05-19 16:49:49 +01:00
José Fonseca
f4a9868811 mesa: add another missing GLAPIENTRY keyword
NOTE: this is a candidate for the 7.10 branch.
2011-05-19 16:39:57 +01:00
Maxim Levitsky
116133af34 nv50: add support for user clip planes
Clip distance is calculated each time vertex position is written
which is suboptiomal is some cases but very safe.
User clip planes are an obsolete feature anyway.

Every time number of clip planes increases, the vertex program
is recompiled.
That ensures no overhead in normal case (no user clip planes)
and reasonable overhead otherwise.

Fixes 3D windows in compiz, and reflection effect in neverball.
Also fixes compiz expo plugin when windows were dragged and each
window shown 3 times.
2011-05-19 12:50:28 +02:00
Kristian Høgsberg
bfaa458445 wayland: Fix link order for libwayland-drm.a 2011-05-18 18:57:05 -04:00
Eric Anholt
3e43adef95 i965: Add support for rendering to depthbuffer mipmap levels > 0.
Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
2011-05-18 13:57:18 -07:00
Eric Anholt
a98dd64af7 i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
2011-05-18 13:57:17 -07:00
Eric Anholt
64f8ddaf9b i965/gen6: Add support for point min/max size from ARB_point_parameters.
Fixes glean pointAtten.
2011-05-18 13:57:17 -07:00
Eric Anholt
90e922267a i965/fs: Don't emit a header on gen5+ sample messages unless required.
Improves glbenchmark egypt performance 0.6% +/- 0.4% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
4bbc7915f1 i965/fs: Fix GPU hang on texture2d-bias on pre-Ironlake.
In the 16-wide rework, I missed that we were setting some things to be
SIMD16 mode (corresponding to their setup in emit_texture_gen4()).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
b126a0c0cb i965: Add support for correct GL_CLAMP behavior by clamping coordinates.
This removes the stupid strict-conformance fallback code I broke when
adding ARB_sampler_objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36572
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-05-18 13:57:17 -07:00
Eric Anholt
7592f00560 i965/fs: Drop the viewport index/rtai clearing in gen6 fb writes.
These fields are documented to be in the payload, and though the FB
write docs say they *aren't* in the payload, for all other fields the
payload and header is structured so that no overwriting is required
except for non-default options.
2011-05-18 13:57:17 -07:00
Eric Anholt
136eb2bde7 i965/fs: Add support for "if" statements in 16-wide mode on gen6+.
It turns out there's nothing in the hardware preventing this.  It
appears that it ought to work on pre-gen6 as well, but just produces
GPU hangs.

Improves glbenchmark Egypt framerate 4.4% +/- 0.3% (n=3), and Pro by
2.6% +/- 0.6% (n=3).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
27b0392661 i965/fs: Fix discard and alpha test in 16-wide.
As of gen6, alt-mode (which we use) MOVs of floats are not raw --
they'll modify infs/nans.  This broke discard and alpha test in
16-wide, where apparently the upper 8 bits of the pixel enables being
set were causing the whole value to get trashed upon being moved.
Treating the values as UD instead of float makes sure they get
preserved.  While I'm here, replace the two 8-wide moves of the halves
of the header with a single compressed move.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36648
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:17 -07:00
Eric Anholt
367020d87c i965/gen6: Fix blending state when no color buffer is bound.
This is part of fixing fbo-alphatest-nocolor -- a regression in
35e8fe5c99 after the initial regression,
that had us using a garbage BLEND_STATE[0] (in particular, the alpha
test enable) if no color buffer was bound.
2011-05-18 13:57:16 -07:00
Eric Anholt
51761a1aef i965/fs: Cut an instruction and a temporary from gen6 discard statements.
I thought I was thwarted initially when I couldn't do conditional mod
on a MOV, and couldn't use two immediate constants in one instruction.
But g0 != g0 is also a way to produce a failing comparison.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 13:57:16 -07:00
Eric Anholt
5dd5be69f0 i965/fs: Fix compiler warnings about dead code from 9634318290 2011-05-18 13:57:16 -07:00
José Fonseca
61c67eca7d gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.
Fixes fdo 36738.
2011-05-18 18:14:37 +01:00
Andreas Faenger
8a98aabe0b swrast: anisotropic filtering extension
Anisotropic filtering extension for swrast intended to be used by osmesa
to create high quality renderings.
Based on Higher Quality Elliptical Weighted Avarage Filter (EWA).
A 2nd implementation using footprint assembly is also provided.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-18 08:14:33 -06:00
Brian Paul
707eadcb7f mesa: simplify error check in _mesa_MapBufferRange() 2011-05-18 08:14:32 -06:00
Brian Paul
496bf04905 mesa: only update array _MaxElement if array is enabled
Fixes failed assertion when calling _mesa_print_arrays() debug function.
2011-05-18 08:14:32 -06:00
Brian Paul
de1df26b5c mesa: check that flex/bison are installed
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=36651

NOTE: This is a candidate for the 7.10 branch.
2011-05-18 07:51:33 -06:00
Kenneth Graunke
3e0bb02358 i965: Rename IS_GT1 and IS_GT2 to IS_SNB_GT1 and IS_SNB_GT2.
This should help distinguish Sandybridge GT1/GT2 from Ivybridge GT1/GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-18 01:31:29 -07:00
Tapani Pälli
2758e65f28 add $SELINUX_LIBS to EGL and OpenVG lib deps
Correctly links against selinux library when MESA is built with --enable-selinux option.

Fixes bug #36333 in Freedesktop bugzilla

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:58:53 +10:00
Dave Airlie
bb31ecf4fb mesa/st: split updating vertex and fragment shader stages.
this seems like a logical thing to do and sets the correct st flags
for vertex textures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
6bd8647b54 st/mesa: only memset sampler when about to use it.
This function was taking a lot more CPU than required due to it memsetting
a bunch of memory that didn't require it from what I can see.

We should only memset here when we are about to fill out the sampler,
otherwise we end up doing a bunch of memsets for everytime this function
is called, basically setting 0 memory to 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Dave Airlie
ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Eric Anholt
4e98318fc1 i965: Instead of fallback on missing region, just bind a null renderbuffer.
The change for GPU hanging in 13bab58f04
fell back even when rb == NULL, which is wrong for GLES2 and caused
segfaulting in GLES2 conformance.  For the GPU hang case (where the
broken 2D driver failed to allocate a BO for the window system
renderbuffer), it also would assertion fail/segfault immediately after
the fallback setup when the renderbuffer map failed.

Fixes GLES2 conformance packed_depth_stencil.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:17 -07:00
Kenneth Graunke
461e193971 i965: Updated fixed-point sizes in Ivybridge SAMPLER_STATE.
Texture LOD Bias is now S4.8 instead of S4.6;
Min LOD, and Max LOD are now U4.8 instead of U4.6.

Fixes piglit test tex-miplevel-selection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:48:16 -07:00
Kenneth Graunke
ead7d73a51 i965: Ivybridge uses the Gen4 SAMPLER_BORDER_COLOR_STATE.
Volume 5c 1.13.7 lists it as [PreDevILK] and [DevIVB+].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-17 23:47:52 -07:00
Kenneth Graunke
b2c1f8ff1d egl: Recognize Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
1b3d354743 intel: Recognize new Ivybridge PCI IDs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
7f5e0d2a90 i965: Disable register spilling on Ivybridge for now.
The data port messages for this are rather different.  For now, fail to
compile rather than hanging the GPU.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
344283de5d i965: Fix RNDZ and RNDE on Sandybridge and Ivybridge.
On gen4/5, the RNDZ and RNDE instructions return floor(x), but set special
"round increment bits" in the flag register; a predicated ADD (+1) fixes
the result.

The documentation still lists '.r' as existing, and says that the
predicated add is necessary, but it apparently lies.  According to the
simulator, BRW_CONDITIONAL_R (7) is not a valid conditional modifier
and the RNDZ and RNDE instructions simply produce the correct value.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
199a2f90ab i965: Fix data port reads on Ivybridge.
These also need to use gen7_dp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
2a95568f64 i965: Avoid register coalescing away MATH workarounds on Ivybridge.
The MATH instruction cannot handle source modifiers, even on Gen7.
So, apply this workaround for Sandybridge on Ivybridge as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
6e918163df i965: Make the CONT instruction point to the WHILE instruction.
This fixes piglit test glsl-fs-loop-continue.shader_test on Ivybridge.
According to the documentation, the CONT instruction's UIP field should
point to the WHILE instruction on both Sandybridge and Ivybridge.

The previous code made UIP point to the implicit DO instruction, which
seems incorrect.  I'm not sure how it could have worked on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
77397ef96e i965: Add support for loops on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:02 -07:00
Kenneth Graunke
64ce592679 i965: Add support for IF/ELSE/ENDIF control flow on Ivybridge.
Ivybridge's IF instruction doesn't support conditional modifiers.
It also introduces UIP, which must point to the ENDIF instruction.

ELSE and ENDIF remain the same except that JIP moves from dst to src1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
ff6e3c73f6 i965: Add support for Ivybridge texturing messages.
Ivybridge puts the shadow comparator first, then lod/bias, and finally
the coordinate---unlike previous generations which always reserved four
slots for the coordinate at the beginning.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
36f8de02e7 i965: Fix sampler message descriptor on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3f44043da3 i965: Fix SAMPLER_STATE on Ivybridge.
Most of this code copied from brw_wm_sampler_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
3984372104 i965: Mark some brw_wm_sampler_state.c helper functions as non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
b2b6cc6622 i965: Update SURFACE_STATE for Ivybridge.
I'm still not happy with the amount of code duplication here, but it
will have to do for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
c12a93d5c4 i965: Mark a few more brw_wm_surface_state functions as non-static.
I need to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
70c6cd39bd i965: Change brw_format_for_mesa_format to a non-static function.
This will make it easier to share between files.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
62b79b4bb9 i965: Set Address Modify Enable in VERTEX_BUFFER on Ivybridge.
Otherwise, Ivybridge seems to ignore the newly supplied data, giving us
rubbish for vertices.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:01 -07:00
Kenneth Graunke
09d881bf74 i965: Enable channel masks in Ivybridge's URB_WRITE_HWORD header.
This shouldn't be done using MRFs, but until I have a proper solution
for dealing with MRFs, this allows my hack to keep working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
97d4d6f77e i965: Fix the URB write message descriptor on Ivybridge.
The message header is still incorrect, but this is a start.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
ce526a7452 i965: Fix render target writes on Ivybridge.
Ivybridge shifts the data port messages by one bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
482e8a6cd5 i965: Mad hacks to avoid using MRFs on Ivybridge.
Ivybridge's SEND instruction uses GRFs instead of MRFs.  Unfortunately,
a lot of our code explicitly uses MRFs, and rewriting it would take a
fair bit of effort.  In the meantime, use a hack:

- Change brw_set_dest, brw_set_src0, and brw_set_src1 to implicitly
  convert any MRFs into the top 16 GRFs.
- Enable gen6_resolve_implied_move on Ivybridge: Moving g0 to m0
  actually moves it to g111 thanks to the previous hack.

It remains to officially reserve these registers so the allocator
doesn't try to reuse them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
550ad737f7 i965: Emit 3DPRIMITIVE Ivybridge-style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
fa4b23581b i965: Don't use the GS for breaking down quads on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
d58400eb4a i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
8c8985bdd7 i965: Add depth buffer support on Ivybridge.
This also disables the HiZ and separate stencil buffers.  We still need
to implement stencil.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
bc08d4ebb8 i965: Upload sampler state pointers on Ivybridge.
Since we currently only support sampling in the fragment shader, we only
bother to emit the PS variant.  In the future we'll need to emit others.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
a94fe79464 i965: Disable binding table pointers for unused pipeline stages.
This may not be necessary, but it seems like a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:33:00 -07:00
Kenneth Graunke
706dbf85f1 i965: Upload binding table pointers on Ivybridge.
Ivybridge uses per-stage commands to update binding table pointers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
e0e2c04596 i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.
Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits.  Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
bac10b58de i965: Explicitly disable unused pipeline stages on Ivybridge.
This may not be strictly necessary, but seems wise.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
6b2010df7d i965: Initial Ivybridge VS state.
Copied from gen6_vs_state.c; reuses create_vs_constant_bo from there.

The 3DSTATE_VS command is identical but 3DSTATE_CONSTANT_VS is not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
18402fbf79 i965: Initial Ivybridge Viewport state setup.
SF and CLIP viewport state has been combined into SF_CLIP_VIEWPORT;
SF_CLIP and CC state pointers can now be uploaded independently.

Some portions of the hardware documentation refer to separate upload
commands for SF and CLIP; these are outdated and incorrect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
81fd03fe56 i965: Initial Ivybridge Clip state setup.
Copied from gen6_clip_state.c.

This enables early culling and sets the necessary fields.  Otherwise, it
is entirely the same, so I doubt this patch is strictly necessary for a
functional driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
24d0ed72c1 i965: Initial Ivybridge CC state setup.
The state itself still seems to be the same; the only change is that
each part (CC, BLEND, DEPTH_STENCIL) can now be uploaded independently.
Thus, we still rely on the code in gen6_cc.c to set up the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
a924d69b57 i965: Initial Ivybridge WM/PS state setup.
Copied from gen6_wm_state.c.

The main change from Sandybridge seems to be that 3DSTATE_WM was split
into two separate state packet commands: 3DSTATE_WM and 3DSTATE_PS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
7d608d0c33 i965: Initial Ivybridge SF/SBE state setup.
Copied from gen6_sf_state.c.

The main change from Sandybridge seems to be that 3DSTATE_SF was split
into two separate state packet commands: 3DSTATE_SF and 3DSTATE_SBE
("setup backend").  The bit-offsets are even the same - only the DWords
numbers have shuffled around a bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
3dc4bc1f78 i965: Make gen6_sf_state.c's get_attr_override non-static.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:59 -07:00
Kenneth Graunke
8832920c29 i965: Initial Ivybridge URB space partitioning, including push constants.
Currently this always reserves 16kB for push constants, regardless of
how much space is needed, and partitions it evenly betwen the VS and FS.
This is probably not ideal, but is straightforward.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
477e2fe031 i965: Set maximum number of threads for Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
235fa21a09 i965: Split out tracked state atoms for Ivybridge.
Currently, gen7_atoms is a verbatim copy of gen6_atoms; future commits
will update it to contain gen7-specific state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
89a82d72ca intel: Initial IS_GEN7 plumbing.
Currently, IS_GEN7, IS_IVYBRIDGE, IS_IVB_GT1, and IS_IVB_GT2 all return
false.  This allows me to write the code for them before actually adding
the PCI IDs and thus enabling the hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d55471768e i965: Rename max_vs_handles to max_vs_entries for consistency.
The documentation uses the term "vertex URB entries", the code talks
about "entry size", and so on.  Also, handles are just "pointers" to
entries (actually small integers).

Also rename max_gs_handles to max_gs_entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
d0f0d06482 i965: Convert BRW_NEW_* dirty bits to use an enum.
This will make it much easier to add new dirty bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
c638180fc7 i965: Rework IF/ELSE jump target back-patching.
The primary motivation for this is to better support Ivybridge control
flow.  Ivybridge IF instructions need to point to the first instruction
of the ELSE block -and- the ENDIF instruction; the existing code only
supported back-patching one instruction ago.

A second goal is to simplify and centralize the back-patching, hopefully
clarifying the code somewhat.

Previously, brw_ELSE back-patched the IF instruction, and brw_ENDIF
back-patched the previous instruction (IF or ELSE).  With this patch,
brw_ENDIF is responsible for patching both the IF and (optional) ELSE.

To support this, the control flow stack (if_stack) maintains pointers to
both the IF and ELSE instructions.  Unfortunately, in single program
flow (SPF) mode, both were emitted as ADD instructions, and thus
indistinguishable.

To remedy this, this patch simply emits IF and ELSE, rather than ADDs;
brw_ENDIF will convert them to ADDs (the SPF version of back-patching).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
5936d96d33 i965: Move IF stack handling into the EU abstraction layer/brw_compile.
This hides the IF stack and back-patching of IF/ELSE instructions from
each of the code generators, greatly simplifying the interface.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
774fb90db3 i965: Get a ralloc context into brw_compile.
This would be so much easier if we were using C++; we could simply use
constructors and destructors.  Instead, we have to update all the
callers.

While we're at it, ralloc various brw_wm_compile fields rather than
explicitly calloc/free'ing them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:58 -07:00
Kenneth Graunke
ebeea98573 i965/gs: Move generation check for bailing earlier.
On Sandybridge, we don't need to break down primitives.  There's no need
to bother setting up brw_compile and such if it's not going to be used;
bail as early as possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:32:57 -07:00
Kenneth Graunke
c6175d7870 i965: Add _NEW_LIGHT to Gen6 clip state dirty bits.
ctx->Light.ProvokingVertex depends on _NEW_LIGHT.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-17 23:30:46 -07:00
Brian Paul
3559440873 mesa: add some missing GLAPIENTRY keywords
NOTE: this is a candidate for the 7.10 branch.
2011-05-17 21:24:05 -06:00
Tom Stellard
217cd216ea r300/compiler: Fix bug in rc_get_variables()
Variables that write to the same source select need to pe paired
together otherwise the register allocator might fail.

https://bugs.freedesktop.org/show_bug.cgi?id=36753
2011-05-17 19:13:47 -07:00
Marek Olšák
390196ecc7 u_vbuf_mgr: fix max_index computation when src_offset is abused as buffer_offset 2011-05-17 01:21:30 +02:00
Marek Olšák
a3ac28a736 mesa: make RGB9_E5 non-renderable on swrast again
_BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
2011-05-17 00:13:43 +02:00
Marek Olšák
947190ab4b Revert "mesa: set reasonable defaults in update_wrapper"
This reverts commit 1d5f16ff8f.

It breaks fbo-readpixels on swrast.
For some reason, swrast likes GL_RGBA and CHAN_TYPE.
2011-05-17 00:13:43 +02:00
Kenneth Graunke
1309d2ea72 i965: Pass brw_compile pointer to brw_set_src[01].
This makes it symmetric with brw_set_dest, which is convenient, and will
also allow for assertions to be made based off of intel->gen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-16 13:30:16 -07:00
Kenneth Graunke
2b8e7215eb i965: Fix "Paramater" typo in gen6_wm_state.c.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-16 09:41:00 -07:00
Benjamin Franzke
b8033a5651 egl: Compile wayland-drm.a into libEGL independent of egl_dri2
Fixes egl_gallium when egl_dri2 is not enabled.
2011-05-16 10:36:36 +02:00
Dave Airlie
c9aa3bbda4 st/mesa: overhaul vertex/fragment sampler and sampler views.
This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me.

I've no idea if someone had another plan for this that is smarter than what
I've done here, but what I've basically done is

split fragment and vertex sampler and sampler_view setup function, factor
out the common chunks of both.

side-cleanups:
drop st->state.sampler_list - unused
don't update border color if we have no border color.

should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bc16c73407 gallium: block signals for new thread when spawning threads
I'm hard pressed to think of any reason a gallium thread would want to
receive a signal, especially considering its probably loaded as a library
and you don't want the threads interfering with the main threads signal
handling.

This solves a problem loading llvmpipe into the X server for AIGLX,
where the X server relies on the SIGIO signal going to the main thread,
but once llvmpipe loads the SIGIO can end up in any of its threads.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-16 06:40:26 +10:00
Dave Airlie
bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Tom Stellard
6d539579ad r300/compiler: Use ALU Result for IF conditionals
This saves one instruction per IF.
2011-05-14 22:35:28 -07:00
Marek Olšák
8a4136f624 r300g: HiZ fixes
Nothing special, just changing conditions for when HiZ can be enabled and
when HiZ memory becomes invalid.

I was thinking about it again and realized it had not been quite right.
2011-05-15 03:28:32 +02:00
Marek Olšák
19f59dd413 r300g: don't set other HyperZ states if depth and stencil tests are disabled
Such as HiZ.
2011-05-15 03:28:32 +02:00
Marek Olšák
fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Marek Olšák
904f43f190 r300g: fix conversion from int to boolean 2011-05-15 03:26:29 +02:00
Marek Olšák
51095f74cf u_vbuf_mgr: fix max_index computation once again
See how I compute and use the 'unused' variable in the code.
It's crucial for getting max_index right.

Fixed with the help of apitrace.
(bisecting the problematic draw call manually was not fun though)

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36268
https://bugs.freedesktop.org/show_bug.cgi?id=36609
2011-05-14 20:03:03 +02:00
Marek Olšák
ad2999d211 st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels
GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-14 01:53:30 +02:00
Kenneth Graunke
2bba244329 i965: Use BRW_DATAPORT_READ_TARGET_DATA_CACHE instead of 0.
Using the #define'd constant is better than 0 with a comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-05-13 15:20:52 -07:00
Kenneth Graunke
c77855d64e i965: Rename dp_render_target struct to gen6_dp.
This is actually just the message descriptor for Gen6+ dataport access;
it has nothing to do with the render cache.  Access to the sampler cache
and constant cache also would use this struct; rename for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:20:45 -07:00
Kenneth Graunke
17eaff77b0 i965: Attempt to un-muddle Gen6 data port message target defines.
These are documented on page 245 of IHD_OS_Vol4_Part2.pdf (the public
Sandybridge documentation/SEND instruction description).

Somebody had the bright idea to reuse gen4/5 defines labelled READ/WRITE
which just happened to be the same values as Render Cache/Sampler Cache.
It turns out that this field has nothing to do with READ/WRITE on
Sandybridge, but rather represents which data port to direct it to.

This was especially confusing in brw_set_dp_read_message, which
used "BRW_MESSAGE_TARGET_DATAPORT_WRITE."  In a read function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-05-13 15:19:31 -07:00
Christoph Bumiller
5f5d486717 nvc0: prevent overlap between load address and destination regs
For example, an indirect load like "ld b128 $r0q c0[$r0]" seems to
overwrite the address register before finishing the load, but only
if there are a lot of threads running.

Visible as displaced geoemtry in Unigine Heaven.
2011-05-13 18:47:54 +02:00
Marek Olšák
dd445ae120 docs: update relnotes-7.11 2011-05-13 18:10:30 +02:00
Marek Olšák
e28e3a774c st/mesa: expose ARB_shader_texture_lod if SM3 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-13 17:57:56 +02:00
Matt Turner
fae77579ad util_logbase2 takes and returns unsigned, not int
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:50 -06:00
Matt Turner
c5ac8a8aa2 Remove redundant util_unsigned_logbase2
util_logbase2 is exactly the same function.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:34 -06:00
Matt Turner
48a0a096f8 u_math.h: Remove redundant mingw32 ffs definition
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-12 16:37:20 -06:00
Benjamin Franzke
184bb09ff5 st/egl: Implement EGL_WL_bind_wayland_display for x11,drm,wayland 2011-05-13 09:31:10 -04:00
Benjamin Franzke
83c68758be egl_dri2: Discard similar configs 2011-05-13 09:31:09 -04:00
Kristian Høgsberg
93aea63a33 egl_dri2: Make it possible to not compile in the X11 platform 2011-05-13 09:31:09 -04:00
Francesco Marella
64e3cd0c42 nvfx: fill some PIPE_CAPs
Signed-off-by: Francesco Marella <francesco.marella@gmail.com>
2011-05-13 14:56:40 +02:00
Kenneth Graunke
f247b2d633 i965: Fix incorrectly named data port define.
According to my documentation this is actually "Media Block Write" on
Gen4-5; there has never been a "DWord Block Write."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:36:07 -07:00
Kenneth Graunke
ceaec24149 i965: Fix typo in Gen6 "DWord Scattered Write" message define.
It's DWORD, not DWORLD.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-13 08:35:13 -07:00
Vinson Lee
ac85ab066b i915g: Fix typos in print messages. 2011-05-12 23:21:58 -07:00
Dave Airlie
c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Dave Airlie
1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie
240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie
d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie
d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie
5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
José Fonseca
5de2c67ba7 egl/dri2: Avoid unused static functions. 2011-05-12 15:24:26 +01:00
José Fonseca
4a47d6d46b egl/dri2: Prevent uninitialized variable dereference. 2011-05-12 15:23:48 +01:00
José Fonseca
6c26072bd1 egl/dri2: Fix const pointer duplication, prevent unitialized variable dereference.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:23:02 +01:00
José Fonseca
6a661895e9 egl: Fix int <-> ptr casts.
Based on zhigang gong <zhigang.gong@gmail.com>'s patch.
2011-05-12 15:12:16 +01:00
zhigang gong
6699cd4e8d glu: Fix _GLUfuncptr typedef.
typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning:
function declaration isn't a prototype.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-05-12 11:45:30 +01:00
José Fonseca
32a95cb70c mesa: Fix GetVertexAttrib* inside display lists.
GetVertexAttrib*{,ARB} is no longer aliased to the NV calls.

This fixes tracing yofrankie with apitrace, given it requires accurate
results from GetVertexAttribiv*.

NOTE: This is a candidate for the stable branches.
2011-05-12 01:09:55 +01:00
Tom Stellard
95c93651b4 r300/compiler: Fix bug in rc_get_variables()
Variables that share readers were not always being linked together.

https://bugs.freedesktop.org/show_bug.cgi?id=36939
2011-05-11 16:16:29 -07:00
Tom Stellard
4612554dce r300/compiler: Limit instructions to 3 source selects
Some presubtract conversions were generating more than 3 source
selects.

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

Note: This is a candidate for the 7.10 branch.
2011-05-11 16:16:29 -07:00
Tom Stellard
d1e8195c07 r300/compiler: Add simple unit test framework
Plus three tests for rc_inst_can_use_presub()
2011-05-11 16:16:29 -07:00
Alex Deucher
b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca
7a271151a5 mesa: Don't append fog code for programs that don't output color.
Fixes fdo 36919.

NOTE: This is a candidate for the stable branches.

It should be cherry-picked to the sames branches that
3aa21f93dc was.
2011-05-11 14:04:08 +01:00
José Fonseca
2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
José Fonseca
a67ecfeebc st/wgl: Remove buggy assertion.
The assertion is wrong, now that state tracker can cope with a window with
zero width or height.
2011-05-10 16:13:05 +01:00
Maxim Levitsky
d6b248652a nv50: fix mistake in pipe caps for pre-NVA0 cards
Introduced by 531b12af35.
2011-05-10 10:16:54 +02:00
Kenneth Graunke
68074387a4 ir_to_mesa: Emit TXD instruction.
Mesa already supports this because of NV_fragment_program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
5a3a242a8f glsl: Add compiler support for ARB_shader_texture_lod.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-09 11:23:54 -07:00
Kenneth Graunke
1d4eb8d5d8 mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-09 11:23:54 -07:00
Marcin Slusarz
4e1b1cbd0d nv50/nvc0: make transfers aware of PIPE_TRANSFER_MAP_DIRECTLY
If state tracker asked us to map resource directly and we can't
do it (because of tiling), return NULL instead of doing full transfer
- state tracker should handle it and fallback to some other method
or repeat transfer without PIPE_TRANSFER_MAP_DIRECTLY.

It greatly improves performance of xorg state tracker on nv50+,
because its fallback (DFS/UTS) is much faster than full transfer.
2011-05-09 20:19:19 +02:00
Matt Turner
86852236a3 r300/compiler: align memory allocations to 8-bytes
Eliminates unaligned accesses on strict architectures. Spotted by Jay
Estabrook.

Signed-off-by: Matt Turner <mattst88@gmail.com>

NOTE: This is a candidate for the 7.10 branch.
2011-05-09 20:01:58 +02:00
Marek Olšák
7297f2ac3c r300g: unreference a zbuffer surface after decompression 2011-05-09 20:01:58 +02:00
Marek Olšák
56b39fcd8b r300g: remove redundant state variable hyperz_locked 2011-05-09 20:01:58 +02:00
Marek Olšák
801fbdf286 mesa: document instructions ir_to_mesa emits
GLSL stopped using:
   BRA, EXP, LOG, LRP, NRM3, NRM4, XPD.

GLSL started using:
   KIL, SCS, SSG, SWZ.
(omg why SWZ? isn't proc_src_register flexible enough?)

GLSL doesn't use these opcodes some Radeons do support:
   ARR, DP2A, DST, LRP, XPD.

These opcodes are now unused:
   AND, NOT, NRM3, NRM4, OR, XOR.
(plus maybe the NV extensions which are unused by Gallium)

In addition to that, we don't use two-dimensional indirect addressing,
which the Mesa IR can do.
2011-05-09 20:01:58 +02:00
Michel Dänzer
39be542f73 r300c: Fix up for register allocator rewrite.
Was broken by commit fe622bac0c ('r300/compiler:
Rewrite register allocator').
2011-05-09 18:26:50 +02:00
Jerome Glisse
b9e8ea6a27 r600g: anisotropic filtering support for evergreen hw
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-05-09 12:18:41 -04:00
Carl-Philip Haensch
ad904cdf98 r600g: add support for anisotropic filtering 2011-05-09 12:09:16 -04:00
Michel Dänzer
9d792d013c gallium: Factor out unknown endianness detection. 2011-05-09 12:29:47 +02:00
Matt Turner
991c1f0249 Don't allow compilation if endianness isn't known
PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of
ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here
only serves to allow bad things to happen.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:23:21 +02:00
Matt Turner
5e945863ca p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-05-09 12:22:59 +02:00
Marcin Slusarz
bd3ce30ee7 st/xorg: add some debugging messages to xorg_exa.c 2011-05-09 12:22:50 +02:00
Marcin Slusarz
6e0263fdd4 st/xorg: remove DEBUG_PRINT macro and add exa_debug_printf
Localizes preprocessor usage to one place.
2011-05-09 12:22:45 +02:00
Marcin Slusarz
7c5eaf5a2d st/xorg: fix compilation of xorg_exa.c with DEBUG_PRINT set to 1 2011-05-09 12:22:24 +02:00
Nicolas Kaiser
7074801ed7 cell: fix unbalanced parenthesis
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-08 07:41:26 -06:00
Matt Turner
de3d9fa956 mesa: add precision to M_PI constant
Value found in my math.h header.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:36:32 -06:00
Matt Turner
ebc0b2dca0 mesa: replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such.

log2(e) = ln(e)/ln(2) = 1/ln(2)

Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2
(right beside each other!) weren't the same.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-05-06 10:33:15 -06:00
Marek Olšák
03615c02d8 r300/compiler: implement TXD and TXL opcodes 2011-05-07 02:51:38 +02:00
Marek Olšák
d8e222d887 r300g: handle seamless_cube_map caps 2011-05-07 02:51:38 +02:00
Benjamin Franzke
6bb230970c egl/wayland: Follow wl_resource_destroy changes 2011-05-06 16:50:45 -04:00
Christoph Bumiller
531b12af35 nv50,nvc0: activate seamless cube map filtering 2011-05-06 21:11:03 +02:00
Marek Olšák
27d3e0b25c docs: update relnotes-7.11 2011-05-06 20:14:28 +02:00
Marek Olšák
483d2ea5e3 docs: update GL3 status 2011-05-06 20:14:28 +02:00
Marek Olšák
d931b0d8b3 r600g: implement seamless_cube_map for evergreen
The r600/r700 support will follow soon.
2011-05-06 20:13:05 +02:00
Marek Olšák
a5f0a11477 gallium: implement seamless cubemap extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
bf65c9ea41 mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-05-06 20:06:30 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Alex Deucher
3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Marcin Slusarz
3b2bc4ac5b gallium/xorg st/nv50: add PIPE_BIND_CURSOR
We need to distinguish surfaces for mouse cursors from scanouts,
because nv50 hardware display engine ignores tiling flags.
2011-05-06 19:09:23 +02:00
Kostas Georgiou
8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher
2c3232da7a egl_dri2: add new radeon pci ids
There seriously needs to be a better way to do
this.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:02:24 -04:00
Kristian Høgsberg
e5169e9615 egl: Add a cursor use bit to MESA_drm_image 2011-05-06 10:33:50 -04:00
Benjamin Franzke
834b84149d egl/wayland-drm: Generalize interface
Do not depend on _EGLDisplay and _EGLImage.
2011-05-06 10:33:50 -04:00
nobled
a3e2c8f31f glx: Check flush DRI extension version at runtime
The DRI driver itself might not have version 3 of the
DRI2 flush extension, in which case this would've
pointed to out of bounds memory...
2011-05-06 09:39:24 +02:00
Alex Deucher
31d27259b6 r600g: add back SOURCE_FORMAT setting that get accidently dropped
Spotted by Henri Verbeet

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 19:30:30 -04:00
Alex Deucher
5939bc03bc r600g: fix up the rules for enabling SOURCE_FORMAT(EXPORT_NORM)
Setting SOURCE_FORMAT to EXPORT_NORM is an optimization.
Leaving SOURCE_FORMAT at 0 will work in all cases, but is less
efficient.  The conditions for the setting the EXPORT_NORM
optimization are as follows:

R600/RV6xx:
BLEND_CLAMP is enabled
BLEND_FLOAT32 is disabled
11-bit or smaller UNORM/SNORM/SRGB

R7xx/evergreen:
11-bit or smaller UNORM/SNORM/SRGB
16-bit or smaller FLOAT

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:54:03 -04:00
Alex Deucher
bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie
5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher
d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Marcin Slusarz
a041525ed9 mesa: don't call git if it's not git repository
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:21 -07:00
Marcin Slusarz
02a6c9428d mesa: don't touch git_sha1.h if sha1 didn't change
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-05 13:49:15 -07:00
Henri Verbeet
f60235e73a r600g: Match alpha ref precision to color format precision.
This fixes piglit fbo-alphatest-formats on Evergreen.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-05-05 21:00:38 +02:00
Dave Airlie
dc4a3edcf9 Revert "DRI2/GLX: make swap event handling match spec"
This reverts commit 70227e21bb.

revert this until we sort things out, with a new glproto release
with compatible struct names.
2011-05-05 16:25:33 +10:00
Dave Airlie
ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Jesse Barnes
70227e21bb DRI2/GLX: make swap event handling match spec
We only handle a 32 bit swap count, so use the new structure definitions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
Jesse Barnes
6ae9e8cbab GLX: don't crash when indirect clients try to set an event mask
After sending the GLXChangeDrawableAttributes request, we also set a
local set of attributes on the DRI drawable.  But in the indirect case
this array won't be present, so skip the setting in that case to avoid a
crash.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-05-04 14:08:48 -07:00
José Fonseca
37058c3497 scons: Add a few more human friendly messages. 2011-05-04 14:10:24 +01:00
José Fonseca
da87370032 mesa/gdi: Silence gcc warning about unused result. 2011-05-04 14:10:15 +01:00
José Fonseca
9fbd708932 st/wgl: Allow to create pbuffers bigger than the desktop.
We use a hidden window for pbuffer contexts, but Windows limits window
sizes to the desktop size by default. This means that creating a big
pbuffer on a small resolution single monitor would truncate the pbuffer
size to the desktop.

This change overrides the windows maximum size, allow to create windows
arbitrarily large.
2011-05-04 13:09:14 +01:00
José Fonseca
c636daa145 st/wgl: Cope with zero width/height windows.
While ensuring the framebuffer area is never zero.
2011-05-04 13:09:13 +01:00
Brian Paul
fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Brian Paul
f85cd39fc4 mesa: remove unused restart.[ch] files
_mesa_PrimitiveRestartIndex() is in varray.c and glPrimitiveRestart()
is handled in the vbo module.
2011-05-03 18:22:04 -06:00
Ian Romanick
0f0179b8c2 glsl: Remove extra newline from error message 2011-05-03 14:51:02 -07:00
Alex Deucher
27477248d3 r600c: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 16:12:04 -04:00
Alex Deucher
c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Marcin Slusarz
a8bbce8d6d st/xorg: flush after loading the cursor
We need cursor data to land in destination buffer before drmModeSetCursor.
It fixes "cursor lag" on nv50.
2011-05-03 16:36:54 +02:00
Michel Dänzer
5829332a9b gallium/draw: Fix enum type taken by draw_get_shader_param().
Pointed out by clang:

src/gallium/auxiliary/draw/draw_context.h:251:41: warning: implicit conversion
from enumeration type 'enum pipe_cap' to different enumeration type
'enum pipe_shader_cap' [-Wconversion]
      return tgsi_exec_get_shader_param(param);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
2011-05-03 16:33:15 +02:00
Marek Olšák
5ba2e7adf0 mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-03 12:03:22 +02:00
Marek Olšák
93754d8499 r600g: reorder caps 2011-05-03 12:03:22 +02:00
Marek Olšák
320adb93a1 r600g: set correct PIPE_CAP_MAX_COMBINED_SAMPLERS 2011-05-03 12:03:22 +02:00
Marek Olšák
a677952e68 mesa: make AMD_draw_buffers_blend an alias of the ARB variant
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
3be1c7f260 glapi: regenerate files for AMD_draw_buffers_blend 2011-05-03 00:35:50 +02:00
Marek Olšák
9ecb46f59e glapi: add functions for AMD_draw_buffers_blend
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
62aa51b78a mesa: flush vertices before changing GL_RASTERIZER_DISCARD state, not after
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Marek Olšák
aafbaa9e6a mesa: make _NEW_TEXTURE dirty when changing GL_TEXTURE_CUBE_MAP_SEAMLESS
Otherwise there would be no way to know whether the state has been changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-05-03 00:35:50 +02:00
Christoph Bumiller
220abb7adf nv50,nvc0: advertise GL_FIXED vertex buffers as supported
We'll handle them like f64 vertex buffers, by falling back to
copying vertex data to the command buffer through translate.
2011-05-03 00:02:36 +02:00
Christoph Bumiller
f986a6560f mesa,st/mesa: fix WPOS adjustment
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-05-03 00:00:55 +02:00
Jon TURNEY
9cb800a97c Default to --disable-gallium-r300 if not --with-driver=dri
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-05-02 17:34:42 +02:00
Marek Olšák
02b352e2ac gallium: reorder fields of pipe_rasterizer_state to pack it more tightly
sizeof(struct pipe_rasterizer_state):
    Before: 32 bytes
    After: 28 bytes

Reviewed-by: Brian Paul <brianp@vmare.com>
2011-05-02 17:16:09 +02:00
Marek Olšák
ca6896ba14 r600g: document some new evergreen formats 2011-05-02 17:16:09 +02:00
Marek Olšák
929b3d8233 r600g: remove some more FIXME comments 2011-05-02 13:15:43 +02:00
Michel Dänzer
5815d06ac5 st/xorg: Fix two more instances of typo 'accle'. 2011-05-02 09:36:49 +02:00
Marcin Slusarz
951244c4cd st/xorg: fix typos 2011-05-02 09:28:16 +02:00
Eric Anholt
484b51d484 i965/gen6: Align interleaved URB writes for overflow outputs as well.
Fixes glsl-max-varyings.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35614
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-05-01 20:13:10 -07:00
Marcin Slusarz
eb0a9e9a5a targets/xorg-nouveau: load nouveau_dri.so instead of i915_dri.so 2011-05-02 02:39:44 +02:00
Marcin Slusarz
1654988562 targets/xorg-nouveau: add libnvc0.a to nouveau libs 2011-05-02 02:39:44 +02:00
Marek Olšák
0d5ceb5891 r600g: remove some FIXME comments
All texture LOD tests pass.
2011-05-02 01:43:33 +02:00
Marek Olšák
72c6a748b9 Revert "r600g: truncate point sampled texture coordinates"
This reverts commit 1dc204d145.

MC_COORD_TRUNCATE is for MPEG and produces quite an interesting behavior
on regular textures. Anyway that commit broke filtering in demos/cubemap.
2011-05-02 01:20:22 +02:00
Marek Olšák
fb8786bda3 st/mesa: remove set-but-unused variables 2011-05-01 14:31:41 +02:00
Marek Olšák
08520bdea2 tgsi: remove set-but-unused variables 2011-05-01 14:13:09 +02:00
Marek Olšák
cacdc42e36 draw: remove set-but-unused variable 2011-05-01 14:12:47 +02:00
Marek Olšák
425cfa139b rbug: remove set-but-unused variables 2011-05-01 14:07:31 +02:00
Marek Olšák
847d397b34 ir_to_mesa: remove set-but-unused variables 2011-05-01 14:02:36 +02:00
Marek Olšák
2032daced1 mesa: remove set-but-unused variables in texcompress_s3tc 2011-05-01 14:02:35 +02:00
Marek Olšák
2d2b546189 mesa: remove set-but-unused variable in bind_attrib_location 2011-05-01 14:02:35 +02:00
Marek Olšák
f507530d25 mesa: remove unused-but-set variable in extract_uint_rgba 2011-05-01 14:02:35 +02:00
Marek Olšák
97398d1d56 r300/compiler: remove set-but-unused variables 2011-05-01 14:02:35 +02:00
Marek Olšák
56e83b4aa2 r600g: remove set-but-unused variable 2011-05-01 13:25:52 +02:00
Marek Olšák
e9d2ef79de r600g: remove FIXME comment
DONTBLOCK is correctly handled in r600_bo_map.
2011-05-01 01:54:29 +02:00
José Fonseca
dc9e5ed5e1 mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean. 2011-04-30 22:38:00 +01:00
Tom Stellard
7679a4ddf4 r300/compiler: Cleanups from the regalloc merge 2011-04-30 13:15:29 -07:00
Tom Stellard
d7cf9833d7 r300/compiler: Add return statement to rc_list() 2011-04-30 12:57:09 -07:00
Tom Stellard
7edf7d1169 r300g: Fix scons build
Broken by the dependency on ralloc introduced by
fe622bac0c
2011-04-30 12:35:06 -07:00
Daniel Vetter
899b786b19 i915g: enable X-tiling for s3tc textures
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-04-30 20:42:34 +02:00
Tom Stellard
d379e938f0 r300/compiler: Enable swizzle packing in the allocator for r300 and r400 2011-04-30 11:00:16 -07:00
Tom Stellard
1b75d48e84 r300/compiler: Handle loops in the register allocator 2011-04-30 11:00:16 -07:00
Tom Stellard
ac952a11df r300/compiler: Handle loops in rc_get_readers() 2011-04-30 11:00:16 -07:00
Tom Stellard
fe622bac0c r300/compiler: Rewrite register allocator
The new allocator uses ra and does swizzle packing.

Also, a data structure (struct rc_variable) and associated functions have
been added for generating UD and DU chains.
2011-04-30 11:00:15 -07:00
Tom Stellard
e4a765ae2d ra: Add ra_set_node_reg()
This function can be used to avoid creating single register classes for
input/payload registers.  This makes optimistic coloring less likely
to fail.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-30 11:00:15 -07:00
Tom Stellard
dbac75fa2f r300/compiler: Use RC_MASK_W when converting RGB to Alpha instructions 2011-04-30 11:00:15 -07:00
Tom Stellard
4f4d1d06da r300/compiler: rc_reader_data: Add ExitOnAbort flag 2011-04-30 11:00:15 -07:00
Tom Stellard
bbcee3268a r300/compiler: Add more info to struct rc_reader
For pair instructions we need a reference to both the arg
and source.
2011-04-30 11:00:15 -07:00
Tom Stellard
6a6068e5e1 r300/compiler: Add remove dead sources pass
The instruction scheduler will sometimes leave orphaned sources when
converting instructions from RGB to Alpha.  If one of these orphaned
sources has an index greater than the maximum temporary register index,
then the compiler will incorrectly report "Too many hardware temporaries
used".  The dead sources pass cleans up these orphaned sources.
2011-04-30 11:00:15 -07:00
Marek Olšák
bd661a933b docs: add ARB_ES2_compatibility in relnotes-7.11 2011-04-30 12:02:01 +02:00
Marek Olšák
fdff7e635b st/mesa: expose ARB_ES2_compatibility if GL_FIXED vertex format is supported
Tested with softpipe and llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Marek Olšák
0f1e59deac mesa: accept GL_FIXED in glVertexAttribPointer (ARB_ES2_compatibility)
GL_FIXED should not be accepted in the other gl*Pointer calls in OpenGL.

There is a new piglit for this: arb_es2_compatibility-fixed-type.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-30 12:02:01 +02:00
Brian Paul
076bd11112 mesa: fix error string, remove out of date comment 2011-04-29 18:42:09 -06:00
Brian Paul
be293c14c6 mesa: remove commented-out #include 2011-04-29 18:40:56 -06:00
Thierry Vignaud
04bdb2f314 mesa: fix tarball creation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-29 17:56:35 -06:00
Eric Anholt
6a02679f01 i965/gen6: Fix LogicOp handling for GL_COPY and/or floating-point RTs.
We were accidentally leaving blending enabled for LogicOp GL_COPY,
which ARB_color_buffer_float/GL_RGBA32F-render (and friends) caught.
Additionally, the GL spec says that no LogicOp should be done to
floating-point targets, and the GPU gets really angry even if you say
to LogicOp GL_COPY to float.
2011-04-29 15:27:02 -07:00
Eric Anholt
3032582d03 i965: Remove dead entrypoints to state cache, rename the one that's left.
As we expanded the usage of the state cache, it grew extra
functionality.  However, with the recent state streaming rework, we're
back to the state cache being used only for shader kernels, which is
the piece of GPU state that's actually expensive to compute again from
scratch, since it involves compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:27:02 -07:00
Eric Anholt
acb4d5cd96 i965/gen4: Move the GS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:56 -07:00
Eric Anholt
8ba0c025a4 i965/gen4: Move clip state to state streaming
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
d6ba7b1603 i965: Drop the now unused brw_cache_data() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
bb7ff01deb i965: Fix up state dumping for SF state.
It was moved to state streaming a while back and this was left over.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:50 -07:00
Eric Anholt
588cebce2d i965/gen4: Move VS state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:43 -07:00
Eric Anholt
04e3f1d3c2 mesa: Add a bunch of documentation to the register allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:34 -07:00
Eric Anholt
a82a43e8d9 i965/gen6: Use the dynamic state base address to reduce relocations.
Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:23 -07:00
Eric Anholt
855f56ca13 i965/gen6: Move scissor state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:18 -07:00
Eric Anholt
5c742ea1ee i965: Move sampler state to state streaming.
Overall, across this series since the last set of numbers, gen6 3DMMES
taiji performance has dropped 0.8% +/- 0.3% (n=15), probably due to
the increased reissuing of state from some of the state objects that
otherwise never changed, and increased occurrence of the per-batch
overhead as we've increased how much we put in the batch BO without
increasing the batch BO's size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:14 -07:00
Eric Anholt
1a447749ed i965/gen4: Move WM state to state streaming.
The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:26:04 -07:00
Eric Anholt
c108a3f863 i965/gen6: Move the depth/stencil state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:59 -07:00
Eric Anholt
35e8fe5c99 i965/gen6: Move the blend state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:54 -07:00
Eric Anholt
2ee1fd2e8f i965/gen6: Move the color calc state to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:50 -07:00
Eric Anholt
d67c08319f i965: Move the CC VP to state streaming.
This is in a way a revert of f5bb775fd1.
The tiny win that had will be overwhelmed by the win of using the gen6
dynamic state base address.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:49 -07:00
Eric Anholt
8d2047ca7e i965/gen6: Move the SF VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:45 -07:00
Eric Anholt
3628e123f1 i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:41 -07:00
Eric Anholt
32cc0c9d8d i965/gen6: Stream the VS push constants.
Improves 3DMMES taiji demo performance by 10.1% +/- 0.9% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:37 -07:00
Eric Anholt
90c70123b8 i965/gen6: Stream the WM push constants.
Improves 3DMMES taiji demo performance by 5.1% +/- 1.9% (n=15), by
reducing CPU time spent thrashing around those tiny little constant BOs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:25:30 -07:00
Eric Anholt
530de3a2f5 i965: Give the push constants and pull constants unique function names.
This helps clarify profiling results.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-29 15:23:21 -07:00
Eric Anholt
03b2e0fcdf i965: Fix fragcoord_w on gen6 with 16-wide.
The payload regs can go all the way up to register 60+, so just give
them 8 bits to be addressed by instead of 3-4 (which made source_w_reg
of 8 end up 0).  There's no reason to aggressively pack these fields,
as they are just used as compiler information, where being easier to
access is probably more important than shaving a byte or two off of
the structure.

Fixes piglit fragcoord_w.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36649
2011-04-29 12:25:21 -07:00
Eric Anholt
8c1637a4c2 meta: Don't ask for floating point textures if not ARB_texture_float.
I was promoting to float for ARB_color_buffer_float unclamped, which
failed when ARB_texture_float wasn't present.  Since the metaops don't
need results outside of [0,1] when not drawing to a floating point
destination, they can just use a fixed point texture when floating
point destinations are impossible.

Fixes regression in fdo23670-depth_test when --enable-texture-float is
not present.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36473
2011-04-29 12:02:44 -07:00
Brian Paul
2be2e1d3ad mesa: fix a few incorrect error messages 2011-04-29 12:03:48 -06:00
Benjamin Franzke
dc520d4fef egl/wayland: Fix possible lockup in drm initialization
Lockup happens when wl_drm interface is not available.
2011-04-29 17:05:16 +02:00
Jon TURNEY
8a58eccc62 Add git_sha1.h to .gitignore
Since commit de579a1 "Include GIT SHA1 in GL version string"

$ git status
 On branch master
 Your branch is ahead of 'origin/master' by 2 commits.

 Untracked files:
   (use "git add <file>..." to include in what will be committed)

       src/mesa/main/git_sha1.h
nothing added to commit but untracked files present (use "git add" to track)

Add git_sha1.h to .gitignore so git knows not to warn it is present but untracked

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-29 12:56:53 +01:00
Marek Olšák
f8279fb9d8 r600g: print opcodes names instead of numbers 2011-04-29 13:16:40 +02:00
Marek Olšák
f974bdebee docs: update relnotes-7.11 2011-04-29 11:32:55 +02:00
Marek Olšák
aed76e5af3 docs: update GL3 status 2011-04-29 11:32:55 +02:00
Marek Olšák
aeac658e25 mesa: remove unused variable bytesPerRow 2011-04-29 11:32:55 +02:00
Marek Olšák
8b558451ad r600g: implement EXT_packed_float 2011-04-29 11:31:55 +02:00
Marek Olšák
e62530a6c0 st/mesa: support EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
631d23daa9 mesa: implement EXT_packed_float
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-29 11:31:55 +02:00
Marek Olšák
b48359184e util: implement R11G11B10_FLOAT pack/unpack functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1271424615 mesa, util: move RGB9E5 conversion functions to gallium/util
Also use MAX3 and incorporate Ian's suggestion in texformat.c.

I don't think wrapping u_format_rgb9e5.h in another header and thus making it
more complicated is worth it.
2011-04-29 11:31:55 +02:00
Marek Olšák
de9f55437a r600g: trivially implement EXT_texture_shared_exponent
Nothing else needed.
2011-04-29 11:31:55 +02:00
Marek Olšák
349184be36 util: implement R9G9B9E5 pack and unpack functions
softpipe and llvmpipe support done (sampler only).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1da44f5923 st/mesa: support EXT_texture_shared_exponent
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
9d7698c468 mesa: implement EXT_texture_shared_exponent
swrast support done.

There is no renderbuffer support in swrast, because it's not required
by the extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Marek Olšák
1d5f16ff8f mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5.

Instead of setting GL_RGBA and CHAN_TYPE for most types,
use the helper functions to obtain the info.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-29 11:31:55 +02:00
Christopher Egert
608a4a17fe i915g: Enable S3TC texture support
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-29 02:15:07 +02:00
Kenneth Graunke
19efd1442c prog_print: Add support for printing the TXD opcode.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-28 14:51:29 -07:00
Brian Paul
8cce283038 llvmpipe: move active_query assignment
Fixes piglit regression.
2011-04-28 12:41:49 -06:00
Brian Paul
284191560b llvmpipe: move active_query assignment in lp_setup_begin_query()
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-28 07:51:55 -06:00
José Fonseca
fa7a051c25 sgi: Fix MSVC build.
Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.
2011-04-27 19:06:07 +01:00
Brian Paul
f9cc6acbfa st/mesa: raise shader MaxParameters if driver supports more
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-04-27 11:58:42 -06:00
Brian Paul
f3c92c2323 mesa: emit more info in program parser error message 2011-04-27 11:57:04 -06:00
Brian Paul
0be6ae74e9 svga: emit user-defined clip plane state
User-defined clip planes were a swtnl fallback before.
2011-04-27 11:51:30 -06:00
Eric Anholt
33afdf8356 docs: Note that ES2_compatibility is already done. 2011-04-27 09:48:38 -07:00
Eric Anholt
aa3e1c25d3 Revert "intel: use throttle ioctl for throttling"
This reverts commit 50ade6ea69.

Fixes jerky rendering again on apps that don't block on the GPU per
frame and are GPU bound (e.g. 3DMMES on Ironlake).  The whole point of
this complicated throttle scheme is to wait on frame n-1 to have
started rendering before starting frame n's rendering.  Otherwise, the
GPU-bound app will race ahead and call the GL to draw many
nearly-identical frames, then >0ms later get stuck waiting for them
(all dispatched at about the same time) to retire, then render a new
batch of nearly-identical frames.
2011-04-27 09:48:26 -07:00
Brian Paul
66d95919d5 st/mesa: choose 3-component float formats before 4-component formats
If GL_RGB16F or GL_RGB32F is specified let's try the 3-component float
texture formats before trying the 4-component ones.  Before this,
GL_RGB16/32F were treated the same as GL_RGBA16/32F.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-04-27 09:06:31 -06:00
Brian Paul
48aa772589 st/mesa: whitespace fixes 2011-04-27 09:05:30 -06:00
Marek Olšák
b8de75d537 util: make macros MIN3, MAX3, MIN4, MAX4 little more efficient 2011-04-27 13:16:35 +02:00
Marek Olšák
069a9766a9 mesa: add macros MIN3 and MAX3 2011-04-27 13:16:35 +02:00
Marek Olšák
7e5953fca2 gallium/nouveau: fix printf warnings 2011-04-27 13:16:35 +02:00
Marek Olšák
31200d0688 gallivm: fix warning: ‘value’ may be used uninitialized in this function
The path where it's uninitialized is guarded by an assert.
2011-04-27 13:16:35 +02:00
Marek Olšák
e031bed122 st/mesa: fix warning: ‘user_memory’ may be used uninitialized in this function
It's initialized later in a conditional the condition of which is always true
the first time it's evaluated.
2011-04-27 13:16:35 +02:00
Marek Olšák
1e5dc6a778 svga: fix warning: ‘uc.ui’ may be used uninitialized in this function
This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.
2011-04-27 13:16:35 +02:00
nobled
39cd791f34 os: simplify ifdef
The actual code that needs this include is just using
"if defined (PIPE_OS_UNIX)", and the two conditions should match.

This should also make the file compile under Hurd.
2011-04-27 11:35:02 +01:00
Brian Paul
2d422a6c48 docs: fix typo, wrap lines in 7.11 release notes 2011-04-26 14:58:33 -06:00
Brian Paul
83eda35f16 docs: add GL_ARB_robustness to 7.11 release notes 2011-04-26 14:57:57 -06:00
Brian Paul
6b329b9274 Squashed commit of the following:
commit 864fe253b04105b7469e5f7b064dc37637b944f8
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Apr 21 20:13:07 2011 -0600

    mesa: s/exec/disp/ in _mesa_init_histogram_dispatch()

    This function isn't normally compiled (FEATURE_histogram).

commit f4bf45e2b94b582cacd19cdca873c5be627e4250
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: hook up GL_ARB_robustness dispatch functions

    ...and advertise the extension.

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 2b89e38e5f572dc40cebc06381ae7c5d04386998
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:58 2011 -0600

    mesa: regenerated API files for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    glapi: add ARB_robustness xml

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: implement GL_ARB_robustness functions

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 938fd71f4c4742f274922d53492a7290ab8d9c9b
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add context fields for GL_ARB_robustness

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 72075137bc79e65be03dac7e97b6dba93c3a86a4
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize more bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 32a3fc23746db49da903fbc08afa0135af3007d2
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: standardize some bounds-checking error messages

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit cecbf1f4d164207de373dec0cadee2e84e1f9656
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add more bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit edc895b52383d5bd274422db56adead1d81daf5f
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: add bounds-checking support for client memory buffers

    Signed-off-by: Brian Paul <brianp@vmware.com>

commit 3a96ef28a538f158a219b406cd090dee70470c85
Author: nobled <nobled@dreamwidth.org>
Date:   Thu Apr 21 07:53:57 2011 -0600

    mesa: use is_bufferobj() helper function

    Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-26 14:54:41 -06:00
Eric Anholt
37642518b8 i965/fs: Add support for compute-to-mrf in 16-wide mode.
This is more painful than instruction scheduling, as we have to
compare two MRF writes to see if they coincide, and have to handle
partial GRF writes before that (for example, the result of a math
instruction written to color).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:22 -07:00
Eric Anholt
445289b509 i965/fs: Typo fix a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:19 -07:00
Eric Anholt
0834607a89 i965/fs: Enable constant propagation in 16-wide.
All that needed fixing was skipping the newly-possible
uncompressed/sechalf partial GRF constant writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:16 -07:00
Eric Anholt
91d1a14158 i965/fs: Fix and enable the instruction scheduler for 16-wide.
Most of the work of the scheduler is agnostic to wide dispatch.  It
operates on our virtual GRF file, which means instructions are
generally referring to 8 or 16 wide naturally.  For the MRF file
management we're trying to track the actual hardware MRF file, so we
need to watch if an instruction writes multiple MRFs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:12 -07:00
Eric Anholt
3b20f999bb i965/fs: Add support for 16-wide dispatch with uniforms in use.
This is glued in in a bit of an ugly way -- we rely on the uniforms
having been set up by 8-wide dispatch, and we just reuse them without
the ability to add new uniforms for any reason, since the 8-wide
compile is already completed.  Today, this all works out because our
optimization passes are effectively the same for both and even if they
weren't, we don't reduce the set of uniforms pushed after
optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:05 -07:00
Eric Anholt
b061b5ffb0 hash_table: Add an iterator for doing things like cleanup of the HT.
Without this, consumers often have to keep linked lists of the
entries, at additional malloc cost.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:20:02 -07:00
Eric Anholt
b943b9b1a6 i965/fs: Add a little whitespace between shader dumping debug.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:59 -07:00
Eric Anholt
9c57780dc0 i965/fs: Add support for compr4 MRF writes.
These reduce an emitted (not decoded) instruction per shader on
g4x/gen5, but may allow for additional register coalescing as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:52 -07:00
Eric Anholt
42ad2f0b9b i965/fs: Add support for 16-wide dispatch on gen5.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:49 -07:00
Eric Anholt
662f1b48bd i965/fs: Add initial support for 16-wide dispatch on gen6.
At this point it doesn't do uniforms, which have to be laid out the
same between 8 and 16.  Other than that, it supports everything but
flow control, which was the thing that forced us to choose 8-wide for
general GLSL support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:46 -07:00
Eric Anholt
76b7a0c1af i965/fs: Add support for discard instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:43 -07:00
Eric Anholt
148a32e622 i965/fs: Add support for math instructions in 16-wide mode.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:40 -07:00
Eric Anholt
54990673a6 i965/fs: Fix interference calculation of pixel_[xy] in 16-wide.
Fixes glsl-fs-ceil in that mode, which produced the code in the comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:33 -07:00
Eric Anholt
af20328271 i965/fs: Disable some optimization passes under 16-wide for now.
These are fixable for 16, but that can wait until after it's basically
working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:30 -07:00
Eric Anholt
8575d18362 i965/fs: Add support for 16-wide texturing on gen5+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:27 -07:00
Eric Anholt
141b0bb277 i965/fs: Add support for computing pixel_[xy] in 16-wide.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:25 -07:00
Eric Anholt
2ac1cb8b83 i965/fs: Add support for 16-wide dispatch to the register allocator.
Note that the virtual grfs are in increments of the dispatch_width,
not hardware registers -- this makes the 16-wide emit and 8-wide emit
mostly the same.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:21 -07:00
Eric Anholt
7c647a2fe9 i965: Move the destination reg setup for 8/16 wide to the emit code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-26 12:19:05 -07:00
Kristian Høgsberg
5dfba09d49 intel: Use tiling for dri2AllocateBuffer implementation 2011-04-26 13:26:34 -04:00
Kristian Høgsberg
7363088f9f intel: Set gen in intelInitScreen, just copy value in intelInitContext 2011-04-26 13:26:31 -04:00
Kristian Høgsberg
63325a0586 intel: Use X tiling for DRM EGL Images 2011-04-26 13:26:28 -04:00
Ian Romanick
cd354b4eb8 mesa: Remove SWcontext::_FogMode, use gl_context::gl_fog_attrib::Mode everywhere
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-25 18:27:17 -07:00
Kristian Høgsberg
f274dfaca4 egl: Use the right extension name in #ifdef 2011-04-25 15:34:04 -04:00
Kristian Høgsberg
b6ed837ffe wayland: Fix prototypes for EGL_WL_bind_wayland_display extension 2011-04-25 15:07:15 -04:00
Nicolas Kaiser
4dfbb81891 main: remove duplicated includes
Remove duplicated includes of guarded headers.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-25 11:03:01 -06:00
Benjamin Franzke
6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke
d72e7f0dd9 st/egl: Add wayland shm softpipe support 2011-04-25 10:45:57 -04:00
Benjamin Franzke
34fd282b27 st/egl: Generalize wayland backend a bit 2011-04-25 10:45:56 -04:00
Benjamin Franzke
aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Henri Verbeet
b2a98c3531 r600g: Unify comment style somewhat.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:22 +02:00
Henri Verbeet
d7577ae3a6 r600g: Cleanup the big endian support a bit.
In particular, make sure the code is at least compiled on little endian
systems.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Henri Verbeet
32001c2244 r600g: Use EG constants in EG r600_colorformat_endian_swap().
This would actually fail to compile when PIPE_ARCH_BIG_ENDIAN is defined.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-25 14:06:21 +02:00
Marek Olšák
0fecb928f5 configure.ac: require LLVM for r300g on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
a86fc719d6 configure.ac: enable LLVM by default on x86 and x86_64 2011-04-25 13:45:05 +02:00
Marek Olšák
9e59ed59c1 mesa: add stricter checks for float formats in the texstore memcpy path
E.g. when the internal format was RGBA16F and the source was RG, it would use
memcpy.
2011-04-25 13:45:05 +02:00
Marek Olšák
628544421d mesa: implement generate-mipmap fallback for RGB10_A2
I hit this when testing RV350, which lacks RGB10_A2 render target
support. It had been missed when implementing the format and probably
unused by anything else too.

Not applicable to 7.10.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-25 13:45:05 +02:00
Vinson Lee
077b1a6144 r600g: Remove r600_helper.c from SConscript.
This is a follow-up to commit d737857ed2.
2011-04-24 23:58:39 -07:00
Marek Olšák
774c165d76 docs: update GL3 status 2011-04-25 01:54:12 +02:00
Marek Olšák
71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák
512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Marek Olšák
def6a91a62 r600g: trivially implement LATC/3DC
Passes fbo-generatemipmap-formats.
2011-04-25 01:20:40 +02:00
Dave Airlie
d737857ed2 r600g: drop r600_helper.c no point in it
move the one function into state common

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 09:06:14 +10:00
Dave Airlie
de48199693 r600g: enable EXT_draw_buffers2
Doesn't cause any piglit regression and passes the fbo-draw-buffers-blend
test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 06:55:09 +10:00
Dave Airlie
863eecd0d8 st/mesa: fix regression since a22aba4eae
"st/mesa: check image size before copy_image_data_to_texture()" caused
a regression in piglit fbo-generatemipmap-formats test on all gallium drivers.

Level 0 for NPOT textures will not match minified values, so don't do this
check for level 0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-25 05:59:47 +10:00
Dave Airlie
0a9cec3475 r600g: fix glean clipflat test.
the provoking vertex doesn't apply to quad/strip/polygon.

This fixes clipFlat on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 20:35:06 +10:00
Marek Olšák
0b3122cfcb r300g: reorder caps 2011-04-24 12:00:00 +02:00
Marek Olšák
0c71da18ee r300g: fix exposing caps on r300-r400
Broken with 72239d16cd.
2011-04-24 12:00:00 +02:00
Bryan Cain
f18a086326 glsl: Fix typos in comments. 2011-04-23 21:33:47 -07:00
Dave Airlie
6372660d12 r600g: fix glsl-fs-abs-neg
the hw does neg after abs, so don't neg the source in the ABS instruction case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 11:04:46 +10:00
Dave Airlie
77dc4c154c r600g: fix bank swizzle calcs for scalar only operations.
In the initial code if we had nothing in the vector slots r would
never get reset to 0, so we'd fail to compile shaders, after the previous
commit this would happen for the LIT tests. When I fixed that we did a lot
of unnecessary loops through all the vector states when we had no vector
slots filled. So this patch optimises thing for the scalar only state.

This fixes the 3 LIT piglit tests on r600g.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:33:19 +10:00
Dave Airlie
22d5a71e4d r600g: PV/PS have cycle restrictions in scalar operations
In the R600 ISA document:
Section 4.7.5 Cycle restrictions for the ALU.trans states that
PV/PS have cycle restrictions wrt constants.

This is part of a fix for the LIT tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-24 08:30:08 +10:00
Eric Anholt
e4da46e007 mesa: Add some comments about FRAG_RESULT_COLOR vs FRAG_RESULT_DATAn.
This came from reading what swrast does, and 965 now behaves the same
and gallium appears to as well.
2011-04-23 13:21:58 -07:00
Eric Anholt
d7f4c4e1b1 mesa: Fix fragment.color (no index) writes with OPTION ARB_draw_buffers.
Fixes a bug in Trine where fragment.color would write
FRAG_RESULT_COLOR (which is interpreted by drivers as being the "write
this to all color buffers" option) instead of FRAG_RESULT_DATA0 (just
the first target).

Fixes piglit ATI_draw_buffers/arbfp-no-index.
2011-04-23 13:21:57 -07:00
Eric Anholt
79bde19ef9 i965: Don't double-emit fragment.color writes for MRT with ARB_fp. 2011-04-23 13:21:57 -07:00
Eric Anholt
bad8da8b00 i965: Fill in the remaining fields of gen5+ sampler default color.
Still doesn't fix texwrap.
2011-04-23 13:21:57 -07:00
Eric Anholt
e1e6545c88 i965: Fix batch decode for the gen5+ sampler default color. 2011-04-23 13:21:57 -07:00
Eric Anholt
1f32c665c8 intel: Add support for ARB_sampler_objects.
This extension support consists of replacing
"gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->".
One instance of referencing the texture's base sampler remains in the
initial miptree allocation, where I'm not sure we have a clear
association with any texture unit.

Tested with piglit ARB_sampler_objects/sampler-objects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
1df72402d9 i965: Add support for NV_conditional_render.
Since we lack hardware support for it, this is a simple matter of
checking _mesa_check_conditional_render at the entrypoints, and
suppressing it for the metaops where it doesn't apply.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:21:57 -07:00
Eric Anholt
332822bd3d swrast: Disable glAccum drawing during conditional rendering. 2011-04-23 13:21:56 -07:00
Eric Anholt
fb60040b69 meta: Don't do conditional rendering on GenerateMipmaps and BlitFramebuffer.
The NV_conditional_render spec calls out specific operations that
conditional rendering applies to, which doesn't include these.

Fixes NV_conditional_render/generatemipmap on swrast.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
4093fdce6d i965: Add support for ARB_texture_compression_rgtc.
Tested with rgtc-teximage-0[12].
EXT_texture_compression_rgtc/fbo-generatemipmap-formats fails in NPOT
just like S3TC does.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
7d1a2056a8 mesa: Don't assert on the compressed convertformat for GenerateMipmaps.
This assertion doesn't make any sense to me -- the convertFormat is
already something valid (tested above), and the BaseFormat dictated by
convertFormat doesn't matter to the function about to be called (it's
the datatype/comps that were pulled out of convertFormat).

Fixes assertion failure in
GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats

(still has a rendering failure in NPOT like S3TC does).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
Eric Anholt
bc880b8d40 mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.
We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-23 13:14:56 -07:00
José Fonseca
da49de811d mesa/gdi: Address compiler warnings.
In particular the function prototypes.
2011-04-23 20:25:11 +01:00
José Fonseca
5bd545f5aa mesa/gdi: Remove InitCritSections.cpp.
We are now able to declare global critical sections through other
mechanisms so this is useless code.
2011-04-23 18:44:19 +01:00
José Fonseca
336487450e Drop fx windows driver.
Irrelevant now that glide driver was removed.
2011-04-23 18:32:56 +01:00
Jakob Bornecrantz
fed8a07ddb glu: Fix linux build 2011-04-23 17:01:19 +02:00
Jakob Bornecrantz
97efac09b2 glu: Clone the enviroment 2011-04-23 16:58:48 +02:00
José Fonseca
c2c44f2641 docs: Remove MSVS project files.
They were totally broken for several releases.

scons now builds everything the project files built and more, and can be
kept up-to-date with little effort.
2011-04-23 13:18:45 +01:00
José Fonseca
d34ddad9a5 scons: Build glu. 2011-04-23 13:16:03 +01:00
José Fonseca
15eaf8297e scons: Build classic mesa gdi driver.
Build as

  scons platform=windows mesagdi
2011-04-23 12:41:28 +01:00
José Fonseca
4c92f3fa6e osmesa: Fix Mingw build.
Build as

  scons platform=windows osmesa
2011-04-23 12:23:42 +01:00
José Fonseca
8e8a56eaa0 scons: Build osmesa.
Just type

  scons osmesa
2011-04-23 12:22:59 +01:00
José Fonseca
c89cca648d mapi/glapi: Avoid warnings about visibility being unsupported on MinGW. 2011-04-23 12:14:39 +01:00
José Fonseca
abda64efce mesa/vf: Remove.
Unused.  Probably replaced by translate module.
2011-04-23 11:49:41 +01:00
José Fonseca
de29ee0e6d graw: Replace dead symlinks to delete python statetracker shaders with their contents. 2011-04-23 11:07:27 +01:00
Brian Paul
931432fea6 draw: fix point/line/tri flushing bug in vbuf code
Need to reset the point/line/tri functions to point to the "first"
versions whenever we flush vertices.  Fixes unfilled polygon rendering
errors seen in demos/samples/logo.c.  See comments for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-04-22 13:39:50 -06:00
Marek Olšák
72239d16cd r300g: do not advertise color_buffer_float on r300 and r400
It seems they can't do unclamped vertex colors. Tested on RV350.
2011-04-22 20:25:24 +02:00
Marek Olšák
9d07ff63fc r300/compiler: fix up error message 2011-04-22 20:25:24 +02:00
Benjamin Franzke
01b036adea egl/wayland: Follow buffer.attach removal 2011-04-22 12:21:46 -04:00
Benjamin Franzke
b1a9172277 egl/wayland: Update to buffer.damage addition 2011-04-22 12:21:37 -04:00
Marek Olšák
5b2ff543ab configure.ac: fix up the help text for --enable-gallium-r300 2011-04-22 16:56:31 +02:00
Marek Olšák
673cec467a r300g: disallow A16F,L16F,LA16F,I16F texture formats on DRM<2.8.0 2011-04-22 16:19:41 +02:00
Benjamin Franzke
400a99a679 st/egl: Update to wayland protocol,egl changes 2011-04-22 08:56:36 -04:00
Benjamin Franzke
f09c66b3cc egl_dri2: Create wl_buffers for pixmap surfaces
Needed since wayland-egl doesnt do this anymore.
2011-04-22 08:56:33 -04:00
Benjamin Franzke
1617b268ef egl/wayland: Add new version parameter for post_drm 2011-04-22 08:56:30 -04:00
Benjamin Franzke
2225397d1c egl/wayland: Fix prefixes for interface names 2011-04-22 08:56:27 -04:00
Marek Olšák
1faf079a69 swrast: fix readpix clamping
Broken with e5c6a92a12. (ARB_color_buffer_float)

Clamping should occur if type != float, otherwise the MSBs of the resulting
pixels are killed off. For example, reading back LUMINANCE = R+G+B can be
greater than 0xff, but the result is naturally masked by 0xff
for UNSIGNED_BYTE, leading to bogus results.

The following bug report seems to want clamping to occur if type == half_float
too. Not sure what's correct.

Bug: [bisected pineview] oglc case pxconv-read failed
https://bugs.freedesktop.org/show_bug.cgi?id=35852

Tested by: Fang Xun <xunx.fang@intel.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-22 06:35:36 +02:00
Kristian Høgsberg
7142a67473 WL_bind_wayland_display: clarify that context must be NULL 2011-04-21 23:47:59 -04:00
Ian Romanick
d439491a77 i915: Gut all remaining bits of hardware fog
None of this ever gets used.  Fog is always calculated by a fragment
program.  Even though the fixed-function fog unit is never used, state
updates are still sent to the hardware.  Removing those spurious state
updates can't hurt performance.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:41 -07:00
Ian Romanick
499f7c0114 i915: i915_context::vertex_fog is always I915_FOG_NONE, so kill it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:38 -07:00
Ian Romanick
c41cb17037 i915: There's always a fragment program
Fragment programs are generated by core Mesa for fixed-function.
Because of this, there's no reason to handle cases where there is no
fragment program for fog.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:35 -07:00
Ian Romanick
8fc5ed18bc i915: Delete disabled try_pixel_fog paths
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:32 -07:00
Ian Romanick
4d203a01e2 mesa: Kill gl_fragment_program::FogOption with fire
All drivers expect this to always be GL_NONE.  Don't let there be any
opportunity for a bad value to leak out and infect some unsuspecting
driver.  If any driver for hardware that had fixed-function
per-fragment fog (i915 and perhaps some r300-ish) was ever going to
add support, it would have done it by now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:29 -07:00
Ian Romanick
df7555e763 i915: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:26 -07:00
Ian Romanick
8780c38983 i965: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:24 -07:00
Ian Romanick
f0188d4b08 mesa: gl_fragment_program::FogOption is always GL_NONE so don't check it
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:21 -07:00
Ian Romanick
3aa21f93dc mesa: Fix bugs in ff fragment shader fog handling
This patch fixes two bugs related to fog in the fixed-function
fragment shader generation code.

Fog was only lowered to instructions if MRTs were used.  The fragment
shader assembler always lowers "fog option" code to instructions, and
many drivers (e.g., r300) expect this.

When fog lowering did happen, it was after the instruction count was
checked against implementation limits.  Since fog lowering may add up
to 5 instructions, a program that was below the limits before lowering
may exceed the limits after lowering.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-21 17:33:18 -07:00
Brian Paul
a22aba4eae st/mesa: check image size before copy_image_data_to_texture()
We should only copy images into the dest texture if the size is correct.
This fixes a failed assertion when finalizing a texture with mis-defined
mipmap levels such as:
level 0: 32x32
level 1: 8x8

Also, fix incorrect mipmap level used in assertion at the top of
copy_image_data_to_texture().

NOTE: This is a candidate for the 7.10 branch.
2011-04-21 13:02:02 -06:00
Marek Olšák
4ad63659c0 galahad,util: warn on resource target mismatch in copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
f9dafcb8f2 st/mesa: implement CopyBufferSubData using resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
883d8a0b44 gallium: add fallback for copying buffers to all drivers
Just to keep drivers working.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Marek Olšák
64f55216e4 util: add a simple memcpy path for copying buffers in util_resource_copy_region
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-04-21 15:51:18 +02:00
Kenneth Graunke
08ba9778db glsl/ast_to_hir: Only use the local 'type' variable as a temporary.
Lots of code (deleted by this patch) tried to make type == result->type,
but not all cases did.  Don't pretend; just use result->type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-20 16:46:17 -07:00
Kenneth Graunke
dfaaf7c5e8 i965: Remove dead vertex buffer structs.
We do this OUT_BATCH-style in brw_draw_upload.c.
2011-04-20 16:43:52 -07:00
Kristian Høgsberg
c0f8c9911c wayland-egl: Update to wayland-egl.h changes, drop struct wl_egl_display 2011-04-20 17:47:20 -04:00
Brian Paul
42d377224a mesa: fix void pointer arithmetic warning 2011-04-20 12:04:25 -06:00
Eric Anholt
2ea0aa4cd9 docs: Mention that GLSL 1.30 is started.
Things definitely remaining todo: switch statements, clip distances.
On 965, we also need real integers in the VS, and implementations of
some things like isinf/isnan.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
6e13cbcb74 docs: Update for Intel ARB_texture_float and ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:43 -07:00
Eric Anholt
d22e2ebe35 intel: Add support for ARB_color_buffer_float.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
99fa449bb9 meta: Add support for ARB_color_buffer_float to _mesa_meta_Clear().
Tested with piglit arb_color_buffer_float-clear.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b249197259 meta: Add support for ARB_color_buffer_float to _mesa_meta_DrawPixels.
Tested with piglit arb_color_buffer_float-drawpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
87478cd6e3 intel: Add support for ARB_texture_float.
For 1 and 2-channel formats the hardware only supports rendering to R
and RG.  To do I and L render targets we just call them R and
everything works out.  For A, we would need to rewrite the CC to do
the alpha channel's blending on color instead, and send the fragment
alpha down the red channel.  For LA, there doesn't seem to be any
hope, because we can't do independent color/alpha blending while
treating the LA surface as RG.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
0bbbeba2db intel: Add support for blit copies of >32bpp formats.
The blitter only does up 32bpp at a time, so we handle it by mangling
coordinates and calling the surface 32bpp.

Fixes ARB_texture_rg/fbo-generatemipmap-formats-float with ARB_texture_float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
b31a99367c mesa: Add renderbuffer accessors for A, I, L, FLOAT32.
Of these, intel will be using I and L initially, and A once we rewrite
fragment shaders and the CC for rendering to it as R.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
bad08969b5 mesa: Add renderbuffer accessors for MESA_FORMAT_R_FLOAT32, RG_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:42 -07:00
Eric Anholt
f7c26109c2 mesa: Add ChooseTexFormat fallbacks for floating point textures.
This covers X_FLOAT16 -> X_FLOAT32, and X -> RGBA_FLOAT32.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
ba99c2fbd9 mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Eric Anholt
a45b757f78 swrast: Add LUMINANCE, INTENSITY, LUMINANCE_ALPHA to span asserts.
Fixes ARB_texture_float/fbo-alphatest-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-20 10:35:41 -07:00
Alex Deucher
abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund
6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Brian Paul
8b7f760f83 translate: disable clamping of instanced array indexes
This fixes piglit's draw-instanced-divisor test for softpipe on both
the generic and SSE paths.  This is temporary until we have the
correct per-array max_index information.
2011-04-19 16:13:47 -06:00
Alex Deucher
08d1c91e6c r600g: add evergreen+ big endian support
Based on Cédric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:35:19 -04:00
Cédric Cano
843dfe3206 r600g: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 13:02:14 -04:00
Alex Deucher
b545b2987a r600c: add evergreen big endian support
Based on Cedric's r6xx/r7xx patch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Cédric Cano
3c3a259603 r600c: add big endian support for r6xx/r7xx
Signed-off-by: Cedric Cano <ccano@interfaceconcept.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-19 12:06:52 -04:00
Brian Paul
7a6061d7a6 Makefile: add missing Scons files 2011-04-19 09:07:44 -06:00
Thierry Vignaud
494b333b03 Makefile: add missing .cpp, .ll, .yy files
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-19 08:34:06 -06:00
Dave Airlie
66866d642f r600g: add cb support for snorm formats.
Check for signed type and enable SNORM.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 20:44:13 +10:00
Marek Olšák
5722286be2 configure.ac: rename --enable-gallium-radeon to --enable-gallium-r300
Also fix up the help string for both r300 and r600.
2011-04-19 12:28:51 +02:00
Marek Olšák
ab13ebf7c1 r200: enable some extensions
Such as:
- GL_ARB_half_float_pixel
- GL_ARB_vertex_array_object
- GL_APPLE_vertex_array_object
- GL_EXT_gpu_program_parameters
2011-04-19 12:23:41 +02:00
Dave Airlie
c98fa6be4b r600g: fix warnings with piglit texture-rg test.
Fill in the swaps for the formats to fix warnings.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 18:45:58 +10:00
Dave Airlie
723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Tom Stellard
ffc1d166d2 r300/compiler: Fix dataflow analysis bug with ELSE blocks
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060
2011-04-18 21:27:03 -07:00
Bryan Cain
f41e1db327 glsl: fix conversions from uint to bool and from float/bool to uint
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-18 17:09:47 -07:00
Dave Airlie
f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen
02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie
162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie
c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Ian Romanick
edf2e4f79d glsl: 80-column wrapping and whitespace fixes 2011-04-18 17:06:08 -07:00
Kenneth Graunke
ff5dd55e26 i965: Convert 3DPRIMITIVE command from struct-style to OUT_BATCH style.
Most of the newer portions of the code use OUT_BATCH style.  I prefer
this style because it offers a clear distinction between a) hardware
messages/structures with a mandatory format, and b) data structures for
our own internal use that we can format however we want.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Kenneth Graunke
42a8057000 i965: Allocate the whole URB to the VS and fix calculations for Gen6.
Since we never enable the GS on Sandybridge, there's no need to allocate
it any URB space.

Furthermore, the previous calculation was incorrect: it neglected to
multiply by nr_vs_entries, instead comparing whether twice the size of
a single VS URB entry was bigger than the entire URB space.  It also
neglected to take into account that vs_size is in units of 128 byte
blocks, while urb_size is in bytes.

Despite the above problems, the calculations resulted in an acceptable
programming of the URB in most cases, at least on GT2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-18 15:26:34 -07:00
Ian Romanick
3d5cfcfed1 glsl: Emit a warning when the left-hand operand of a comma has no effect
The expression

    x = y, 5, 3;

will generate

    0:7(9): warning: left-hand operand of comma expression has no effect

The warning is only emitted for the left-hand operands, becuase the
right-most operand is the result of the expression.  This could be
used in an assignment, etc.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-18 14:43:48 -07:00
Brian Paul
7ca38f5d97 mesa: fix void pointer arithmetic warnings
And fix a couple logic errors in the put_*_generic() functions.
2011-04-18 13:01:05 -06:00
Brian Paul
9418d05914 mesa: fix wrong parameter type in set_sampler_max_lod() 2011-04-18 12:43:42 -06:00
Brian Paul
1249e54f8b nvfx: comment-out unused var 2011-04-18 12:34:29 -06:00
Eric Anholt
dad95c112f intel: Add I8 and L8 to intel_mesa_format_to_rb_datatype().
Fixes warnings in fbo-storage-formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
bc57df0356 Revert "intel: Add spans code for the ARB_texture_rg support."
This reverts what remains of commit
28bab24e16.  It was garbage, trying to
use a MESA_FORMAT enum as a preprocessor token, and I don't know how I
thought it was even tested.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
73f0700481 intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
Fixes:
ARB_texture_rg/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
2b624634dd swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
The GL_RED and GL_RG were tricking this code into executing, but it's
totally unprepared for a 16-bit channel and just rescaled the values
down to 0.  We don't have anything with <8bit channels alongside >8bit
channels, so disabling it should be safe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
f0471d904c mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
This will replace the current (broken by trying to use an enum in the
preprocessor) spantmp2.h support I wrote for the intel driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
a52803e108 mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
6ab9889a27 mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
0778fdb002 intel: Use Mesa core's renderbuffer accessors for depth.
Since we're using GTT mappings now (no manual detiling), there's
really nothing special to accessing these buffers, other than needing
the new RowStride field of gl_renderbuffer to accomodate padding.

Reduces the driver size by 2.7kb, and improves glean depthStencil
performance 3-10x (!)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:54 -07:00
Eric Anholt
9f164823c7 mesa: Add a function to set up the default renderbuffer accessors.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
155200c154 mesa: Add a gl_renderbuffer.RowStride field like textures have.
This will allow some drivers to reuse the core renderbuffer.c get/put
row functions in place of using the spantmp.h macros.  Note that
unlike textures, we use a signed integer here to allow for handling
FBO orientation.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
348ea34d03 mesa: Repack single-byte fields in gl_renderbuffer.
Cuts 8 out of 120 bytes in the struct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
91226ce648 mesa: Remove renderbuffer deletion debug field.
It has presumably served its purpose by now, and other object deletion
doesn't do this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
641dd899bd swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Marek Olšák
699ecec58c r300g: remove non-existing include path from SConscript 2011-04-18 03:07:46 +02:00
Marek Olšák
d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Thierry Vignaud
f79717d27a Fix mesa tarball creation again
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-18 01:26:47 +02:00
Marek Olšák
fc8e30edbc r600g: disable ARB_draw_instanced
The very presence of this extension breaks things.
This should bring us closer to being able to run Unigine Heaven.

The extension will be re-enabled once gl_InstanceID is implemented.
2011-04-18 00:44:17 +02:00
Marek Olšák
3f32efa2b8 r300g: disable ARB_draw_instanced on SWTCL chipsets.
This fixes Unigine Heaven.
2011-04-18 00:44:17 +02:00
Eric Anholt
4673f9433f i965: Quit spamming gen6 DP read/write send instructions with gen5 bits.
This was copy-and-paste from originally trying to get DP read/write
working reliably, and notably for other common messages (URB, sampler)
we weren't doing this.
2011-04-17 10:26:09 -07:00
Eric Anholt
59c6b775a6 i965/fs: Add gen6 register spilling support.
Most of this is code movement to get the scratch space allocated in a
shared location.  Other than that, the only real changes are that the
old oword block messages now operate on oword-aligned areas (with new
messages for unaligned access, which we don't do), and that the
caching control is in the SFID part of the descriptor instead of
message control.

Fixes glsl-fs-convolution-1.
2011-04-17 10:26:09 -07:00
Eric Anholt
14eedf3028 mesa: Fix _mesa_unpack_dudv_span_byte assertion.
It was accepting only GL_DUDV_ATI and not the specific sized format
GL_DU8DV8_ATI.  Fixes assertion failure at startup in Shadowgrounds.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-17 10:26:09 -07:00
Carl Worth
9dacbe2226 glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).
The 095-recursive-define test case was triggering infinite recursion
with the following test case:

	#define A(a, b) B(a, b)
	#define C A(0, C)
	C

Here's what was happening:

  1. "C" was pushed onto the active list to expand the C node

  2. While expanding the "0" argument, the active list would be
     emptied by the code at the end of _glcpp_parser_expand_token_list

  3. When expanding the "C" argument, the active list was now empty,
     so lather, rinse, repeat.

We fix this by adjusting the final popping at the end of
_glcpp_parser_expand_token_list to never pop more nodes then this
particular invocation had pushed itself. This is as simple as saving
the original state of the active list, and then interrupting the
popping when we reach this same state.

With this fix, all of the glcpp-test tests now pass.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32835
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-17 01:02:24 -07:00
Dave Airlie
93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie
70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Marcin Slusarz
b5dfc38eea gallium: include u_format.h for util_format_is_supported
Without it gcc complains:
nv50_screen.c: In function ‘nv50_screen_is_format_supported’:
nv50_screen.c:48: warning: implicit declaration of function ‘util_format_is_supported’

and handles it wrongly - util_format_is_supported returns boolean, which is typedef'ed
to uchar, but function without prototype is assumed to return int.

For me nv50_screen_is_format_supported was returning true for float formats without
--enable-texture-float...
2011-04-17 01:15:52 +02:00
Christoph Bumiller
25a7f66214 nvc0: work around what looks like a code prefetch bug
Sounds very unlikely, but I don't have a better explanation at the
moment.
The GPU throws page faults at the first page after the code buffer
quite frequently on startup, and traces don't show us overflowing.
2011-04-17 00:17:14 +02:00
Christoph Bumiller
f4ad25fefb nv50,nvc0: add new texture and render target formats 2011-04-17 00:17:14 +02:00
Christoph Bumiller
b4c7cd3fd6 nv50,nvc0: fix normalized RG16 and RGBA32 texture format entries 2011-04-17 00:17:14 +02:00
Christoph Bumiller
a582b859f7 nvc0: fix viewport rectangle calculation 2011-04-17 00:17:14 +02:00
Tom Stellard
97535699ee prog_optimize: Add simplify CMP optimization pass
This pass coverts CMP T0, T1 T2 T0 -> MOV T0, T2 when the CMP
instruction is the first instruction to write to register T0.
This pass is useful for hardware that requires a lot of lowering passes
that generate many CMP instructions.
2011-04-16 13:55:55 -07:00
Tom Stellard
257cc48de2 prog_optimize: get_src_arg_mask() respect writemask for more opcodes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-16 13:55:54 -07:00
Tom Stellard
0fa81d6d05 r300/compiler: Fix incorrect presubtract conversion
ADD instructions with constant swizzles can't be converted to
presubtract operations.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-16 13:55:54 -07:00
Carl-Philip Haensch
d5a5893adc mesa: provide more info for glCompressedTexImage() errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-16 08:13:47 -06:00
Brian Paul
af0e2ef8cc mesa: move error check code in compressedteximage()
This was mistakenly inside the #if FEATURE_ES block.
2011-04-16 08:05:14 -06:00
José Fonseca
77db34b50d docs: Reapply some of Marek's typo fixes.
There were some typos too.
2011-04-16 11:15:29 +01:00
José Fonseca
bb78f6ad78 gallium/docs: Improve min_index/max_index description. 2011-04-16 10:18:20 +01:00
José Fonseca
4ee40c37a0 docs: Undo Marek typo fixes to original text.
Not really typos.
2011-04-16 09:41:00 +01:00
Brian Paul
41b38bd21c translate: s/varient/variant/ 2011-04-15 10:16:53 -06:00
Brian Paul
0630593c5f vbo: init prim[] array with memset()
This fixes a Coverity warning about uninitialized data.
2011-04-15 08:33:20 -06:00
Brian Paul
1b800c10e4 vega: move ureg_destroy(ureg) after last use of ureg var 2011-04-15 08:33:20 -06:00
Brian Paul
2c57caa893 st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
2011-04-15 08:33:20 -06:00
Pierre-Eric Pelloux-Prayer
6e9c7c4c11 st/mesa: add handling for 'PIPE_FORMAT_B8G8R8X8_UNORM' in st_fast_readpixels
With minor edits by Brian Paul.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-15 08:30:10 -06:00
Marek Olšák
d2afae33f8 Revert "r300/compiler: Don't try to convert RGB to Alpha in full instructions"
This reverts commit cd2857fae1.

It breaks Unigine Heaven.
2011-04-15 05:08:00 +02:00
Marek Olšák
9305922563 docs: update relnotes-7.11
I made a glxinfo diff between 7.10 and master and added missing items
and also sorted the list.
2011-04-15 05:08:00 +02:00
Marek Olšák
397e478683 docs: update GL3 status 2011-04-15 05:08:00 +02:00
Marek Olšák
75fa5c99a8 gallium: add and use generic function for querying patented format support (v2)
v2: Unsigned floats are allowed regardless of the configure switch.
2011-04-15 05:08:00 +02:00
Marek Olšák
848f7d368d configure.ac: add an enable switch for float textures (v2)
So --enable-texture-float it is.

Hardware drivers (including the Gallium ones) should
use #ifdef TEXTURE_FLOAT_ENABLED to hide any code that may
expose floating-point renderbuffers via any interface,
public or private.

v2: Print a warning when using --enable-texture-float.
2011-04-15 05:08:00 +02:00
Marek Olšák
2d12dbb28d docs: add patents.txt
Thanks to José Fonseca for writing this.
2011-04-15 05:08:00 +02:00
Marek Olšák
faba01d171 r300g: enable A/L/LA/I float render targets 2011-04-15 05:08:00 +02:00
Marek Olšák
8e28d842d1 st/mesa: convert Mesa float formats to Gallium
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    st/mesa: require RGBA16F and RGBA32F to be renderable
    st/mesa: fix L32F and L16F format translation
    st/mesa: also convert the R/RG float formats

commit 49a9948b6a81b7d813304d081139d98e95ba5d1a
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 20 10:36:17 2010 +0200

    mesa/st: enable ARB_texture_float if supported formats allow it

commit 7383632f7b6f9021b65f4973b7e7c99f0e8ce9b2
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:46 2010 +0200

    mesa/st: support ARB_texture_float internal formats

commit 7c362cc06982586c2d29fac55f6bcc4bcd1550b5
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:00:33 2010 +0200

    mesa/st: convert L/A/I floating point formats
2011-04-15 05:08:00 +02:00
Luca Barbieri
33128310b0 gallium: add A/L/LA/I floating point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
15f99d1362 mesa: finish up ARB_texture_float
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: handle floating-point formats in _mesa_base_fbo_format
    mesa: add ARB/ATI_texture_float, remove MESAX_texture_float

commit 123bb110852739dffadcc81ad80b005b1c4f586d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 01:35:42 2010 +0200

    mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
2011-04-15 05:08:00 +02:00
Marek Olšák
0ecbb0ab74 mesa: add R/RG floating-point formats 2011-04-15 05:08:00 +02:00
Marek Olšák
19648fcf01 mesa: fix L16F and L32F format properties 2011-04-15 05:08:00 +02:00
Carl Worth
3d78f83cde Add expected file for 095-recursive-define test case.
It's clear enough that the current segmentation fault isn't what we
want. And it's also very easy to know what we do want here, (just
check with any functional C preprocessor such as "gcc -E").

Add the desired output as an expected file so that the test suite
gives useful output, (showing the omitted output and the segfault),
rather than just reporting "No such file" for the expected file.
2011-04-14 16:20:49 -07:00
Carl Worth
02d293c08e glcpp: Simplify calling convention of parser's active_list functions
These were all written as generic list functions, (accepting and returning
a list to act upon). But they were only ever used with parser->active as
the list. By simply accepting the parser itself, these functions can update
parser->active and now return nothing at all. This makes the code a bit
more compact.

And hopefully the code is no less readable since the functions are also
now renamed to have "_parser_active" in the name for better correlation
with nearby tests of the parser->active field.
2011-04-14 15:35:41 -07:00
Carl Worth
0b80f2d4c9 glcpp: Add --valgrind option to the glcpp-test utility
The common case for this test suite is to quickly test that everything
returns the correct results. In this case, the second run of the test
suite under valgrind was just annoying, (and the user would often
interrupt it).

Now, do what is wanted in the common case by default (just run the
test suite), and require a run with "glcpp-test --valgrind" in order
to test with valgrind.
2011-04-14 14:55:52 -07:00
Carl Worth
6affa4806a Add an expected file for 084-unbalanced-parentheses
The expected file here captures the current behavior of glcpp (which
is to generate an obscure "syntax error, unexpected $end" diagnostic
for this case).

It would certainly be better for glcpp to generate a nicer diagnostic,
(such as "missing closing parenthesis in function-like macro
definition" or so), but the current behavior is at least correct, and
expected. So we can make the test suite more useful by marking the
current behavior as expected.
2011-04-14 14:43:11 -07:00
Carl Worth
d3c6ed382d Add an expected file for 094-divide-by-zero-short-circuit
The expected file here captures the current behavior of glcpp (which
is to generate a division-by-zero error) for this case.

It's easy to argue that it should be short-circuiting the evaluation
and not generating the diagnostic (which happens to be what gcc does).
But it doesn't seem like we should force this behavior on our
pre-processor, (and, as always, the GLSL specification of the
pre-processor is too vague on this point).
2011-04-14 14:42:52 -07:00
Carl Worth
ea3b2560b1 Add an expected file for 093-divide-by-zero
This test is behaving just fine already---it's generating an informative
diagnostic, ("error: division by 0 in preprocessor directive"), so adding
this in the expected file makes things pass.
2011-04-14 14:29:34 -07:00
José Fonseca
6881cfc7f7 mesa/st: Avoid spurious transfers when creating fbo textures without image data.
We could actually try to do an early return both for gallium textures and
malloc memory textures, but I'm not sure exactly which situations
stImage->pt is NULL, and whether texImage->Data == NULL would be acceptible
or not.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-14 19:51:45 +01:00
pepp
78e90bf247 st/mesa: add support for GL_RGBA + GL_UNSIGNED_INT_8_8_8_8 in st_fast_readpixels
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-14 07:55:02 -06:00
Eric Anholt
a9a02c8a39 mesa: Expose ATI_draw_buffers.
This is the same as ARB_draw_buffers (which derived from it), except
for s/ARB/ATI/.  The glapi bits were already in place, and what was
missing was just the ARB_fp part.  The new Humble Bundle game "trine"
tries to use this extension without checking that it's exposed, which
this works around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36182
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:32 -07:00
Eric Anholt
fb6e39737a mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.
Tested by piglit ati_draw_buffers-arbfp.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:07:01 -07:00
Eric Anholt
28cec9e832 mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
Fixes fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34321
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 18:05:44 -07:00
Eric Anholt
4847f802c2 i965/fs: Constant-fold immediates in src0 of SEL instructions.
This is like what we do for add/mul, but we have to invert the
predicate to choose the other source instead.

This removes 5 extra moves of constants in nexuiz shaders.  No
statistically significant performance difference on my Sandybridge
laptop (n=5).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:53 -07:00
Eric Anholt
811c147220 i965/fs: Constant-fold immediates in src0 of CMP instructions.
This is like what we do with add/mul, but we also have to flip the
conditional test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:46 -07:00
Eric Anholt
756c262756 glsl: Perform type checking on "^^" operands.
We were letting any old operand through, which generally resulted in
assertion failures later.

Fixes array-logical-xor.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 17:57:43 -07:00
Eric Anholt
175829f1a8 glsl: When we've emitted a semantic error for ==, return a bool constant.
This prevents later errors (including an assertion failure) from
cascading the failure.

Fixes invalid-equality-04.vert.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33303
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
9e04b190b5 glsl: Semantically check the RHS of `||' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant false case.

Fixes glslparsertest/glsl2/logic-02.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:26 -07:00
Eric Anholt
7ec0c97896 glsl: Semantically check the RHS of `&&' even when short-circuiting.
We just do the AST-to-HIR processing, and only push the instructions
if needed in the constant true case.

Fixes glslparsertest/glsl2/logic-01.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:25 -07:00
Eric Anholt
01822706ec glsl: Avoid cascading errors when looking for a scalar boolean and failing.
By always using a boolean, we should generally avoid further
complaints.  The failure case I see is logic_not, where the user might
understandably make the mistake of using `!' on a boolean vector (like
a piglit case did recently!), and then get a further complaint that
the new boolean type doesn't match the bvec it gets assigned to.

Fixes invalid-logic-not-06.vert (assertion failure when the bad type
ends up in an expression and ir_constant_expression gets angry).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33314
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-13 15:48:02 -07:00
Eric Anholt
6a35cbb656 glsl/opt_cpe: Reenable opt_copy_propagation_elements.cpp pass. 2011-04-13 10:51:03 -07:00
Eric Anholt
909bd476ca glsl/opt_cpe: Fix a crash when a kill kills for two reasons.
Fixes glsl-copy-propagation-loop-2 when this optimization pass is
re-enabled.

Reported-by: David Lamparter <equinox@diac24.net>
2011-04-13 10:51:03 -07:00
Eric Anholt
487debfda5 glsl/opt_cpe: Kill when the assignment isn't something we recognize.
A few GLES2 tests tripped over this when using array dereferences to
hit channels on the LHS (see piglit test
glsl-copy-propagation-vector-indexing).  We wouldn't find the
ir_dereference_variable, and assume that that meant that it wasn't an
assignment to a scalar/vector, and thus not notice that the variable
had been changed.
2011-04-13 10:51:03 -07:00
Brian Paul
b9c8b2a1f1 svga: defined QSZ in terms of SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 2011-04-13 09:52:21 -06:00
Brian Paul
32aab51df5 svga: define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES and update comments 2011-04-13 09:52:16 -06:00
Brian Paul
4cbb261eba st/mesa: minor clean-ups in update_textures() 2011-04-13 07:37:03 -06:00
Brian Paul
032a7ef0a1 mesa: 80-column wrapping and whitespace fixes 2011-04-13 07:35:25 -06:00
Brian Paul
75d585e544 mesa: fix some comments in sampler object code 2011-04-13 07:35:25 -06:00
Chad Versace
d3cc3901ab i965: Change assertion condition from implicit to explicit
... because grokking explicit assertions requires fewer neurons.

In brw_misc_state.c:emit_depthbuffer, change assertion condition
    tiling != I915_TILING_X && tiling != I915_TILING_NONE
to
    tiling == I915_TILING_Y

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
4d7c187167 i965: Define BRW_DEPTHFORMAT_D24_UNORM_X8_UINT
This depth format was added in Gen5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
05173c61c7 i965: Document brw_context.state.depth_region
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Chad Versace
9949d2a251 i965: Remove unnecessary release/reference of brw_context.state.depth_region
Release the old depth region and reference the new one *only* if it has
changed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
2011-04-12 17:52:09 -07:00
Kenneth Graunke
3f7318c1b8 i965: Add comments about URB size units and limits.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-12 15:21:21 -07:00
Kenneth Graunke
35b3f597bd i965: Never enable the GS on Gen6.
Prior to Gen6, we use the GS for breaking down quads, quad-strips,
and line loops.  On Gen6, earlier stages already take care of this,
so we never need the GS.

Since this code is likely completely untested, remove it for now.
We can write new code when enabling real geometry shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-04-12 15:19:47 -07:00
Chris Wilson
f703ba8c42 Revert "i965: Reinstate max-index paranoia"
This reverts commit b4cbd2b312.

It looked like a safe sanity check. It missed the issue of the start of
the buffer not being at 0, but even that was not enough to explain why
setting the max vertex index caused glyphs to be dropped from the game
'Achron'.

Instead, the issue appears to be related to the use of the vertex bias
and so we would need to re-emit the max-index every time we adjusted the
bias, so re-emitting the relocations and defeating the original
optimisation.

Reported-and-tested-by: Thomas Jones <thomas.jones@utoronto.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35163
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-12 19:14:27 +01:00
Benjamin Franzke
f05751aa2a egl/wayland: Update to per-surface frame events 2011-04-12 11:08:17 -04:00
Dave Airlie
b27f206b0c nouveau_vieux: fix build since sampler objects merge 2011-04-12 21:23:00 +10:00
José Fonseca
16d42af618 st/wgl: Prevent spurious framebuffer sizes when the window is minimized.
When the window is minimized GetClientRect will return zeros.

Instead of creating a 1x1 framebuffer, simply preserve the current window
size, until the window is restored or maximized again.
2011-04-12 12:00:49 +01:00
José Fonseca
b5829c0d64 st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size(). 2011-04-12 12:00:49 +01:00
José Fonseca
6b95cfb0de svga: Rebind framebuffer and tss bindings strictly when necessary.
The earlier change to ensure rendertargets and textures are always
rebound at every command buffer start had the downside of making
successive flushes no longer no-ops, as a command buffer with merely
the rebinding commands were being unnecessarily sent to the vGPU.

This change only re-emits the bindings when necessary, by keeping track
of the need to rebind outside of the dirty state update mechanism.
2011-04-12 12:00:49 +01:00
Hans de Goede
e338a1b0ce texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616
According to https://bugs.freedesktop.org/show_bug.cgi?id=34280
commit 5d1387b2da causes the font corruption
problems people have been seeing under various apps and gnome-shell on r200
cards.

This commit changed (loosened) the check for using the memcpy path in the
former al88 / al1616 texstore functions, which are now also used to
store rg texures. This patch restores the old strict check in case of
al textures. I've no idea why this fixes things, since I don't know the
code in question at all. But after seeing the bisect in bfdo34280 point
to this commit, I gave this fix a try and it fixes the font issues seen on
r200 cards.

[airlied:
r200 has no native working A8, so it does an internal storage format of AL88
however srcFormat == internalFormat == ALPHA when we get to this point,
so it copies, but it wants to store into an AL88 not ALPHA so fails,
I'll also push a piglit test for this on r200].

Many thanks to Nicolas Kaiser who did all the hard work of tracking this down!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-12 20:32:45 +10:00
Brian Paul
847f991a87 ir_to_mesa: silence signed/unsigned comparison warnings 2011-04-11 21:29:06 -06:00
Brian Paul
482a64dcf1 configs: add r600 dir to DRI_DIRS 2011-04-11 21:23:14 -06:00
Brian Paul
155a9670e6 r600: silence various compiler warnings 2011-04-11 21:22:54 -06:00
Brian Paul
1ca5585459 Merge branch 'arb_sampler_objects' 2011-04-11 21:19:41 -06:00
Zou Nan hai
2432ca1c2e Revert "i965: clear global offset to zero in m0.2 for VS DP read."
This reverts commit 66b66295d0.
it was already fixed by commit 9d60a7ce08
2011-04-12 10:52:50 +08:00
Ian Romanick
a7fa203f0d i965: Remove hint_gs_always and resulting dead code
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
7e809f0b8d intel: Fix ROUND_DOWN_TO macro
Previously the macro would (ALIGN(value - alignment - 1, alignment)).
At the very least, this was missing parenthesis around "alignment -
1".  As a result, if value was already aligned, it would be reduced by
alignment.  Condisder:

     x = ROUND_DOWN_TO(256, 128);

This becomes:

    x = ALIGN(256 - 128 - 1, 128);

Or:

    x = ALIGN(127, 128);

Which becomes:

    x = 128;

This macro is currently only used in brw_state_batch
(brw_state_batch.c).  It looks like the original version of this macro
would just use too much space in the batch buffer.  It's possible, but
not at all clear to me from the code, that the original behavior is
actually desired.

In any case, this patch does not cause any piglit regressions on my
Ironlake system.

I also think that ALIGN_FLOOR would be a better name for this macro,
but ROUND_DOWN_TO matches rounddown in the Linux kernel.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Whitwell <keithw@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
03eade164d glsl: Make GL_ARB_shader_stencil_export enable block be similar to other blocks
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:42 -07:00
Ian Romanick
f2bda1b566 glsl: Only let a shader enable GL_ARB_draw_instanced if the driver supports it
Also make the GL_ARB_draw_instanced block follow the same pattern as
the other blocks.

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-11 14:43:41 -07:00
Brian Paul
65b024d63a mesa: fixup r600 DRI driver for sampler object changes 2011-04-11 13:26:42 -06:00
Eric Anholt
88022278f7 i965: Move the SF VP from state caching to state streaming.
This is a 49.6% +/- 2.0% (n=9, IPS outlier removed) performance
improvement for the hacked-up-for-cache-misses scissor-many, and no
statistically significant performance difference for the
hacked-up-for-cache-hits version (n=9, IPS outlier removed).  No
statistically significant performance difference from ETQW (n=5) from
these last two commits.
2011-04-11 11:55:25 -07:00
Eric Anholt
b1be5bd205 i965: Change the SF unit from state caching to state streaming.
This is a 28.1% +/- 1.4% (n=10) performance improvement for the
hacked-up-for-cache-misses scissor-many (n=10), and no statistically
significant wall-time performance difference for the
hacked-up-for-cache-hits version (n=9, first outlier in each removed
since IPS was warming up.  User time increased by about 4.7%, but
kernel time decreased equivalently).
2011-04-11 11:55:17 -07:00
Eric Anholt
aaf188e3bb i965: Turn SF unit and viewport structs into pointers to prep for streaming.
I wanted to separate this mechanical change from the actual work.
2011-04-11 11:43:40 -07:00
pepp
45920d2ecb u_vbuf_mgr: fixed vbo max_index calculation
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-11 17:35:28 +02:00
Marek Olšák
5c477ab2de r600g: handle PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL in get_param 2011-04-11 14:38:32 +02:00
Brian Paul
da8d0c965c docs: GL_ARB_sampler_objects updates 2011-04-10 13:12:50 -06:00
Brian Paul
34a5d3b9f4 mesa: plug in new functions for GL_ARB_sampler_objects
Build the new sources, plug the new functions into the dispatch table,
implement display list support.  And enable extension in the gallium
state tracker.
2011-04-10 13:12:49 -06:00
Brian Paul
f22d49de0f mesa: new code/functions for GL_ARB_sampler_objects
This implements the infrastructure for sampler objects and all the new
API functions.
2011-04-10 13:12:49 -06:00
Brian Paul
6bb4d807f7 mesa: alloc/free shared sampler objects 2011-04-10 13:12:49 -06:00
Brian Paul
0308beebc2 mesa: new driver hooks for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
aebe16da53 mesa: add glGet for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
ecfaab88b2 mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular
texture object sampling state.  glGenSamplers() generates new instances
of gl_sampler_object which can override that state with glBindSampler().
2011-04-10 13:12:49 -06:00
Brian Paul
1cbd3a1cc7 glapi: regenerated files for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Brian Paul
d40ec9a884 glapi: interface for GL_ARB_sampler_objects 2011-04-10 13:12:49 -06:00
Henri Verbeet
a26121f375 glx: Only remove the glx_display from the list after it's destroyed.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:34 +02:00
Henri Verbeet
a75de67c51 glx: Destroy dri2Hash on DRI2 display destruction.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:33 +02:00
Henri Verbeet
158d42c8b0 mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.
NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-10 18:53:33 +02:00
Nicolas Kaiser
82cb6e6519 docs: fix typos in wayland spec
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-10 10:00:10 -06:00
Nicolas Kaiser
ae5776c41f docs: fix typos in Mesa specs
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-10 09:58:53 -06:00
Christoph Bumiller
74559abbef nv50,nvc0: silence shader debug output 2011-04-10 14:06:52 +02:00
Christoph Bumiller
003224bd97 nvc0: make the card permit separate colour outputs 2011-04-10 14:06:52 +02:00
Christoph Bumiller
7b4e478496 nv50-nvc0: make use of COLOR_MASK,BLEND_ENABLE_COMMON 2011-04-10 14:06:52 +02:00
Christoph Bumiller
d9ef976967 nvc0: shrink CSOs a little 2011-04-10 14:06:52 +02:00
Christoph Bumiller
843d5391c3 nv50,nvc0: identify some line rasterization state
Fixes width of non-smooth (aliased) lines on nvc0.
2011-04-10 14:06:52 +02:00
Christoph Bumiller
d546df4d9c nvc0: force perspective correction hint to nicest
Fixes issues in e.g. nexuiz (desertfactory) or supertuxkart that
look like lighting bugs.

They're not visible with the software rasterizers because their
notion of linear interpolation seems to be different from that
of nv50/nvc0.
2011-04-10 14:06:52 +02:00
Christoph Bumiller
ee2a8ea7d9 nv50,nvc0: don't insert instructions after the block terminator 2011-04-10 14:06:51 +02:00
Alan Coopersmith
d27ff8c5cd Make st_pipe_vertex_format return type in st_draw.h match st_draw.c
Fixes compiler error from Sun compilers:
"state_tracker/st_draw.c", line 185: identifier redeclared: st_pipe_vertex_format
        current : function(unsigned int, unsigned int, unsigned int, unsigned char) returning enum pipe_format
        previous: function(unsigned int, unsigned int, unsigned int, unsigned char) returning unsigned int : "state_tracker/st_draw.h", line 73

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-08 17:36:46 -07:00
Alan Coopersmith
64ce3933f5 Fix GET_PROGRAM_NAME() on Solaris to not try to modify a read-only string
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-08 17:36:46 -07:00
Marek Olšák
ee678895e9 Revert "r300g: handle DISCARD_WHOLE_RESOURCE for buffers"
This reverts commit 437c748bf5.

The commit is wrong for several reasons. One of them is when we grab
a new buffer, we should update all the states it is bound in,
including all parallel contexts. I don't think this is even doable.

The correct solution would be upload data via a temporary buffer and
do resource_copy_region to the original one.

https://bugs.freedesktop.org/show_bug.cgi?id=36088
2011-04-08 23:20:00 +02:00
Marek Olšák
69c71396c6 r300g: fix another crash with hyperz
https://bugs.freedesktop.org/show_bug.cgi?id=36086
2011-04-08 23:17:15 +02:00
Jon TURNEY
c6e33ca285 Disable direct rendering on Cygwin
Add Cygwin platform-specific settings and drivers to build for dri driver:
- by default, disable direct rendering.
- if direct rendering is enabled, the swrast dridriver is the only one it's
sensible to try to build (this doesn't work at the moment as additional patches
are required to build a libGL which can load just swrast without the DRM headers,
even though there's no actual functional dependency)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-04-08 20:37:41 +01:00
nobled
e7d18ed1ef Disable direct rendering on GNU/Hurd
The Hurd kernel doesn't have DRM yet.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-By: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-08 20:37:38 +01:00
Samuel Thibault
758561786c Only require libdrm if direct rendering is actually enabled.
Fix build when configured --with-driver=dri --disable-driglx-direct on targets
without drm e.g. GNU/Hurd and Cygwin

Based on the Debian patch file '05_hurd-ftbfs.diff' by Samuel Thibault.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-By: Jakob Bornecrantz <wallbraker@gmail.com>
2011-04-08 20:37:36 +01:00
Marek Olšák
aac4bae986 r300g: fix crash when adding a new relocation
No idea why it's so hard to reproduce.
Broken with: c35572352e

Thanks to Toni Spets for assistance.
2011-04-08 21:34:16 +02:00
Marek Olšák
ff3d7ce201 r300g: emit US_FORMAT on R520 only 2011-04-08 20:07:01 +02:00
Eric Anholt
9634318290 i965/fs: Remove broken optimization for live intervals in loops.
The theory here was to detect a temporary variable used within a loop,
and avoid considering it live across the entire loop.  However, it was
overeager and failed when the first definition of the variable
appeared within the loop but was only conditionally defined.

Fixes glsl-fs-loop-redundant-condition.
2011-04-08 08:04:00 -10:00
Marek Olšák
a0d154dc13 u_vbuf_mgr: fix crash with unsupported vertex format in hw VBOs 2011-04-08 19:31:26 +02:00
Marek Olšák
1329d94334 r300g: fix crash with hyperz
r300_update_hyperz_state is no longer required to be called here.
2011-04-08 13:27:14 +02:00
Henri Verbeet
1bcdc1e319 r300g: Properly take the sampler view's first_level into account when sampling.
Signed-off-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-04-08 04:47:37 +02:00
Fabian Bieler
08070cead0 llvmpipe: Take the sampler view's first_level into account when sampling. 2011-04-08 04:47:04 +02:00
Henri Verbeet
9acdd7739b softpipe: Take the sampler view's first_level into account when sampling.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:45:38 +02:00
Henri Verbeet
79db70bd8a st/mesa: Clamp min_lod to the max miplevel as well.
Otherwise min_lod can potentially be larger than the clamped max_lod. The
code that follows will swap min_lod and max_lod in that case, resulting in a
max_lod larger than MAX_LEVEL.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:45:03 +02:00
Henri Verbeet
2ecb73379e st/mesa: Set samplers views' first_level.
Base level and min LOD aren't equivalent. In particular, min LOD has no
effect on image array selection for magnification and non-mipmapped
minification.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-08 04:44:21 +02:00
Marek Olšák
7984c2d42d r300g: do not advertise R16F and RG16F on DRM < 2.8.0 2011-04-08 04:38:36 +02:00
Marek Olšák
10ea8567f4 r300g: fix texturing with sizes > 2048 on r500 2011-04-08 04:38:36 +02:00
Marek Olšák
9d5de0fcb6 r300g: add 'radeon: ' prefix to error messages in winsys 2011-04-08 04:38:36 +02:00
Marek Olšák
6eff8479af mesa: fix dstRowDiff computation in RGTC texstore functions
Copied from libtxc_dxtn, this fixes NPOT RGTC1 textures with r300g.
I also did the same for RGTC2.
2011-04-08 04:38:36 +02:00
Kristian Høgsberg
55a629cee5 egl_dri2.c: Open drm device with O_CLOEXEC
Not a good fd to leak.
2011-04-07 18:27:56 -04:00
Henri Verbeet
09eff39a58 r600g: Unreference framebuffer state on context destruction.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-07 22:29:56 +02:00
Henri Verbeet
3e15fa86d7 r600g: Use symbolic names for NUMBER_TYPE.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-07 22:29:56 +02:00
Brian Paul
0da2a22ba6 docs: replace llvmpipe/README with docs/llvmpipe.html 2011-04-07 13:56:45 -06:00
Brian Paul
06613b7b3a llvmpipe: document issue with LLVM 2.8 and earlier with AVX 2011-04-07 13:43:00 -06:00
Brian Paul
ef2c80f506 util: add cpu detection for sse 4.2 and avx 2011-04-07 13:41:52 -06:00
Brian Paul
1e105741f1 util: simplify bit shifting in util_cpu_detect() 2011-04-07 13:41:52 -06:00
Brian Paul
6638b4a590 svga: another tweak to adjust_x term (use -0.5) 2011-04-07 11:25:46 -06:00
José Fonseca
584d1e2309 mesa: Update _ElementSize in a few more places. 2011-04-07 13:35:25 +01:00
José Fonseca
0c501bacef mesa/st: Fix user buffer size computation when stride is zero.
Although for GL a zero stride means tightly packed elements, Mesa
internally uses zero strides for constant arrays.

Therefore user buffers need to be defined from

  buffer_offset + src_offset + min_index*stride

to

  buffer_offset + src_offset + max_index*stride + elem_size

Simplifying the later with (max_index + 1)*stride will give zero
sized buffers.

This change also aggregates the st_context's info about user buffers
into a single array.
2011-04-07 12:20:06 +01:00
Brian Paul
204991bf5d mesa: Update _ElementSize. 2011-04-07 12:20:06 +01:00
José Fonseca
23d75936a7 mesa/st: Prevent 'end' < 'start' in vbo_exec_DrawRangeElementsBaseVertex()
We adjust 'end' to fit into _MaxElement, but that may result into a 'start'
value bigger than 'end' being passed downstream, causing havoc.

This could be seen with arb_robustness_draw-vbo-bounds, due to an
application bug.
2011-04-07 12:20:06 +01:00
José Fonseca
aa61b15351 mesa/st: Handle feedback draw when VBO offsets are not sorted in ascending order.
Simply port the same logic from setup_interleaved_attribs().

Avoids overflow in mustpass.c and feedback.c conform tests.
2011-04-07 12:20:06 +01:00
Zou Nan hai
66b66295d0 i965: clear global offset to zero in m0.2 for VS DP read.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-04-07 21:07:57 +08:00
Vinson Lee
8800a798d1 mesa: Fix allocation size of extension_indices array.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-06 16:14:22 -07:00
Brian Paul
95368f25c1 mesa: fix error message text 2011-04-06 16:52:48 -06:00
Brian Paul
7b8830d81d mesa: consolidate code in _mesa_update_array_max_element() 2011-04-06 16:52:48 -06:00
Ian Romanick
de4cb19a1c mesa: Add link to 7.10.2 release notes 2011-04-06 13:46:58 -07:00
Ian Romanick
130872a2a6 docs: update news.html with 7.10.2 release
(cherry picked from commit b0866f6cfd)
2011-04-06 13:46:37 -07:00
Ian Romanick
2c8ba760fa Import 7.10.2 release notes from 7.10 branch 2011-04-06 13:46:20 -07:00
Julian Adams
3f8455d07b r600g: Fix non-independent blend state.
This fixes piglit fbo/fbo-drawbuffers-blend-add.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-04-06 21:16:40 +02:00
Brian Paul
122275760d mesa: init/release the default texture buffer object 2011-04-06 13:00:14 -06:00
Brian Paul
53245fffc0 mesa: fix popping of texture state for GL_TEXTURE_BUFFER
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=36032
2011-04-06 12:45:30 -06:00
Brian Paul
c1f4b2364f mesa: TEXTURE_BUFFER fix-up
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=36033
2011-04-06 12:33:30 -06:00
Tom Stellard
cd2857fae1 r300/compiler: Don't try to convert RGB to Alpha in full instructions
Note: This is a candidate for the 7.10 branch.
2011-04-06 00:31:53 -07:00
José Fonseca
740282b417 mesa: Recognize MESA_VERBOSE=all as shortcut for all debug options. 2011-04-06 08:27:53 +01:00
José Fonseca
dcbc9be38e draw: Fix thinko in debug warnings. 2011-04-06 08:27:52 +01:00
José Fonseca
c0f6bfd489 trace: Correct/cleanup.
Observe the actual type hierarchy and polymorphism of sampler views and
surface state.

s/texture/resource/

etc.
2011-04-06 08:26:44 +01:00
José Fonseca
391f7147e7 Revert "trace: Dump blend state as a binary blob."
This reverts commit dcdf94c87c.

No retrace support anymore, so human-legible representation of blend
state is much more useful than a blob.
2011-04-06 08:26:04 +01:00
José Fonseca
afeaf1771d st/python: Remove bindings, and all its dependencies.
Because:
- bindings are not fully automatic, and they are broken most of the time
- unit tests/samples can be written in C on top of graw
- tracing/retracing is more useful at API levels with stable ABIs such as
  GL, producing traces that cover more layers of the driver stack and and
  can be used for regression testing
2011-04-06 08:26:04 +01:00
Brian Paul
14b574433c swrast: simplify assertion to silence warning 2011-04-05 20:18:46 -06:00
Brian Paul
874a2c0b7d mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
2011-04-05 19:02:09 -06:00
Brian Paul
9a77e285e8 mesa: regenerated API entrypoints for GL_ARB_texture_buffer_object 2011-04-05 18:50:39 -06:00
Brian Paul
13ba6b7369 mesa: API spec for GL_ARB_texture_buffer_object 2011-04-05 18:48:26 -06:00
Vinson Lee
622ee08e51 scons: Generate empty git_sha1.h for all platforms.
Fixes MinGW SCons build.
2011-04-05 15:34:30 -07:00
Kenneth Graunke
b4dfb7473e ir_to_mesa: Use gl_register_file enum type rather than 'int'.
src_reg already used this; make dst_reg use it too.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
ce5d969adf ir_to_mesa: Unprefix ir_to_mesa_undef* and ir_to_mesa_address_reg.
Rename ir_to_mesa_undef to undef_src, for clarity.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
5d9718f0db ir_to_mesa: Use emit overloads to avoid passing undef registers.
Makes the code just a little bit cleaner.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
01e19fcf1f ir_to_mesa: Rename ir_to_mesa_emit_*_opX methods to emit_*.
There's really no need for a prefix on member functions, and overloading
takes care of the _op1/_op2 distinction quite nicely.  Eric already made
a similar change in the i965 FS backend.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:31:58 -07:00
Kenneth Graunke
cb21fa91b8 ir_to_mesa: Use constructors to convert between src_reg and dst_reg.
Rather than ir_to_mesa_dst_reg_from_src and ir_to_mesa_src_reg_from_dst.

The new constructors are marked 'explicit' so that the compiler can
catch cases where source and destination registers were accidentally
interchanged.

This also necessitated using constructors to initialize the undef and
address registers, as well as adding a default constructor.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Kenneth Graunke
fc6b4332c3 ir_to_mesa: Remove the "ir_to_mesa_" prefix on src_reg/dst_reg types.
Both classes are completely private to ir_to_mesa.cpp, so there won't be
any name conflicts with other parts of Mesa.  The prefix simply makes it
harder to read.

Also, use a class rather than typedef structs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Kenneth Graunke
461273e910 ir_to_mesa: Rename src_reg and dst_reg variables to src and dst.
This is in preparation from removing the "ir_to_mesa_" prefix on the
src_reg and dst_reg types, which would cause a naming conflict.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-04-05 15:29:07 -07:00
Brian Paul
0c2455031d scons: generate empty git_sha1.h file for now
My feeble attempt to invoke the extract_git_sha1 script from
SConscript didn't work.  Hopefully this will do for now.
2011-04-05 14:07:48 -06:00
Ian Romanick
de579a1629 mesa: Include GIT SHA1 in GL version string
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
2011-04-05 11:21:01 -07:00
Ian Romanick
0fe34b7bbc dri: Remove driver date from renderer string
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
2011-04-05 11:21:01 -07:00
Ian Romanick
9996a86085 ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly
The code would previously handle the projection, then swizzle the
shadow comparitor into place.  However, when the projection is done
"by hand," as in the TXB case, the unprojected shadow comparitor would
over-write the projected shadow comparitor.

Shadow comparison with projection and LOD is an extremely rare case in
real application code, so it shouldn't matter that we don't handle
that case with the greatest efficiency.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=32395
2011-04-05 10:57:27 -07:00
Marek Olšák
4af3fe857d r300g: postpone fragment shader state validation until draw_vbo 2011-04-05 19:25:25 +02:00
Tom Stellard
d8361400b7 r300/compiler: Fix vertex shader MAD instructions with constant swizzles
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-04-05 09:04:42 -07:00
Fabian Bieler
5d5db24a26 st/mesa: Apply LOD from texture object
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 09:08:19 -06:00
Fabian Bieler
d863bd7d7b st/mesa: Apply LOD bias from correct texture unit
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 09:07:07 -06:00
Brian Paul
8778bf221e mesa: fix alpha value for texstore_rgbx8888
Silences constant overflow compiler warning.
2011-04-05 07:53:09 -06:00
Fabian Bieler
c7339d42c6 mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared.

At least with the gallium state tracker this can actually occur if st_render_texture fails.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-04-05 07:51:01 -06:00
Brian Paul
db0f9e701d mesa: added _mesa_get_attachment_teximage() helpers 2011-04-05 07:51:01 -06:00
Brian Paul
e9375cd0e8 mesa: 80-column wrapping 2011-04-05 07:51:01 -06:00
Dave Airlie
9ac64f7301 r300c: fix build since last r300g commit 2011-04-05 16:54:08 +10:00
Marek Olšák
b3011ea60c r300g: fix RG/LATC1_SNORM by doing UNORM->SNORM conversion in the shader 2011-04-05 06:36:56 +02:00
Marek Olšák
20141d9efd r300/compiler: implement the CND opcode
No one uses it now, but I will need it for a lowering pass.
2011-04-05 06:36:56 +02:00
Marek Olšák
c97234507a r300/compiler: set the MSB of ADDR for inline constants
The docs say so.
2011-04-05 06:36:56 +02:00
Brian Paul
5d92596c56 st/mesa: minor assorted clean-ups and fixes 2011-04-04 17:42:43 -06:00
Brian Paul
ed9396782e st/mesa: use 'array' local var to simplify the code a bit 2011-04-04 17:42:43 -06:00
Brian Paul
6cab07685f st/mesa: fix zero-sized user vertex buffer bug
Commit 4c4ab5668c didn't properly
handle the stride==0 case.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35961
2011-04-04 17:42:43 -06:00
Ian Romanick
e397b3a7c0 mesa: Add fall-back formats for unsupported snorm formats
This is always the way with real hardware and desktop OpenGL.  Some
hardware can't do some formats natively.  The alpha-only, luminance,
and intensity formats are usually the most problematic.  Some sized
formats can also be problematic.  This patch provides fall-back
formats for those that are not natively supported.

At some point it would be interesting to try providing
device-independent conversions using EXT_texture_swizzle.  The drivers
that support EXT_texture_swizzle could, for example, see
GL_LUMINANCE16_SNORM as MESA_FORMAT_SIGNED_R16 with a { r, r, r, 1 }
swizzle.  Care would need to be taken to prevent issues with using
those textures for FBO rendering.

This is the rest of the fix for glean's pixelFormats test on i965.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-04 15:18:37 -07:00
Ian Romanick
ad3fbac00b i965: Add the missing supportable EXT_texture_snorm formats
This class of hardware can natively sample all of the snorm surface
formats that DX10 requires, but it can't do some of the legacy GL
formats.  In particular, all of the alpha, luminance, and intensity
formats are unsupported.

This partially fixes the breakage in glean's pixelFormats test since
GL_EXT_texture_snorm support was added to Mesa.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-04-04 14:32:01 -07:00
Bryan Cain
19d06b5c05 nv50: prevent NV_OP_SELECT from having flags_def defined 2011-04-04 23:08:54 +02:00
Brian Paul
fdb04c0384 mesa: work around failed assertion for GL_RGBA16_SNORM accum buffer
We use this format to represent the accum buffer.  No snorm texture
sampling or rendering takes place.

Fixes failed assertion with swrast and any app using the accum buffer
(and glxinfo).
2011-04-04 14:37:28 -06:00
Brian Paul
32a11e5324 docs: update prerequisites, remove old demo info 2011-04-04 11:30:46 -06:00
Brian Paul
48f696c793 docs: update info about Mesa packaging/contents 2011-04-04 11:17:55 -06:00
Marek Olšák
0d96ae8fc7 r300/compiler: apply the texture swizzle to shadow pass and fail values too
Piglit tests:
- glsl-fs-shadow2d-01
- glsl-fs-shadow2d-02
- glsl-fs-shadow2d-03
- fs-shadow2d-red-01
- fs-shadow2d-red-02
- fs-shadow2d-red-03

NOTE: This is a candidate for the stable branches.
2011-04-04 19:13:01 +02:00
Marek Olšák
2679760834 r300/compiler: propagate SaturateMode down to the result of shadow comparison
NOTE: This is a candidate for the stable branches.
2011-04-04 19:13:01 +02:00
Alex Deucher
a0fc40f0d5 r600g: add some additional ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:15:18 -04:00
Alex Deucher
b0da65bd0e r600c: add new ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:13:44 -04:00
Marek Olšák
6caac3ecb8 r300g: do not wait for a busy BO if neither GPU nor CPU is changing it
Improves frame rate in apps with at least one user vertex buffer and
a hw index buffer.
2011-04-03 22:49:22 +02:00
Marek Olšák
9d881cbd5a r300g: remove unused RADEON_PB_USAGE_CACHE 2011-04-03 21:18:03 +02:00
Marek Olšák
f814dd7a81 r300g: tell the GLSL compiler to lower the continue opcode
NOTE: This is a candidate for the stable branches.
2011-04-03 19:35:43 +02:00
Marek Olšák
652bf121f2 r300g: avoid mapping the same buffer twice
Shouldn't happen, but you never know.
2011-04-03 19:32:27 +02:00
Marek Olšák
437c748bf5 r300g: handle DISCARD_WHOLE_RESOURCE for buffers 2011-04-03 19:32:27 +02:00
Marek Olšák
c35572352e r300g: remove the redundant reference counter in radeon_bo
We already have pb_buffer::reference::count.
2011-04-03 19:32:27 +02:00
Tom Stellard
381d32af74 Revert "r300/compiler: Remove obsolete compiler passes"
This reverts commit 9f013a8233.

These passes are still need for non-GLSL paths like g3dvl and ARB
programs.
2011-04-02 23:22:48 -07:00
Kenneth Graunke
5d7fefb9af i965/fs: Switch W and 1/W in Sandybridge interpolation setup.
Various documentation mentions that "W" is handed to the WM stage,
but further digging seems to indicate that they really mean 1/W.

The code here is still unclear, but changing this fixes piglit
test "fragcoord_w" on Sandybridge as well as a Khronos ES2 conformance
test.  I also tested 3DMarkMobile ES2.0's taiji and hoverjet demos, as
well as Nexuiz, just to be safe.

NOTE: This is a candidate for the 7.10 branch.
2011-04-02 18:58:16 -07:00
Kenneth Graunke
a019dd0d6e i965: Fix null register use in Sandybridge implied move resolution.
Fixes regressions caused by commit 9a21bc6401, namely GPU hangs when
running gnome-shell or compiz (Mesa bugs #35820 and #35853).

I incorrectly refactored the case that dealt with ARF_NULL; even in that
case, the source register needs to be changed to the MRF.

NOTE: This is a candidate for the 7.10 branch (if 9a21bc6401 is
cherry-picked, take this one too).
2011-04-03 00:57:30 -07:00
Eric Anholt
904b8ba1bb i965: Fix the VS thread limits for GT1, and clarify the WM limits on both. 2011-04-01 14:12:32 -07:00
José Fonseca
6586a3b287 tests: Use elts in translate_test. 2011-04-01 20:18:22 +01:00
José Fonseca
3f68d4b058 scons: Add aliases for unit tests. 2011-04-01 20:18:22 +01:00
José Fonseca
17bbc1f042 translate: Respect translate_buffer::max_index. 2011-04-01 20:18:18 +01:00
José Fonseca
3733da31e8 draw: Prevent out-of-bounds vertex buffer access.
Based on some code and ideas from Keith Whitwell.
2011-04-01 20:18:18 +01:00
Marek Olšák
4a7f013f9d gallium: set PIPE_CAP_MIXED_COLORBUFFER_FORMATS in some drivers 2011-04-01 13:48:01 +02:00
Marek Olšák
25f2699767 gallium: add a CAP for mixed colorbuffer format support
Some GPUs can't do it (I think most of DX9 ones), so they should have
the option not to allow it.
2011-04-01 13:48:01 +02:00
Tom Stellard
9f013a8233 r300/compiler: Remove obsolete compiler passes
Branch emulation and loop unrolling are done in the GLSL frontend.
Transforming loops is no longer needed for fragment shaders, but it is still
necessary for vertex shaders.
2011-03-31 23:45:26 -07:00
Tom Stellard
18dcbd358f prog_optimize: Fix reallocating registers for shaders with loops
Registers that are used inside of loops need to be considered live
starting with the first instruction of the outermost loop.

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

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-31 21:20:46 -07:00
Christoph Bumiller
c3526585b7 nv50: fix for GPR allocation granularity being 16 bit 2011-03-31 16:51:32 +02:00
Christoph Bumiller
3f625689ac nv50: copy regalloc fixes from nvc0
Should fix gnome-shell's fade shader.

Unification of the shader backend which is supposed to remove the
code duplication is still WIP.
2011-03-31 16:24:59 +02:00
José Fonseca
3dedd39cdd draw: Revert code reorg in previous change.
Because

  fetch_count = max_index - min_index + 1

overflows for min_index = 0 and max_index = 0xffffffff.

Fixes fdo 35815.
2011-03-31 12:20:37 +01:00
Chris Wilson
c40b7910ee intel: Fix regression in clear_with_blit from 7bae1c3d
Oops, the mask was being used in the loop to determine whether to use
include the stencil || depth values. This began to fail when mask was
cleared at the beginning of the loop. So reorder the tests and do the
work up-front along with determining the depth_stencil value to use.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35822
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-31 11:58:36 +01:00
Luca Barbieri
5f996e2b1d draw: implement vertex color clamping, and disable SSE and PPC paths
(some little changes by Marek Olšák)

Squashed commit of the following:

commit 737c0c6b7d591ac0fc969a7590e1691eeef0ce5e
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Fri Aug 27 02:13:57 2010 +0200

    draw: disable SSE and PPC paths (use LLVM instead)

    These paths don't support vertex clamping, and are anyway
    obsoleted by LLVM.

    If you want to re-enable them, add vertex clamping and test that it
    works with the ARB_color_buffer_float piglit tests.

commit fed3486a7ca0683b403913604a26ee49a3ef48c7
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:27:38 2010 +0200

    draw_llvm: respect vertex color clamp

commit ef0efe9f3d1d0f9b40ebab78940491d2154277a9
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:26:43 2010 +0200

    draw: respect vertex clamping in interpreter path
2011-03-31 03:35:31 +02:00
Jerome Glisse
ebe304fa54 gallium: list use inline function to avoid macro shot coming
Macro can lead to hard to debug list bugs. For instance consider
the following :
LIST_ADD(item, list->prev)
3 instruction of the macro became :
(list->prev)->next->prev = item
which is equivalent to :
list->prev = item
Thus list prev field changes and next instruction in the macro
(list->prev)->next = item
became :
item->next = item
And you endup with list corruption, other case lead to similar
list corruption. Inline function are not affected by this short
coming

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-03-30 17:03:00 -04:00
José Fonseca
dcad6fb670 draw: Forgot to remove one istart usage. 2011-03-30 16:09:34 +01:00
José Fonseca
713230ff39 draw: Fix bug when drawing ushort indices.
When the condition

 min_index == 0 && sizeof(ib[0]) == sizeof(draw_elts[0])

was true, we were wrongly ignoring istart and processing indices 0.

Reorder some statements to make the code easier to understand.
2011-03-30 16:05:24 +01:00
Chris Wilson
6584d0cd4f intel: Remove the unrelaxed relocation assertion
Now that we purposefully generate delta that point outside of the target
buffer, the assertion has outlived its usefulness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 15:13:05 +01:00
Feng, Haitao
58f95f9d01 egl_dri2 x11: Fix a typo
Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-03-30 08:29:09 -04:00
Chris Wilson
5eb9f68708 intel: Add some defense against buffer allocation failure for subimage blits
Once more! This time without the unwarranted conversion from
drm_intel_bo_alloc_tiled.

Signed-off-by: [a very embarrassed] Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 11:01:42 +01:00
Chris Wilson
f5a9a0bc22 Revert "intel: Add some defense against buffer allocation failure for subimage blits"
This reverts commit de7678ef52.

The conversion from using drm_intel_bo_alloc_tiled to a plain
drm_intel_bo_alloc forgot that the tiled variant adjusts the
allocation height even for TILING_NONE.

Reported-by: Dave Airlie <airlied@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35786
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-30 11:01:42 +01:00
Michel Dänzer
167d35c303 gallium: Use explicit values in caps enums.
Simplifies mapping between numbers and identifiers for these.
2011-03-30 10:50:11 +02:00
Michel Dänzer
72e82418ef Use row stride instead of width when getting colour index texels.
Untested, noticed while working on the depth/stencil fix.
2011-03-30 10:48:37 +02:00
Michel Dänzer
b082e04619 Use proper source row stride when getting depth/stencil texels. 2011-03-30 09:31:21 +02:00
Kenneth Graunke
ee8d182426 intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.
Also, refactor IS_GEN6 to use the IS_GT1 and IS_GT2 macros.
2011-03-29 17:08:53 -07:00
Christoph Bumiller
8f060df60d nv50,nvc0: implement colour clamping controls 2011-03-29 23:09:02 +02:00
Fredrik Höglund
d04ab396a5 r600g: implement texture barrier 2011-03-29 16:54:19 -04:00
Fredrik Höglund
948e1eb8e9 r600g: implement the pipe_screen fence functions
v2: Allocate the fences from a single shared buffer object.
v3: Allocate the r600_fence structs in blocks of 16.
    Spin a few times before calling sched_yield in r600_fence_finish().
2011-03-29 16:37:04 -04:00
Ian Romanick
a99e80d795 mesa: Fix ugly indentation left from previous commit
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:09 -07:00
Ian Romanick
89d81ab16c glsl: Calcluate Mesa state slots in front-end instead of back-end
This should be the last bit of infrastructure changes before
generating GLSL IR for assembly shaders.

This commit leaves some odd code formatting in ir_to_mesa and brw_fs.
This was done to minimize whitespace changes / reindentation in some
loops.  The following commit will restore formatting sanity.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:08 -07:00
Ian Romanick
92e412e788 glsl: Move _mesa_builtin_uniform_desc from uniforms.c to ir_variable.cpp
This array is going to be used in the main compiler soon.  Leaving
them uniforms.c caused problems for building the stand-alone compiler.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-29 13:21:08 -07:00
Marek Olšák
0420ae3d90 r300g: add support for all render targets with one and two channels
The hardware should be set according to this table:

FORMAT -> R300 COLORFORMAT
-------------------------
X16    -> UV88
X16Y16 -> ARGB8888
X32    -> ARGB8888
X32Y32 -> ARGB16161616

US_OUT_FMT must contain the real format.

I wasn't able to make B3G3R2 and L4A4 work, but those aren't important.
2011-03-29 18:47:02 +02:00
Marek Olšák
7d41857566 intel: fix build
broken with e5c6a92a12
(mesa: implement clamping controls (ARB_color_buffer_float))
2011-03-29 18:03:19 +02:00
Chris Wilson
7bae1c3d85 intel: Protect intel_clear_with_blit from failed buffer allocations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34419
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:56 +01:00
Chris Wilson
252eaa765e i965: Avoid name clash of loop counter and member
src/mesa/drivers/dri/i965/brw_fs.cpp:565 warning: name lookup of ‘c’ changed

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:56 +01:00
Chris Wilson
b094dff50a i915: Detect allocation failure of batch buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29 15:43:55 +01:00
Marek Olšák
8cbdfe1de4 docs: update GL3 status 2011-03-29 13:04:15 +02:00
Marek Olšák
2e6a69939c r300g: finish up signed normalized textures and render targets 2011-03-29 12:50:28 +02:00
Marek Olšák
f037914670 r300g: enable clamping controls 2011-03-29 12:50:28 +02:00
Marek Olšák
8d4ec87d7f gallium: remove PIPE_CAP_VERTEX_COLOR_CLAMP_CONTROL
The vertex color clamp control is a property of an API,
a lot like gl_rasterization_rules.

The state should be set according to the API being implemented, for example:
   OpenGL Compatibility: enabled by default
   OpenGL Core: disabled by default
   D3D11: always disabled

This patch also changes the way ARB_color_buffer_float is advertised.
If no SNORM or FLOAT render target is supported, fragment color clamping
is not required.
2011-03-29 12:50:27 +02:00
Marek Olšák
e28fe8fe5d mesa: clamp texture border color if ARB_texture_float is unsupported
ARB_texture_float disables clamping of the texture border color,
ARB_color_buffer_float only modifies clamping of the glGet query.
2011-03-29 12:50:27 +02:00
Marek Olšák
b518f4d0ea st/mesa: choose an appropriate texture format for DrawPixels 2011-03-29 12:50:22 +02:00
Marek Olšák
2af1da1546 gallium: add EXT_texture_snorm support 2011-03-29 12:04:55 +02:00
Marek Olšák
daa5242f9e mesa: implement texstore and texfetch hooks for signed normalized formats
The snorm texstore functions were all broken.

swrast support done except for mipmap generation, but I leave it disabled.
2011-03-29 12:04:55 +02:00
Marek Olšák
0be369975f mesa: initial EXT_texture_snorm support
The component ordering of some formats has been been reversed to match
Gallium types.
2011-03-29 12:04:55 +02:00
Luca Barbieri
47e3896dfd gallium: implement clamping controls (ARB_color_buffer_float)
BTW this changes the gallium interface.
Some rather cosmetic changes by Marek.

Squashed commit of the following:

commit 513b37d484f0318311e84bb86ed4c93cdff71f13
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:17:54 2010 +0200

    mesa/st: respect fragment clamping in st_DrawPixels

commit 546a31e42cad459d7a7a10ebf77fc5ffcf89e9b8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:17:28 2010 +0200

    mesa/st: support fragment and vertex color clamping

commit c406514a1fbee6891da4cf9ac3eebe4e4407ec13
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:56:37 2010 +0200

    mesa/st: expose ARB_color_buffer_float if unclamping is supported

commit d0c5ea11b6f75f3da2f4ca989115f150ebc7cf8d
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 17:53:41 2010 +0200

    mesa/st: use unclamped colors

    This assumes that Gallium is to be interpreted as given drivers the
    responsibility to clamp these colors if necessary.

commit aef5c3c6be6edd076e955e37c80905bc447f8a82
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:12:34 2010 +0200

    mesa, mesa/st: handle read color clamping properly

    We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where
    the operation mandates it. (see the removed XXX comment. -Marek)

    TODO: did I get the set of operations mandating it right?

commit 76bdfcfe3ff4145a1818e6cb6e227b730a5f12d8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:18:25 2010 +0200

    gallium: add color clamping to the interface
2011-03-29 12:04:55 +02:00
Marek Olšák
e5c6a92a12 mesa: implement clamping controls (ARB_color_buffer_float)
Squashed commit of the following:

Author: Marek Olšák <maraeo@gmail.com>

    mesa: fix getteximage so that it doesn't clamp values
    mesa: update the compute_version function
    mesa: add display list support for ARB_color_buffer_float
    mesa: fix glGet query with GL_ALPHA_TEST_REF and ARB_color_buffer_float

commit b2f6ddf907935b2594d2831ddab38cf57a1729ce
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 31 16:50:57 2010 +0200

    mesa: document known possible deviations from ARB_color_buffer_float

commit 5458935be800c1b19d1c9d1569dc4fa30a97e8b8
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Tue Aug 24 21:54:56 2010 +0200

    mesa: expose GL_ARB_color_buffer_float

commit aef5c3c6be6edd076e955e37c80905bc447f8a82
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:12:34 2010 +0200

    mesa, mesa/st: handle read color clamping properly

    (I'll squash the st/mesa part to a separate commit. -Marek)

    We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where
    the operation mandates it.

    TODO: did I get the set of operations mandating it right?

commit 3a9cb5e59b676b6148c50907ce6eef5441677e36
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:09:41 2010 +0200

    mesa: respect color clamping in texenv programs (v2)

    Changes in v2:
    - Fix attributes other than vertex color sometimes getting clamped

commit de26f9e47e886e176aab6e5a2c3d4481efb64362
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:05:53 2010 +0200

    mesa: restore color clamps on glPopAttrib

commit a55ac3c300c189616627c05d924c40a8b55bfafa
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 18:04:26 2010 +0200

    mesa: clamp color queries if and only if fragment clamping is enabled

commit 9940a3e31c2fb76cc3d28b15ea78dde369825107
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Wed Aug 25 00:00:16 2010 +0200

    mesa: introduce derived _ClampXxxColor state resolving FIXED_ONLY

    To do this, we make ClampColor call FLUSH_VERTICES with the appropriate
    _NEW flag.

    We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging
    effects, despite being in the Color attrib group.

    This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g

commit 6244c446e3beed5473b4e811d10787e4019f59d6
Author: Luca Barbieri <luca@luca-barbieri.com>
Date:   Thu Aug 26 17:58:24 2010 +0200

    mesa: add unclamped color parameters
2011-03-29 12:04:55 +02:00
Marek Olšák
3bdd12ecb5 mesa: regenerate glapi files 2011-03-29 12:04:54 +02:00
Kenneth Graunke
9d60a7ce08 i965: Resolve implied moves in brw_dp_READ_4_vs_relative.
Fixes piglit test glsl-vs-arrays-3 on Sandybridge, as well as garbage
rendering in 3DMarkMobileES 2.0's Taiji demo and GLBenchmark 2.0's
Egypt and PRO demos.

NOTE: This a candidate for stable release branches.  It depends on
commit 9a21bc6401.
2011-03-29 06:22:48 -07:00
Kenneth Graunke
9a21bc6401 i965: Refactor Sandybridge implied move handling.
This was open-coded in three different places, and more are necessary.
Extract this into a function so it can be reused.

Unfortunately, not all variations were the same: in particular, one set
compression control and checked that the source register was not
ARF_NULL.  This seemed like a good idea, so all cases now do so.
2011-03-29 05:29:06 -07:00
Vinson Lee
4f94e0b76a mesa: Add missing parentheses in glBlitFramebufferEXT error strings. 2011-03-28 20:32:01 -07:00
Ian Romanick
e21beaeb10 intel: Don't leak the tex object miptree when replacing it
Eventually the miptree refcounting interface should be cleaned up.
The assymmetry dramatically increases the probability of bugs like
this.  It should be made to like like libdrm refcounting or the
refcounting style used in other parts of Mesa.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-03-28 19:54:51 -07:00
Vinson Lee
92e29dc5b0 gallivm: Fix build with llvm-2.9.
The build fix of commit 40ae214067 does
not apply to llvm-2.9 but rather to llvm-3.0svn.
2011-03-28 17:48:37 -07:00
Vinson Lee
2737350157 i915g: Fix build.
Fix build failures introduced with commit 0fbb64a529.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-03-28 17:37:33 -07:00
Daniel Vetter
0fbb64a529 i915g: use drm ioctl to get pci devid
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-28 21:23:31 +02:00
Tobias Droste
40ae214067 gallivm: Fix build with llvm-2.9
In llvm-2.9 Target->createMCInstPrinter() takes different arguments

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-03-28 17:23:45 +01:00
Henri Verbeet
5d7c27f5ec st/mesa: Validate state before doing blits.
Specifically, this ensures things like the front buffer actually exist. This
fixes piglt fbo/fbo-sys-blit and fd.o bug 35483.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:01:59 +02:00
Fabian Bieler
244a3bbf14 r600g: Handle texture fetch instructions with relative addressing
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Fabian Bieler
da5b4764b2 r600g: Handle texture fetch instructions with neg or abs on source register
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Fabian Bieler
78037d95da r600g: Handle texture fetch instructions with swizzle on source register
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-27 15:00:07 +02:00
Kenneth Graunke
8752824f27 glsl: Accept precision qualifiers on sampler types, but only in ES.
GLSL 1.30 states clearly that only float and int are allowed, while the
GLSL ES specification's issues section states that sampler types may
take precision qualifiers.

Fixes compilation failures in 3DMarkMobileES 2.0 and GLBenchmark 2.0.

NOTE: This is a candidate for stable release branches.
2011-03-26 23:56:18 -07:00
Kenneth Graunke
0c8beb0ab5 i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.
Civilization 4's shaders make heavy use of gl_Color and don't use
perspective interpolation.  This resulted in rivers, units, trees, and
so on being rendered almost entirely white.  This is a regression
compared to the old fragment shader backend.

Found by inspection (comparing the old and new FS backend code).

References: https://bugs.freedesktop.org/show_bug.cgi?id=32949

NOTE: This is a candidate for the 7.10 branch.
2011-03-26 22:20:11 -07:00
Benjamin Franzke
62d5f7a04a egl/wayland-drm: Fix include path
src/egl/main/egltypedefs.h needs the path for EGL/egl.h

Reported by jlind on irc.
2011-03-26 10:57:31 -04:00
Kristian Høgsberg
a1bd012473 egl_dri2: We don't actually support KHR_gl_texture_2D_image 2011-03-26 10:57:31 -04:00
Kristian Høgsberg
981e338611 egl_dri2: Enable image extensions in one place
We know what we can support in egl_dri2.c so just enable the extensions
there.
2011-03-26 10:57:31 -04:00
Kenneth Graunke
56ef62d988 glsl: Generate readable unique names at print time.
Since GLSL IR allows multiple ir_variables to share the same name, we
need to generate unique names when printing the IR.  Previously, we
always used %s@%p, appending the ir_variable's memory address.

While this worked, it had two drawbacks:
- When there aren't duplicates, the extra "@0x669a3e88" is useless
  and makes the code harder to read.
- Real duplicates were hard to tell apart:
  channel_expressions@0x6699e3c8 vs. channel_expressions@0x6699ddd8

We now append @2, @3, @4, and so on, but only where necessary to
distinguish duplicates.  Since we only do this at print time, any
performance impact is irrelevant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-03-25 16:31:53 -07:00
Vinson Lee
eb0dd37094 gallivm: Fix build with llvm-2.9.
In llvm-2.9, the header file llvm/System/Host.h has been moved to
llvm/Support/Host.h.
2011-03-25 12:47:06 -07:00
Ian Romanick
dfdff940b6 glsl: Make add_variable, add_uniform, et. al. have similar signatures
While making some other changes in this area I was finding it annoying
each of these functions took mostly the same set of parameters in
differing orders.
2011-03-25 11:28:08 -07:00
Ian Romanick
4e994e150f i965/fs: Use different name for inner loop counter
'i' is already used for the outer loop.  This caused some problems
while doing other work in this area.  No bug exists here... until you
want to use the outer loop counter in the inner loop.
2011-03-25 11:28:07 -07:00
Ian Romanick
0d9d036004 glsl: Fix off-by-one error setting max_array_access for non-constant indexing
NOTE: This is a candidate for the stable branches.
2011-03-25 11:28:07 -07:00
Ian Romanick
bc83f6bd58 glsl: Add array access bounds checking to ir_validate 2011-03-25 11:28:07 -07:00
Brian Paul
cf290344cc mesa: add void to save_TextureBarrierNV() 2011-03-25 10:33:51 -06:00
José Fonseca
28f1d6ab49 glsl: Add void to _mesa_destroy_shader_compiler() argument list.
At least MSVC sees a distinction between foo() and foo(void) and warns
about it.
2011-03-25 16:22:34 +00:00
José Fonseca
a81828cb96 mesa: Avoid redefining PUBLIC/USE/likely/unlikely macros. 2011-03-25 16:22:32 +00:00
José Fonseca
7fbe020bbc mesa: Use appropriate call convention in VertexAttribI*v.
We were using typecasts because the functions pointers are polymorphic
in the second argument type, which.

Surprisingly the wrong calling convention didn't cause crashes on Windows,
but it was causing certain registers to be trashed in MSVC optimized
builds, when processing callists in the ClearView RC Flight Simulator.
2011-03-25 16:22:30 +00:00
José Fonseca
5858abec6e gallium: Avoid redefinition of likely/unlikely macros on non gcc compilers. 2011-03-25 16:22:28 +00:00
José Fonseca
acd7ce57f7 mesa,mapi: Remove spurious const keyword from ClearBufferfi args. 2011-03-25 16:22:26 +00:00
Marek Olšák
226ae9d6c8 r300g: fix alpha-test with no colorbuffer
Piglit:
- fbo-alphatest-nocolor

NOTE: This is a candidate for the stable branches.
2011-03-24 23:37:51 +01:00
Brian Paul
e1a9ef2304 mesa: added _mesa_dump_image() for debugging 2011-03-24 13:38:28 -06:00
Brian Paul
e4852ae4d2 mesa: minor whitespace fixes 2011-03-24 13:38:27 -06:00
Eric Anholt
2911fa0cca i965/fs: Make compile failure more verbose with INTEL_DEBUG=wm. 2011-03-24 11:31:36 -07:00
Eric Anholt
4a101f9577 i965/fs: Clean up reg_undef args from long ago lack of fs_inst overloads. 2011-03-24 11:31:36 -07:00
Eric Anholt
53d78be3bd i965/fs: Clean up the emit calls by introducing emit() overload helpers.
I think the code ends up a lot more legible this way, though we've
still got the overloads in the fs_inst as well (even though there's
only one caller left currently).
2011-03-24 11:31:36 -07:00
Brian Paul
82dd62fb22 mesa: new MESA_EXTENSION_MAX_YEAR env var
If set to year X, only report extensions up to that year.  This is a
work-around for games that try to copy the extensions string to a fixed
size buffer and overflow.  If a game was released in year X, setting
MESA_EXTENSION_MAX_YEAR to that year will likely fix the problem.
2011-03-24 11:39:23 -06:00
Brian Paul
4c75d5ae63 svga: adjust triangle rasterization offset
Fixes minor sub-pixel positioning error in some apps.
2011-03-24 11:32:38 -06:00
Iain Hibbert
c22a7f9045 radeon: use C99 style in macros with variable arguments
Signed-off-by: Iain Hibbert <plunky@netbsd.org>
2011-03-24 08:36:31 -06:00
Brian Paul
ff2950dd69 radeon: reorder #includes to silence warnings
Silences warnings about RADEON_TILING_SURFACE being redefined.
Only compile tested, not run tested.
2011-03-24 08:34:44 -06:00
Brian Paul
b5745429d7 r128: fix an old annoying warning 2011-03-24 08:29:28 -06:00
Brian Paul
7d40bf2566 radeon: fix radeon_create_image_from_name() wrong parameter type 2011-03-24 08:29:28 -06:00
José Fonseca
f4e392bf8d st/wgl: Adjust the pbuffer invisible window size.
Thanks to Brian Paul for diagnosing the issue.
2011-03-24 10:47:03 +00:00
José Fonseca
81992010b5 mesa: More glGet* fixes.
glGet(GL_NORMAL_ARRAY) giving potentially wrong results.

Most of glGet(GL_XXX_ARRAY_BUFFER_BINDING) giving totally bogus results.
2011-03-23 16:47:41 +00:00
Brian Paul
12b9e07966 mesa: remove unused _MESA_NEW_NEED_NORMALS 2011-03-23 09:05:04 -06:00
Brian Paul
7ecb61c30c mesa: remove _MESA_NEW_TRANSFER_STATE 2011-03-23 09:04:22 -06:00
José Fonseca
f6970872c0 mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*). 2011-03-22 22:48:02 +00:00
Fabian Bieler
8d7c12de1e r600g: Check for relative addressing in destination register when trying to merge instruction groups
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-22 21:24:09 +01:00
Dave Airlie
e4b040c2b9 r600g: fix bo names causing -35 EDEADLCK
this is a port of the r300 winsys code to do the same thing.
2011-03-22 11:48:36 +10:00
José Fonseca
b881ea87f1 svga: Avoid synchronizing when doing piecewise upload of textures. 2011-03-21 18:47:24 +00:00
José Fonseca
29288249e3 svga: Undo the DMA buffer size limiting.
Move this to the winsys, given it is not a virtual device limitation,
but a limitation specific to certain winsyses.

Also update debug message.
2011-03-21 18:46:59 +00:00
Dave Airlie
9b13c988ac glapi: drop glapi.[ch] and glapitemp.h from being copied to the X server.
These files are no longer considered shared as the X code is a lot simpler
without sharing them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-21 12:03:20 +10:00
Brian Paul
cfc7ded3ff mesa: 80-column wrapping and comment updates 2011-03-19 14:17:42 -06:00
Brian Paul
d0d767ad4c mesa: 80-column wrapping, update comment 2011-03-19 14:17:41 -06:00
Brian Paul
912c4ec6df gl.h: reorder some #defines 2011-03-19 14:17:41 -06:00
Brian Paul
933b99f113 mesa: consolidate enable/disable code for GL_TEXTURE_GEN_S/T/R/Q 2011-03-19 14:17:41 -06:00
Brian Paul
ec4a21b0e2 mesa: consolidate clip plane update code 2011-03-19 14:17:41 -06:00
Brian Paul
957552fce0 mesa: 80-column wrapping 2011-03-19 14:17:41 -06:00
Brian Paul
aafcbd2cf7 mesa: replace macro with function 2011-03-19 14:17:41 -06:00
Brian Paul
9459cc593c mesa: 80-column wrapping 2011-03-19 14:17:41 -06:00
Brian Paul
630d925666 mesa: rename functions to follow Mesa conventions 2011-03-19 14:17:40 -06:00
Brian Paul
79f4281a52 mesa: 80-column wrapping 2011-03-19 14:17:40 -06:00
Christoph Bumiller
83ff3809f1 nv50,nvc0: implement texture barrier 2011-03-19 14:45:55 +01:00
Tom Stellard
9d2ef284bb r300/compiler: Use a 4-bit writemask in pair instructions
We now use a 4-bit writemask for all instruction types, which makes it
easier to write generic helper functions to manipulte writemasks.

NOTE: This is a candidate for the 7.10 branch.
2011-03-18 12:04:20 -07:00
Johannes Obermayr
8042d751de nouveau: Fix serious compiler warnings
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=35025

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-18 12:10:11 -06:00
Brian Paul
5b902a08c1 mesa: minor improvements in glTexEnvfv() 2011-03-17 20:31:58 -06:00
Brian Paul
582570a04c mesa: only report up to 50 _mesa_problem() calls
http://bugs.freedesktop.org/show_bug.cgi?id=35200 reports a disk
partition getting filled because of warning messages.  Stop emitting
after 50.
2011-03-17 20:31:58 -06:00
Brian Paul
147148fd50 swrast: report data type in error message 2011-03-17 20:31:58 -06:00
Kenneth Graunke
5e9aa9926b mesa: Remove the CompileShader driver hook; it's just a no-op. 2011-03-17 14:48:54 -07:00
Brian Paul
cbadedb511 mesa: use _mesa_get_current_tex_unit() helper in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
552f54bf04 mesa: remove unneeded local var in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
dfda559b98 mesa: clean up the glBindTexture early out code a bit 2011-03-16 21:13:31 -06:00
Kenneth Graunke
2279156fe7 i965: Rename brw_(IF|CONT)_gen6 functions to gen6_(IF|CONT). 2011-03-16 14:18:03 -07:00
Tobias Droste
f3a828c21f autoconf: don't use CFLAGS for cpp files
Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-03-16 13:54:50 -07:00
Kenneth Graunke
2baac48f39 i965: Rename BRW_DATAPORT_..._GEN6 messages to GEN6_... for consistency. 2011-03-16 13:51:44 -07:00
Kenneth Graunke
cc48d663f7 i965: Rename BRW_SAMPLER_MESSAGE_..._GEN5 to GEN5_SAMPLER_MESSAGE.
We already have lots of GEN6_* defines; this seems more consistent.
2011-03-16 13:51:44 -07:00
José Fonseca
b47d508412 svga: Leave any_user_vertex_buffers flag alone.
It is pointless to change, now that we don't replace user vertex buffer
with uploaded copy, per commit 52e598d200.
2011-03-16 15:46:21 +00:00
José Fonseca
74651f5738 svga: Hardcode SVGA_COMBINE_USERBUFFERS to 1.
The code no longer supports otherwise -- it relies on buffers being
uploaded via u_upload_mgr -- so make this clear.

Also, there's no need to flush after draws from user buffers, given all
user content should have been copied by then.
2011-03-16 15:43:00 +00:00
José Fonseca
8767fe2437 mesa: Sort extensions in extension string by year.
The years were obtained automatically by scraping the first year from
the spec text file.  They are approximate.
2011-03-16 11:38:53 +00:00
José Fonseca
e08a3d674a svga: Use transfer information on buffer transfers.
Should prevent the assert failure

  svga_buffer_flush_mapped_range: Assertion `sbuf->map.writing' failed.

on nested transfers.
2011-03-16 11:21:12 +00:00
José Fonseca
6b3713f8b8 glsl2: Silence unused added variable gcc warning. 2011-03-16 09:16:01 +00:00
José Fonseca
5fc5820cbc mesa: Use typecast in BITFIELD64_BIT macro.
Unsigned long is 32bit on several platforms (e.g., Windows), yielding
1UL << 32 to be zero.

Note that BITFIELD64_BIT result is often assigned to variables of type
GLbitfield, instead of GLbitfield64. That's probably wrong and should be
addressed in a later change.
2011-03-16 09:15:30 +00:00
Brian Paul
11150e4667 mesa: use BITFIELD64_BIT() macro 2011-03-15 18:21:36 -06:00
Brian Paul
aa878f94ab st/mesa: use BITFIELD64_BIT() macro in a few more places 2011-03-15 18:21:35 -06:00
Brian Paul
d350ef1682 glsl: add cast to silence signed/unsigned comparison warning 2011-03-15 18:21:35 -06:00
Brian Paul
d029ba9ec0 mesa: use 1UL for 64-bit unsigned constant for C++
This fixes C++ warnings where BITFIELD64_BIT() is used.
2011-03-15 18:21:35 -06:00
Ian Romanick
85caea29c1 glsl: Only allow unsized array assignment in an initializer
It should have been a tip when the spec says "However, implicitly
sized arrays cannot be assigned to. Note, this is a rare case that
*initializers and assignments appear to have different semantics*."
(empahsis mine)

Fixes bugzilla #34367.

NOTE: This is a candidate for stable release branches.
2011-03-15 16:41:23 -07:00
Daniel Vetter
d04348aaf6 i915g: fix braino in the static state rework
For mip-map level rendering, both draw offset and size tend to change ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 21:49:25 +01:00
Daniel Vetter
11ee41fe7f i915g: implement early z
v2: Make it actually work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:25 +01:00
Daniel Vetter
288504fac7 i915g: split up static state
Early Z support is set in the DST_VARS command. Hence split up static
state emission to avoid reissuing to much on fragment shader changes,
especially the costly dst buffer relocations.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-15 18:36:00 +01:00
Eric Anholt
a99447314c i965: Fix alpha testing when there is no color buffer in the FBO.
We were alpha testing against an unwritten value, resulting in garbage.
(part of) Bug #35073.
2011-03-15 10:14:52 -07:00
Eric Anholt
b60651a17b i965: Do our lowering passes before the loop of optimization.
The optimization loop won't reinsert noise instructions or quadop
vectors, so we were traversing the tree for nothing.  Lowering vector
indexing was in the loop after do_common_optimization() to avoid the
work if it ended up that the index was actually constant, but that has
been called already in the core.
2011-03-15 10:14:52 -07:00
Eric Anholt
c75427f4c8 glsl: Skip processing the first function's body in do_dead_functions().
It can't call anything, so there's no point.
2011-03-15 10:14:51 -07:00
Eric Anholt
11af045ea8 glsl: Whitespace fixup in opt_dead_functions.cpp. 2011-03-15 10:14:51 -07:00
Eric Anholt
2b13e13594 glsl: Skip processing of expression trees in discard simplification.
It only cares about "if", "loop", and "discard".
2011-03-15 09:49:01 -07:00
Eric Anholt
05cf1ad82e glsl: Reduce processing of expression trees in do_structure_splitting.
Most of the time we don't have a non-uniform struct variable in the
shader, so this cuts the time spent in do_structure_splitting during
glean texCombine by about 2/3.
2011-03-15 09:49:01 -07:00
Eric Anholt
991fa4d3d0 glsl: Skip processing expression trees in do_if_simplification().
Reduces time spent in this during glean texCombine by about 2/3.
2011-03-15 09:49:00 -07:00
Eric Anholt
d3a444af2d glsl: Skip processing expression trees in optimize_redundant_jumps()
Cuts the time spent in this function during glean texCombine by 2/3.
2011-03-15 09:49:00 -07:00
José Fonseca
b0fff8d17e svga: Tell the host to discard when doing writes without FLUSH_EXPLICIT. 2011-03-15 15:44:03 +00:00
José Fonseca
147ca90bd3 svga: Update svga_winsys_screen::buffer_map comments. 2011-03-15 15:43:33 +00:00
José Fonseca
ef33c82bfd svga: Ensure DMA commands are serialized with unsynchronized flag is unset. 2011-03-15 15:38:18 +00:00
Jose Fonseca
a946e84071 scons: copy hash_table.c, symbol_table.c to glsl directory
This fixes an issue where the .obj files wound up in the src/
directory rather than the build/ directory.  That prevented
combined 32-bit and 64-bit builds from working.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-15 15:32:00 +00:00
Marek Olšák
d0e805ebd8 mesa: fix scons build 2011-03-15 16:25:16 +01:00
Marek Olšák
79ddcb93fb r300g: implement the texture barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
aea4ed41ed gallium: add texture barrier support to the interface and st/mesa (v2)
v2: change the gallium entry point to texture_barrier.
2011-03-15 15:58:12 +01:00
Marek Olšák
9a9c1e1ae1 mesa: add display list support for NV_texture_barrier 2011-03-15 15:58:12 +01:00
Marek Olšák
7fa53f37e6 mesa: regenerate glapi files
Be sure to type "make clean" after this commit, otherwise your binaries
will segfault.
2011-03-15 15:58:00 +01:00
Marek Olšák
867f9b07d4 mesa: add NV_texture_barrier 2011-03-15 15:47:27 +01:00
Mathias Fröhlich
65942e141f gallium/util: Use PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write.
Additionally, to discarding the whole buffer, use
PIPE_TRANSFER_DISCARD_RANGE in pipe_buffer_write when the
write covers only part of the buffer.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:38 +01:00
Mathias Fröhlich
baab835a1f st/mesa: Make use of the new PIPE_TRANSFER_DISCARD_* for buffer object.
In memory mapping buffer objects make use of
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE and PIPE_TRANSFER_DISCARD_RANGE
when appropriate.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-03-15 15:39:31 +01:00
Dave Airlie
fedc5b03db glx: add ARB_create_context functions/ops to glx xml 2011-03-15 14:27:27 +10:00
Henri Verbeet
df3d11f6ca r600g: FLT_TO_INT_FLOOR and FLT_TO_INT_RPI are vector-only instructions on Evergreen.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-15 01:15:50 +01:00
Alex Deucher
39d60610e8 r600g: fix logic error in 028987c803
Spotted by Henri on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 18:07:15 -04:00
Alex Deucher
3e30148900 r600g: don't set per-MRT blend bits on R600
It doesn't support them.  Also, we shouldn't be
emitting CB_BLENDx_CONTROL on R600 as the regs don't
exist there, but I'm not sure of the best way to deal
with this in the current r600 winsys.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:53:00 -04:00
Alex Deucher
d6fea4a985 r600g: Original R600 does not support per-MRT blends
Only rv6xx+ support them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:47:21 -04:00
Alex Deucher
028987c803 r600g: emit SURFACE_BASE_UPDATE packet on rv6xx
This packet is required when updating the DB, CB,
or STRMOUT base addresses on rv6xx for the surface
sync logic to work correctly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:42:19 -04:00
Henri Verbeet
1a8dc1539b r600g: Properly update MULTIWRITE_ENABLE in r600_pipe_shader_ps().
This sort of worked because blend state setup cleared MULTIWRITE_ENABLE again,
but that's not something we want to depend on.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
ab1a2e454e r600g: Fix the DB_SHADER_CONTROL mask in create_ds_state().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
2342e89979 r600g: Properly update DB_SHADER_CONTROL in evergreen_pipe_shader_ps().
Disable Z_EXPORT / STENCIL_EXPORT / KILL_ENABLE again if a shader doesn't
use those. This is similar to 0a6f09a76a.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
a2ef38368b r600g: Move fetch shader register setup to r600_state.c / evergreen_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
f262ba26f0 r600g: Move r600_pipe_shader_ps() to r600_state.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Henri Verbeet
c0ca43e507 r600g: Move r600_pipe_shader_vs() to r600_state.c.
The idea behind this is that anything touching registers should be in
r600_state.c or evergreen_state.c. This is also consistent with
evergreen_pipe_shader_vs().

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
Rafael Monica
112ffdfd07 r600g: Evergreen add support for log opcode.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-14 22:15:56 +01:00
José Fonseca
202c345c7c autoconf/make: Don't specify individual llvm libraries.
We need more and more of these, and it is difficult and prone to version
incompatability issues trying to single out every one of them.

This mimicks what was done in SCons.
2011-03-14 20:05:56 +00:00
Kenneth Graunke
25e3114095 i965: Enable texture lookups whose return type is 'float'
This enables the new shadow texture functions in GLSL 1.30.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2011-03-14 13:03:50 -07:00
Chad Versace
1842b89f77 i965: Fix tex_swizzle when depth mode is GL_RED
Change swizzle from (x000) to (x001).

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Chad Versace
e0cbb154f2 i965: Remove dead assignment
The assignment on line 368, `tex_swizzles[i] = SWIZZLE_NOOP`, is rendered
dead by the reassignment on line 392.

Signed-off-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-03-14 13:03:50 -07:00
Kenneth Graunke
233b88eab9 glsl: Explicitly specify a type when reading/printing ir_texture.
This is necessary for GLSL 1.30+ shadow sampling functions, which return
a single float rather than splatting the value to a vec4 based on
GL_DEPTH_TEXTURE_MODE.
2011-03-14 13:03:50 -07:00
Kenneth Graunke
cb3317b85a texture_builtins.py: Add support for 130-style Shadow sampler variants. 2011-03-14 13:03:50 -07:00
Marek Olšák
bb0910bfa6 mesa: rename _mesa_texstore_a8 -> _mesa_texstore_unorm8
It's a generic function capable of storing A8, L8, I8, R8.
2011-03-14 18:51:29 +01:00
Marek Olšák
c0110d5450 mesa: fix up assertion in _mesa_source_buffer_exists
This was probably missed when implementing luminance and luminance alpha
render targets.

_mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE.

This fixes:
main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.
2011-03-14 10:24:24 +01:00
Marek Olšák
23ccab39cd r300g: clamp after blending for fixed-point formats only 2011-03-14 10:09:34 +01:00
Dave Airlie
340e15c79b glx: the server still needs __GLXcontext.
This file generates code for the X server and it still uses
the __GLXcontext structure name.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-14 15:03:53 +10:00
Marek Olšák
0f84ddad29 ir_to_mesa: do not check the number of uniforms against hw limits
The r300 compiler can eliminate unused uniforms and remap uniform locations
if their number surpasses hardware limits, so the limit is actually
NumParameters + NumUnusedParameters. This is important for some apps
under Wine to run.

Wine sometimes declares a uniform array of 256 vec4's and some Wine-specific
constants on top of that, so in total there is more uniforms than r300 can
handle. This was the main motivation for implementing the elimination
of unused constants.

We should allow drivers to implement fail & recovery paths where it makes
sense, so giving up too early especially when comes to uniforms is not
so good idea, though I agree there should be some hard limit for all drivers.

This patch fixes:
- glsl-fs-uniform-array-5
- glsl-vs-large-uniform-array
on drivers which can eliminate unused uniforms.
2011-03-14 03:12:34 +01:00
Dave Airlie
110f5e2056 autoconf/llvm: fix build for disassembler
tested by okias on irc
2011-03-14 09:37:08 +10:00
José Fonseca
c27e58c109 gallivm: Fix build with llvm 2.6 on 32bit platforms 2011-03-13 19:49:21 +00:00
José Fonseca
e6314db0ac gallivm: Use LLVM MC disassembler, instead of udis86.
Included in LLVM 2.7+. Unlink udis86, should support all instructions that
LLVM can emit.
2011-03-13 19:24:26 +00:00
José Fonseca
d2332569d2 util: Silence gcc unitialized member warning 2011-03-13 18:56:19 +00:00
José Fonseca
b79b05e17e draw: Fix draw_variant_output::format's type. 2011-03-13 18:56:07 +00:00
Christoph Bumiller
c448a556e9 nv50,nvc0: don't assert on cso with 0 vertex elements 2011-03-13 18:19:22 +01:00
Jakob Bornecrantz
07838ff990 rbug: Use the call mutex
Fixes crashes in [soft|llvm]pipe when replacing shaders
2011-03-13 18:13:55 +01:00
Mathias Fröhlich
0a6f09a76a r600g: Only update DB_SHADER_CONTROL once in r600_pipe_shader_ps().
Avoid setting the same gpu register several times in a r600_pipe_state.
Compute the final value of the register and set that one time. This avoids
some overhead in r600_context_pipe_state_set().

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-13 17:25:16 +01:00
Jakob Bornecrantz
629bc76b75 tgsi: Fix parsing of properties with digits in the name 2011-03-13 15:35:35 +01:00
Jakob Bornecrantz
f4e6061d88 rbug: Skip drawing on disabled shaders 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
dfac72208d rbug: Remove flags from flush 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c7894dfad9 i915g: Lie more so we get GLSL
Lots of piglit tests are lazy and wants GLSL
2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
c03be14d42 i915g: Point sprite cap could be supported 2011-03-13 13:36:21 +01:00
Jakob Bornecrantz
6d86429bd9 i915g: Sort cap list 2011-03-13 13:36:21 +01:00
Christoph Bumiller
07f73577af nvc0: support edge flags 2011-03-13 13:23:55 +01:00
Christoph Bumiller
c0f53fe8aa nvc0: fix POLYGON_MODE_BACK macro copy/paste error 2011-03-13 13:23:55 +01:00
Christoph Bumiller
e864ccb3f2 nv50,nvc0: fix pipe context switch 2011-03-13 13:23:55 +01:00
Christoph Bumiller
4388817a67 nv50,nvc0: clean up flushes 2011-03-13 13:23:55 +01:00
Christoph Bumiller
26a199efac nv50,nvc0: add some missing resource referencing 2011-03-13 13:23:55 +01:00
Christoph Bumiller
259efc90e7 nvc0: mask out centroid bit for writing FP header
It's only 2 bit per input, centroid is set in the instruction.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
0abaaac872 nvc0: identify VERTEX_QUARANTINE
Well, not sure what exactly it is, but it certainly doesn't contain
the control flow stack, but vertex data.

Not sure about size, I've only seen the first few KiB written, but
the binary driver seems to allocate more.
2011-03-13 13:23:55 +01:00
Christoph Bumiller
f0ee7d8bb4 nvc0: don't enable early-z if alpha test is enabled
Depth values are also written before the shader is executed, so if
early tests are enabled, fragments that failed the alpha test were
modifying the depth buffer, but they shouldn't.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
d9f1310e51 nvc0: move sprite coord replace state into cso
It's not dependent on any other state anymore now.
2011-03-13 13:23:54 +01:00
Christoph Bumiller
11f07a35f4 nvc0: s/nblocksx/nblocksy for height in resource_copy_region 2011-03-13 13:23:54 +01:00
Christoph Bumiller
d7a23cfb88 nvc0: fix unitialized variable in TGSI sysval decl processing 2011-03-13 13:23:54 +01:00
Christoph Bumiller
f10b2021c1 nvc0: update/fix supported instruction src modifiers 2011-03-13 13:23:54 +01:00
Chad Versace
dedc81e1dc glsl: Document glsl_type::sampler_dimensionality 2011-03-12 17:39:48 -08:00
Eric Anholt
098f9c5325 Revert "mesa: Convert fixed function fragment program generator to GLSL IR."
This reverts commit 7cb87dffce.
There were regressions (Bug #35244) and more review has been requested.
2011-03-12 15:11:01 -08:00
Eric Anholt
07c420a3c6 Revert "mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program"
This reverts commit b4452c3baa.
2011-03-12 15:11:00 -08:00
Eric Anholt
403be11111 Revert "i965: Use the fixed function GLSL program instead of the ARB program."
This reverts commit 81b34a4e3a.  There
were regressions in the core change that this depends on.
2011-03-12 15:11:00 -08:00
Daniel Vetter
7735f8c6e5 i915g: fix transfer coherency
The kernel drm takes care of all coherency as long as we don't forget
to submit all outstanding commands in the batchbuffer ...

Also move batchbuffer initialization up because otherwise transfers
for some helper textures fail with a segmentation fault.

And kill the dead code, flushes should now be correct everywhere.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 22:58:19 +01:00
Daniel Vetter
f608795588 i915g: don't recalculate fb dimension
The statetracker should do this for us correctly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:30 +01:00
Daniel Vetter
d46c6084ce i915g: use y-tiling when the blitter is not used
The blitter is broken. Who'd have guessed?

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:32:29 +01:00
Daniel Vetter
f0c56e2a23 i915g: implement copy_region using u_blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>works
2011-03-12 20:32:29 +01:00
Daniel Vetter
06713a4079 i915g: fix use after free
Pipe templates should be copied if still needed after the create
call completes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-12 20:31:30 +01:00
Jakob Bornecrantz
1a79064da1 gallium: Delay the creation of simple helper shaders 2011-03-12 19:39:45 +01:00
Carl-Philip Hänsch
7339915a4b r600g: Fix VS sampler view offsets for r600/r700.
077c448d18 missed this.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-12 19:33:16 +01:00
Henri Verbeet
656c314573 r600g: Fix an unused variable warning. 2011-03-12 16:43:58 +01:00
Henri Verbeet
ab21147c89 u_blitter: Do blits in linear color space.
Blits between sRGB and linear formats should happen in linear color space.
This fixes piglit fbo/fbo-srgb-blit.
2011-03-12 16:43:58 +01:00
Marek Olšák
6da4866ffd r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500
The docs say it can be set for direct texture lookups, but even that
causes problems.

This fixes the wireframe bug:
https://bugs.freedesktop.org/show_bug.cgi?id=32688

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 11:54:23 +01:00
Marek Olšák
1e97b4dd10 r300/compiler: TEX instructions don't support negation on source arguments
This fixes piglit:
- glsl-fs-texture2d-dependent-4

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:22:18 +01:00
Marek Olšák
589d835dfd r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 10:18:45 +01:00
Marek Olšák
d96305e4fc r300/compiler: fix translating the src negate bits in pair_translate
(1, -_, ...) was converted to (-1, ...) because of the negation
in the second component.
Masking out the unused bits fixes this.

Piglit:
- glsl-fs-texture2d-branching

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-12 09:39:46 +01:00
Marek Olšák
1868d21c8e st/dri: fix warning: ‘bind’ may be used uninitialized in this function 2011-03-12 08:49:54 +01:00
Marek Olšák
f1e160f89b llvmpipe: fix warning: ‘t0’ may be used uninitialized in this function 2011-03-12 08:48:43 +01:00
Marek Olšák
4b92c688a4 r300g: implement fragment color clamping in the shader
This finishes the implementation of the fragment color clamp control
for ARB_color_buffer_float. I don't wanna keep this stuff in a branch...
2011-03-12 07:56:33 +01:00
Marek Olšák
e4707604ab r300/compiler: fix the saturate modifier when applied to TEX instructions
This bug can only be triggered if the source texture is either signed or float.
2011-03-12 07:54:23 +01:00
Adam Jackson
cbcb84fccf r600g: revert unintentional commit 2011-03-11 17:46:03 -05:00
Adam Jackson
02725bc8b0 nouveau: Build fix
nouveau_vieux_dri.so.tmp: undefined reference to `_mesa_need_secondary_color'
2011-03-11 17:37:21 -05:00
Adam Jackson
b5872cdda0 r600: Build fix
r600_dri.so.tmp: undefined reference to `_mesa_rgba_logicop_enabled'
2011-03-11 17:24:47 -05:00
Vinson Lee
4faa95e74d st/python: Remove flags from flush function. 2011-03-11 14:00:32 -08:00
Vinson Lee
9c366ceedb st/python: Remove the geom_flags param from is_format_supported. 2011-03-11 13:37:30 -08:00
Vinson Lee
d17ef8636d st/python: Clean up fence_finish. 2011-03-11 13:35:06 -08:00
Vinson Lee
dee6eafbd2 scons: Move texenvprogram.c to ff_fragment_shader.cpp. 2011-03-11 13:32:41 -08:00
Eric Anholt
81b34a4e3a i965: Use the fixed function GLSL program instead of the ARB program.
This gets one more piece of the pipeline onto the new codegen backend.
Once ARB_fragment_program can generate GLSL programs, we can nuke the
old backend.
2011-03-11 12:55:14 -08:00
Eric Anholt
b4452c3baa mesa: Track a computed _CurrentFragmentProgram for current gl_shader_program
This is like how we track FragmentProgram._Current for the computed
ARB fragment program for fixed function texenv, but this gives direct
access to the gl_shader_program for drivers to codegen from, skipping
ARB_fp.
2011-03-11 12:55:14 -08:00
Eric Anholt
7cb87dffce mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen.  Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization.  Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
2011-03-11 12:55:14 -08:00
Eric Anholt
29e013e58b mesa: Add gl_MESAFogParamsOptimized for our special pre-computed fog params.
It would be nice if we handled optimized uniform math like this in
some generic way, since people often end up doing uniform expressions
in shaders, but for now keep this hard-coded like it was in the
texenvprogram code.
2011-03-11 12:55:14 -08:00
Eric Anholt
20f7a6f11a mesa: Add a builtin uniform for the ATI_envmap_bumpmap rotation matrix.
For fixed function fragment processing in GLSL IR, we want to be able
to reference this state value.  gl_* not explicitly permitted is
reserved, so using this variable name internally shouldn't be any
issue.
2011-03-11 12:55:14 -08:00
Eric Anholt
cdacca4868 mesa: Move texenvprogram.c to ff_fragment_shader.cpp.
This file is about to change to generating a shader program instead of
a fragment program.
2011-03-11 12:55:13 -08:00
Eric Anholt
e1cb12bfff prog_cache: Add some support for shader_programs in prog_cache.
This is used in the upcoming fixed function shader_program generation,
and shader_program and ARB programs are together in this code until
both fragment and vertex ff get converted.
2011-03-11 12:55:13 -08:00
Eric Anholt
9c7231c1d9 mesa: Don't try to remove an internal shader_program from the hash.
It fails on assertions if the key isn't actually present.
2011-03-11 12:55:13 -08:00
Eric Anholt
5ae1d19506 i965: Use ffs() on a 32-bit int value instad of ffsll(). 2011-03-11 12:55:13 -08:00
Marek Olšák
7e02303497 gallium: remove flags from the flush function
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
2011-03-11 21:39:31 +01:00
Marek Olšák
e968975cb5 gallium: remove the geom_flags param from is_format_supported 2011-03-11 21:39:30 +01:00
Marek Olšák
bfe88e6998 gallium: cleanup fence_signalled and fence_finish
So that they don't have the driver-specific param and return type.
2011-03-11 21:39:30 +01:00
Marek Olšák
25485f4b69 gallium: kill is_resource_referenced
Only st/xorg used it and even incorrectly with regards to pipelined transfers.
2011-03-11 21:39:30 +01:00
Adam Jackson
2b64886c81 swrastg: Add __DRI_TEX_BUFFER support
Without this, EXT_texture_from_pixmap is trivially broken.  With it,
it's merely subtly broken.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-11 14:49:28 -05:00
Brian Paul
d7db14ab7d mesa: test against MaxUniformComponents in check_resources()
Since we're compiling/linking GLSL shaders we should check against
the shader uniform limits, not the legacy vertex/fragment program
parameter limits which are usually lower.
2011-03-11 10:04:17 -07:00
Brian Paul
e0e94026a0 mesa: move location of some geometry program limits
The gl_program_constants struct is for limits that are applicable to
any/all shader stages.  Move the geometry shader-only fields into the
gl_constants struct.
Remove redundant MaxGeometryUniformComponents field too.
2011-03-11 09:25:22 -07:00
Brian Paul
8cc84b3e45 mesa: use check_resources() to check program against limits
Without these checks we could create shaders with more samplers,
constants than the driver could handle.  Fail linking rather than
dying later.
2011-03-11 09:25:22 -07:00
Brian Paul
decc6e2a32 mesa: replace NEED_SECONDARY_COLOR(), RGBA_LOGICOP_ENABLED() with inlines
and rename them.
2011-03-11 09:25:21 -07:00
Brian Paul
4293a12c7f mesa: call FLUSH_VERTICES() before deleting shaders, buffers, query objects
Need to flush rendering (or at least indicate that the rug might be getting
pulled out from underneath us) when a shader, buffer object or query object
is about to be deleted.

Also, this helps to tell the VBO module to unmap its current vertex buffer.
2011-03-11 09:25:21 -07:00
Brian Paul
a4a5d7e0dd vega: remove unused pipe var 2011-03-11 09:25:21 -07:00
José Fonseca
530ad1ff6f svga: Propagate discard/unsynchronized flags to the host when doing texture DMAs. 2011-03-11 15:03:21 +00:00
José Fonseca
f0ea6395b6 util: Fix typo in u_upload_flush().
upload->offset is how much we used. upload->size is the whole buffer size.
2011-03-11 11:54:26 +00:00
Nicolas Peninguy
b6c9c78bff r300g: fix alignement for NPOT values in hyperz setup
With 3 pipes cards we need to align with NPOT values. This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=32945

Signed-off-by: Nicolas Peninguy <nico@lostgeeks.org>
2011-03-11 04:36:37 +01:00
Marek Olšák
8a01cb8793 draw: remove unnecessary flush 2011-03-11 02:02:16 +01:00
Marek Olšák
cb06f180e3 st/vega: remove unnecessary flushes
I don't see a reason we need them.
2011-03-11 02:02:16 +01:00
Marek Olšák
bdf1038940 st/mesa: remove unnecessary flushes
The framebuffer cache flush should be implicit when calling
set_framebuffer_state.

There is no need to flush the command stream either.
2011-03-11 02:02:16 +01:00
Thomas Hellstrom
ded1e315a4 Revert "gallium/svga: Only upload parts of vertexarrays that are actually used"
This reverts commit 6d4e337f38.

The commit is incorrect. I'll rework it. Revert for now.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 23:31:42 +01:00
Daniel Vetter
fb3b712b84 i915g: implement surface clear functions using hw-clear
Tested by temporarily using util_clear even when not using the blitter.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:20 +01:00
Daniel Vetter
6ad4a11b3e i915g: make set_framebuffer_state more robust
u_blitter is lazy and doesn't fully clear it's stack-allocated fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:19 +01:00
Daniel Vetter
6358e6371b i915g: implement hw clear
Benefits:
- spares us a relocation.
- needed for zone rendering (if that ever happens).
- just awesome.

v2: Rename the debug option. Completely disabling the blitter is
required for Y tiling to work, so this option will cover other
code paths in the future.

v3: Implement suggestions by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 23:04:10 +01:00
Daniel Vetter
8c420db1c4 i915g: blitter handles overlapping blits
No need to assert.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:50 +01:00
Daniel Vetter
55d2d7fb3a i915g: enable separate depth/stencil clears
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:49 +01:00
Daniel Vetter
9070879a79 i915g: streamline derived state updates of the driver pipeline
Flushing the batch/hw backend doesn't invalidate the derived state.
So kill the unnecessary function calls and add an assert in
emit_hardware_state for paranoia.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:48 +01:00
Daniel Vetter
b0dd74aaf7 i915g: don't validate a NULL vbo
With the new clear code this is possible (if the app call glClear
before drawing the first primitive).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-10 22:47:47 +01:00
Brian Paul
7dcf019af2 gallium/util: new polygon stipple utility helper
The polygon stipple fallback does not have to be implemented in the
draw module (it doesn't need window coords, etc).  Drivers can use
this utility and avoid sw vertex fallbacks if pstipple is enabled.
Note: this is WIP and not used by any driver yet.
2011-03-10 09:44:32 -07:00
Brian Paul
0eab3a8a97 glsl: silence warning in printf() with a cast 2011-03-10 09:29:00 -07:00
Brian Paul
76a43c5fba glx: fix null pointer deref in __glXGenerateError()
The gc var would be NULL if called from line 238.  Instead, get
the opcode from __glXSetupForCommand(dpy) as done in other places.
And remove the unused gc parameter.

Fixes a bug reported by "John Doe" on 3/9/2011.

NOTE: This is a candidate for the 7.10 branch.
2011-03-10 08:50:52 -07:00
Thomas Hellstrom
6d4e337f38 gallium/svga: Only upload parts of vertexarrays that are actually used
Make sure we only upload parts of vertex arrays that are actually used
by a draw command.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-10 14:30:50 +01:00
Dave Airlie
9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Eric Anholt
f6ca4a304b intel: Don't complain when getparam fails due to a missing param.
This is an expected behavior when we're testing for the presence of
new kernel features.
2011-03-09 12:54:47 -08:00
Chris Wilson
ea004a3aed i965: Pack the tracked state atoms into separate arrays for prepare/emit.
Improves performance of a hacked-up scissor-many (to reuse a small set
of scissors instead of blowing out the cache, and then to run 100x
more iterations so it actually took some time) by 3.6% +/- 1.2% (n=10)
2011-03-09 10:18:29 -08:00
Christoph Bumiller
caaa7fdd6f nv50: add back initialization of redefine_user_buffer
Got lost in f80c03e187.
2011-03-09 17:26:33 +01:00
Christian König
bb4f2a0f35 r600g: remove some now unneeded code from r600_bc_vtx_build 2011-03-09 14:49:03 +01:00
Christian König
2ed56d3170 r600g: R700+ can do more than 8 tex and vtx clause in one CF inst
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
Christian König
8dc1dfc9f0 r600g: split R600 and R700 CF generation for VTX and TEX
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
2011-03-09 14:49:03 +01:00
José Fonseca
8308272291 svga: Add a new winsys entry point to query the hw version. 2011-03-09 13:34:21 +00:00
José Fonseca
d5249b7d89 util: Use PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE in pipe_buffer_write. 2011-03-09 11:17:45 +00:00
Keith Whitwell
05efcee46e util: add ensure_sanity checks, fix a bug
Add ensure_sanity checks.
Fix a bug which caused us to misplace entries adding to a full cache.
2011-03-09 11:17:14 +00:00
Keith Whitwell
20962bf547 util: improve cache collision behaviour
Add linear probing on collisions.

Expand entry array by a fixed scale (currently 2) to help avoid
collisions.

Use a LRU approach to ensure that the number of entries stored in the
cache doesn't exceed the requested size.
2011-03-09 11:16:53 +00:00
Alex Corscadden
d00cbf46cd util: Add remove to util_cache
I need to be able to remove entries from util_cache caches.  This change
enables that functionality.
2011-03-09 11:16:49 +00:00
Alex Corscadden
eb2e8167fa util: Allow util_draw_texquad to draw quads with non-integer coordinates. 2011-03-09 11:16:49 +00:00
José Fonseca
0ffd603e17 wgl: Force framebuffer validation on glViewport. 2011-03-09 09:58:35 +00:00
Thomas Hellstrom
52e598d200 gallium/svga: Don't replace user vertex buffer with uploaded copy
Do that later on when we set up the hwtnl state instead.
This addresses a problem when we drop the uploaded copy due to a vb
size change, it will remain referenced in svga->curr.vb[], and the
new contents of the vb will never be uploaded.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-09 08:49:33 +01:00
Vinson Lee
c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Vinson Lee
67f61199c2 st/python: Add timeout parameter to fence_finish.
This is a follow-up to commit b39bccbd4e.

Fixes Linux SCons build.
2011-03-08 16:18:16 -08:00
Marek Olšák
ac8821ffe2 r300g: handle timeout parameter in fence_finish 2011-03-08 23:52:37 +01:00
Marek Olšák
b39bccbd4e gallium: add timeout parameter to fence_finish
This is a follow-up to the ARB_sync patch for st/mesa and completes
the ARB_sync implementation.
2011-03-08 23:52:37 +01:00
Marek Olšák
5257a6dbc6 st/mesa: implement ARB_sync
The ServerWaitSync implementation matches Intel's driver.

The extension is advertised when pipe_screen::fence_finish is set.
2011-03-08 23:52:37 +01:00
Marek Olšák
5ef807c036 r300g: add LATC support 2011-03-08 23:52:37 +01:00
Marek Olšák
b0ec461954 st/mesa: cleanup checking for signed compressed formats in generate_mipmaps 2011-03-08 23:52:37 +01:00
Marek Olšák
384845f335 st/mesa: add LATC and 3DC support
softpipe passes all tests.
2011-03-08 23:52:37 +01:00
Marek Olšák
23f92c20d7 gallium/util: add LATC support
Again, a lot of code is shared with RGTC.

The layout is UTIL_FORMAT_LAYOUT_RGTC, because LATC is just swizzled RGTC.
2011-03-08 23:52:37 +01:00
Marek Olšák
69f16accd0 mesa: add ATI_texture_compression_3dc
LUMINANCE_ALPHA_LATC2 = LUMINANCE_ALPHA_3DC, so this is easy.

Note that there is no specification for 3DC, just a few white papers
from ATI.
2011-03-08 23:52:37 +01:00
Marek Olšák
7d16e2c0cd mesa: add EXT_texture_compression_latc
The encoding/decoding algorithms are shared with RGTC.
Thanks to some magic with the base format, the RGTC texstore functions work
for LATC too.

swrast passes the related piglit tests besides two things:
- The alpha channel is wrong (it's always 1), however the incorrect alpha
  channel makes some other tests fail too, so I guess it's unrelated to LATC.
- Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]),
  however RGTC has the same problem.

Further testing (with other of my patches) shows that hardware drivers
and softpipe work.

BTW, ETQW uses this extension.
2011-03-08 23:52:37 +01:00
Thomas Hellstrom
12fa91b675 st/mesa: Fix an incorrect user vertex buffer reference
st->user_vb[attr] was always pointing to the same user vb, regardless
of the value of attr. Together with reverting the temporary workaround
for bug 34378, and a fix in the svga driver, this fixes googleearth on svga.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-08 22:15:50 +01:00
Marek Olšák
ef58598c1c vbo: mark vertex arrays as dirty when re-binding
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-03-08 22:14:47 +01:00
Marek Olšák
ff8baec5bc r300/compiler: remove unused variables 2011-03-08 22:13:29 +01:00
Ian Romanick
bdb6a6ef83 glsl: Use insert_before for lists instead of open coding it 2011-03-08 11:47:25 -08:00
Ian Romanick
60f898a90e linker: Add imported functions to the linked IR
Fixes piglit test glsl-function-chain16 and bugzilla #34203.

NOTE: This is a candidate for stable release branches.
2011-03-08 11:47:25 -08:00
Ian Romanick
8bbfbb14ee glsl: Add several function / call related validations
The signature list in a function must contain only ir_function_signature nodes.

The target of an ir_call must be an ir_function_signature.

These were added while trying to debug Mesa bugzilla #34203.
2011-03-08 11:47:25 -08:00
Ian Romanick
2df56b002d glsl: Function signatures cannot have NULL return type
The return type can be void, and this is the case where a `_ret_val'
variable should not be declared.
2011-03-08 11:47:25 -08:00
Christian König
719f07e45a r600g: set start instance correctly 2011-03-08 16:57:47 +01:00
Brian Paul
4a802738b0 swrast: flip the conditionals in shadow_compare4() for readability 2011-03-08 08:31:43 -07:00
Philip Taylor
d9f584e663 swrast: add coord clamping, fix comparisons for shadow testing
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=31159 for swrast
and piglit depth-tex-compare.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-08 08:31:43 -07:00
Brian Paul
9181a75c4d docs: added Depth format cube textures to GL3.txt list 2011-03-08 08:31:42 -07:00
Marek Olšák
5650a719f0 r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
2011-03-08 08:23:29 +01:00
Marek Olšák
6051f26b78 r300g: use pipelined transfers for RGTC textures 2011-03-08 08:17:12 +01:00
Marek Olšák
4dfcf3c4fe r300/compiler: fix equal and notequal shadow compare functions 2011-03-08 07:36:40 +01:00
Marek Olšák
94818d4c6a r300/compiler: detect constants harder 2011-03-08 06:54:14 +01:00
Marek Olšák
4f38261179 r300/compiler: improve the detection of constants for constant folding
Now the expression V==0 generates one instruction instead of two.
2011-03-08 06:37:50 +01:00
Marek Olšák
eb1acd1613 r300/compiler: saturate Z before the shadow comparison
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=31159

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-03-08 05:13:45 +01:00
Brian Paul
2c1ef65a04 llvmpipe: clamp texcoords in lp_build_sample_compare()
See previous commit for more info.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 18:59:42 -07:00
Philip Taylor
0eef561a5b softpipe: clamp texcoords in sample_compare()
This fixes http://bugs.freedesktop.org/show_bug.cgi?id=31159 for softpipe
and fixes the piglit depth-tex-compare test.

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-03-07 18:56:54 -07:00
Marek Olšák
a674ef7814 mesa: return after invalidating renderbuffer 2011-03-07 23:33:36 +01:00
Marek Olšák
fb5d9e1199 st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails
This fixes:
  state_tracker/st_format.c:401:st_pipe_format_to_mesa_format:
  Assertion `0' failed.
2011-03-07 23:27:35 +01:00
Marek Olšák
df818d572e mesa: invalidate framebuffer if internal format of renderbuffer is changed
RenderTexture doesn't have to be called in invalidate_rb, I guess.
2011-03-07 23:27:35 +01:00
Brian Paul
f4ca12c4f1 mesa: initialize DummyBufferObject's mutex
The mutex's fields were all zeros.  That's OK on Linux, but not Windows.

NOTE: This is a candidate for the 7.10 branch.
2011-03-07 14:58:39 -07:00
Brian Paul
ce6f16d382 st/mesa: fix incorrect version checking code 2011-03-07 14:58:39 -07:00
Brian Paul
8329f4db61 st/glx: whitespace, 80-column fixes 2011-03-07 14:58:39 -07:00
Brian Paul
51db2045b4 mesa: remove stray _mesa_finish() call in _mesa_CopyPixels()
Leftover debug code from 6364d75008.
2011-03-07 14:01:09 -07:00
Henri Verbeet
0e4750a84d r600g: Simplify some swizzle lookups. 2011-03-07 21:48:21 +01:00
Henri Verbeet
eac50295fc r600g: Constant buffers can contain up to 4096 constants. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a8bde5c47e i915: Only invert wpos when rendering to the system framebuffer. 2011-03-07 21:48:21 +01:00
Henri Verbeet
a99b23752b i915: Derive the gl_fragment_program from i915_fragment_program.
Instead of using the current gl_fragment_program. These aren't necessarily
the same, for example when translate_program() is called by
i915ValidateFragmentProgram().
2011-03-07 21:48:21 +01:00
Henri Verbeet
c3c91a0fe5 glx: Take GLPROTO_CFLAGS into account. 2011-03-07 21:48:20 +01:00
Chris Wilson
6547253bd1 intel: check for miptree allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:09 +00:00
Chris Wilson
de7678ef52 intel: Add some defense against buffer allocation failure for subimage blits
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:05 +00:00
Chris Wilson
f627d429bd intel: Add some defense against bo allocation failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-07 10:53:00 +00:00
Benjamin Franzke
4f6fbfa0ed egl_dri2: Add attribute map for __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE
Broken since 6538b5824e.
Thanks to iskren on #wayland for helping on finding this.
2011-03-07 00:32:05 +01:00
Christian König
e0cf8471a1 r600g: use long long integers for instance addr calculation
Using a long for instance addr calculation isn't
big enough on 32bit systems, use a long long int instead.

Thanks to Rafael Monica for fixing this.
2011-03-06 23:37:47 +01:00
Dave Airlie
6538b5824e glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.
This realigns the name of the glx bit to align with the core mesa names.
2011-03-06 20:06:42 +10:00
Dave Airlie
b09b3e5c8f glx: add initial GLX_EXT_framebuffer_sRGB support.
this doesn't bind to drivers yet, just enough to in theory make indirect
work against other servers.

I'm really not sure what the rules for adding extensions to the known_gl_extensions list as it looks to be missing a few. are these GL extensions that have GLX
protocol??

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-06 19:56:22 +10:00
José Fonseca
7cb17862c6 pb: Add is_buffer_busy for malloc buffers. 2011-03-06 09:12:58 +00:00
José Fonseca
e1510d4816 st/wgl: No need to initialize OneTimeLock anymore. 2011-03-06 09:12:30 +00:00
José Fonseca
b531b01b70 mapi: _glthread_DECLARE_STATIC_MUTEX is not broken on Windows. 2011-03-06 09:11:59 +00:00
José Fonseca
e640eec9ba trace: Use pipe_static_mutex. 2011-03-06 09:11:13 +00:00
José Fonseca
db6d0d9ebf os: Fix pipe_static_mutex on Windows. 2011-03-06 09:10:38 +00:00
José Fonseca
5e1b31066b graw-gdi: Silence gcc missing initialization warning. 2011-03-06 09:10:03 +00:00
Daniel Vetter
f95892b46a i915g: update TODO
Comments about the deleted stuff:
- openaren hang: likely caused by the vertex corruptions, fixed by Jakob.
- tiling: Y-tiling works with my hw-clear branch. X-tiling works as
  merged to master a while ago (execbuf2 version).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-06 00:39:18 +01:00
Marek Olšák
b6a9675b2f r300g/swtcl: advertise draw_instanced and primitive_restart 2011-03-05 17:41:12 +01:00
Marek Olšák
65482f2c2b r300g: implement instanced arrays 2011-03-05 17:41:11 +01:00
Marek Olšák
95c7881ac8 gallium: split CAP_INSTANCE_DRAWING into INSTANCEID and INSTANCE_DIVISOR
ARB_instanced_arrays is a subset of D3D9.
ARB_draw_instanced is a subset of D3D10.

The point of this change is to allow D3D9-level drivers to enable
ARB_instanced_arrays without ARB_draw_instanced.
2011-03-05 17:40:19 +01:00
Marek Olšák
307408a4f8 r300g: cleanup parameters of draw functions 2011-03-05 16:13:43 +01:00
Christoph Bumiller
533bf171d4 nv50: support the InstanceID system value 2011-03-05 14:53:23 +01:00
Christian König
17b9b757b7 r600g: simplify instance addr calculation
Use MULHI_UINT instead of the more complex
INT_TO_FLT->MUL->TRUNC->FLT_TO_INT
2011-03-05 13:42:51 +01:00
Vinson Lee
19355a461a nvc0: Update SConscript. 2011-03-04 17:15:21 -08:00
Vinson Lee
dbf4970b69 nv50: Update SConscript. 2011-03-04 17:11:35 -08:00
Christian König
fd2409ca27 r600g: fix fragment shader size calculation
bc.ndw is altered in r600_bc_build, respect that
in fragment shader size calculation.
2011-03-05 01:52:44 +01:00
Ian Romanick
09a4ba0fc3 glsl: Process redeclarations before initializers
If an array redeclaration includes an initializer, the initializer
would previously be dropped on the floor.  Instead, directly apply the
initializer to the correct ir_variable instance and append the
generated instructions.

Fixes bugzilla #34374 and piglit tests glsl-{vs,fs}-array-redeclaration.

NOTE: This is a candidate for stable release branches.  0292ffb8 and
8e6cb9fe are also necessary.
2011-03-04 16:33:31 -08:00
Ian Romanick
0292ffb85c glsl: Refactor AST-to-HIR code handling variable initializers 2011-03-04 16:32:37 -08:00
Ian Romanick
8e6cb9fe51 glsl: Refactor AST-to-HIR code handling variable redeclarations 2011-03-04 16:32:37 -08:00
Christoph Bumiller
b0698396dc nv50,nvc0: get format desc for TIC entry from sampler view format
Fixes piglit/tex-srgb.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
1f5d6fc59b nv50,nvc0: share sampler state creation 2011-03-05 00:51:07 +01:00
Christoph Bumiller
e4c968cdbb nv50,nvc0: update the format tables
Removed sampler view support for USCALED/SSCALED, the texture unit
refuses to convert to non-normalized float. The enums are treated
like UNORM.

Removed duplicate format related headers.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
f556b897eb nvc0: use m2mf for resource_copy_region if formats are equal
Which is always the case, but we'll keep the 2D engine blitter
nonetheless.
2011-03-05 00:51:07 +01:00
Christoph Bumiller
4fae7da9a3 nv50,nvc0: fix texture layer issues 2011-03-05 00:51:07 +01:00
Jakob Bornecrantz
9f0acfe138 i915g: Use tgsi_info from fragment shader instead 2011-03-05 00:23:27 +01:00
Daniel Vetter
98b418e56e i915g: use passthough shader for empty fragment programs
The hw doesn't like it - demos/shadowtex is broken. The emitted shader
isn't totally empty though, the depth write fixup gets emitted instead.
Maybe that one is somewhat fishy, too?

Idea for this patch from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-04 23:46:20 +01:00
Benjamin Franzke
22d9ae11bc egl_dri2: Fix incompatible vfunc-pointer warning 2011-03-04 16:36:37 -05:00
Benjamin Franzke
e71920929e egl/wayland: Move wayland-egl into a subdir
This hopefully fixes wayland-egl's dependency
resolution for autogenerated wayland-drm headers.
2011-03-04 16:36:37 -05:00
Eric Anholt
1a57717bbe i965: Apply a workaround for the Ironlake "vertex flashing".
This is an awful hack and will hurt performance on Ironlake, but we're
at a loss as to what's going wrong otherwise.  This is the only common
variable we've found that avoids the problem on 4 applications
(CelShading, gnome-shell, Pill Popper, and my GLSL demo), while other
variables we've tried appear to only be confounding.  Neither the
specifications nor the hardware team have been able to provide any
enlightenment, despite much searching.

https://bugs.freedesktop.org/show_bug.cgi?id=29172
Tested by:	Chris Lord <chris@linux.intel.com> (Pill Popper)
Tested by:	Ryan Lortie <desrt@desrt.ca> (gnome-shell)
2011-03-04 12:04:42 -08:00
Marek Olšák
bdb811772f r300g: preliminary implementation of clamping controls 2011-03-04 17:47:56 +01:00
Marek Olšák
10a893106b r300g: implement FP16 alpha test 2011-03-04 17:47:56 +01:00
Marek Olšák
910bac63df r300g: implement blending for some of non-RGBA8 formats
Blending is now fully supported with:
- R8_UNORM
- R8G8_UNORM
- B8G8R8A8_UNORM
- R16G16B16A16_FLOAT (r500-only)

Blending is partially supported (DST_ALPHA not working) with:
- L8A8_UNORM
- I8_UNORM
- B5G5R5A1_UNORM
- B10G10R10A2_UNORM

The other formats can't do blending.
2011-03-04 17:47:56 +01:00
José Fonseca
4a4f6a3901 draw: Silence tgsi_emit_sse2 failed messages. 2011-03-04 16:29:13 +00:00
José Fonseca
6838c9ce74 tgsi: Disable SSE2 code generation.
It's broken now that tgsi_exec_machine::Inputs/Ouputs are pointers.

Temporary if anybody still cares about tgsi_sse2.c. Permanent otherwise.
2011-03-04 14:54:24 +00:00
José Fonseca
c8e904e159 scons: Unbreak mingw cross compilation. 2011-03-04 14:44:39 +00:00
Marek Olšák
ba48811fa8 st/mesa: set PIPE_BIND_RENDER_TARGET for sRGB formats if UNORM is supported
Because the format can be changed to UNORM in a surface.

This fixes:
state_tracker/st_atom_framebuffer.c:163:update_framebuffer_state:
Assertion `framebuffer->cbufs[i]->texture->bind & (1 << 1)' failed.
2011-03-04 14:52:45 +01:00
José Fonseca
5378983417 scons: Get glsl2 and glcpp programs building correctly. 2011-03-04 13:11:49 +00:00
José Fonseca
12d17bcadf glsl/glcpp: Use stdio.h instead of unistd.h. 2011-03-04 12:53:14 +00:00
José Fonseca
f52660c3dc glsl: Define YY_NO_UNISTD_H on MSVC. 2011-03-04 12:49:55 +00:00
José Fonseca
d40b868db5 gallium: Define __func__ on MSVC. 2011-03-04 11:55:36 +00:00
Christoph Bumiller
cf143c1f4d Merge remote branch 'origin/nvc0' 2011-03-04 11:02:10 +01:00
Chris Wilson
9d31138f53 i965: Fix extending VB packets
Computation of the delta of this array from the last had a silly little
bug and ignored any initial delta==0 causing grief in Nexuiz and
friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
18dd7932c7 i965: Handle URB_FENCE erratum for Broadwater
There is a silicon bug which causes unpredictable behaviour if the
URB_FENCE command should cross a cache-line boundary. Pad before the
command to avoid such occurrences. As this command only applies to
gen4/5, do the fixup unconditionally as the specs do not actually state
for which chip it was fixed (and the cost is negligible)...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1546291e5b i965: Align index to type size and flush if the type changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
1c0d09cd4e intel: Add couple of missing gen6 commands to decode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:31 +00:00
Chris Wilson
b93684f5f3 i965: Prevent using a zero sized (or of unknown type) vertex array
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-04 09:58:30 +00:00
Dave Airlie
137d44e0f2 r600g: disable tiling by default again.
we still have a lot of corner cases that aren't working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-04 08:47:10 +10:00
José Fonseca
9f3c59a350 tgsi: Update assert.
Elements(mach->Inputs) is wrong now that mach->Inputs is dynamically
allocated.
2011-03-03 19:23:04 +00:00
Kenneth Graunke
09e1bebc25 glcpp: Remove trailing contexts from #if rules.
These are now unnecessary.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
f20656e944 glcpp: Rework lexer to use a SKIP state rather than REJECT.
Previously, the rule deleted by this commit was matched every single
time (being the longest match).  If not skipping, it used REJECT to
continue on to the actual correct rule.

The flex manual advises against using REJECT where possible, as it is
one of the most expensive lexer features.  So using it on every match
seems undesirable. Perhaps more importantly, it made it necessary for
the #if directive rules to contain a look-ahead pattern to make them
as long as the (now deleted) "skip the whole line" rule.

This patch introduces an exclusive start state, SKIP, to avoid REJECTs.
Each time the lexer is called, the code at the top of the rules section
will run, implicitly switching the state to the correct one.

Fixes piglit tests 16384-consecutive-chars.frag and
16385-consecutive-chars.frag.
2011-03-03 10:42:37 -08:00
Kenneth Graunke
b56f30c2b2 glcpp/tests: Update 063-comments.c.expected to match output.
The expected result has been out of sync with what glcpp produces for
some time; glcpp's actual result seems to be correct and is very close to
GCC's cpp.  Updating this will make it easier to catch regressions in
upcoming commits.
2011-03-03 10:42:37 -08:00
Jakob Bornecrantz
4bd27cfecc rbug: Fix depth stencil surface not being sent to the client 2011-03-03 18:29:17 +00:00
José Fonseca
5d0e8beaa2 scons: More tweaks to fix MinGW build. 2011-03-03 16:57:38 +00:00
José Fonseca
dbfbb8cf6d scons: Ensure generated headers are in the include path. 2011-03-03 15:43:18 +00:00
José Fonseca
54d8c5e3c2 scons: Add human friendlier build messages for lex/yacc. 2011-03-03 15:42:58 +00:00
José Fonseca
8987109c27 scons: Always load lex/yacc tool.
lex/yacc is not loaded by default when toolchain is not default either,
e.g., when toolchain=crossmingw.
2011-03-03 15:28:36 +00:00
Christoph Bumiller
3bf92a281b nv50: check grclass instead of chipset for 3D caps 2011-03-03 12:32:40 +01:00
Christoph Bumiller
7048ad62f8 nv50: increase size of shader code bo
512 KiB should be quite enough, but dynamic resize might be nicer.
2011-03-03 12:32:40 +01:00
Ben Skeggs
6b4e3e8941 nouveau: allow pipe driver to define which buffers should start in sysmem
PIPE_BIND_CONSTANT_BUFFER alone was OK for nv50/nvc0, but nv30 will need
to be able to set others on certain chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-03 15:56:20 +10:00
Zou Nan hai
118ecb1a22 i965: SNB GT1 has only 32k urb and max 128 urb entries.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-03 10:30:06 +08:00
Kenneth Graunke
2e756f3d6f glsl: Remove unused glcpp/Makefile.am.
This is a remnant of when glsl2 lived in its own repository.
2011-03-02 15:25:49 -08:00
Kenneth Graunke
8be828c3b3 glsl: Remove 'tests' subfolder.
These have long since moved to piglit and aren't useful to have here.
2011-03-02 15:25:49 -08:00
Christian König
8d9ea4c4e7 r600g: correct mega_fetch_count in fetch shader 2011-03-03 00:23:15 +01:00
Zack Rusin
ff2a0faba0 tgsi: defer allocation of huge inputs/outputs until we have a gs 2011-03-02 17:45:22 -05:00
Ian Romanick
d569cc4d44 docs: added news item for 7.9.2 and 7.10.1 releases 2011-03-02 14:37:59 -08:00
Ian Romanick
910820daf4 docs: All links to 7.9.2 and 7.10.1 release notes 2011-03-02 14:37:59 -08:00
Ian Romanick
8010c35852 docs: Import 7.10.1 release notes from 7.10 branch 2011-03-02 14:37:59 -08:00
Ian Romanick
198e9bb5b0 docs: Import 7.9.2 release notes from 7.9 branch 2011-03-02 14:37:59 -08:00
Christoph Bumiller
0c0e996d59 nv50: fix IB index buffer path
Add missing VERTEX_END and treat unaligned offsets correctly.
2011-03-02 22:37:56 +01:00
Christoph Bumiller
fa94f8b209 nv50: fix POINT_COORD_REPLACE_MAP method size
Introduced in 223d98bb8d.
2011-03-02 21:07:33 +01:00
Christoph Bumiller
47a62b1ca1 nv50: primitive restart trick for vertex data through FIFO mode
Also, on nv50 the VERTEX_BEGIN method doesn't follow VERTEX_END,
which was erroneously taken over from nvc0 and is fixed now.
2011-03-02 20:59:54 +01:00
Christoph Bumiller
b8646bc2af nv50: fix depth clamp for disabled primitive clipping 2011-03-02 20:59:53 +01:00
Christoph Bumiller
ddcb90248f nv50: implement independent blend functions for nva3+ and fix cap 2011-03-02 20:59:53 +01:00
Christoph Bumiller
669de7016c nv50: fix tile size calculations 2011-03-02 20:59:53 +01:00
Christoph Bumiller
223d98bb8d nv50: fix point sprite state validation
Wasn't updated if the FP didn't change, and coordinate replacement
wasn't disabled anymore.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
dbdbbce066 nv50: allow accidentally disabled IB index buffers again
Must have sneaked in from debugging.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
908013b737 nv50: apply relocations to shader code
On nv50, branches are absolute, so we need to adjust them according
to the shader's position in the code buffer.
2011-03-02 20:59:53 +01:00
Christoph Bumiller
040ff18a21 nv50: fix wrong miptree tile flags taken over from nvc0 2011-03-02 20:59:53 +01:00
Benjamin Franzke
4ca075ac4f egl_dri2 x11: Workaround device_name xcb-dri2 bug
This commit is basically a copy-over of the fix
Chia-I Wu's commited to wayland:
   http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=1b6c0ed95
   "Workaround an xcb-dri2 bug.
    xcb_dri2_connect_device_name generated by xcb-proto 1.6 is broken.
    It only works when the length of the driver name is a multiple of 4."
2011-03-02 20:41:38 +01:00
Benjamin Franzke
648a16d079 egl/wayland: build subdirs (wayland-drm) before depend
Autogenerated files need to be generated first.
2011-03-02 20:17:26 +01:00
Marek Olšák
a6314eb47f r300g: require DRM 2.3.0 (kernel 2.6.34)
Running any older kernel is not recommended anyway.
2011-03-02 17:54:36 +01:00
Marek Olšák
f6dbcb92bf r300g: do not use ioctl thread offloading on single-core machines 2011-03-02 17:54:36 +01:00
Brian Paul
8ad821df0a mesa: added gl_program_constants::MaxAddressOffset
See https://bugs.freedesktop.org/show_bug.cgi?id=29418
2011-03-02 09:32:47 -07:00
Brian Paul
41208bf047 mesa: increase INST_INDEX_BITS to 12
For more info see fd.o bug 29418.
2011-03-02 09:20:59 -07:00
Brian Paul
5f4d0cc6bc Revert "mesa: reduce calls to _mesa_test_framebuffer_completeness()"
This reverts commit 1f9a0a4e6e.

This caused trouble with Lightsmark w/ i965 driver and fbo/fbo-blit-d24s8
(see bug 34894).  It's probably something simple but no time to debug now.
2011-03-02 09:11:43 -07:00
Brian Paul
69c6e21ceb vbo: fix error parameter
Spotted by Ian.
2011-03-02 09:10:49 -07:00
Vinson Lee
bbd9616838 r300g: Silence 'control reaches end of non-void function' warning.
Fixes this GCC warning.
r300_hyperz.c: In function 'r300_get_hiz_func':
r300_hyperz.c:65: warning: control reaches end of non-void function
2011-03-02 00:43:09 -08:00
Vinson Lee
0f29d394a4 gallium: Add u_format_rgtc.c to SConscript. 2011-03-01 23:02:50 -08:00
Zou Nan hai
f1824905fa i965: Maxinum the usage of urb space on SNB.
SNB has 64k urb space, we only use piece of them.
      The more urb space we alloc,
      the more concurrent vs threads we can run.
      push the urb space usage to the limit.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-02 14:23:17 +08:00
Dave Airlie
e8d061fd74 mesa/st: fix softpipe npot compressed mipmaps.
this fixes fbo-generatemipmap-formats rgtc and s3tc in NPOT mode
with softpipe.

r600g fails to even get level 0 correct so have to look into that
a bit further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 16:13:59 +10:00
Dave Airlie
e80bfc8515 softpipe: enable RGTC now that we have u_format support. 2011-03-02 15:30:17 +10:00
Dave Airlie
64f19b90d7 mesa/st: fix generate mipmap for signed compressed formats.
This was always converting to 8-bit per channel unsigned formats,
which isn't suitable for RGTC signed formats, this special cases
those two formats and converts to floats for those.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 15:30:17 +10:00
Dave Airlie
8d62b2aca9 gallium: add RGTC UNORM support to u_format.
SNORM needs a bit of work in the state tracker in order for mipmap
generation to work I believe.

I'm also not sure that having unorm fetches for an snorm format is
sane.
2011-03-02 15:30:16 +10:00
Dave Airlie
59cae3eee1 rgtc: remove GL types from this file.
I'd like to share this file with gallium u_format stuff.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:33:35 +10:00
Dave Airlie
531c336fa3 rgtc: move the texel fetch into common unsigned/signed code.
This function can be done in the include file also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:16:39 +10:00
Dave Airlie
fb6ecca0a5 rgtc: fix issues with compressor and signed types.
With signed types we weren't hitting this test however the comment
stating this doesn't happen often doesn't apply when using signed
types since an all 0 block is quite common which isn't abs min or max.

this fixes the limits correctly again also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 14:08:59 +10:00
Dave Airlie
521394a204 rgtc: don't try to access off the end of the block.
if the values are all in the last dword, the high bits can be 0,

This fixes a valgrind warning I saw when playing with mipmaps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:14:34 +10:00
Dave Airlie
5f714c2aaf rgtc: move to using ubyte for fetch instead of chan + fix limit
My previous fix to the byte max was incorrect.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 13:02:20 +10:00
Marek Olšák
c37e283423 st/mesa: use RGTC for GL_COMPRESSED_RED/RG if possible
With proper fallback formats.
2011-03-02 03:46:27 +01:00
Brian Paul
e118fdc9e2 svga: reduce MAX_DMA_SIZE to 4MB 2011-03-01 17:40:27 -07:00
Brian Paul
8731f0363f vbo: add vbo_always_unmap_buffers()
Drivers can call this function as needed.  It tells the VBO module to
always unmap the current glBegin/glEnd VBO when we flush.  Otherwise
it's possible to be in a flushed state but still have the VBO mapped.
2011-03-01 17:16:53 -07:00
Brian Paul
a2924b488b vbo: generate GL_INVALID_VALUE for bad glVertexAttrib index 2011-03-01 17:16:02 -07:00
Brian Paul
1c9ca21adb i915g: remove extra semicolon 2011-03-01 17:09:15 -07:00
Ian Romanick
3ff4974f22 mesa: Revert most of 3158cc7d because it causes other breakage 2011-03-01 15:57:32 -08:00
Marek Olšák
30600e3dab r300g: accelerate resoure_copy_region for rgtc 2011-03-02 00:54:06 +01:00
Kenneth Graunke
8be58df67a scons: Use Flex and Bison to generate lexer/parser files.
This gets it building again here; I'll leave it up to the SCons
maintainers to make further improvements.
2011-03-01 15:49:29 -08:00
Kenneth Graunke
80ec97af79 glsl: Rename .lpp to .ll and .ypp to .yy.
SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since
there's no real benefit to using the old names, change them.
2011-03-01 15:49:29 -08:00
Dave Airlie
ff0f36f59d rgtc: fix fetch function limits for signed types 2011-03-02 09:52:53 +10:00
Dave Airlie
8eebd216dd rgtc: fixup mipmap generation
this allows swrast to pass mipmap generation for these formats.
2011-03-02 09:48:40 +10:00
Dave Airlie
01d5d1e80e swrast/rgtc: fix rendering issues introduced when fix constants
The max value was wrong and this showed up in the piglit tests.
2011-03-02 09:41:38 +10:00
Dave Airlie
c7d239c43b r600g: change the cross over point for 2d->1d
this fixes some rendering in the fbo-generatemipmap-formats test on
my rv610.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-02 09:30:24 +10:00
Ian Romanick
3158cc7df8 mesa: Fix build breakage caused by c73e6ce 2011-03-01 15:22:43 -08:00
Benjamin Franzke
6b369c4c7c egl: Add EGL_WL_bind_wayland_display 2011-03-01 17:23:50 -05:00
Ian Romanick
654adaabc9 Generate lexer and parser files for tarball creation process 2011-03-01 13:43:12 -08:00
Ian Romanick
6dd0a2ed40 Add generated parser / lexer files to gitignore lists 2011-03-01 13:43:12 -08:00
Ian Romanick
1034284596 mesa: Fix some quirkiness of make tarballs
Among other benefits, parallel makes now work.  Since many people have
parallel builds by default (via MAKEFLAGS environment variable), this
sames some irritation at release time...when there's usually not any
other irritation already.
2011-03-01 13:43:12 -08:00
Ian Romanick
8170684fbe mesa: Remove nonexistent files from distribution list 2011-03-01 13:43:12 -08:00
Ian Romanick
c73e6ce7e2 mesa: Remove files generated by flex and bison from GIT
These files were for the ARB_vertex_program / ARB_fragement_program assembler.
2011-03-01 13:43:12 -08:00
Ian Romanick
cb48207e4b glcpp: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Ian Romanick
8864b38783 glsl: Remove files generated by flex and bison from GIT 2011-03-01 13:43:12 -08:00
Daniel Vetter
8f9e546fde i915g: kill relocs accouting
No one ever cared. libdrm does dynamic resizing of its reloc-table,
anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:11 +01:00
Daniel Vetter
ee7acf6493 i915g: switch to the exact batch space reservation code
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:10 +01:00
Daniel Vetter
179cb58795 i915g: split up hw state emission into small atoms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:09 +01:00
Christian König
4c4ab5668c st/mesa: probably handle instanced drawing
Remove the previous workaround for instanced drawing and implement it correctly.
2011-03-01 21:42:16 +01:00
Daniel Vetter
583eb13948 i915g: fix i915_winsys_batchbuffer_write
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 20:57:57 +01:00
Kenneth Graunke
d1fc920f61 intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.
Nexuiz was hitting a software fallback.
2011-03-01 11:21:48 -08:00
Chris Wilson
faf1ddacfb configure: Bump libdrm requirements
In my last commit I introduced a build dependency upon a new libdrm.
Add the associated autoconf checks. As the headers are part of the core
libdrm, we need to bump that version and so may as well bump the chipset
specific versions simultaneously.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 18:42:23 +00:00
Marek Olšák
952222e4bf r300g: initialize some r500 PS3 regs 2011-03-01 19:10:30 +01:00
Marek Olšák
a5ee80a264 r300g: document some more DRM 2.8.0 features 2011-03-01 19:10:30 +01:00
Chris Wilson
900a5c91ee i965: Use negative relocation deltas to minimse vertex uploads
With relaxed relocation checking in the kernel, we can specify a
negative delta (i.e. pointing outside of the target bo) in order to fake
a range in a large buffer. We only then need to upload the elements used
and adjust the buffer offset such that they correspond with the indices
used in the DrawArrays.

(Depends on libdrm 0209428b3918c4336018da9293cdcbf7f8fedfb6)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:34:50 +00:00
Chris Wilson
9fa380ccdc i965: Undo 'continuation of vb packets'
This breaks nexuiz for unknown reason; disable until a true fix can be
found.
2011-03-01 16:33:49 +00:00
Chris Wilson
69b3f24658 i965: Fix uploading of shortened vertex packets
... handle all cases and not just the interleaved upload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 16:33:40 +00:00
Chris Wilson
6ddfb322f5 i965: Upload all vertices used
... and take advantage of start_vertex_bias to trim to [min_index,
max_index] where possible (i.e. when we need to upload all arrays).

Fixes half_float_vertex(misc.fillmode.wireframe)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34595
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-01 09:42:52 +00:00
Thomas Hellstrom
8b145e2302 st/egl: Implement swapbuffer throttling
When doing copy swapbuffers using drm, throttle on outstanding copy operations.
Introduces a new environment variable, EGL_THROTTLE_FENCES that the
user can use to indicate the desired number of outstanding swapbuffers, or
disable throttling using EGL_THROTTLE_FENCES=0.

This can and perhaps should be extended to the pageflip case as well, since
with some hardware pageflips can be pipelined. In case the pageflip syncs, the
throttle operation will be a no-op anyway.

Update copyright notices.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
c9febff31f st/egl/drm: Rework swapbuffers
Use the pageflip ioctl when available.
Otherwise, or when the backbuffer contents need to be preserved,
fall back to a copy operation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
2b079485f6 st/egl: Add a helper to perform a copy swap on a resource surface
The copy swap can be used when we need to preserve the contents of
the back buffer or when there is no way to do native page-flipping.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:19 +01:00
Thomas Hellstrom
d1e4117355 st/egl: Move the copy context to the native display structure
This makes it usable also for native helpers.
Also add inline functions to access the context and to
uninit the native display structure.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-03-01 10:36:18 +01:00
Kenneth Graunke
186d3bc7a3 Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."
This reverts commit 4a3b28113c, as it
caused a regression on Ironlake (bug #34646).
2011-03-01 01:09:15 -08:00
Dave Airlie
b1ceda5cbd st/dri: one more missing array size
whats one more between friends.

again bnf on irc.
2011-03-01 18:32:33 +10:00
Dave Airlie
02448f2241 st/dri: fix missing array size init.
Init array size to 1,

reported by bnf on irc.
2011-03-01 18:29:24 +10:00
Dave Airlie
2d62e39c62 egl/st: add array size initialisor
reported by bnf on irc.
2011-03-01 18:24:15 +10:00
Ben Skeggs
450aa241bf nouveau: remove nouveau_stateobj.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:43:13 +10:00
Ben Skeggs
28eb7214db nvc0: fix a crash on context destruction
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
1ba8e95108 nouveau: ensure vbo_dirty is set when buffer write transfer complete
This introduces a shared nouveau_context struct to track such things.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:23:31 +10:00
Ben Skeggs
96d57722fd nouveau: fix leak of nouveau_mman structs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:53 +10:00
Ben Skeggs
4826cd0f61 nvc0: port to common fence/mm/buffer code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 17:22:49 +10:00
Dave Airlie
a44b65312e r600g: add NV_conditional_render support.
This is reliant on a drm patch that I posted on the list + a version bump.

These will appear in drm-next today.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:09:00 +10:00
Dave Airlie
929be6eb95 r600g: start using drm minor version to enable things.
If the drm minor version is > 9 (i.e. whats in drm-next),
we enable s3tc + texture tiling by default now.

this changes R600_FORCE_TILING to R600_TILING which can
be set to false to disable tiling on working drm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:08:50 +10:00
Ben Skeggs
40d7a87a8e nv50: multiply polygon offset units by 2
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
be68782d9a nv50: sync textures with render targets ourselves
Port of the nvc0 commit doing the same.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
79079141fa nv50: move onto common linear buffer manager
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
5c1c4f8593 nouveau: common linear buffer manager, ported from nv50/nvc0 drivers
nv50_resource is being called nv04_resource now temporarily, to avoid
a naming conflict with nouveau_resource from libdrm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
cd24fcedec nouveau: create linear gart/vram mman in common screen init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
3a38a4b0a8 nouveau: fix fence_ref() where fence and *ref are the same fence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:43 +10:00
Ben Skeggs
d6bdf1f6ae nouveau: fix compiler complaint
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
2f30a5bdaa nv50: make mm available as common code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
7a8ee058a8 nv50: move onto shared fence code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
5a0915870c nouveau: move nv50/nvc0 fencing to common location, and modify slightly
Modified from original to remove chipset-specific code, and to be decoupled
from the mm present in said drivers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Ben Skeggs
48e191f90c nv50-nvc0: set cur_ctx during init if none currently bound
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-01 14:44:42 +10:00
Marek Olšák
ea4a19c392 r300g: fix RGTC2_SNORM
ATI engineers have probably chosen those sign bits by a dice roll.
2011-03-01 05:25:33 +01:00
Marek Olšák
66d5de74c4 r300g: reorder parts of translate_texformat 2011-03-01 05:25:33 +01:00
Alex Deucher
1dc204d145 r600g: truncate point sampled texture coordinates
By default the hardware rounds texcoords.  However,
for point sampled textures, the expected behavior is
to truncate.  When we have point sampled textures,
set the truncate bit in the sampler.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=25871

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 22:01:59 -05:00
Zou Nan hai
6c324777a6 i965: bump VS thread number to 60 on SNB
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2011-03-01 10:39:35 +08:00
Marek Olšák
7a61957424 r300g: fix RGTC1_UNORM and RGTC2_UNORM
Signs don't work the way I'd like...
2011-03-01 03:24:55 +01:00
Dave Airlie
9c16fcc617 rgtc: shared the compressor code between signed/unsigned
No idea why I didn't do it like this the first time, but share
the code like other portions of mesa do using _tmp.h suffix
and some #defines for the types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 11:57:51 +10:00
Brian Paul
7b3bec87df vbo: silence unused var warning 2011-02-28 18:34:06 -07:00
Brian Paul
125b4ac7e6 softpipe: remove redundant draw_flush() call
We'll flush after the same-shader comparison.
2011-02-28 18:25:41 -07:00
Brian Paul
e6f3e24330 draw: setup pipe's draw pointer for the aapoint stage
The other draw stages like aaline and pstipple were already doing this.
If the driver used the aapoint stage but not the others it would crash
because of a null pipe->draw pointer.
2011-02-28 18:25:37 -07:00
Brian Paul
b70610b982 mesa: move PBO-related functions into a new file 2011-02-28 18:24:35 -07:00
Brian Paul
7d8db55148 mesa: always generate error in glColorTableParameter[fi]v()
These were only used by GL_SGI_texture_color_table, which is gone now.
2011-02-28 18:24:30 -07:00
Brian Paul
9d20849516 mesa: remove GL_SGI_texture_color_table support
It was only implemented in the swrast driver and probably not used by
any applications.  A modern app would use a dependent/chained texture
lookup in the fragment shader.
2011-02-28 18:24:30 -07:00
Brian Paul
7e161bcf11 svga: add assertions in svga_shader_type() 2011-02-28 18:24:30 -07:00
Brian Paul
c6991433ef mesa: consolidate framebuffer target lookup code 2011-02-28 18:24:25 -07:00
Brian Paul
fec26193fb mesa: remove some old do-nothing code 2011-02-28 18:24:25 -07:00
Brian Paul
1f9a0a4e6e mesa: reduce calls to _mesa_test_framebuffer_completeness()
when updating/validating framebuffer state.  The _Status field is set
to zero when we need to recompute _Status.  Otherwise, it's up to date.
2011-02-28 18:24:25 -07:00
Brian Paul
b0fceae22f mesa: reduce calls to _mesa_test_framebuffer_completeness()
when doing glCopyTex[Sub]Image() and checking the source buffer's
completeness.
We only need to determine FBO completeness when the status is indeterminate.
2011-02-28 18:24:20 -07:00
Brian Paul
ca1b551562 mesa: s/mesaFormat/attFormat/ 2011-02-28 18:23:23 -07:00
Marek Olšák
790c731409 r300g: set the correct HiZ clear value 2011-03-01 01:46:27 +01:00
Marek Olšák
4609be4410 r300g: update derived state before uploading vertex buffers
The function may invoke blitter, which invalidates vertex buffers.
2011-03-01 00:46:58 +01:00
Marek Olšák
fbedd9c73a u_vbuf_mgr: compute user buffer size for instance data from instance_count 2011-03-01 00:46:58 +01:00
Marek Olšák
2f665885cd r300g: fix printing whether Z compression is enabled 2011-03-01 00:46:58 +01:00
Marek Olšák
ebf69f2c50 r300g: disable HiZ permanently if the the depth function is inverted
Instead of temporarily.

The HiZ function (something like a depth function) is a property
of a HiZ buffer and can only be changed during HiZ clears.
2011-03-01 00:46:54 +01:00
Marek Olšák
d99ec708af r300g: fix HiZ memory size computation and deciding when to use HiZ
I removed the HiZ memory management, because the HiZ RAM is too small
and I also did it in hope that HiZ will be enabled more often.

This also sets aligned strides to HIZ_PITCH and ZMASK_PITCH.
2011-03-01 00:23:11 +01:00
Alex Deucher
5f44fab5a6 r600g: add missing evergreen INT_TO_FLT to r600_bc_get_num_operands
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-28 17:21:26 -05:00
Dave Airlie
3f600047d9 rgtc: fix void pointer arith.
should fix scons build.
2011-03-01 06:47:00 +10:00
Kenneth Graunke
0a163cf56d glsl: Enable GL_OES_texture_3D extension for ES2. 2011-02-28 10:35:57 -08:00
Kenneth Graunke
eb639349e2 glsl: Use reralloc instead of plain realloc.
Plugs a memory leak when compiling shaders with user defined structures.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-28 10:35:40 -08:00
Jerome Glisse
c33e091d17 r600g: indentation fixes
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-28 13:33:13 -05:00
Marek Olšák
ab824a0722 r300g: initialize SC_SCREENDOOR 2011-02-28 12:43:26 +01:00
Christoph Bumiller
f80c03e187 nv50: replace most of it with nvc0 driver ported to nv50
We'll have to do some unification now to reduce code duplication.
2011-02-28 12:41:09 +01:00
Marek Olšák
d1dbbf7bf4 r300g: disable hyper-z on rs6xx+
It doesn't work.
2011-02-28 12:28:07 +01:00
Vinson Lee
93893139a4 mesa: Add texcompress_rgtc.c to SConscript. 2011-02-27 23:17:49 -08:00
Dave Airlie
e107a3aa08 rgtc: update docs 2011-02-28 13:43:32 +10:00
Dave Airlie
83ebc01c1d mesa/st: add RGTC format support.
this just adds a format check + format conversion.
2011-02-28 13:35:35 +10:00
Dave Airlie
903726d285 swrast: add RGTC support 2011-02-28 13:35:35 +10:00
Dave Airlie
8d47c91985 mesa: Add RGTC texture store/fetch support.
This adds support for the RGTC unsigned and signed
texture storage and fetch methods.

the code is a port of the DXT5 alpha compression code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:35:34 +10:00
Dave Airlie
e792e79f5a mesa: make_float_temp_image non-static
We need this to do signed stuff for RGTC.
2011-02-28 13:34:25 +10:00
Dave Airlie
e3709c26a6 rgtc: llvmpipe/softpipe refuse RGTC until u_format has support.
So far I haven't implemented the u_format code for these.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 13:34:25 +10:00
Dave Airlie
0495425dc3 r300g: force swizzles for RGTC
still can't get signed to work
2011-02-28 13:21:44 +10:00
Christian König
96bbc627f3 r600g: implement instanced drawing support 2011-02-28 02:19:39 +01:00
Christian König
bce4f9ac39 st/mesa & v_bug_mgr: two small instanced drawing fixes 2011-02-28 02:19:39 +01:00
Dave Airlie
0a17444133 Revert "r600g: Don't negate result of ABS instruction"
This reverts commit b6d4021393.

This actually breaks gears here on my rv670.
2011-02-28 11:10:35 +10:00
Fabian Bieler
0ab7dcddb3 r600g: Process TRUNC with tgis_op2
TRUNC is neither a scalar instruction nor exclusive to the Trans unit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:22:16 +10:00
Fabian Bieler
b6d4021393 r600g: Don't negate result of ABS instruction
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-28 09:21:41 +10:00
Daniel Vetter
d42c9433b0 i915g: implement cache flushing
With an extremely dumb strategy. But it's the same i915c employs.

Also improve the hw_atom code slightly by statically specifying the
required batch space. For extremely variably stuff (shaders, constants)
it would probably be better to add a new parameter to the hw_atom->validate
function.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:10:46 +01:00
Daniel Vetter
f90fa55347 i915g: buffer validation for blitter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 22:03:51 +01:00
Daniel Vetter
342016010a i915g: buffer validation for render state
Also contains the first few bits for hw state atoms.

v2: Implement suggestion by Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 21:57:31 +01:00
Daniel Vetter
3c59b3eb4b i915g/winsys: buffer validation support
v2: Add the batch bo to the libdrm validation lost, for otherwise
libdrm won't take previously used buffers into account.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 18:49:56 +01:00
Daniel Vetter
e20c3255e2 i915g: add raw batchbuffer dumping in drm winsys
These files can be decoded with intel_dump_decode from the intel-gpu-tools
available at:

http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 16:32:38 +01:00
Daniel Vetter
f58c11af72 i915g: cleanup static state calculation, part 2
Now also for the DRAW_RECT command

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:13 +01:00
Daniel Vetter
beaf039f97 i915g: cleanup static state calculation, part 1
Move it to i915_state_static.c This way i915_emit_state.c only emits
state and doesn't (re)calculate it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 15:58:03 +01:00
Kenneth Graunke
a385ac6207 glsl/builtins: Fix return type for textureSize sampler2DArray variants.
A copy and paste error.
2011-02-27 00:44:47 -08:00
Eric Anholt
5f889c5bf5 glx: Adjust the MESA_multithread_makecurrent spec to match implementation.
This came out of discussion at the office today, and we agreed that
solving this for indirect wasn't really interesting, though the
server-side change would be of a similar level of difficulty.
2011-02-26 12:43:15 -08:00
Eric Anholt
dea5e57861 intel: Use the current context rather than last bound context for a drawable.
If another thread bound a context to the drawable then unbound it, the
driContextPriv would end up NULL.

With the previous two fixes, this fixes glx-multithread-makecurrent-2,
despite the issue not being about the multithreaded makecurrent.
2011-02-26 12:43:15 -08:00
Eric Anholt
74cde6505c dri2: Don't call the dri2 flush hook for swapbuffers unless we have a context.
The driver only has one reasonable place to look for its context to
flush anything, which is the current context.  Don't bother it with
having to check.
2011-02-26 12:43:15 -08:00
Eric Anholt
4d01bea808 glx: Don't do the implicit glFlush in SwapBuffers if it's the wrong drawable.
The GLX Spec says you only implicitly glFlush if the drawable being
swapped is the current context's drawable.
2011-02-26 12:43:15 -08:00
Eric Anholt
49d7e48b33 mesa: Add new MESA_multithread_makecurrent extension.
This extension allows a client to bind one context in multiple threads
simultaneously.  It is then up to the client to manage synchronization of
access to the GL, just as normal multithreaded GL from multiple contexts
requires synchronization management to shared objects.
2011-02-26 12:43:15 -08:00
Daniel Vetter
132dc0b6d2 i915g: make dynamic state emission actually lazy
Premature semicolon.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 21:20:03 +01:00
Jakob Bornecrantz
11f9ec5422 gallivm: Initialize stack values
valgrind gives me a warning with llvmpipe with profile builds but
not debug builds, this seems to fix the issue at least.
2011-02-26 20:13:08 +01:00
Arkadiusz Miskiewicz
99b9019716 glsl/Makefile: Remove builtin_function.cpp if generation fails.
Fixes bug #34346.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-26 10:28:00 -08:00
Jakob Bornecrantz
052122a8cd i915g: Handle null constants properly 2011-02-26 15:45:47 +01:00
Daniel Vetter
b8e44f648e i915g: fix null deref in draw_rect emission
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Daniel Vetter
1df1e0841d i915g: simplify math in constants emission
The old code even falls apart for nr == 0 (which is caught earlier, but)!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-26 15:35:24 +01:00
Jakob Bornecrantz
acc290aff0 i915g: Use the same debug env vars in drm and sw winsys 2011-02-26 15:35:13 +01:00
Jakob Bornecrantz
9a371b938c i915g: Use unchecked writes in sw winsys batchbuffer 2011-02-26 15:29:21 +01:00
Alan Hourihane
53fe5b334e Check for out of memory when creating fence 2011-02-26 10:30:19 +00:00
Jakob Bornecrantz
ca8a91ff7e util: Don't destroy shaders null shaders
Fixes regression from a08e612fd8
2011-02-26 02:32:22 +01:00
Jakob Bornecrantz
a08e612fd8 util: Don't create array texture shaders if the driver doesn't support it 2011-02-26 00:50:52 +01:00
Kenneth Graunke
58f7c9c72e i965/fs: Initial plumbing to support TXD.
This adds the opcode and the code to convert ir_txd to OPCODE_TXD;
it doesn't actually add support yet.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
2830b1ae90 i965/fs: Complete TXL support on gen5+.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
4ddd11aad6 i965/fs: Complete TXL support on gen4.
Initial plumbing existed to turn the ir_txl into OPCODE_TXL, but it was
never handled.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
e54d62b896 i965/fs: Use a properly named constant in TXB handling.
The old value, BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE makes it sound like we're
doing a non-bias texture lookup.  It has the same value as the new constant
BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_BIAS_COMPARE, so there should be no
functional changes.
2011-02-25 15:30:45 -08:00
Kenneth Graunke
a3cd542894 i965: Add #defines for gen4 SIMD8 TXB/TXL with shadow comparison.
From volume 4, page 161 of the public i965 documentation.
2011-02-25 15:30:45 -08:00
Jerome Glisse
b0e8aec5ab gallium/tgsi: shuffle ureg_src structure to work around gcc4.6.0 issue
There is an issue with gcc 4.6.0 that leads to segfault/assert with mesa
due to ureg_src size, reshuffling the structure member to better better
alignment work around the issue.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47893

7.9 + 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 12:44:07 -05:00
Jerome Glisse
8e17adfdbd gallium/st: place value check before value is use
7.9 & 7.10 candidate

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-02-25 11:49:23 -05:00
Dave Airlie
179ff0551c gallium/util: add 1d/2d mipmap generation support
so far only hw mipmap generation is testing on softpipe,
passes test added to piglit.

this requires another patch to mesa to let array textures mipmaps
even start to happen.
2011-02-25 16:06:15 +10:00
Vinson Lee
eb17802386 scons: Reduce all Cygwin platform names to 'cygwin'.
platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.
2011-02-24 19:49:37 -08:00
Dave Airlie
b2413de916 r600g: explicity set sign bits for RGTC 2011-02-25 09:18:42 +10:00
Dave Airlie
c9bca01819 r600g: bc 4/5 or rgtc textures need to be tiled as well.
Make the s3tc upload code more generic.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-25 09:18:42 +10:00
Dave Airlie
79ad6f5375 r300g: explicit sign bits on RGTC textures 2011-02-25 09:18:41 +10:00
Kenneth Graunke
e6e5c1f46d i965: Increase Sandybridge point size clamp in the clip state.
255.875 matches the hardware documentation.  Presumably this was a typo.

NOTE: This is a candidate for the 7.10 branch, along with
      commit 2bfc23fb86.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-24 11:23:08 -08:00
Neil Roberts
c0ad70ae31 intel: Try using glCopyTexSubImage2D in _mesa_meta_BlitFramebuffer
In the case where glBlitFramebuffer is being used to copy to a texture
without scaling it is faster if we can use the hardware to do a blit
rather than having to do a texture render. In most of the drivers
glCopyTexSubImage2D will use a blit so this patch makes it check for
when glBlitFramebuffer is doing a simple copy and then divert to
glCopyTexSubImage2D.

This was originally proposed as an extension to the common meta-ops.
However, it was rejected as using the BLT is only advantageous for Intel
hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33934
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 16:43:39 +00:00
Christoph Bumiller
11b9f4439c nvc0: fix PointCoord enable in FP header 2011-02-24 17:35:36 +01:00
Christoph Bumiller
d0caaba370 nvc0: change TGSI CMP translation to use slct
Saves us the explicit compare instruction needed with selp.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b0bf4ee85f nvc0: sprite coord enable is per GENERIC, not overall index 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9dd7d0803e nvc0: fix new_value calls using type instead of size 2011-02-24 17:35:36 +01:00
Christoph Bumiller
1a82971393 nvc0: set local memory usage info in shader header
Before this, l[] access was a no-op.
2011-02-24 17:35:36 +01:00
Christoph Bumiller
b5f04b2008 nvc0: don't fold loads from local memory 2011-02-24 17:35:36 +01:00
Christoph Bumiller
9612139907 nvc0: presin and preex2 can load from const space 2011-02-24 17:35:36 +01:00
Christoph Bumiller
f017483553 nvc0: kick out empty live ranges
They affect overlap tests even though they're actually empty.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
cd47f10c90 nvc0: preemptively insert branch at ENDIF
Might be necessary if a block sneaks in somewhere, like a common
block for moves of phi sources after a loop break.

This is harmless and normally will be removed before emission.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
4377657f8e nvc0: correct allocation of constrained registers
In linear scan we can't allocate multiple values with different
live ranges at the same time to assign them consecutive regs.

Maybe we should just switch to graph coloring for all values ...
2011-02-24 17:35:35 +01:00
Christoph Bumiller
67c7aefea3 nvc0: sync textures with render targets ourselves
Fixes for example piglit/fbo-flushing and nexuiz' bloom effect.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
a6ea37da4b nvc0: improve userspace fencing
Before, there were situations in which we never checked the fences
for completion (some loading screens for example) and thus never
released memory.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
410a13c5ce nvc0: values for undefined outputs must have file GPR 2011-02-24 17:35:35 +01:00
Christoph Bumiller
1579017b08 nvc0: multiply polygon offset units by 2
Wasn't sure if this still was necessary because the piglit test
started to fail at some point on nv50 where we already do this.
2011-02-24 17:35:35 +01:00
Christoph Bumiller
7d8ff54feb nvc0: fix SSG 2011-02-24 17:35:35 +01:00
Christoph Bumiller
88066d62ae nvc0: don't visit target blocks of a loop break multiple times 2011-02-24 17:35:35 +01:00
Christoph Bumiller
3d190e44de nvc0: don't overwrite phi sources at the end of a loop
Except the reference to its own result.
2011-02-24 17:35:35 +01:00
Fabian Bieler
728695b435 gallium/utils: Fix vertex element setup
Check if element was translated per element instead of per buffer.
2011-02-24 15:05:10 +01:00
José Fonseca
369ece1702 svga: Ensure rendertargets and textures are always rebound at every command buffer start.
The svga_update_state() mechanism is inadequate as it will always end up
flushing the primitives before processing the SVGA_NEW_COMMAND_BUFFER
dirty state flag.
2011-02-24 14:00:13 +00:00
Chris Wilson
f19439940c i965: Remember to pack the constant blend color as floats into the batch
Fixes regression from aac120977d.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:59:52 +00:00
Chris Wilson
5ce0f7f109 intel: Reset the buffer offset after releasing reference to packed upload
Fixes oglc/vbo(basic.bufferdata)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34603
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 12:29:51 +00:00
Chris Wilson
135ccb2dae i965: Unmap the correct pointer after discontiguous upload
Fixes piglit/fbo-depth-sample-compare:

==14722== Invalid free() / delete / delete[]
==14722==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==14722==    by 0x84FBBFD: intel_upload_unmap (intel_buffer_objects.c:695)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==  Address 0xc606310 is 0 bytes after a block of size 18,720 alloc'd
==14722==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==14722==    by 0x85202AB: copy_array_to_vbo_array (brw_draw_upload.c:256)
==14722==    by 0x85205BC: brw_prepare_vertices (brw_draw_upload.c:457)
==14722==    by 0x852F975: brw_validate_state (brw_state_upload.c:394)
==14722==    by 0x851FA24: brw_draw_prims (brw_draw.c:365)
==14722==    by 0x85F2221: vbo_exec_vtx_flush (vbo_exec_draw.c:389)
==14722==    by 0x85EF443: vbo_exec_FlushVertices_internal (vbo_exec_api.c:543)
==14722==    by 0x85EF49B: vbo_exec_FlushVertices (vbo_exec_api.c:973)
==14722==    by 0x86D6A16: _mesa_set_enable (enable.c:351)
==14722==    by 0x42CAD1: render_to_fbo (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42CEE3: piglit_display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)
==14722==    by 0x42F508: display (in /home/ickle/git/piglit/bin/fbo-depth-sample-compare)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34604
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:58:22 +00:00
Chris Wilson
a2029a78c3 intel: Protect against waiting on a NULL render target bo
If we fall back to software rendering due to the render target being
absent (GPU hang or other error in creating the named target), then we
do not need to nor should we wait upon the results.

Reported-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34656
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 10:12:37 +00:00
Dave Airlie
69d969e8fa r600g: EXT_texture_array support.
This adds EXT_texture_array support to r600g, it passes the piglit
array-texture test but I suspect may not be complete.

It currently requires a kernel patch to fix the CS checker to allow
these, so you need to use R600_ARRAY_TEXTURE=true for now
to enable them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:28 +10:00
Dave Airlie
13f5a4d316 st/mesa: treat 1D ARRAY upload like a depth or 2D array upload.
This is because the HW doesn't always store a 1D array like a
2D texture, it more likely stores it like 2D texture (i.e.
alignments etc).

This means we upload each slice separately and let the driver
work out where to put it.

this might break nvc0 as I can't test it, I have only nv50 here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24 13:26:16 +10:00
Vinson Lee
100cd214e3 scons: Fix Cygwin platform names.
Fixes immediate Python exceptions with SCons on Cygwin.
2011-02-23 18:21:14 -08:00
Jakob Bornecrantz
8fb0ecd0cf i915g: Lazy emit dynamic state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
b9baad2aff i915g: Lazy emit immediate state 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
69cfc16cb6 i915g: Disable LIS7 state updates for now 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
42b8b2be85 i915g: Clean up in i915_state_immediate 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
481fad1552 i915g: Remove outdated comment 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fbd681f1a0 i915g: Use dump function in sw winsys 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
fc77dee0bd i915g: Enable mirror repeat wrap mode 2011-02-24 00:26:02 +00:00
Jakob Bornecrantz
4407e5078f i915g: Always set vbo to flush on flushes
Reported-by Chris Wilson <chris@chris-wilson.co.uk>
2011-02-24 00:26:02 +00:00
Chris Wilson
671018aa99 intel: gen3 is particular sensitive to batch size
... and prefers a small batch whereas gen4+ prefer a large batch to
carry more state.

Tuning using openarena/padman indicate that a batch size of just 4096 is
best for those cases.

Bugzilla: https://bugs.freedesktop.org/process_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 23:11:26 +00:00
Chris Wilson
19ac5fa50d i915: And remember assign the new value to the state reg...
Fixes regression from 298ebb78de.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34589
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-23 22:10:43 +00:00
Tom Fogal
4484297505 Fix GLX_USE_TLS define.
It was only getting set in the case of DRI drivers.
2011-02-23 10:40:26 -07:00
Fabian Bieler
0ed5bf668d r600g: Request DWORD aligned vertex buffers.
The spec says that the offsets in the vertex-fetch instructions need to be byte-aligned and makes no specification with regard to the required alignment of the offset and stride in the vertex resource constant register.

However, testing indicates that all three values need to be DWORD aligned.
2011-02-23 11:42:32 -05:00
Wiktor Janas
b65e2195c4 st/mesa: fix computing the lowest address for interleaved attribs
Ptr can be very well NULL, so when there are two arrays, with one having
offset 0 (and thus NULL Ptr), and the other having a non-zero offset,
the non-zero value is taken as minimum (because of !low_addr ? start ...).
On 32-bit systems, this somehow works. On 64-bit systems, it leads to crashes.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-02-23 15:19:37 +01:00
Brian Paul
6d1f28d6c0 vbo: added vbo_check_buffers_are_unmapped() debug function 2011-02-22 14:32:37 -07:00
Brian Paul
bcd017f16f vbo: removed unused #defines, add comments 2011-02-22 14:23:50 -07:00
Brian Paul
eb24a5a9be mesa: move comment, change debug code 2011-02-22 13:37:30 -07:00
Brian Paul
d7fcb2ac81 vbo: simplify NeedFlush flag clearing 2011-02-22 13:31:09 -07:00
Brian Paul
d8aebc4e4b vbo: use ctx intstead of exec->ctx 2011-02-22 13:24:56 -07:00
Brian Paul
cbe47a2459 r300g: fix missing initializers warning 2011-02-22 12:47:18 -07:00
Brian Paul
7898d2ae16 i915g: remove extra semicolons 2011-02-22 12:47:18 -07:00
Andy Skinner
90e227f079 xlib: pass Display pointer to XMesaGarbageCollect()
Fixes an issue when different displays are used on different threads.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-22 12:47:17 -07:00
Kenneth Graunke
2bfc23fb86 i965: Increase Sandybridge point size clamp.
255.875 matches the hardware documentation.  Presumably this was a typo.

Found by inspection.  Not known to fix any issues.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:45 -08:00
Kenneth Graunke
4a3b28113c i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.
pixel_w is the final result; wpos_w is used on gen4 to compute it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
df2aef0e19 i965/fs: Refactor control flow stack handling.
We can't safely use fixed size arrays since Gen6+ supports unlimited
nesting of control flow.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
2c2686b912 i965/fs: Avoid register coalescing away gen6 MATH workarounds.
The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries.  Unfortunately, this pass coalesced those
registers, restoring the original problem.  Avoid doing that.

Fixes several OpenGL ES2 conformance failures on Sandybridge.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
72cd7e87d3 i965/fs: Apply source modifier workarounds to POW as well.
Single-operand math already had these workarounds, but POW (the only two
operand function) did not.  It needs them too - otherwise we can hit
assertion failures in brw_eu_emit.c when code is actually generated.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
Kenneth Graunke
3e91070ea8 i965: Fix shaders that write to gl_PointSize on Sandybridge.
gl_PointSize (VERT_RESULT_PSIZ) doesn't take up a message register,
as it's part of the header.  Without this fix, writing to gl_PointSize
would cause the SF to read and use the wrong attributes, leading to all
kinds of random looking failure.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-02-22 10:52:44 -08:00
José Fonseca
c6cedd43fe mesa: Avoid undeclared ffs function warning on mingw. 2011-02-22 14:59:09 +00:00
José Fonseca
7aeb610fe1 gallium: s/PIPE_TRANSFER_CPU_READ/PIPE_TRANSFER_READ/ in comments. 2011-02-22 14:14:45 +00:00
José Fonseca
0562f44625 gallium/docs: Update PIPE_TRANSFER_xx docs. Reformat to use definitions. 2011-02-22 14:14:22 +00:00
Keith Whitwell
fad8497d3b gallium: new transfer flag: DISCARD_WHOLE_RESOURCE 2011-02-22 14:13:07 +00:00
Marek Olšák
695cdee678 st/mesa: fix crash when using both user and vbo buffers with the same stride
If two buffers had the same stride where one buffer is a user one and
the other is a vbo, it was considered to be one interleaved buffer,
resulting in incorrect rendering and crashes.

This patch makes sure that the interleaved buffer is either user or vbo,
not both.
2011-02-20 22:16:22 +01:00
Marek Olšák
7942e6a5ae st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
2011-02-20 22:16:22 +01:00
Chris Wilson
3adc108b4a i965: Trim the interleaved upload to the minimum number of vertices
... should have no impact on a properly formatted draw operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:47 +00:00
Chris Wilson
b4cbd2b312 i965: Reinstate max-index paranoia
Don't trust the applications not to reference beyond the end of the
vertex buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:45 +00:00
Chris Wilson
3377faffcd i965: Zero the offset into the vbo when uploading non-interleaved
Fixes regression from 559435d915.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22 11:24:34 +00:00
Jakob Bornecrantz
94ccc31ba4 st/dri: Track drawable context bindings
Needs to track this ourself since because we get into a race condition with
the dri_util.c code on make current when rendering to the front buffer.

This is what happens:
Old context is rendering to the front buffer.

App calls MakeCurrent with a new context. dri_util.c sets
drawable->driContextPriv to the new context and then calls the driver make
current. st/dri make current flushes the old context, which calls back into
st/dri via the flush frontbuffer hook. st/dri calls dri loader flush
frontbuffer, which calls invalidate buffer on the drawable into st/dri.

This is where things gets wrong. st/dri grabs the context from the dri
drawable (which now points to the new context) and calls invalidate
framebuffer to the new context which has not yet set the new drawable as its
framebuffers since we have not called make current yet, it asserts.
2011-02-20 16:31:48 +01:00
Eric Anholt
9e872a5865 i965: Fix VB packet reuse when offset for the new buffer isn't stride aligned.
Fixes regression in scissor-stencil-clear and 5 other tests.
2011-02-21 16:36:09 -08:00
Brian Paul
12f25eb6d5 Revert "mesa: convert macros to inline functions"
This reverts commit e9ff76aa81.

Need to use macros so __FUNCTION__ reports the caller.
2011-02-21 17:01:00 -07:00
Brian Paul
e2d108ec82 st/mesa: need to translate clear color according to surface's base format
When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Brian Paul
c966c6980c st/mesa: fix the default case in st_format_datatype()
Part of the fix for piglit fbo-clear-formats

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-21 16:58:42 -07:00
Daniel Vetter
55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter
1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
43e6fe5549 i915g: Add option to lie about caps 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
27b49e91c9 i915g: Move debug fields to screen 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
fe6800a1bb i915g: Use debug get once options 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
3c74ecf687 i915g: Rework texture tiling a bit 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7e1fd057e i915g: Anisotropic filtering works 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
a641766576 i915g: TODO about point sprites 2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e7cdcefbee i915g: TODO about untested code hidden behind caps
Should be fairly easy to test and fix since you can look at
the code in the classic driver.
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz
e3c9bf1a67 i915g: Reorg caps 2011-02-21 23:42:53 +00:00
Brian Paul
7dbafea860 st/mesa: fix incorrect texture size allocation in st_finalize_texture()
If finalizing a non-POW mipmapped texture with an odd-sized base texture
image we were allocating the wrong size of gallium texture (off by one).
Need to be more careful about computing the base texture image size.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
4cdcec08d1 st/mesa: refactor guess_and_alloc_texture() code 2011-02-21 15:15:53 -07:00
Brian Paul
51f9713e39 st/mesa: fix mipmap generation for non-POW textures
This is part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=34463
2011-02-21 15:15:53 -07:00
Brian Paul
e9ff76aa81 mesa: convert macros to inline functions 2011-02-21 15:15:53 -07:00
Brian Paul
da9adb9613 vbo: more comments 2011-02-21 15:15:52 -07:00
Brian Paul
6f027ba20d vbo: make vbo_exec_FlushVertices_internal() static 2011-02-21 15:15:52 -07:00
Brian Paul
bbd756e824 vbo: remove old debug code, add comments 2011-02-21 15:15:52 -07:00
Brian Paul
7cba2df4a6 vbo: rename, document function params 2011-02-21 15:15:52 -07:00
Brian Paul
f0c8e7c327 vbo: comments 2011-02-21 15:15:52 -07:00
Brian Paul
0ba2810e47 vbo: replace assert(0) with proper assertions 2011-02-21 15:15:52 -07:00
Brian Paul
ae4b6e04cd vbo: rename some vars, add new comments, fix formatting, etc. 2011-02-21 15:15:52 -07:00
Brian Paul
8b2598d000 vbo: use ctx instead of exec->ctx 2011-02-21 15:15:52 -07:00
Brian Paul
f9e1542286 radeon: add default switch case to silence unhandled enum warning 2011-02-21 15:15:52 -07:00
Ian Romanick
497baf4e4a Use C-style system headers in C++ code to avoid issues with std:: namespace 2011-02-21 13:07:29 -08:00
Chris Wilson
5a1fbf0f70 intel: Fix insufficient integer width for upload buffer offset
I was being overly miserly and gave the offset of the buffer into the bo
insufficient bits, distracted by the adjacency of the buffer[4096].

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=34541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 20:58:09 +00:00
José Fonseca
dcb21d8b1c svga: Remove some remaining fake S3TC rendering support. 2011-02-21 18:36:51 +00:00
Chris Wilson
a43f20e069 i965: Remove spurious duplicate ADVANCE_BATCH
... a leftover from a bad merge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 16:02:26 +00:00
Chris Wilson
2c6793fb6b i915: Emit a single relocation per vbo
Reducing the number of relocations has lots of nice knock-on effects,
not least including reducing batch buffer size, auxilliary array sizes
(vmalloced and copied into the kernel), processing of uncached
relocations etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
298ebb78de i915: Suppress emission of redundant stencil updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
7c97e288fb i915: Separate BLEND from general context state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:46 +00:00
Chris Wilson
4f82585e27 i915: Only flag context changes if the actual state is changed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:45 +00:00
Chris Wilson
0b0cad38c5 i915: suppress repeated sampler state emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 13:04:41 +00:00
Chris Wilson
87641cffd9 i915: Eliminate redundant CONSTANTS updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
41260a9bf6 i965: Use compiler builtins when available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
8ea6e98c7b i965: Micro-optimise check_state
Replace the intermediate tests due to the logical or with the bitwise
or.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
50ade6ea69 intel: use throttle ioctl for throttling
Rather than waiting on the first batch after the last swapbuffers to be
retired, call into the kernel to wait upon the retirement of any request
less than 20ms old. This has the twofold advantage of (a) not blocking
any other clients from utilizing the device whilst we wait and (b) we
attain higher throughput without overloading the system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:37 +00:00
Chris Wilson
46131a824f i965: Remove unused 'next_free_page' member
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
57ca0803b3 intel: Skip the flush before read-pixels via blit
As we will flush when reading the return values of the blit, we can forgo
the earlier flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
c625aa19cb intel: extend current vertex buffers
If the next vertex arrays are a (discontiguous) continuation of the
current arrays, such that the new vertices are simply offset from the
start of the current vertex buffer definitions we can reuse those
defintions and avoid the overhead of relocations and invalidations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
a07e481179 intel: Use specified alignment for writes into the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
d9e591391d i965: Clean up brw_prepare_vertices()
Use a temporary glarray variable to replace the numerous input->glarray.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
3630d5b69a intel: combine short memcpy using a temporary allocated buffer
Using a temporary buffer for large discontiguous uploads into the common
buffer and a single buffered upload is faster than performing the
discontiguous copies through a mapping into the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:36 +00:00
Chris Wilson
dfc6c96e5c i965: upload normal arrays as interleaved
Upload the non-vbo arrays into a single interleaved buffer object, and
so need to just emit a single vertex buffer relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
94d73d700e i965: interleaved vbo
If the user passed in several arrays interleaved in the same vbo, only
emit a single vertex buffer and relocation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
559435d915 i965: emit one vb packet per vbo
Track reuse of the vertex buffer objects and so minimise the number of
vertex buffers used by the hardware (and their relocations).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
abb5109756 i965: upload transient indices into the same discontiguous buffer
As we now pack the indices into a common upload buffer, we can reuse a
single CMD_INDEX_BUFFER packet and translate each invocation with a
start vertex offset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
60bb3e5614 i965: suppress repeat-emission of identical vertex elements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
aac120977d i965: Move repeat-instruction-suppression to batchbuffer core
Move the tracking of the last emitted instructions into the core
batchbuffer routines and take advantage of the shadow batch copy to
avoid extra memory allocations and copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Chris Wilson
3f55683927 i965: drop state_bo references to batch_bo
As we use state relocations and we know that all the state belongs to
the same bo, we can drop the multiple references to the same bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
1be3764dbe i965: directly write wm state to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
df156549e7 i965: write cc straight to batch
As we write directly into the batch in system memory, we do not need to
write first to the stack (as was to avoid read back through the GTT)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
f29606598e i965: switch gen6 to use its own cc state bo
In preparation for a greater change, use the color_calc_state_bo already
provisioned for this purpose.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
8a9e67b8df intel: Buffered upload
Rather than performing lots of little writes to update the common bo
upon each update, write those into a static buffer and flush that when
full (or at the end of the batch). Doing so gives a dramatic performance
improvement over and above using mmaped access.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
40ee15407a intel: Replace the bo for a complete update
Rather than performing a blit to completely overwrite a busy bo, simply
discard it and create a new one with the fresh data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
abb37861d9 i965: Combine vb upload buffer with the general upload buffer
Reuse the new common upload buffer for uploading temporary indices and
rebuilt vertex arrays.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
e476e12220 intel: Pack dynamic draws together
Dynamic arrays have the tendency to be small and so allocating a bo for
each one is overkill and we can exploit many efficiency gains by packing
them together.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
d0809d7b15 intel: Use system memory for DYNAMIC_DRAW source objects
Dynamic draw buffers are used by clients for temporary arrays and for
uploading normal vertex arrays. By keeping the data in memory, we can
avoid reusing active buffer objects and reallocate them as they are
changed. This is important for Sandybridge which can not issue blits
within a batch and so ends up flushing the batch upon every update, that
is each batch only contains a single draw operation (if using dynamic
arrays or regular arrays from system memory).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:34 +00:00
Chris Wilson
45ba7afbd1 i965: Trim the trailing NOOP from 3DSTATE_INDEX_BUFFER
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Chris Wilson
13bab58f04 i965: Fallback on encountering a NULL render buffer
Following a GPU hang, or other error, the render target is not likely to
have an allocated BO and so we must fallback to avoid using it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32534
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:33 +00:00
Vinson Lee
8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter
c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz
ec3c5ac592 i915g: Add dummy flush_frontbuffer 2011-02-21 00:50:16 +01:00
Jon TURNEY
aa6a5cf1d5 Fix --enable-shared-glapi configure option
Fix a typo which meant that --enable-shared-glapi didn't actually cause a shared glapi to be built

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-02-20 12:53:42 -07:00
Chia-I Wu
bf0c56522e egl_dri2: Return NULL when xcb_get_geometry_reply fails.
This should fix bug #33946.
2011-02-20 12:26:31 -07:00
José Fonseca
91ea60395e scons: Add aliases for the llvmpipe unit tests.
Now one can simply do

  scons lp_test_format
2011-02-19 10:56:05 +00:00
José Fonseca
57d4e922a6 gallivm: Use simple scaling plus casting in more unorm->float cases. 2011-02-19 10:56:05 +00:00
Kenneth Graunke
b1002e4aa5 glsl: Remove $(PWD) from Makefile in favor of .
Hopefully should fix bug #34468.
2011-02-19 00:06:00 -08:00
Marek Olšák
0b436cf511 r300g: fix a possible race when counting contexts
Atomics aren't sufficient here.
2011-02-19 00:17:27 +01:00
Marek Olšák
e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
José Fonseca
e16e70610c svga: Fix NULL dereference.
Probably introduced with the surface view move from screen to context.
2011-02-18 19:03:43 +00:00
Brian Paul
7ea729a185 vbo: add debug code to verify that buffers are unmapped before drawing 2011-02-18 10:34:25 -07:00
Brian Paul
6364d75008 mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebuffer 2011-02-18 10:34:25 -07:00
Brian Paul
633c9fcf78 st/mesa: set renderbuffer _BaseFormat in a few places
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-02-18 10:28:27 -07:00
Brian Paul
09f14a6086 st/mesa: check buffer orientation in blit_copy_pixels()
Can't invert the region if copying between surfaces with different
orientations.
2011-02-18 10:24:41 -07:00
José Fonseca
0ced789a0b svga: Ensure pending drawing commands other surface operations are emitted before DMAs.
This behavior was last when moving the transfers to the contexts.

This fixes several piglit failures, which were reading the color renderbuffer
before the draw operations were emitted.
2011-02-18 16:43:59 +00:00
José Fonseca
f9b4867846 svga: Cannot use negate or abs on source to dsx/dsy instructions. 2011-02-18 16:43:44 +00:00
José Fonseca
0cb6329e89 svga: Ensure SWTNL is created after HWTNL.
Matches the internal driver layering, and prevents null svga->hwtnl
dereferencing from inside the swtnl.
2011-02-18 16:43:40 +00:00
José Fonseca
15c3e21097 svga: Ensure LRP's restrictions are observed in all uses.
The dst reg must be a temporary, and not be the same as src0 or src2.
2011-02-18 16:43:38 +00:00
José Fonseca
965ab5fed3 svga: Preserve src swizzles in submit_op2/3/4.
Several opcodes require scalar swizzle, and this requirement was
being was not being observed when creating temporaries for other reasons.
2011-02-18 16:43:36 +00:00
Marek Olšák
fd8d4b32ed r300g: remove tracking whether vertex buffers need to be validated
This was getting hard to maintain and didn't really bring any real benefits.
Instead, validate buffers when the vertex array state is dirty.
2011-02-18 16:15:03 +01:00
Marek Olšák
bb46eeade3 st/mesa: fix geometry corruption by always re-binding vertex arrays
This is a temporary workaround. It fixes sauerbrauten with shaders enabled.

I guess we might be changing vertex attribs somewhere and not updating
the appropriate dirty flags, therefore we can't rely on them for now.
Or maybe we need to make this state dependent on some other flags too.

More info:
https://bugs.freedesktop.org/show_bug.cgi?id=34378
2011-02-18 16:01:01 +01:00
Jakob Bornecrantz
e0481cac7d svga: Disable surface cache for textures
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:48 +00:00
Jakob Bornecrantz
912ad88742 svga: Describe svga_sampler_views for refcnt debugging
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:47 +00:00
Jakob Bornecrantz
99d955263b svga: Make sure that refcnt debugger gets the correct backtrace for create
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:46 +00:00
Jakob Bornecrantz
52ad45677d util: Make refcnt and symbol debuggers work on windows
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2011-02-18 14:46:23 +00:00
Cyril Brulebois
d252db7af1 Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org
Suggested by a freedesktop.org admin.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-02-18 07:42:41 -07:00
Marek Olšák
449c4f3706 u_vbuf_mgr: initialize flag indicating that buffers have been updated
This fixes r300g errors:
r300: Cannot get a relocation in radeon_drm_cs_write_reloc.
2011-02-18 13:57:31 +01:00
Thomas Hellstrom
8cbd3b5ef1 gallium/svga: Fix unnecessary swtnl fallbacks
When we drop the in_swtnl_draw flag, we must force a rerun of
update_need_swtnl to reset the need_swtnl flag to its correct value outside
of a swtnl vbo draw.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-18 13:25:32 +01:00
Dave Airlie
dfa5928404 r600g: reorganise rgtc pieces.
when the cs checker fixes go upstream a lot of this can disappear
into a drm version check.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 16:00:49 +10:00
Brian Paul
b736b4a2b5 st/mesa: implement blit-based path for glCopyPixels
If doing a simple non-overlapping glCopyPixels with no per-fragment ops
we can use pipe_context::resource_copy_region().
2011-02-17 19:11:32 -07:00
Brian Paul
d44fbd3c9d mesa: fix comments for _mesa_clip_readpixels() 2011-02-17 19:11:32 -07:00
Brian Paul
de2f25de26 st/mesa: indentation fix 2011-02-17 19:11:32 -07:00
Fabian Bieler
8b5119aab3 r600g: Start a new TEX clause if the texture lookup address was fetched in the current clause
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:41 +10:00
Fabian Bieler
51cc14471c r600g: Add support to dump vertex- and texture-fetch clauses
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-18 10:04:34 +10:00
Dave Airlie
2a6cce09e3 r600g: add BC4/5 to RGTC conversion
this doesn't do anything much since the rest of mesa doesn't
support RGTC yet.
2011-02-18 09:39:23 +10:00
José Fonseca
262b785ccd util: Fix typo in last commit. 2011-02-17 17:15:57 +00:00
Brian Paul
d1becefb05 st/mesa: fix incorrect glCopyPixels position on fallback path
If we hit the pipe_get/put_tile() path for setting up the glCopyPixels
texture we were passing the wrong x/y position to pipe_get_tile().
The x/y position was already accounted for in the pipe_get_transfer()
call so we were effectively reading from 2*readX, 2*readY.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-17 10:13:33 -07:00
Brian Paul
1fa97ddb25 draw: update comments, rename vars in pstipple code 2011-02-17 10:13:33 -07:00
José Fonseca
0adeaf00e6 svga: Don't use more than one constant per IFC instruction. 2011-02-17 15:29:32 +00:00
José Fonseca
8902c42db4 mesa: Do copy propagation across if-else-endif.
Addresses excessive TEMP allocation in vertex shaders where all CONSTs are
stored into TEMPS at the start, but copy propagation was failing due to
the presence of IFs.

We could do something about loops, but ifs are easy enough.
2011-02-17 15:29:30 +00:00
José Fonseca
6c1fcf8583 util: Cleanup symbol name resolution on Windows.
- Support symbol name resolution on MinGW.
- Use dbghelp.dll (which should allow 64bit support), but untested yet.
- Cleanup.
2011-02-17 15:26:53 +00:00
Brian Paul
1bf9954bb4 docs: updated environment variable list 2011-02-17 07:29:20 -07:00
Brian Paul
f9df46f873 st/mesa: remove unused screen variables 2011-02-17 07:28:58 -07:00
Brian Paul
30ed4ced11 mesa: remove the MESA_NO_DITHER env var
This was sometimes useful back when 16-bit framebuffers were prominent.
2011-02-17 07:28:58 -07:00
Brian Paul
b1d485712f softpipe: rename env vars to be consistent 2011-02-17 07:28:58 -07:00
Haitao Feng
f55d027ac2 egl_dri2: add swrast
This enables the egl_dri2 driver to load swrast driver
for software rendering. It could be used when hardware
dri2 drivers are not available, such as in VM.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-16 23:06:36 -05:00
Dave Airlie
231bf886da r600g: get s3tc working on cards with crappy 64/128 bit types.
Some cards don't appear to work correctly with the UNORM type,
so switch to the integer type, however since gallium has no
integer types yet from what I can see we need to do a hack to
workaround it for the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-17 10:27:09 +10:00
Dave Airlie
5cc35124b3 r600g: add missing type to color buffer swap. 2011-02-17 10:27:09 +10:00
Brian Paul
5d236d71c8 gallium/util: init key with memset()
To silence missing initializers warning.
2011-02-16 17:10:36 -07:00
Brian Paul
c8f8d7d873 svga: flush when transitioning between HW and SW rendering paths
To avoid mixing HW and SW rendering with the same vertex buffer.
2011-02-16 17:07:02 -07:00
Brian Paul
b5df194923 rtasm: add dummy return statement to silence MSVC warning
And use assert(0) instead of abort() to be consistent with rest
of Gallium.
2011-02-16 17:07:02 -07:00
Brian Paul
2f5032ec1e svga: use TRUE/FALSE instead of 0/1
Some fields are booleans, others are bitmasks.  Use TRUE/FALSE to
clarify what's what.
2011-02-16 17:07:02 -07:00
Brian Paul
64762af008 svga: fix incorrect comment 2011-02-16 17:07:02 -07:00
Brian Paul
d432f462c2 svga: dimension the dirty[] array with SVGA_STATE_MAX 2011-02-16 17:07:02 -07:00
Brian Paul
e162f28228 mesa: make _mesa_write_renderbuffer_image() non-static 2011-02-16 17:07:02 -07:00
Brian Paul
4b6c9b799b svga: disable a debug_printf() call 2011-02-16 17:07:02 -07:00
Sam Hocevar
3e8fb54fb8 docs: add glsl info 2011-02-16 17:05:08 -07:00
Sam Hocevar
fde4943688 docs: fix glsl_compiler name 2011-02-16 17:05:08 -07:00
Brian Paul
aaceca16df mesa: 80-column wrap 2011-02-16 17:05:08 -07:00
José Fonseca
fa05ddca15 svga: Proper redefine_user_buffer implementation.
Unfortunately still not enough to make GoogleEarth happy.
2011-02-16 21:53:10 +00:00
Marek Olšák
fa3f1348e4 r300g: fix a race between CS and SET_TILING ioctls 2011-02-16 22:23:23 +01:00
Marek Olšák
2d1cc27729 r300g: fix blitting NPOT compressed textures 2011-02-16 21:40:54 +01:00
Marek Olšák
8513d3405b mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2 and 4_4
Oops, I copy-pasted a typo from 3_3_2.

The 3_3_2 part is a candidate for 7.9 and 7.10.
The 4_4 part isn't, because AL44 is in neither branches.
2011-02-16 20:44:46 +01:00
Marek Olšák
4d6994e40e mesa: fix mipmap generation for MESA_FORMAT_AL44
This was missed when implementing AL44.
2011-02-16 20:21:40 +01:00
José Fonseca
33d8ff9c31 scons: Recognize 'AMD64' processor as well. 2011-02-16 18:02:08 +00:00
José Fonseca
590c2ee568 scons: Don't get fooled by 32bit python on a 64bit windows. 2011-02-16 18:02:06 +00:00
José Fonseca
9f9d6481de scons: Avoid depending on scons 2.0 in general. 2011-02-16 18:02:01 +00:00
José Fonseca
2a2b156ea5 mesa: Remove the DXT compression via blit path.
No longer used.
2011-02-16 16:50:24 +00:00
José Fonseca
697a3eb832 svga: Don't fake DXT compression ability. 2011-02-16 16:50:24 +00:00
Christoph Bumiller
3903e25a2c nvc0: fix blend factor mapping 2011-02-16 15:45:31 +01:00
Christoph Bumiller
3f1361e060 nvc0: fix emit_dfdx,dfdy 2011-02-16 15:45:31 +01:00
Christoph Bumiller
bb2c8e7099 nvc0: don't swap sources if either value is not in a GPR
The memory / immediate source should already be in the only valid
position.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
2fa35eedd9 nvc0: add missing break statements in constant_operand 2011-02-16 15:45:31 +01:00
Christoph Bumiller
e7845e3196 nvc0: fix clipping and use VIEWPORT instead of SCISSOR 2011-02-16 15:45:31 +01:00
Christoph Bumiller
19f2272e94 nvc0: demagic the clear flags and fix region clears
The CLIP_RECTs always affect dedicated clears, and it's nicer than
having to mark the viewport or scissor state dirty after it.
2011-02-16 15:45:31 +01:00
Christoph Bumiller
293a8d1b60 nvc0: front stencil mask and func mask methods are swapped 2011-02-16 15:45:31 +01:00
Christoph Bumiller
a24e9bd497 nvc0: clone memory values with multiple refs before modifying them 2011-02-16 15:45:30 +01:00
Christoph Bumiller
80a7ae3cc5 nvc0: disable early fragment tests if KIL is used
Early-Z pass raises the occlusion counter.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
17d680cc53 nvc0: force vertex data through FIFO if we need to convert it
We may want to put the converted vertex buffer in persistent
storage instead, but these are rare corner cases.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
bf1ce9c64b nvc0: use format from the template on surface creation
Fixes piglit/fbo-srgb.
2011-02-16 15:45:30 +01:00
Christoph Bumiller
1b4c0c8ea0 nvc0: update the set of formats supported by the 2D engine 2011-02-16 15:45:30 +01:00
Christoph Bumiller
a3c62afa7c nvc0: fix user vertex buffer updates 2011-02-16 15:45:30 +01:00
Brian Paul
fc5ab1b197 mesa: use gl_format type instead of GLuint 2011-02-16 07:08:58 -07:00
Dave Airlie
f53436d821 r600g: fix typo in previous s3tc commit
pointed out by Marek on irc.
2011-02-16 16:51:41 +10:00
Marek Olšák
9e725b9123 r300g: fix texture border color for float formats 2011-02-16 07:46:36 +01:00
Dave Airlie
4ffef88899 Revert "util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)"
This reverts commit 6e7d782da5.

Oops, I just had this locally for testing and forgot to remove it before pushing.
2011-02-16 16:13:58 +10:00
Dave Airlie
04903d1f63 r600g: add L8A8 SRGB formats.
this fixes the piglit mipmap generation sRGB on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:09:43 +10:00
Marek Olšák
6e7d782da5 util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)
This is a workaround for a bug in libtxc_dxtn.

Fixes:
- piglit/GL_EXT_texture_compression_s3tc/fbo-generatemipmap-formats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:04:14 +10:00
Dave Airlie
4016a1b4c6 r600g: add L4A4 support.
this fixes piglit fbo-generatemipmap-formats on my rv730.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 16:01:36 +10:00
Dave Airlie
0863eaf91c r600g: fix s3tc-texsubimage
we need to translate the destination box as well.

fixes piglit's s3tc-texsubimage test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-16 15:56:11 +10:00
Ian Romanick
25b36e8ff8 linker: Fix off-by-one error implicit array sizing
Arrays are zero based.  If the highest element accessed is 6, the
array needs to have 7 elements.

Fixes piglit test glsl-fs-implicit-array-size-03 and bugzilla #34198.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 18:22:33 -08:00
Vinson Lee
ae11707b83 st/python: add usage parameter to pipe_buffer_create
This is a follow-up to commit eafb7f234d.

Fixes Linux SCons build.
2011-02-15 17:29:43 -08:00
Marek Olšák
38104a767c r300g: disable linear filtering for float textures 2011-02-16 00:55:39 +01:00
Chad Versace
62c8c77333 glsl: Reinstate constant-folding for division by zero
Fixes regression: https://bugs.freedesktop.org/show_bug.cgi?id=34160

Commit e7c1f058d1 disabled constant-folding
when division-by-zero occured. This was a mistake, because the spec does
allow division by zero. (From section 5.9 of the GLSL 1.20 spec: Dividing
by zero does not cause an exception but does result in an unspecified
value.)

For floating-point division, the original pre-e7c1f05 behavior is
reinstated.

For integer division, constant-fold 1/0 to 0.
2011-02-15 15:46:12 -08:00
Chad Versace
f2e9981e43 Revert "glsl: Fix constant-folding for reciprocal expressions"
This reverts commit b3cf92aa91.

The reverted commit prevented constant-folding of reciprocal expressions
when the reciprocated expression was 0. However, since the spec allows
division by zero, constant-folding *is* permissible in this case.

From Section 5.9 of the GLSL 1.20 spec:
    Dividing by zero does not cause an exception but does result in an
    unspecified value.
2011-02-15 15:46:12 -08:00
Chad Versace
a231ac23f4 tnl: Add support for datatype GL_FIXED in vertex arrays
Before populating the vertex buffer attribute pointer (VB->AttribPtr[]),
convert vertex data in GL_FIXED format to GL_FLOAT.

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

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-15 15:39:22 -08:00
Dave Airlie
632918d3ec r600g: add srgb compressed formats to the list. 2011-02-16 08:54:14 +10:00
Marek Olšák
eafb7f234d gallium: add usage parameter to pipe_buffer_create
And set a reasonable buffer usage flag everywhere instead of
just PIPE_USAGE_DEFAULT.
2011-02-15 22:44:21 +01:00
Fabian Bieler
82a9794a35 r600g: Fix RGB10_A2 format handling 2011-02-15 12:31:30 -05:00
Dave Airlie
4b81c5f6e1 r600g: fix regression in r6/7xx since mipmap rework
I typod this when copy-pasting.
2011-02-15 18:43:56 +10:00
Vinson Lee
cd8af3b60b nvc0: Fix uninitialized variable warning.
Fixes this GCC warning.
nvc0_tgsi_to_nc.c: In function 'bld_tex':
nvc0_tgsi_to_nc.c:1392: warning: 'dim' may be used uninitialized in this function
2011-02-15 00:27:16 -08:00
Marek Olšák
b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Dave Airlie
8e0437914b r600g: add support for s3tc formats.
On r600, s3tc formats require a 1D tiled texture format,
so we have to do uploads using a blit, via the 64-bit and 128-bit formats

Based on the r600c code we use a 64 and 128-bit type to do the
blits.

Still requires R600_ENABLE_S3TC until the kernel fixes are in,
this has only been tested on evergreen where the kernel doesn't
yet get in the way.
2011-02-15 14:44:09 +10:00
Dave Airlie
a661dacf14 r600g: fix miptree calculations
the miptree setup and pitch storing didn't work so well for block
based things like compressed textures. The CB takes blocks, where
the texture sampler takes pixels, and transfers need bytes,

So now we store blocks/bytes and translate to pixels in the sampler.

This is necessary for s3tc to work properly.
2011-02-15 14:44:08 +10:00
Dave Airlie
ea7a548d07 r600g: drop tiled flag
we can work this out from the array_mode and it makes more sense
to do that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Dave Airlie
fdb4373a20 st/mesa: fix compressed mipmap generation.
If the underlying transfer had a stride wider for hw alignment reasons,
the mipmap generation would generate badly strided images.

this fixes a few problems I found while testing r600g with s3tc

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-15 14:44:08 +10:00
Marek Olšák
dc578188fa st/mesa: fix GLES build
Broken since d5062fb3a3.

I wonder why this code is hidden behind #if by default.
2011-02-15 04:56:09 +01:00
Marek Olšák
333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák
45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák
8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák
18b4978ac8 r300g: implement fences using dummy relocations
So finally we have them.
2011-02-15 04:00:46 +01:00
Marek Olšák
4faf11ad6c r300g: fix SIGFPE on debug builds 2011-02-15 01:19:54 +01:00
Marek Olšák
56029ce52b r300g: inline some of the pipe_buffer_map/unmap calls 2011-02-15 01:19:54 +01:00
Marek Olšák
20112cca26 r300g: do not track whether occlusion queries have been flushed
The winsys takes care of flushing automatically.
2011-02-14 23:36:12 +01:00
Marek Olšák
89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Vinson Lee
ec21eabe2a st/python: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 14:10:05 -08:00
Vinson Lee
7582448016 graw: remove pipe_vertex_buffer::max_index
This is a follow-up to commit cdca3c58aa.
2011-02-14 13:53:09 -08:00
Fabian Bieler
a476ca1fd1 st/mesa: Use blend equation and function of first render target for all render targets if ARB_draw_buffers_blend is not supported
If EXT_draw_buffers2 is supported but ARB_draw_buffers_blend isn't
_mesa_BlendFuncSeparateEXT only sets up the blend equation and function for the
first render target. This patch makes sure that update_blend doesn't try to use
the data from other rendertargets in such cases.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-14 14:37:18 -07:00
Marek Olšák
a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák
49579a4df8 pb_bufmgr_cache: add is_buffer_busy hook and use it instead of non-blocking map
This is cleaner and implementing the hook is optional.
2011-02-14 21:51:01 +01:00
Marek Olšák
588fa884d2 gallium: notify drivers about possible changes in user buffer contents
Also implement the redefine_user_buffer hook in the drivers.
2011-02-14 21:50:08 +01:00
Marek Olšák
2a904fd6a0 st/mesa: set vertex arrays state only when necessary
The vertex arrays state should be set only when (_NEW_ARRAY | _NEW_PROGRAM)
is dirty. This assumes user buffer content is mutable, which will be
sorted out in the next commit. The following usage case should be much faster
now:

for (i = 0; i < 1000; i++) {
   glDrawElements(...);
}

Or even:

for (i = 0; i < 1000; i++) {
   glSomeStateChangeOtherThanArraysOrProgram(...);
   glDrawElements(...);
}

The performance increase from this may be significant in some apps and
negligible in others. It is especially noticable in the Torcs game (r300g):
    Before: 15.4 fps
    After: 20 fps

Also less looping over attribs in st_draw_vbo yields slight speed-up
in apps with lots of glDraw* calls.
2011-02-14 21:50:08 +01:00
Marek Olšák
cdca3c58aa gallium: remove pipe_vertex_buffer::max_index
This is redundant to pipe_draw_info::max_index and doesn't really fit
in the optimizations I plan.
2011-02-14 21:50:08 +01:00
Marek Olšák
d5062fb3a3 gallium: always save and restore vertex buffers using cso_cache 2011-02-14 21:50:07 +01:00
Marek Olšák
cfaf217135 vbo: bind arrays only when necessary
We don't need to call bind_arrays in the vbo module if the states
which the function depends on are not dirty.
2011-02-14 21:50:07 +01:00
Marek Olšák
5a01361cea vbo: notify a driver that we change buffer offsets, strides, etc. 2011-02-14 21:50:07 +01:00
Vinson Lee
d123959ff7 r300g: Remove redundant initialization.
Remove redundant initialization from commit
3b01b52bd7 noticed by tstellar.
2011-02-14 10:47:58 -08:00
Alex Deucher
9e96ea0652 r600g: add alignment cases for linear aligned
Matches the drm and ddx.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-14 13:07:29 -05:00
José Fonseca
07eb660fc9 draw: Don't define the last two mipmap levels in aa lines.
Some hardware needs to make a seperate copy of all levels to obey
max_lod, so simply do not define the last two levels instead of
clamping.
2011-02-14 10:56:48 +00:00
José Fonseca
9305e93114 svga: Set the appropriate flags when creating sampler/surface views. 2011-02-14 10:53:54 +00:00
Marek Olšák
a0c293ec11 r300g: put indices in CS if there's just a few of them and are in user memory 2011-02-14 11:43:14 +01:00
Marek Olšák
437583ea63 r300g: cleanup the draw functions 2011-02-14 11:43:14 +01:00
Marek Olšák
476cec37d6 r300g: do not create a user buffer struct for misaligned ushort indices fallback 2011-02-14 11:43:14 +01:00
Marek Olšák
d173f1ba8a r300g: fix fallback for misaligned ushort indices with num vertices >= 65535 2011-02-14 11:43:14 +01:00
Marek Olšák
3d5ac32f3b r300g: consolidate emission of common draw regs 2011-02-14 11:43:14 +01:00
Sedat Dilek
0f912534fd docs: Fix typo in GL3.txt 2011-02-14 00:45:44 -08:00
Vinson Lee
3b01b52bd7 r300g: Move declaration before code.
Fixes SCons build.
2011-02-14 00:07:07 -08:00
Marek Olšák
e9d993e9b9 r600g: do not destroy the original index buffer when translating indices
Because we only translate a subrange of the buffer.
2011-02-14 07:45:14 +01:00
Marek Olšák
5a6ba08c21 r300g: emit 3D_LOAD_VBPNTR only when necessary
I thought I couldn't skip emitting this packet in some cases.
Well it looks like I can.
2011-02-14 07:45:14 +01:00
Marek Olšák
004dd01583 r300g: fix reference counting when translating indices 2011-02-14 07:45:14 +01:00
Marek Olšák
9a90eeee67 u_index_modify: map buffers with PIPE_TRANSFER_UNSYNCHRONIZED 2011-02-14 07:45:14 +01:00
Marek Olšák
5197b09bee r300g: remove the relocation after AARESOLVE_PITCH 2011-02-14 07:45:14 +01:00
Dave Airlie
1f5b674168 egl_dri2: add nouveau support.
but really wtf? all these PCI IDs need to be ripped out of here, its totally
unscalable and the drivers already have this info so could export it some better way.

tested by Darxus on #wayland.
2011-02-14 07:54:28 +10:00
Marcin Slusarz
8fe5da89e3 nv50: fix query assertion 2011-02-13 22:05:28 +01:00
Marek Olšák
e6e4860555 r300g: correctly determine if a texture is blittable in texture_get_transfer 2011-02-13 08:49:15 +01:00
Marek Olšák
8ab1fcc66a r300g: fixup the handle_compare function
Accidentally negated in 685c3262b9.
2011-02-13 00:31:04 +01:00
Marek Olšák
1fd6bbc881 r300g: when printing shader linker errors to stderr, report it's not a bug 2011-02-12 23:38:00 +01:00
Marek Olšák
9ad9a6861a r300g: add debug options nozmask and nohiz which disable some hyper-z features 2011-02-12 23:37:14 +01:00
Marek Olšák
685c3262b9 r300g: typecast void* to unsigned correctly 2011-02-12 23:36:48 +01:00
Eric Anholt
04521c158f dri: Remove the old metaops code which has been superceded by ../common/ 2011-02-12 12:26:04 -08:00
Eric Anholt
211725eccd radeon: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:43 -08:00
Eric Anholt
47589c17b0 intel: Remove setup of the old dri/ meta code, which is now unused. 2011-02-12 12:23:20 -08:00
Dave Airlie
a6b7393eb8 update GL3.txt for GL_EXT_framebuffer_sRGB status 2011-02-12 18:08:04 +10:00
Tom Stellard
9106b98766 r300/compiler: Don't erase sources when converting RGB->Alpha
https://bugs.freedesktop.org/show_bug.cgi?id=34030

NOTE: This is a candidate for the 7.10 branch.
2011-02-11 19:42:35 -08:00
Christopher James Halse Rogers
d1e28b2267 mesa: Optionally build a dricore support library (v3)
This an adds --enable-shared-dricore option to configure.  When enabled,
DRI modules will link against a shared copy of the common mesa routines
rather than statically linking these.

This saves about 30MB on disc with a full complement of classic DRI
drivers.

v2: Only enable with a gcc-compatible compiler that handles rpath
    Handle DRI_CFLAGS without filter-out magic
    Build shared libraries with the full mklib voodoo
    Fix typos
v3: Resolve conflicts with talloc removal patches

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-02-11 18:31:05 -08:00
nobled
b5dc40710d glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.

Also add a null check for psc, and drop gc's redundant initialization.
2011-02-11 18:19:10 -08:00
Marek Olšák
df54b53b7d r300g: improve function radeon_bo_is_referenced_by_cs
This should prevent calling into radeon_get_reloc when there's
only one context.
2011-02-12 03:08:39 +01:00
Marek Olšák
20a78b68a3 u_vbuf_mgr: fix segfault
max_index could have been less than min_index, which later caused integer
underflow followed by a segfault in memcpy.
2011-02-12 03:08:39 +01:00
Ian Romanick
3803295fc2 ir_to_mesa: Don't dereference a NULL pointer during copy propagation
The ACP may already be NULL, so don't try to make it NULL again.

This should fix bugzilla #34119.
2011-02-11 15:44:19 -08:00
Ian Romanick
a0120e6e0f glcpp: regerated files
These should have been committed right after fd1252ab, but they were
missed.  Soon, we'll never have to do this again...
2011-02-11 15:44:19 -08:00
Ian Romanick
afdceede55 glsl: Regenerate files modified by previous commits 2011-02-11 14:12:44 -08:00
Ian Romanick
8842158944 glsl: Finish out the reduce/reduce error fixes
Track variables, functions, and types during parsing.  Use this
information in the lexer to return the currect "type" for identifiers.

Change the handling of structure constructors.  They will now show up
in the AST as constructors (instead of plain function calls).

Fixes piglit tests constructor-18.vert, constructor-19.vert, and
constructor-20.vert.  Also fixes bugzilla #29926.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Keith Packard
f4b812e1a6 glsl: Eliminate reduce/reduce conflicts in glsl grammar
This requires lexical disambiguation between variable and type
identifiers (as most C compilers do).

Signed-off-by: Keith Packard <keithp@keithp.com>

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-11 14:12:43 -08:00
Benjamin Franzke
81affb8f4c st/mesa: Fix surfaceless opengl with non-dummy contexts
main/context.c:check_complatible() detecs an incomplete
framebuffer using its pointer, so do not copy it.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=34042
2011-02-11 16:54:04 -05:00
Brian Paul
6c3a82a1a3 svga: disable a debug_printf() call 2011-02-11 14:07:43 -07:00
Brian Paul
396da5df0e svga: comments and debug code 2011-02-11 14:02:30 -07:00
Brian Paul
f7d84c177f svga: more comments for need_pipeline field 2011-02-11 14:02:30 -07:00
José Fonseca
6826d58bbf scons: Need c99 also when cross compiling. 2011-02-11 20:09:26 +00:00
José Fonseca
982609f4cf scons: builtin_glsl_function on windows needs bundled getopt. 2011-02-11 20:09:26 +00:00
José Fonseca
ae760279f1 scons: Try to support building 64bit binaries on 32bit windows. 2011-02-11 20:09:26 +00:00
José Fonseca
051f8bbfee scons: Fix MSVC 64bit build. 2011-02-11 20:09:26 +00:00
Brian Paul
3ee97ead0b mesa: remove some unused gl_shader fields 2011-02-11 12:00:51 -07:00
Brian Paul
413511f796 draw: tweak AA line texture minimum alpha
AA lines drawn as textured quads look a little better with this change.
Conformance/piglit tests still pass.
2011-02-11 12:00:51 -07:00
Brian Paul
da2e541218 svga: add max DMA size check in svga_winsys_buffer_create()
This fixes a problem when trying to use large (2K x 2K) texture
images.  We'll DMA the image in chunks.

Patch written by Jose.
2011-02-11 11:56:45 -07:00
Brian Paul
8c61799051 svga: remove old comment, remove extra whitespace 2011-02-11 11:54:55 -07:00
Tobias Jakobi
11f35aa418 glsl: Fix parallel build.
Broken since e0c1fc3283.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-02-11 10:36:14 -08:00
José Fonseca
6ed0f2ac11 svga: Enable the draw pipeline for smooth lines.
Spotted by Brian Paul.
2011-02-11 11:24:55 +00:00
José Fonseca
57a3d36a68 svga: Don't use the draw pipeline for non-AA lines with a fractional width.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
4586e6c8cb draw: Don't use the pipeline when drawing lines with fractional widths.
Spotted by Jakob Bornecrantz.
2011-02-11 11:24:55 +00:00
José Fonseca
7ac2db893a llvmpipe: Use u_math's round. 2011-02-11 11:24:54 +00:00
José Fonseca
151faa2258 util: Define round and roundf on MSVC. 2011-02-11 11:11:33 +00:00
José Fonseca
f0ca9f7134 svga: Stippled lines can also be drawn with triangles. 2011-02-11 07:48:05 +00:00
Marek Olšák
de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +01:00
Haitao Feng
3104e5cb4f egl_dri2: rename loader_extension to dri2_loader_extension
Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-10 23:41:21 -05:00
Benjamin Franzke
9f213f6a4a st/egl wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
51f2820922 egl_dri2 wayland: Sync front buffer release 2011-02-10 23:07:01 -05:00
Benjamin Franzke
4e8f95f64d egl_dri2: Always unbind old contexts
This fixes __DRIdrawable refcounting.
Binding a context increases their refcount,
so we need to decrease it.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
87dde5b1cd egl_dri2: Use double buffering for window surfaces 2011-02-10 23:07:01 -05:00
Benjamin Franzke
71fa227029 st/dri: Set render_buffer in dri_fill_st_visual
st/mesa/st_managaer.c needs render_buffer in order
to determinde which buffer should be rendered to.
2011-02-10 23:07:01 -05:00
Benjamin Franzke
fa3283cca8 st/dri: img_from_renderbuf: Fix incorrect usage of dri_context() 2011-02-10 23:07:01 -05:00
Benjamin Franzke
0acb31be17 st/dri: Fix surfaceless gl using contexts with previous bound surfaces
ctx->dPriv might be != NULL then draw which is NULL is accessed:

struct dri_drawable *draw = dri_drawable(driDrawPriv);
[..]
if (ctx->dPriv != driDrawPriv) {
      ctx->dPriv = driDrawPriv;
      draw->texture_stamp = driDrawPriv->lastStamp - 1;
}
2011-02-10 23:07:01 -05:00
Benjamin Franzke
c79a5a7067 st/egl wayland: Set color_format according to wl_visual 2011-02-10 23:07:01 -05:00
Dave Airlie
596684eb93 r600g: get correct height alignment
useful for s3tc
2011-02-11 13:47:35 +10:00
Dave Airlie
9d85aba0e3 r600g: drop two unused | 0 that are actually in word4 anyways.
these were NOPs anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:35 +10:00
Dave Airlie
0d851f6e9c r600g: handle 16/32 u/s norm formats properly
add support for the 32-bit types, also fixup the
export setting to handle types with channels > 11 bits properly

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-11 13:47:34 +10:00
Marek Olšák
9a1fe76a20 r300g: prevent NULL pointer dereference in r300_buffer_create
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=33185
2011-02-11 03:18:05 +01:00
Kenneth Graunke
2e8726f5b1 mesa: Remove empty header file s_trispan.h. 2011-02-10 17:37:01 -08:00
Kenneth Graunke
e0c1fc3283 glsl/Makefile: glcpp doesn't need libglsl.a.
Also, add a 'glcpp' target so you can type 'make glcpp' instead of
'make glcpp/glcpp'.
2011-02-10 17:37:01 -08:00
Marek Olšák
032b162ce8 r300g: plug a memory leak in winsys 2011-02-11 02:34:15 +01:00
Marek Olšák
862ebb411b r300g: remove unneeded code in winsys
We don't need the read/write flags.
2011-02-11 01:32:44 +01:00
Marek Olšák
98f344c504 r300g: fix warning 2011-02-11 01:18:53 +01:00
Marek Olšák
7da5105fb3 configure.ac: remove libdrm_radeon dependency for r300g and r600g 2011-02-11 01:16:06 +01:00
Marek Olšák
6ccab620a0 r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.

The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.

Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency

I'm surprised that this has resulted in less code in the end.
2011-02-11 01:07:25 +01:00
Marek Olšák
c0beaf6e6d st/mesa: allow rendering to sRGB textures if EXT_fb_srgb is unsupported
In this case, we always use the corresponding linear format in create_surface,
therefore we should check for linear format support as well.
2011-02-11 01:07:21 +01:00
Ian Romanick
4c1dc1c4d7 i915: Force lowering of all types of indirect array accesses in the FS
NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
Ian Romanick
53b8b68843 i915: Calculate partial result to temp register first
Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-10 13:26:49 -08:00
José Fonseca
05a16b8e1c u_upload_mgr: Use PIPE_TRANSFER_FLUSH_EXPLICIT.
This can avoid DMAing the whole buffer when just a fraction was changed.
2011-02-10 20:55:10 +00:00
José Fonseca
d60f07489e scons: Disable -mstackrealign on MinGW again.
It's still broken, however it doesn't show up on debug builds.
2011-02-10 16:29:10 +00:00
Kristian Høgsberg
1a8899d630 configure.ac: Fix typo 2011-02-10 10:45:27 -05:00
Marek Olšák
fea4ad8f66 r300g: implement accelerated copy_region for compressed formats 2011-02-10 11:27:35 +01:00
Marek Olšák
7c24a4c6a8 r300g: add a way to change texture properties arbitrarily
So that we can implement resource_copy on arbitrary data.
2011-02-10 11:27:35 +01:00
Marek Olšák
56ba7e913f r300g: consolidate buffers and textures to r300_resource
Transfers and create/destroy are still handled separately.
2011-02-10 11:27:35 +01:00
Marek Olšák
ce9c0d2801 r300g: simplify WRITE_RELOC API and cleanup 2011-02-10 11:27:35 +01:00
Marek Olšák
ac366af9fd u_blitter: let the driver check whether there's a recursion 2011-02-10 11:27:34 +01:00
Marek Olšák
fc9170d0cf r300g: use format from pipe_surface instead of pipe_resource 2011-02-10 02:11:38 +01:00
Marek Olšák
2314a2f45f Revert "r300g: support sRGB colorbuffers"
This partially reverts commit 91eba2567e.

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2011-02-10 01:43:27 +01:00
Dave Airlie
21b0996dfc mesa/st: enable GL_EXT_framebuffer_sRGB
If the formats don't match we need to update the surface with the new
format.

if we can render to SRGB formats, enable the extension

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-10 10:14:27 +10:00
José Fonseca
3b8bb7b449 scons: Restrict whole program optimization to release builds.
It just takes forever, so it is inadequate for continuous testings
(i.e., checked and profile build types).
2011-02-09 18:31:21 +00:00
José Fonseca
2d95885308 svga: Don't advertise pixel shader addr register support.
It's not fully supported.
2011-02-09 18:31:21 +00:00
Kristian Høgsberg
04c5cc5b8b eglplatform.h: Define Wayland native platform types
This is conditional on WL_EGL_PLATFORM being #defined, so application
must make sure to include wayland-egl.h before including any egl header.
2011-02-09 10:58:20 -05:00
Christoph Bumiller
b6e3130a3b nvc0: serialize on PIPE_FLUSH_RENDER_CACHE as well
Effects were easily visible in piglit/fbo-generatemipmap-formats.
2011-02-09 16:05:00 +01:00
Christoph Bumiller
fc798dc37d nvc0: fix stride of NVC0_3D_RT methods 2011-02-09 16:05:00 +01:00
Christoph Bumiller
95f0aa0e52 nvc0: correct storage type for 16 bit surface formats 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0bd04cdd12 nvc0: make CSE work for ops with multiple results 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0691530b7f nvc0: replace branching with predicated insns where feasible 2011-02-09 16:05:00 +01:00
Christoph Bumiller
0f776fea43 nvc0: implement local memory load and store ops 2011-02-09 16:05:00 +01:00
Christoph Bumiller
4124feabcb nvc0: make sure phi-ops really have one source per in-block 2011-02-09 16:05:00 +01:00
Christoph Bumiller
7401590ded nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
c485368efe nvc0: do not generate a backwards jump if a loop ends with BRK 2011-02-09 16:05:00 +01:00
Christoph Bumiller
8e240e6153 nvc0: store only one value per basic block for TGSI regs 2011-02-09 16:05:00 +01:00
Christoph Bumiller
d5263e4093 nv50,nvc0: fix condition code change when commuting SET sources 2011-02-09 16:04:59 +01:00
Christoph Bumiller
8f05134580 nvc0: set basic block on manual instruction insertion 2011-02-09 16:04:59 +01:00
Christoph Bumiller
92d8af582d nvc0: try to fix register conflicts for vector instructions
Vector here means using multiple 32 bit regs which are forced to be
consecutive in the register file.

This still isn't quite nice.
2011-02-09 16:04:59 +01:00
Christoph Bumiller
c62fc50c88 nvc0: reset texture base address after read transfer 2011-02-09 16:04:59 +01:00
Christoph Bumiller
d3ea15f5ca nvc0: don't combine memory loads across block boundaries 2011-02-09 16:04:59 +01:00
Christoph Bumiller
f0d7429623 nvc0: detect no-op MIN/MAX, do CSE earlier to succeed more often 2011-02-09 16:04:59 +01:00
Thomas Hellstrom
a7293cbe5c mesa/st: Clean up vertex buffer unreferencing
Avoid accessing draw module internal structures outside of the draw module.
Unreference vertex buffers in error path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-09 09:45:34 +01:00
Marek Olšák
c264786809 gallium/docs: fix typo 2011-02-09 05:21:20 +01:00
Brian Paul
f70c98b6a6 r200: add cast to silence warning 2011-02-08 19:25:04 -07:00
Brian Paul
3b0c2eb07c mesa: remove unused BITFIELD64 macros 2011-02-08 19:25:04 -07:00
Brian Paul
6f2f449414 mesa: remove _mesa_create_context_for_api()
Just add the gl_api parameter to _mesa_create_context().
2011-02-08 19:25:04 -07:00
Brian Paul
5e4ca1ccc9 mesa: remove _mesa_initialize_context_for_api()
Just add the gl_api parameter to _mesa_initialize_context().
2011-02-08 19:25:04 -07:00
Brian Paul
2634e92dc0 mesa: add/update VERBOSE_API logging 2011-02-08 19:20:43 -07:00
Brian Paul
7230e1a228 st/mesa: fix shader deletion regression
Fixes a regression from commit 5cbff0932e.
The problem is *some* glDrawPixels fragment programs need to be deleted,
but not all.  Use an explicit flag to indicate whether or not the program
needs to be deleted.

This should fix http://bugs.freedesktop.org/show_bug.cgi?id=34049
2011-02-08 18:23:59 -07:00
Kenneth Graunke
f6f04ae29c i965: Add missing DEFINE_BITS for brw dirty bits.
These are only used for debugging, but should be there.
Found by inspection.
2011-02-08 16:56:18 -08:00
Kenneth Graunke
58b7e37722 i965: Separate the BRW_NEW_(VS|WM)_CONSTBUF dirty bits.
These were incorrectly defined to the same value - likely due to a cut
and paste error.  Found by inspection.
2011-02-08 16:55:20 -08:00
Kenneth Graunke
71acbb54f4 i965: Rename a few more commands to match the documentation. 2011-02-08 16:06:47 -08:00
Benjamin Franzke
15598fbf42 st/egl: Fix platform selection
A break for case _EGL_PLATFORM_X11 is missing.
introduced by: 381ea0d67a
2011-02-08 15:16:31 -05:00
Eric Anholt
df8ca3e0ec i965: Remove pointless keying of WM state on VUE size. 2011-02-08 11:42:44 -08:00
Eric Anholt
76857e8954 mesa: Fix the Mesa IR copy propagation to not read past writes to the reg.
Fixes glsl-vs-post-increment-01.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-02-08 11:42:35 -08:00
Eric Anholt
60aab5f335 glsl: Disable the new copy propagation pass until it gets fixed.
It apparently regressed a bunch of ES2 cases.
2011-02-08 11:41:05 -08:00
Chad Versace
82f994f386 glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
From section 5.9 of the GLSL 1.20 spec:
   The operator modulus (%) is reserved for future use.

From section 5.8 of the GLSL 1.20 spec:
   The assignments modulus into (%=), left shift by (<<=), right shift by
   (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
   operators are reserved for future use.

The GLSL ES 1.00 spec and GLSL 1.10 spec have similiar language.

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

Fixes Piglit tests:
spec/glsl-1.00/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.00/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.10/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.10/compiler/assignment-operators/modulus-assign-00.frag
spec/glsl-1.20/compiler/arithmetic-operators/modulus-00.frag
spec/glsl-1.20/compiler/assignment-operators/modulus-assign-00.frag
2011-02-08 09:37:03 -08:00
Marek Olšák
69e5516308 r600g: fixup assertion 2011-02-08 18:18:13 +01:00
Marek Olšák
71df812146 r600g: add a faster implementation of transfer_inline_write
u_default_transfer_inline_write uses util_copy_rect, which is kinda slow.
2011-02-08 17:47:00 +01:00
Marek Olšák
f0b202ec73 r600g: slab-allocate buffer and transfer structures 2011-02-08 17:30:39 +01:00
Marek Olšák
b541a3c4c0 r300g: use the same upload buffer for vertices and indices 2011-02-08 16:35:02 +01:00
Marek Olšák
467023e808 r600g: use the same upload buffer for vertices, indices, and constants
This should reduce memory consumption.
2011-02-08 16:35:02 +01:00
Thomas Hellstrom
8042470057 mesa/st: Plug a fragment program variant parameter leak
Fixes a minor memory leak with the "engine" mesa demo.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-02-08 08:13:39 -07:00
Brian Paul
5cbff0932e st/mesa: free the temporary bitmap/drawpix shader code
Fixes a per-shader memory leak when drawing glBitmaps, glDrawPixels
or glCopyPixels.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-08 08:10:22 -07:00
Marek Olšák
1ee71bdc8a u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer 2011-02-08 15:20:11 +01:00
Marek Olšák
7628c4ecb6 u_vbuf_mgr: remove tabs 2011-02-08 15:18:46 +01:00
Marek Olšák
f53cbf8bb0 u_vbuf_mgr: make the uploader public 2011-02-08 15:08:04 +01:00
Marek Olšák
d8d5c2660f Revert "r600g: do not flush the uploader" (with comments)
This reverts commit 1c2a4f0820.
2011-02-08 14:48:12 +01:00
Brian Paterni
4d78dafc84 r600g: silence a few valgrind warnings 2011-02-08 12:48:44 +01:00
Thomas Hellstrom
bb1036aae5 mesa/st: Fix vertex buffer leak
Make sure we unreference the vertex buffer pointers in a local array.
This fixes huge vertex buffer / memory leaks in mesa demos "fire" and "engine".

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-02-08 11:01:21 +01:00
Kristian Høgsberg
1e1b89103e wayland-egl: Add struct wl_egl_display argument to +wl_egl_window_create() 2011-02-07 20:50:18 -05:00
Henri Verbeet
077c448d18 r600g: Add support for relative addressing on constant buffers.
Relative addressing of constant buffers can't work properly through the
kcache, since you can only address within the currently locked kcache window.
Instead, this patch binds the constant buffer as a shader resource, and then
explicitly fetches the constant using a vertex fetch with fetch type
VTX_FETCH_NO_INDEX_OFFSET from the shader. There's probably still some room
for improvement, doing the fetch right before the instruction that needs the
value may not be quite optimal for example.
2011-02-07 15:22:08 +01:00
Henri Verbeet
871460eb14 r600g: Set the fetch type in r600_bc_vtx_build(). 2011-02-07 15:22:08 +01:00
Henri Verbeet
4c30a80e38 r600g: Handle the ADD_INT instruction in r600_bc_get_num_operands(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
5c59eebfae r600g: Generalize the pipe_add_vertex_attrib() functions.
This allows them to be used for VS or PS buffer resources as well.
2011-02-07 15:22:07 +01:00
Henri Verbeet
b9fd1a1e4b r600g: Remove vs_resource and ps_resource from the pipe context.
These are practically unused, only the vs_resource array is being abused for
fetch shader resources.
2011-02-07 15:22:07 +01:00
Henri Verbeet
7687eabaa0 r600g: Split constants in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
1fa95c7f9e r600g: Do the tgsi_full_src_register to r600_shader_src conversion in r600_shader_from_tgsi(). 2011-02-07 15:22:07 +01:00
Henri Verbeet
a77e813de3 r600g: Split r600_bc_alu_src.
The r600_bc_alu_src structure is used in two different ways, as a vector and
for the individual channels of that same vector. This is somewhat fragile,
and probably confusing.
2011-02-07 15:22:07 +01:00
Henri Verbeet
3b1c1f0253 r600g: Store literal values in the r600_bc_alu_src structure.
This is much easier to work with, and allows use to get rid of some of the
literal handling hacks.
2011-02-07 15:22:07 +01:00
Henri Verbeet
80235d92e6 r600g: tgsi_dst() can't fail. 2011-02-07 15:22:07 +01:00
Henri Verbeet
d0f2ffad76 r600g: tgsi_src() can't fail. 2011-02-07 15:22:07 +01:00
Kristian Høgsberg
56758c839f wayland-egl: Force roundtrips to get device name and authenticate correctly
If the client hasn't done the initial wl_display_iterate() at the time
we initialize the display, we have to do that in platform_wayland.c.
Make sure we detect that correctly instead of dup()ing fd=0, and use
the sync callback to make sure we don't wait forever for authorization that
won't happen.
2011-02-07 14:01:31 +01:00
Benjamin Franzke
93aea84f47 egl_dri2: Add wayland platform 2011-02-07 14:01:31 +01:00
Benjamin Franzke
9630437fc9 egl_dri2: Export dri2_get_driver_for_fd 2011-02-07 14:01:31 +01:00
Benjamin Franzke
a8128d7d4b egl_dri2: Enable pixmap bind_to_texture according to the extension 2011-02-07 14:01:30 +01:00
Benjamin Franzke
381ea0d67a st/egl: Add wayland platform 2011-02-07 14:01:16 +01:00
Benjamin Franzke
9b6dc9b7a4 st/egl: drm_image: Check for MESA_drm_image
MESA_drm_image isnt limited to drm platform,
others can enable the extension too.
2011-02-07 13:55:29 +01:00
Benjamin Franzke
464cb3a09e st/egl: native_helper: Add resource_surface_import_resource 2011-02-07 13:55:29 +01:00
Benjamin Franzke
214fc6e850 egl: Implement libwayland-egl
This library is required and defined by wayland for
EGL implementations supporting wayland.
2011-02-07 13:55:20 +01:00
Benjamin Franzke
e586c4b763 egl: Add wayland platform 2011-02-07 13:52:29 +01:00
Benjamin Franzke
2adfde3aae intel: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
f8e939a3a7 st/dri: Implement dri2::{Allocate,Release}Buffer 2011-02-07 13:52:28 +01:00
Benjamin Franzke
1b8ef9416b Add dri2::{Allocate,Release}Buffer extension 2011-02-07 13:52:28 +01:00
Marek Olšák
a22bda9f80 r600g: correctly report supported vertex formats 2011-02-07 03:51:53 +01:00
Marek Olšák
c95bc1224a r300g: use the new vertex buffer manager 2011-02-07 02:46:23 +01:00
Marek Olšák
aa8a2224a3 r600g: use the new vertex buffer manager 2011-02-07 02:46:17 +01:00
Marek Olšák
975320ab76 util: import a new vertex buffer manager
This code has originally matured in r300g and was ported to r600g several
times. It was obvious it's a code duplication.

See also comments in the header file.
2011-02-07 02:23:46 +01:00
Marek Olšák
1c2a4f0820 r600g: do not flush the uploader 2011-02-06 21:13:58 +01:00
Marek Olšák
529d867207 r300g: do not flush the uploader
We don't have to unmap and recreate the upload buffer when a flush occurs.
This should also prevent buffer allocations from failing.
2011-02-06 21:12:51 +01:00
Marek Olšák
ec96b0ecdb configure.ac: correctly check for libdrm_radeon version 2011-02-06 15:47:00 +01:00
Marek Olšák
4ad3b27cee r300g: RS400 doesn't have ZMASK 2011-02-06 15:46:51 +01:00
Dave Airlie
780c183b8f r600g: use surface format not underlying texture format
This uses the surface format to set the CB up not the underlying texture
format, since these can and do differ.

Fixes piglit fbo-srgb.
2011-02-06 19:00:04 +10:00
Tom Stellard
68b701f5de r300/compiler: Disable register rename pass on r500
The scheduler and the register allocator are not good enough yet to deal
with the effects of the register rename pass.  This was causing a 50%
performance drop in Lightsmark.  The pass can be re-enabled once the
scheduler and the register allocator are more mature.  r300 and r400
still need this pass, because it prevents a lot of shaders from using
too many texture indirections.

NOTE: This is a candidate for the 7.10 branch.
2011-02-05 22:39:58 -08:00
Tom Stellard
19202284c0 r300/compiler: Don't count BEGIN_TEX instructions in the compiler stats 2011-02-05 00:27:24 -08:00
Dave Airlie
88ffa9ce5b mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)
This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new
constant to say that the driver can support sRGB enabled FBOs since enabling
the extension doesn't mean the driver can actually support sRGB.

Also adds the suggested state flush in the core code suggested by Brian.

fix the ARB_fbo color encoding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-05 17:06:30 +10:00
Ian Romanick
5c3f1cdbbe mesa: Fix error checks in GetVertexAttrib functions
Querying index zero is not an error in OpenGL ES 2.0.

Querying an index larger than the value returned by
GL_MAX_VERTEX_ATTRIBS is an error in all APIs.

Fixes bugzilla #32375.
2011-02-04 12:10:05 -08:00
Ian Romanick
ce9171f9d8 linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present.

Fixes bugzilla #32214.
2011-02-04 12:10:04 -08:00
Vinson Lee
425ba19832 glsl: Add opt_copy_propagation_elements.cpp to SConscript.
Fixes SCons build.
2011-02-04 11:47:01 -08:00
Eric Anholt
1b80622c4e i965: Drop the dead tracking of color_regions[].
We pull the draw regions right out of the renderbuffers these days.
2011-02-04 12:18:38 -06:00
Eric Anholt
95cdce7f70 i965: Drop the INTEL_DEBUG=state spam about the cache size check.
There's way more interesting info in INTEL_DEBUG=state if you could find
it among the state size checks.
2011-02-04 12:18:38 -06:00
Eric Anholt
29a2e9133e glsl: Remove extra checks for constant true assignment conditions.
These are already stripped by opt_constant_folding.cpp.
2011-02-04 12:18:38 -06:00
Eric Anholt
b6d49ab843 glsl: Fix a comment typo in copy propagation. 2011-02-04 12:18:38 -06:00
Eric Anholt
e31266ed3e glsl: Add a new opt_copy_propagation variant that does it channel-wise.
This patch cleans up many of the extra copies in GLSL IR introduced by
i965's scalarizing passes.  It doesn't result in a statistically
significant performance difference on nexuiz high settings (n=3) or my
demo (n=10), due to brw_fs.cpp's register coalescing covering most of
those extra moves anyway.  However, it does make the debug of wine's
GLSL shaders much more tractable, and reduces instruction count of
glsl-fs-convolution-2 from 376 to 288.
2011-02-04 12:18:38 -06:00
Vinson Lee
cde443e0b9 ralloc: Add missing va_end following va_copy. 2011-02-03 22:10:16 -08:00
Dave Airlie
3188a7deb3 r600g: don't set tile_type on evergreen.
Since we never bind the actual DB to the CB/texture only the flushed one
we don't need to track the tile type at the moment.
2011-02-04 15:26:41 +10:00
Dave Airlie
fdd35dc912 r600g: fix evergreen sampler view + depth interaction 2011-02-04 15:26:09 +10:00
Vinson Lee
9ee765197c util: Change u_get_transfer_vtbl usage argument type to match prototype.
The type of u_get_transfer_vtbl of the usage argument in u_transfer.h is
unsigned and not enum pipe_transfer_usage. This patch changes the type
of usage to unsigned to match the prototype in the header file.
2011-02-03 20:15:25 -08:00
Vinson Lee
61c59234f9 glsl: Add using statements for standard library functions.
Standard library functions in C++ are in the std namespace. When using
C++-style header files for the standard library, some compilers, such as
Sun Studio, provide symbols only for the std namespace and not for the
global namespace.

This patch adds using statements for standard library functions. Another
option could have been to prepend standard library function calls with
'std::'.

This patch fixes several compilation errors with Sun Studio.
2011-02-03 19:19:12 -08:00
Dave Airlie
151a945d38 r600g: get offset for correct texture when setting up CB.
this fixes the mipmap tests with tiling forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:38:01 +10:00
Dave Airlie
812c314e51 r600g: avoid trying to flush the flushing texture.
Since these textures still have the depth bit set.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:36:02 +10:00
Dave Airlie
8c643446f9 r600g: evergreen CB check for flushed texture 2011-02-04 09:34:32 +10:00
Dave Airlie
2271c793e8 r600g: flushing texture needs all levels.
For mipmap generation we need all levels in the flushing texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
cd6864c079 r600g: remove unused variables 2011-02-04 09:09:45 +10:00
Dave Airlie
3e9bc43fba r600g: add a flag to just create flushed texture without flushing.
This just adds a flag to create the texture without doing any
flushing to it. Flushing occurs in the draw function. This avoids
unnecessary flushes when we end up rebinding a CB/DB/texture due
to the blitter just restoring state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:45 +10:00
Dave Airlie
446bc12c17 r600g: also check CB bindings for textures to depth flush.
This checks the color buffer bindings to make sure there is something
to flush.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Dave Airlie
4b49fcbb9a r600g: flush depth texture before a blit from it.
If we are going to blit from a depth texture we need to flush
it before we blit from it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-04 09:09:44 +10:00
Brian Paul
5026841d5e svga: rename a couple sampler, sampler view functions 2011-02-03 14:22:21 -07:00
Brian Paul
e40252d4d9 gallium/svga: added debug code for dumping framebuffer images (disabled) 2011-02-03 14:22:21 -07:00
Brian Paul
73e37d933d gallium/docs: more info about setting samplers and sampler views
Plus other assorted clarifications.
2011-02-03 13:47:12 -07:00
Brian Paul
c5fb2c60bf cso: don't tell drivers to bind null samplers, sampler views
Before, the set_sampler_views() and restore_sampler_views() functions
used MAX2(old,new) to tell the driver how many samplers or sampler
views to set.  This could result in cases such as:

pipe->set_fragment_sampler_views(pipe, 4, views={foo, bar, NULL, NULL})

Many/most gallium drivers would take this as-is and set
ctx->num_sampler_views=4 and ctx->sampler_views={foo, bar, NULL, NULL, ...}.
Later, loops over ctx->num_sampler_views would have to check for null
pointers.  Worse, the number of sampler views and number of sampler CSOs
could get out of sync:

ctx->num_samplers = 2
ctx->samplers = {foo, bar, ...}
ctx->num_sampler_views = 4
ctx->sampler_views={Foo, Bar, NULL, NULL, ...}

So loops over the num_samplers could run into null sampler_views pointers
or vice versa.

This fixes a failed assertion in the SVGA driver when running the Mesa
engine demo in AA line mode (and possibly other cases).

It looks like all gallium drivers are careful to unreference views
and null-out sampler CSO pointers for the units beyond what's set
with the pipe::bind_x_sampler_states() and pipe::set_x_sampler_views()
functions.

I'll update the gallium docs to explain this as well.
2011-02-03 13:47:11 -07:00
Henri Verbeet
a6a710cbe7 r600g: Make some more things static. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d06b990096 r600g: Get rid of the unused r600_cf_vtx_tc() function. 2011-02-03 21:13:12 +01:00
Henri Verbeet
d17d03a8dc r300g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Henri Verbeet
126e98966d r600g: Make the buffer and texture vbtls static const. 2011-02-03 21:13:12 +01:00
Alex Deucher
4668ad36f3 egl_dri2: Add new radeon pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-03 14:35:54 -05:00
Kristian Høgsberg
9dc5de5bb1 egl_dri2: Split out drm platform implementation to a separate file 2011-02-03 11:59:38 -05:00
Kristian Høgsberg
2889d9640f egl_dri2: Split out x11 platform code 2011-02-03 11:59:38 -05:00
Haitao Feng
b43a147128 swrast: add an interface createNewContextForAPI
This new interface could set up context for OpenGL,
OpenGL ES1 and OpenGL ES2. It will be used by egl_dri2
driver.

Signed-off-by: Haitao Feng <haitao.feng@intel.com>
2011-02-03 11:59:30 -05:00
José Fonseca
610c24b19d svga: Fix resource leak; undo temporary workaround.
Leak was introduced when fixing strict aliasing violation in this code:
the reference counting was preserved, but the destructor call on zero
reference count was not.
2011-02-03 16:14:02 +00:00
José Fonseca
0f3eeb45c7 svga: Temporarily disable buffer DMA upload coalescing.
See comment for more details.
2011-02-03 15:15:23 +00:00
José Fonseca
637ed52f59 svga/drm: Flushing preemptively on a 1/3 of the aperture.
Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.
2011-02-03 15:15:23 +00:00
José Fonseca
b6b6b8f8bb util: Prevent transfer dangling pointer on map failure. 2011-02-03 15:15:23 +00:00
José Fonseca
5c296a583d svga: Don't call swc->flush directly.
Only svga_context_flush should do it, to ensure upload commands are not
submitted to hardware in an inconsistent state.
2011-02-03 15:15:23 +00:00
José Fonseca
9d4488e4a8 svga: Add an assert to catch reentrancy. 2011-02-03 15:15:23 +00:00
José Fonseca
63c0a504a0 svga/drm: Update for pb_vtbl::map argument addition. 2011-02-03 15:15:23 +00:00
Michel Dänzer
7535f93e5a r300c: Unbreak after R4xx support was added to r300/compiler. 2011-02-03 13:25:16 +01:00
José Fonseca
82e79e93ac scons: Eliminate libgcc_s_sjlj-1.dll dependency
Certain mingw32 cross compilers (e.g. RedHat's) defaults to use DLL gcc
runtime.

Given the main deliverable from this project are self-contained drivers,
which are loaded by any application, this dependency can cause havoc.
2011-02-03 09:16:49 +00:00
Dave Airlie
aa31a5cbc7 r600g: flush differences back to DB copy. 2011-02-03 14:19:52 +10:00
Dave Airlie
417cfa60b2 r600g: fix depth hw resource copies.
With the previous fixes we can now enabled hw depth copies

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:19:37 +10:00
Dave Airlie
5730d56549 r600g: only set depth bit for hw accessible depth buffers.
If we get a sw accessible buffer like the S8 texture we end up
doing depth tracking on it when there is no need since we won't
ever bind it to the hardware. This leads to a sw fallback in the
transfer destruction which leads to and endless recusion loop
of fail in transfer destroy.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:18:01 +10:00
Dave Airlie
b13b7b86b2 r600g: rework dirty / depth texture tracking.
this adds a flag to keep track of whether the depth texture structure
is the flushed texture or not, so we can avoid doing flushes when
we do a hw rendering from one to the other.

it also renames flushed to dirty_db which tracks if the DB copy
has been dirtied by being bound to the hw.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-03 14:17:05 +10:00
Dave Airlie
d0293290ad r600g: set correct pitch/offset for depth textures in flushed state.
This fixes zreaddraw in tiling mode
2011-02-03 14:12:32 +10:00
Brian Paul
4629be0509 softpipe: rename sampler[] -> fragment_samplers[] 2011-02-02 20:43:56 -07:00
Brian Paul
843f206a34 softpipe: rename fragment sampler/view fields
To be consistant with vertex, geometry sampler fields.
2011-02-02 20:30:56 -07:00
Brian Paul
c06fa98c86 cso: refactor texture sampler and sampler view code
This consolidates the code duplicated between the fragment sampler
and vertex sampler functions.  Plus, it'll make adding support for
geometry shader samplers trivial.
2011-02-02 20:28:00 -07:00
Brian Paul
5f30e0b231 cso: rename fragment sampler-related fields
To better distinguish from vertex sampler fields.
2011-02-02 18:14:48 -07:00
Brian Paul
d087cfaabf cso: fix loop bound in cso_set_vertex_samplers()
Before we were looping to nr_samplers, which is the number of fragment
samplers, not vertex samplers.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 18:11:30 -07:00
Chad Versace
fd1252ab67 glcpp: Raise error when modulus is zero
For example, this now raises an error:
   #define XXX 1 / 0

Fixes bug: https://bugs.freedesktop.org//show_bug.cgi?id=33507
Fixes Piglit test: spec/glsl-1.10/preprocessor/modulus-by-zero.vert

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 10:19:51 -08:00
Chad Versace
e7c1f058d1 glsl: Avoid division-by-zero during constant-folding
Avoid division-by-zero when constant-folding the following expression
types:
    ir_unop_rsq
    ir_binop_div
    ir_binop_mod

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

Fixes Piglit tests:
glslparsertest/glsl2/div-by-zero-01.frag
glslparsertest/glsl2/div-by-zero-02.frag
glslparsertest/glsl2/div-by-zero-03.frag
glslparsertest/glsl2/modulus-zero-01.frag
glslparsertest/glsl2/modulus-zero-02.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:55:35 -08:00
Chad Versace
b3cf92aa91 glsl: Fix constant-folding for reciprocal expressions
Do not constant-fold a reciprocal if any component of the reciprocated
expression is 0. For example, do not constant-fold `1 / vec4(0, 1, 2, 3)`.

Incorrect, previous behavior
----------------------------
Reciprocals were constant-folded even when some component of the
reciprocated expression was 0. The incorrectly applied arithmetic was:
   1 / 0 := 0
For example,
   1 / vec4(0, 1, 2, 3) = vec4(0, 1, 1/2, 1/3)

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-02 09:54:52 -08:00
José Fonseca
50278c0901 svga: Flush upload buffers or we get asserts
Based on work from Jakob Bornecrantz, Michel Dänzer, and Brian Paul.
2011-02-02 11:28:41 +00:00
Kenneth Graunke
dfdb9fda82 glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.
This has probably existed since e5e34ab18e or so.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 23:53:39 -08:00
Kenneth Graunke
cfd8d45ccd glsl: Fix invalid use of ralloc_asprintf in prototype_string.
This was my mistake when converting from talloc to ralloc.  I was
confused because the other calls in the function are to asprintf_append
and the original code used str as the context rather than NULL.

Fixes bug #33823.
2011-02-01 23:31:35 -08:00
Christian König
8ca3b140eb r600g: use burst exports in shaders
Join multiple exports into just one instruction
instead of exporting each register separately.
2011-02-02 01:33:03 +01:00
Alex Deucher
8503cffc4c r200: remove 0x4243 pci id
There's no such device.  0x4243 is a pci bridge id,
not a GPU.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-02-01 19:13:54 -05:00
Ian Romanick
a04582739e i915: Only mark a register as available if all components are written
Previously a register would be marked as available if any component
was written.  This caused shaders such as this:

  0: TEX TEMP[0].xyz, INPUT[14].xyyy, texture[0], 2D;
  1: MUL TEMP[1], UNIFORM[0], TEMP[0].xxxx;
  2: MAD TEMP[2], UNIFORM[1], TEMP[0].yyyy, TEMP[1];
  3: MAD TEMP[1], UNIFORM[2], TEMP[0].zzzz, TEMP[2];
  4: ADD TEMP[0].xyz, TEMP[1].xyzx, UNIFORM[3].xyzx;
  5: TEX TEMP[1].w, INPUT[14].xyyy, texture[0], 2D;
  6: MOV TEMP[0].w, TEMP[1].wwww;
  7: MOV OUTPUT[2], TEMP[0];
  8: END

to produce incorrect code such as this:

  BEGIN
  DCL S[0]
  DCL T_TEX0
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[0].xyz = MOV U[0]
  R[1] = MUL CONST[0], R[0].xxxx
  R[2] = MAD CONST[1], R[0].yyyy, R[1]
  R[1] = MAD CONST[2], R[0].zzzz, R[2]
  R[0].xyz = ADD R[1].xyzx, CONST[3].xyzx
  R[0] = MOV T_TEX0.xyyy
  U[0] = TEXLD S[0],R[0]
  R[1].w = MOV U[0]
  R[0].w = MOV R[1].wwww
  oC = MOV R[0]
  END

Note that T_TEX0 is copied to R[0], but the xyz components of R[0] are
still expected to hold a calculated value.

Fixes piglit tests draw-elements-vs-inputs, fp-kill, and
glsl-fs-color-matrix.  It also fixes Meego bugzilla #13005.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-02-01 13:43:36 -08:00
Ian Romanick
20d278a7ff mesa: glGetUniform only returns a single element of an array
Also return it as the correct type.  Previously the whole array would
be returned and each element would be expanded to a vec4.

Fixes piglit test getuniform-01 and bugzilla #29823.
2011-02-01 09:48:41 -08:00
José Fonseca
3c701f1d61 glsl: Fix printf_length() on MSVC. 2011-02-01 10:41:46 +00:00
Kenneth Graunke
a7d350790b glsl: Fix memory error when creating the supported version string.
Passing ralloc_vasprintf_append a 0-byte allocation doesn't work.  If
passed a non-NULL argument, ralloc calls strlen to find the end of the
string.  Since there's no terminating '\0', it runs off the end.

Fixes a crash introduced in 14880a510a.
2011-02-01 00:20:01 -08:00
Dave Airlie
11bc8991e9 r600g: just change tile type when buffer is set to depth.
Not 100% sure on this one, but this is how it should work,
the question is whether it will uncover other bugs elsewhere.
2011-02-01 14:38:45 +10:00
Dave Airlie
a112cc283d r600g: align the tiling modes with what the DDX and kernel expects.
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-01 14:23:35 +10:00
Dave Airlie
8b5a50b31c r600g: fix evergreen for depth decompress test 2011-02-01 13:06:35 +10:00
Dave Airlie
aee5f1e40c r600: only decompress depth when its tile type is wrong.
If the tile type for the buffer is 1 then its been bound to the
DB at some point, we need to decompress it, otherwise its only
been bound as texture/cb so don't do anything.

This fixes 5 piglit tests here on r600g.
2011-02-01 13:02:56 +10:00
Kenneth Graunke
3ef397dafc texture_builtins.py: Fix a warning about mixed tabs/spaces. 2011-01-31 16:41:34 -08:00
Dave Airlie
42b5f68198 r600g: start looking at evergreen tiling.
this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.
2011-02-01 10:36:57 +10:00
Henri Verbeet
d171ae086b r600g: Actually use the info from the flushed depth texture when creating a sampler view on a depth texture.
R600/R700 was using incorrect tiling information from the (compressed) depth
buffer. Evergreen worked anyway because tiling doesn't work.
2011-02-01 01:19:16 +01:00
Ian Romanick
5e19b5ad16 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-31 15:32:56 -08:00
Ian Romanick
14880a510a glsl: Reject shader versions not supported by the implementation
Previously we'd happily compile GLSL 1.30 shaders on any driver.  We'd
also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context.
This has been a long standing FINISHME in the compiler.

NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
e5e34ab18e glsl: Ensure that all GLSL versions are supported in the stand-alone compiler
NOTE: This is a candidate for the 7.9 and 7.10 branches
2011-01-31 15:32:56 -08:00
Ian Romanick
bf9850db22 glsl: Fix dependencies / linkage for glsl_compiler 2011-01-31 15:32:55 -08:00
Ian Romanick
09e15ac76a mesa: Initial size for secondary color array is 3
See table 6.7 on page 347 of the OpenGL 3.0 specification.
2011-01-31 15:32:55 -08:00
Christian König
7fb722c35c r600g: fix invalid ref count handling in r600_set_constant_buffer
Only decrement ref count if r600_upload_const_buffer
really changes the buffer.
2011-01-31 23:38:10 +01:00
Brian Paul
a8c144a388 llvmpipe: fix incorrect array index in image dump code 2011-01-31 14:09:24 -07:00
Brian Paul
a1f5c46d24 glsl: regerated files 2011-01-31 14:09:24 -07:00
Brian Paul
aacd07d623 glsl: make _token_list_is_empty_ignoring_space() static
To silence warning about missing prototype.
2011-01-31 14:09:24 -07:00
Brian Paul
3b8c7d70b3 scons/glsl: add top-level 'include' dir to CPPPATH
To avoid using the /usr/include/GL/gl.h file which may be lacking
some special #defines.
2011-01-31 14:09:24 -07:00
Brian Paul
59c957b688 glsl: add cast to silence signed/unsigned comparison warning 2011-01-31 14:09:24 -07:00
José Fonseca
3ae7aa3403 glsl: Define va_copy on MSVC. 2011-01-31 20:53:03 +00:00
Kenneth Graunke
0f7325b890 i965: Emit texel offsets in sampler messages. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ca418cbde6 glsl/builtins: Uncomment prototypes for texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
ba3de801ec texture_builtins.py: Generate texture*Offset functions. 2011-01-31 11:10:59 -08:00
Kenneth Graunke
4c63f2de2f texture_builtins.py: Generalize the "use_proj" field to support offsets.
Rather than passing "True", pass a bitfield describing the particular
variant's features - either projection or offset.

This should make the code a bit more readable ("Proj" instead of "True")
and make it easier to support offsets in the future.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
99f36486eb texture_builtins.py: Refactor coordinate dimension calculations.
For offsets, we'll want the straight sampler dimensionality, without the
+1 for array types.  Create a new function to do that; refactor.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
819d57fce9 glsl: Introduce a new "const_in" variable mode.
This annotation is for an "in" function parameter for which it is only legal
to pass constant expressions.  The only known example of this, currently,
is the textureOffset functions.

This should never be used for globals.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
c5a27b5939 glsl: Change texel offsets to a single vector rvalue.
Having these as actual integer values makes it difficult to implement
the texture*Offset built-in functions, since the offset is actually a
function parameter (which doesn't have a constant value).

The original rationale was that some hardware needs these offset baked
into the instruction opcode.  However, at least i965 should be able to
support non-constant offsets.  Others should be able to rely on inlining
and constant propagation.
2011-01-31 11:10:59 -08:00
Kenneth Graunke
60c8e91c79 glsl: Re-synchronize ir_variable_mode and the printer's string array.
Since the introduction of ir_var_system_value, system variables would be
printed as "temporary" and temporaries would result in out-of-bounds
array access, showing up as garbage in printed IR.
2011-01-31 11:04:37 -08:00
Vinson Lee
8c115aa247 scons: Gracefully handle pkg-config errors with libdrm_radeon.
Print warnings and continue build.
2011-01-31 10:50:06 -08:00
Kenneth Graunke
1568b19e3b Remove the talloc sources from the Mesa repository. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
8aac5d123c Remove talloc from the SCons build system. 2011-01-31 10:17:10 -08:00
Kenneth Graunke
d1d8120545 Remove talloc from the make and automake build systems. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
42fd9c2ebb ralloc: a new MIT-licensed recursive memory allocator. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
d3073f58c1 Convert everything from the talloc API to the ralloc API. 2011-01-31 10:17:09 -08:00
Kenneth Graunke
dc55254f5b ralloc: Add a fake implementation of ralloc based on talloc. 2011-01-31 10:17:09 -08:00
Henri Verbeet
7d9e0ea739 glx: Properly check for a valid fd in dri2CreateScreen().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 10:54:04 -07:00
Michel Dänzer
5a1ce49c82 svga: Fix translation of TGSI SSG opcode.
SVGA3D only supports SGN for vertex shaders, and this requires two additional
temporary registers for intermediate results.

For fragment shaders, lower to two CMPs and one ADD.
2011-01-31 17:47:57 +01:00
Michel Dänzer
11c11ee0bc svga: TEXLDL opcode dst/src register information is correct. 2011-01-31 17:47:14 +01:00
Michel Dänzer
a61b7aa90d svga: Print the number and mnemonic of the opcode we're missing information for.
Makes it easier to figure out which opcode it's about.
2011-01-31 17:45:07 +01:00
Henri Verbeet
0b47d59e5b glx: Fix leaks in DRISW screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:24 -07:00
Henri Verbeet
0e8e8ba29a glx: Fix leaks in DRI screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:31:21 -07:00
Henri Verbeet
bfc889517a glx: Fix leaks in DRI2 screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:29:54 -07:00
Julien Cristau
cbe9fc12a6 glx: fix length of GLXGetFBConfigsSGIX
The extra length is the size of the request *minus* the size of the
VendorPrivate header, not the addition.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:55 -07:00
Julien Cristau
e27913f805 glx: fix GLXChangeDrawableAttributesSGIX request
xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:28:37 -07:00
Dave Airlie
ea5ede2178 r600g: fix eg OQ properly.
the context init is separate for these gpus.
2011-01-31 20:44:47 +10:00
Alex Deucher
26a4c1cb65 r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-31 02:49:27 -05:00
Dave Airlie
df8089df90 r600g: fix occlusion query results.
Like on some r5xx, there are multiple DB backends on the r600,
we need to add up the query results from each of these to get the
final correct value.

So far I'm not 100% sure how to calculate the num_db, value
setting it to 4 should be harmless enough until we do.

This fixes occulsion_query piglit test on my rv740.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 16:14:03 +10:00
Alex Deucher
2f7c876ff5 r600g: remove some non-existent evergreen reg fields
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-30 22:41:59 -05:00
Dave Airlie
065c8696e7 r600g: fix regression in cubemap tests since eea1d8199b
Although CUBE is a reduction inst, it writes to more than just PV.X
so we need to keep the dst channel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 13:06:17 +10:00
Dave Airlie
5555cd776b r600g: handle the write all cbufs property.
This only works on r600/r700 so far, evergreen doesn't appear
to have the multiwrite enable bit in the color control, so we
may have to actually do a shader rewrite on EG hardware.

remove some duplicate code reg defines also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 10:01:06 +10:00
Henri Verbeet
f668b464c0 util: Call tables should be const. 2011-01-30 18:59:13 +01:00
Henri Verbeet
38b54158b6 r600g: Update the flushed depth texture after drawing to the corresponding texture.
I know Jerome will probably rewrite the way depth textures work sometime
soon. For the time being this should at least make common depth texture usage
for shadowing work properly though.
2011-01-30 18:59:13 +01:00
Chia-I Wu
3f0a966807 st/vega: Disable blending when the paint is opaque.
When the paint is opaque (currently, solid color with alpha 1.0f), no
blending is needed for VG_BLEND_SRC_OVER.  This eliminates the serious
performance hit introduced by 859106f196
for a common scenario.
2011-01-30 23:22:40 +08:00
Chia-I Wu
e919dee1ed st/vega: Remove an invalid sanity check.
Before create_handle returns, obj->handle is 0.  Calling
handle_to_object will fail.
2011-01-30 23:22:40 +08:00
Chia-I Wu
05e5b53128 st/vega: s/vg[A-Z]/vega[A-Z]/. 2011-01-30 23:22:40 +08:00
José Fonseca
11b15c4d25 scons: We have C++ in several libraries, so always link with the C++ compiler
Prevents missing symbols in libGL.so when LLVM is disabled.
2011-01-30 11:19:44 +00:00
Vinson Lee
cad0520179 r600g: Fix void pointer arithmetic.
Fixes SCons build.
2011-01-30 01:08:54 -08:00
Dave Airlie
71f610e26e r600g: fixes a segfault in the piglit fbo-genmipmap-formats test.
should be no need to unset this ptr here and if we don't end up using the
blitter we've just broken the state.
2011-01-30 18:09:25 +10:00
Tom Stellard
8f32c6cfc6 r300/compiler: Standardize the number of bits used by swizzle fields
Swizzles are now defined everywhere as a field with 12 bits that contains
4 channels worth of meaningful information.  Any channel that is unused is
set to RC_SWIZZLE_UNUSED.  This change is necessary because rgb instructions
and alpha instructions were initializing channels that would never be used
(channel 3 for rgb and channels 1-3 for alpha) with 0 (aka RC_SWIZZLE_X).
This made it impossible to use generic helper functions for swizzles,
because sometimes a channel value of 0 meant unused and other times it
meant RC_SWIZZLE_X.

All hacks that tried to guess how many channels were relevant have
also been removed.
2011-01-29 21:32:02 -08:00
Marek Olšák
debc45bca0 r300g: upload translated indices via the uploader 2011-01-30 03:29:49 +01:00
Marek Olšák
8d0a540020 r300g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
3) Rename valid_vertex_buffer[] to real_vertex_buffer[]
2011-01-30 03:29:48 +01:00
Marek Olšák
77900843b4 r600g: upload translated indices via the uploader 2011-01-30 03:29:48 +01:00
Marek Olšák
73a40d1383 r600g: rework vertex format fallback
1) Only translate the [min_index, max_index] range.
2) Upload translated vertices via the uploader.
2011-01-30 03:29:48 +01:00
Marek Olšák
70e656b4eb r600g: fix vertex format fallback
This fixes:
- piglit/draw-vertices
- piglit/draw-vertices-half-float
2011-01-30 03:29:48 +01:00
Marek Olšák
8c631cfeae r600g: rework vertex buffer uploads
Only upload the [min_index, max_index] range instead of [0, userbuf_size].
This an important optimization.

Framerate in Lightsmark:
Before: 22 fps
After: 75 fps

The same optimization is already in r300g.
2011-01-30 03:29:48 +01:00
Marek Olšák
15730a8207 r600g: consolidate set_constant_buffer functions 2011-01-30 03:29:48 +01:00
Marek Olšák
73fb2b7c90 r600g: consolidate vertex_buffer_update functions 2011-01-30 03:29:48 +01:00
Marek Olšák
2d7738eb2b r600g: consolidate draw_vbo functions (v2)
Added a conditional to spi_update per Dave's comment.
2011-01-30 03:29:48 +01:00
Marek Olšák
5cefe1eddd r600g: make r600_drawl inherit pipe_draw_info 2011-01-30 03:29:48 +01:00
Marek Olšák
02f8f13464 r600g: add back u_upload_mgr integration
I can't see a performance difference with this code, which means all
the driver-specific code removed in this commit was unnecessary.

Now we use u_upload_mgr in a slightly different way than we did before it got
dropped. I am not restoring the original code "as is" due to latest
u_upload_mgr changes that r300g performance benefits from.

This also fixes:
- piglit/fp-kil
2011-01-30 03:29:48 +01:00
Christoph Bumiller
f8a7a0b6f3 nvc0: implement transform feedback state 2011-01-30 01:25:41 +01:00
Christoph Bumiller
7fd29468ec nvc0: enable PIPE_CAP_ARRAY_TEXTURES and fix them 2011-01-29 23:57:52 +01:00
Chia-I Wu
218381d927 egl_dri2: Export glapi symbols for DRI drivers.
When an app loads libEGL.so dynamically with RTLD_LOCAL, loading DRI
drivers would fail because of missing glapi symbols.  This commit makes
egl_dri2 load libglapi.so with RTLD_GLOBAL to export glapi symbols for
future symbol resolutions.

The same trick can be found in GLX.  However, egl_dri2 can only do so
when --enable-shared-glapi is given.  Because, otherwise, both libGL.so
and libglapi.so define glapi symbols and egl_dri2 cannot tell which
library to load.
2011-01-30 05:28:24 +08:00
Chia-I Wu
f36cba6cf3 egl: Make the transition to built-in drivers more smooth.
When the user sets EGL_DRIVER to egl_dri2 (or egl_glx), make sure the
built-in driver is used.  The user might leave the outdated egl_dri2.so
(or egl_glx.so) on the filesystem and we do not want to load it.
2011-01-30 04:55:08 +08:00
Chia-I Wu
b825e49552 mapi: Workaround a bug in makedepend.
makedepend would crash when a source includes a header indirectly, such
as

  #define HEADER "some-header.h"
  #include HEADER

Do not define HEADER (makedepend would detects this as an incomplete
include) and add the dependency manually in the Makefile.

This should hopefully fix bug #33374.
2011-01-29 19:22:54 +08:00
Marek Olšák
2a456dc123 u_blitter: use user buffers instead of real buffers
User buffers may be the fastest way to upload data.
2011-01-29 05:17:43 +01:00
Brian Paul
c5fb0518f4 gallium/docs: add info about transfer boxes and array textures 2011-01-28 20:25:27 -07:00
Brian Paul
f9a36a496f gallium: added comments to pipe_transfer 2011-01-28 20:25:27 -07:00
Brian Paul
1dd8e27578 st/mesa: fix texture array dimensions
For 1D/2D texture arrays use the pipe_resource::array_size field.
In OpenGL 1D arrays texture use the height dimension as the array
size and 2D array textures use the depth dimension as the array size.
Gallium uses a special array_size field instead.  When setting up
gallium textures or comparing Mesa textures to gallium textures we
need to be extra careful that we're comparing the right fields.

The new st_gl_texture_dims_to_pipe_dims() function maps OpenGL
texture dimensions to gallium texture dimensions and simplifies
this quite a bit.
2011-01-28 20:25:27 -07:00
Brian Paul
80777743b7 softpipe: fix array textures to use resource array_size
Don't use height for 1D array textures or depth for 2D array textures.
2011-01-28 20:25:27 -07:00
Brian Paul
b3cfcdf923 mesa: fix typo, wrap long line 2011-01-28 20:25:26 -07:00
Brian Paul
db3a8af7f9 st/mesa: pass layers param to st_texture_create() 2011-01-28 20:25:26 -07:00
Carl Worth
2a18d1950c Revert "glcpp: Demote "macro redefined" from an error to a warning"
This reverts commit d3df641f0a.

The original commit had sat unpushed on my machine for months. By the
time I found it again, I had forgotten that we had decided not to use
this change after all, (the relevant test was removed long ago).
2011-01-29 08:21:05 +10:00
Jakob Bornecrantz
3451ee056c util: Fix leak of transfers in upload manager 2011-01-28 22:10:53 +01:00
Brian Paul
e89fc33d7a docs: removed VC8 project files 2011-01-28 13:40:47 -07:00
Brian Paul
f247175e4a mesa: omit VC8 project files from tarball 2011-01-28 13:40:47 -07:00
Thierry Vignaud
d3d6beec96 Fix missing files in Mesa tarballs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-01-28 12:31:04 -08:00
Chad Versace
c494763579 mesa: Fix available APIs for AMD_conservative_depth
Remove ES2, since AMD_conservative_depth is not listed in the OpenGL ES
extension registry.
2011-01-28 11:19:51 -08:00
Marek Olšák
c6ace30028 r300/compiler: print stats based on the initial number of instructions
The same number of shaders is now printed regardless of optimizations being
enabled or not, so that we can compare shader stats side by side easily.
2011-01-28 19:37:31 +01:00
Marek Olšák
0029979eee r300g: fix resource_copy_region for DXT SRGB formats 2011-01-28 17:15:22 +01:00
Carl Worth
d3df641f0a glcpp: Demote "macro redefined" from an error to a warning
The GLSL specification is vague here, (just says "as is standard for
C++"), though the C specifications seem quite clear that this should
be an error.

However, an existing piglit test (CorrectPreprocess11.frag) expects
this to be a warning, not an error, so we change this, and document in
README the deviation from the specification.
2011-01-28 15:16:36 +10:00
Dave Airlie
476db2bd3d dri: add a placeholder for the framebuffer sRGB capable bit.
This is needed to build the X server GLX_EXT_framebuffer_sRGB bits.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-28 11:45:44 +10:00
Dimitry Andric
cfb9aae3ec glapi: add @GOTPCREL relocation type
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-27 18:04:57 -07:00
Marek Olšák
6dc0a0e71f r600g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:58:30 +01:00
Marek Olšák
588c925224 r300g: handle PIPE_CAP_ARRAY_TEXTURES 2011-01-28 01:56:57 +01:00
Marek Olšák
baf2a795eb r300g: 8x8-compressed zbuffer can only be point-sampled 2011-01-28 01:16:27 +01:00
Marek Olšák
2050f2ab96 r300g: fix and re-enable 8x8 zbuffer compression mode
Also cleanup the whole thing.
2011-01-28 01:04:51 +01:00
Marek Olšák
82e60236a9 r300g: print driver info if RADEON_DEBUG=info 2011-01-27 23:17:41 +01:00
Marek Olšák
39f16e2aa7 r300g: add winsys flag CAN_AACOMPRESS 2011-01-27 23:13:28 +01:00
Marek Olšák
2e3ccada07 r300g: rename flag squaretiling -> drm_2_1_0 2011-01-27 23:06:15 +01:00
Marek Olšák
e0b98cde41 docs: update GL3 status 2011-01-27 21:17:25 +01:00
Marek Olšák
387fe8dd47 util: fix parsing debug options
So that 'foo' can be found in: OPTION=prefixfoosuffix,foo

Also allow that debug options can be separated by a non-alphanumeric characters
instead of just commas.
2011-01-27 20:32:03 +01:00
Marek Olšák
db299a9f82 r300g: fix some bugs with zbuffer compression (v4)
This drops the memblock manager for ZMASK. Instead, only one zbuffer can be
compressed at a time. Note that this does not necessarily have to be slower.
When there is a large number of zbuffers, compression might be used more often
than it was before. It's also easier to debug.

How it works:
1) 'clear' turns the compression on.
2) If some other zbuffer is set or the currently-bound zbuffer is used
   for texturing, the driver decompresses it and then turns the compression off.

Notes:
- The ZMASK clear has been refactored, so that only one packet3 is used to clear
  ZMASK.
- The 8x8 compression mode is disabled. I couldn't make it work without issues.
- Also removed driver-specific stuff from u_blitter.

Driver status:
- RV530 and R580 appear to just work (finally).
- RV570 should work, but there may be an issue that we don't correctly
  calculate the number of dwords to clear, resulting in a partially
  uninitialized zbuffer.
- RS690 misrenders as if no ZMASK clear happened. No idea what's going on.
- RV350 may even hardlock. This issue was already present and this patch doesn't
  fix it.

I think we are still missing some hardware info we need to make the zbuffer
compression work fully.

Note that there is also an issue with HiZ, resulting in a sort of blocky
zigzagged corruption around some objects.
2011-01-27 18:12:01 +01:00
Brian Paul
7a4345fd83 glsl: use 'this' pointer to be consistent 2011-01-26 21:16:41 -07:00
Brian Paul
2b7be12d54 glsl: remove needless conditional 2011-01-26 21:16:32 -07:00
Brian Paul
86471246f0 glsl: move ir_var_out code 2011-01-26 21:16:14 -07:00
Brian Paul
7baa498ae4 glsl: move ir_var_system_value code 2011-01-26 21:15:52 -07:00
Brian Paul
304b239869 glsl: use local var to simplify code a bit 2011-01-26 21:15:39 -07:00
Zack Rusin
59dbdbbb7d mesa: fix compilation
this isn't c++ please don't mix declerations with code
2011-01-26 21:20:53 -05:00
Chad Versace
67c67ee80f glsl: Refresh autogenerated lexer file
For previous commit.
2011-01-26 16:37:45 -08:00
Chad Versace
cc4a787044 glsl: Remove extraneously extraneous parens
I found this parenthetical usage of parentheses to be extraneously
extraneous:
   (yyextra->ARB_fragment_coord_conventions_enable)
2011-01-26 16:37:45 -08:00
Chad Versace
ad3dc370d8 mesa: Allow extensions in MESA_EXTENSION_OVERRIDE to be prefixed with '+'
If an extension is prefixed with '+', attempt to enable it.  This
introduces symmetry with the prefix '-', which is already allowed.
2011-01-26 16:37:45 -08:00
Chad Versace
7cbcf4c583 mesa: Simplify logic in get_extension_override()
* Reduce max indentation level from 7 to 3.
* Eliminate counter variables.
* Remove function append().
2011-01-26 16:37:45 -08:00
Chad Versace
8ba260e099 glsl: Enable AMD_conservative_depth in parser
All the necessary compiler infrastructure for AMD_conservative_depth is in
place, so it's safe to enable it in the parser.
2011-01-26 16:37:45 -08:00
Chad Versace
a1b83464ff mesa: Propagate gl_FragDepth layout from GLSL IR to Mesa IR 2011-01-26 16:37:45 -08:00
Chad Versace
addae33d6b glsl: Raise linking error if gl_FragDepth layout is inconsistent
From the AMD_conservative_depth spec:
   If gl_FragDepth is redeclared in any fragment shader in a program, it
   must be redeclared in all fragment shaders in that program that have
   static assignments to gl_FragDepth. All redeclarations of gl_FragDepth in
   all fragment shaders in a single program must have the same set of
   qualifiers.
2011-01-26 16:37:45 -08:00
Chad Versace
bc04d244f5 glsl: Propagate depth layout qualifier from AST to IR 2011-01-26 16:37:44 -08:00
Chad Versace
5fc57f471b glsl: Define enum ir_depth_layout 2011-01-26 16:37:44 -08:00
Chad Versace
39cad66a88 glsl: Refresh autogenerated parser files
For commits titled:
glcpp: Conditionally define macro GL_AMD_conservative_depth
glsl: Add support for AMD_conservative_depth to parser
2011-01-26 16:37:44 -08:00
Chad Versace
fb5db0570c glsl: Add support for AMD_conservative_depth to parser
When AMD_conservative_depth is enabled:
* Let 'layout' be a token.
* Extend the production rule of layout_qualifier_id to process the tokens:
   depth_any
   depth_greater
   depth_less
   depth_unchanged
2011-01-26 16:37:44 -08:00
Chad Versace
565a22090c glsl: Add depth layout qualifiers to ast_type_qualifier 2011-01-26 16:37:44 -08:00
Chad Versace
0423f24eb8 glcpp: Conditionally define macro GL_AMD_conservative_depth
Define macro GL_AMD_conservative_depth to 1 when its extension is
enabled.
2011-01-26 16:37:44 -08:00
Chad Versace
1aeecaa433 mesa: Add AMD_conservative_depth to extension list
The extension is off by default.

First in a patchset that implements support for AMD_conservative_depth in
the compiler.
2011-01-26 16:37:44 -08:00
Brian Paul
8697dbdfbc tgsi: add cases for array textures
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33555
2011-01-26 16:22:32 -07:00
Kristian Høgsberg
3fe0185ba5 mesa: Support internalFormat=GL_BGRA for DRI drivers 2011-01-26 15:05:46 -05:00
Kristian Høgsberg
e28ecdee03 st/egl: Downgrade warning to debug when we can't create a drm screen
We try to load a DRI driver if this fails so don't confuse users.
2011-01-26 10:47:03 -05:00
Brian Paul
684c66bb8b mesa: fix MESA/EXT typo
Spotted by Bernd Buschinski.
2011-01-26 08:01:31 -07:00
Marek Olšák
c7c733545a util: require debug options to be separated by commas
Let's assume there are two options with names such that one is a substring
of another. Previously, if we only specified the longer one as a debug option,
the shorter one would be considered specified as well (because of strstr).
This commit fixes it by checking that each option is surrounded by commas.

(a regexp would be nicer, but this is not a performance critical code)
2011-01-26 10:48:21 +01:00
Zack Rusin
0657fc00dd gallium: add an interface for query predicates
as specified in the arb_occlusion_query2. just the interface.
2011-01-26 00:03:12 -05:00
Brian Paul
779e9cb658 softpipe: support for 1D/2D texture arrays 2011-01-25 20:27:10 -07:00
Brian Paul
9b56a2cb62 st/mesa: support for 1D/2D texture arrays 2011-01-25 20:26:22 -07:00
Brian Paul
c0d941877b tgsi: add support for 1D/2D texture arrays 2011-01-25 20:25:53 -07:00
Tormod Volden
903185bf3b configure.ac: define LIBDRM_INTEL_REQUIRED
To have the LIBDRM* requirements in one place

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 18:53:00 -07:00
Brian Paul
0bfd174fb5 mesa: remove isProxy local var 2011-01-25 18:53:00 -07:00
Brian Paul
365f658602 mesa: use texFormat local var in more places 2011-01-25 18:53:00 -07:00
Brian Paul
f322400970 mesa: consolidate error handling code in _mesa_GetTexLevelParameteriv() 2011-01-25 18:53:00 -07:00
Brian Paul
0f6b8e29ab mesa: consolidate error handling in set_tex_parameteri() 2011-01-25 18:53:00 -07:00
Brian Paul
f2dd11817a mesa: add checks for GL_EXT_texture_array
In case the driver enables GL_MESA_texture_array but not the EXT version.
2011-01-25 18:53:00 -07:00
Ian Romanick
0f4b2a0a23 linker: Propagate max_array_access while linking functions
Update the max_array_access of a global as functions that use that
global are pulled into the linked shader.

Fixes piglit test glsl-fs-implicit-array-size-01 and bugzilla #33219.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
c87e9ef4d2 linker: Set sizes for non-global arrays as well
Previously only global arrays with implicit sizes would be patched.
This causes all arrays that are actually accessed to be sized.

Fixes piglit test glsl-fs-implicit-array-size-02.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 13:41:26 -08:00
Ian Romanick
5c2cec8337 ir_to_mesa: Add several assertions about sizes of arrays
Both of these assertions are triggered by the test case in bugzilla
size of 0.
2011-01-25 13:41:26 -08:00
Brian Paul
9f2bf3d65c glsl: silence uninitialized var warning in read_texture()
And generate an error if the texture pattern is not matched.
2011-01-25 13:11:47 -07:00
Mathias Fröhlich
90c2fd8640 r600g: Implement timer queries. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
e7ec532735 r600g: Implement asyncronous query results. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich
b55fd961e1 r600g: Fix meaning of num_results for queries. 2011-01-25 14:18:19 -05:00
Tim Wiederhake
4102c7c7e2 fix potential leak in r600_context_init 2011-01-25 14:18:19 -05:00
Tim Wiederhake
9d41e5ee46 silences some valgrind warnings
==5547== Conditional jump or move depends on uninitialised value(s)
==5547==    at 0x8FE745D: r600_drm_winsys_create (r600_drm.c:86)
2011-01-25 14:18:19 -05:00
Brian Paul
ba0953da5b Revert "glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S"
This reverts commit 731ec60da3.

This change causes crashes in the x86-64 dispatch code.
2011-01-25 12:12:34 -07:00
Brian Paul
40ac24e631 softpipe: fix off-by-one error in setup_fragcoord_coeff()
If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:58:15 -07:00
Brian Paul
23490d7a8b st/mesa: add comments in emit_wpos() 2011-01-25 11:57:10 -07:00
Brian Paul
bb56631f0c st/mesa: fix incorrect fragcoord.x translation
emit_adjusted_wpos() needs separate x,y translation values.  If we
invert Y, we don't want to effect X.

Part of the fix for http://bugs.freedesktop.org/show_bug.cgi?id=26795

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-25 11:54:07 -07:00
Dimitry Andric
37bffe8d12 glapi: adding @ char before type specifier in glapi_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33433
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:23:46 -07:00
Dimitry Andric
731ec60da3 glapi: adding missing @GOTPCREL qualifer in glapi_x86-64.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-25 09:22:14 -07:00
Roland Scheidegger
7acb98c67c svga: link libwsw for dri-vmwgfx target with make build system too 2011-01-25 16:32:32 +01:00
Marek Olšák
02d7d9ec36 u_blitter: remove bogus assertion
The module uses the 3D engine, so it can blit non-compatible formats.
2011-01-25 05:51:49 +01:00
Marek Olšák
9a3523e38b u_blitter: report recursion, update comments 2011-01-25 05:51:49 +01:00
Vinson Lee
db4f6c7eeb nvc0: Move declaration before code.
Fixes nvc0 SCons build.
2011-01-24 20:04:31 -08:00
Zack Rusin
3fa814d7f8 gallium/tgsi: update the docs for the new opcodes a bit 2011-01-24 21:46:03 -05:00
Brian Paul
d30156525f mesa: add red, red/green formats in _mesa_base_fbo_format() 2011-01-24 19:38:52 -07:00
Brian Paul
62c66b3430 mesa: plug in fallback function for ctx->Driver.ValidateFramebuffer()
The software renderer doesn't support GL_ALPHA, GL_LUMINANCE, etc
so we should report GL_FRAMEBUFFER_UNSUPPORTED during FBO validation.
2011-01-24 19:38:52 -07:00
Brian Paul
976ea9d76b mesa: new cases in _mesa_base_fbo_format()
The set of internalFormat parameters accepted by glRenderBufferStorage
depends on the EXT vs. ARB version of framebuffer_object.  The later
added support for GL_ALPHA, GL_LUMINANCE, etc. formats.  Note that
these formats might be legal but might not be supported.  That should
be checked with glCheckFramebufferStatus().
2011-01-24 19:38:52 -07:00
Brian Paul
f41bbc7c44 Revert "mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages."
This reverts commit 65c41d55a0.

There really are quite a few differences in the set of internal
formats allowed by glTexImage and glRenderbufferStorage.
2011-01-24 19:38:52 -07:00
Vinson Lee
e24f1ea594 scons: Add nvc0 to SConscript. 2011-01-24 17:48:24 -08:00
Brian Paul
99c67f27d3 vega: implement handler/pointer conversion using a hash table
Before, we were just casting between 32-bit VGHandles and 64-bit pointers.
2011-01-24 18:12:49 -07:00
Brian Paul
f3e6edc70b vega: remove redundant functions found elsewhere 2011-01-24 18:12:49 -07:00
Brian Paul
d41e694cf7 vega: replace casts with pointer/handle conversion functions
Per the spec, all OpenVG handles are 32-bit.  We can't just cast them
to/from integers on 64-bit systems.

Start fixing that mess by introducing a set of handle/pointer conversion
functions in handle.h.  The next step is to implement a handle/pointer
hash table...
2011-01-24 18:12:49 -07:00
Julien Cristau
4324d6fdfb glx: fix request lengths
We were sending too long requests for GLXChangeDrawableAttributes,
GLXGetDrawableAttributes, GLXDestroyPixmap and GLXDestroyWindow.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 18:10:38 -07:00
Jakob Bornecrantz
c523f31f4a svga: Add more swrast debuging 2011-01-25 01:00:07 +01:00
Jakob Bornecrantz
daaf542220 svga: Use get once helpers for context debug envs 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
becb733dbc rbug: Fix surface reference leak 2011-01-25 00:58:46 +01:00
Jakob Bornecrantz
4fabdf72ea glsl: Fix mingw crosscompile 2011-01-25 00:58:46 +01:00
Henri Verbeet
1af59b28b5 r600g: FLT_TO_INT* are vector instructions on Evergreen.
FLT_TO_INT is a vector instruction, despite what the (current) documentation
says. FLT_TO_INT_FLOOR and FLT_TO_INT_RPI aren't explicitly mentioned in the
documentation, but those are vector instructions too.
2011-01-25 00:35:34 +01:00
Zack Rusin
3d9138781d graw: add a test showing the new sampling scheme in action 2011-01-24 17:53:29 -05:00
Zack Rusin
bdbe77f9c6 gallium: implement modern sampling scheme
largely a merge of the previously discussed origin/gallium-resource-sampling
but updated.
the idea is to allow arbitrary binding of resources, the way opencl, new gl
versions and dx10+ require, i.e.
    DCL RES[0], 2D, FLOAT

    LOAD DST[0], SRC[0], RES[0]
    SAMPLE DST[0], SRC[0], RES[0], SAMP[0]
2011-01-24 17:47:10 -05:00
Benjamin Franzke
b066983780 st/mesa: Enable EXT_texture_format_BGRA8888 for gles1/2 2011-01-24 16:41:29 -05:00
Benjamin Franzke
c5c1dc8b3f st/mesa: support internalFormat=GL_BGRA in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
8bfbcba2b7 mesa/es: require internalFormat==format in TexImage2D 2011-01-24 16:41:29 -05:00
Benjamin Franzke
f1452844fe mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D 2011-01-24 16:41:29 -05:00
Dimitry Andric
811ee32a9e mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33386
NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:37:52 -07:00
Dimitry Andric
3fda80246f mesa: s/movzx/movzbl/
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33388
NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 14:34:28 -07:00
Kenneth Graunke
e0c4a59dc6 glsl: Remove long unused 'configure.ac' file.
This was from way back when glsl2 lived in its own repository.
2011-01-24 10:33:38 -08:00
José Fonseca
92badb4c8c draw: Do not use LLVM's opaque types.
Contrary what the name may suggest, LLVM's opaque types are used for
recursive types -- types whose definition refers itself -- so opaque
types correspond to pre-declaring a structure in C. E.g.:

   struct node;

   struct link {
      ....
      struct node *next;
   };

   struct node {
      struct link link;
   }

Void pointers are also disallowed by LLVM. So the suggested way of creating
what's commonly referred as "opaque pointers" is using byte pointer (i.e.,
uint8_t * ).
2011-01-24 17:27:14 +00:00
Tim Wiederhake
d14764815c add machine generated files to .gitignore
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:57 -07:00
Tim Wiederhake
c48dd8049c secure malloc in translate_cache_create
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 09:17:54 -07:00
Christopher James Halse Rogers
7d6abd254a osmesa: mklib requires arguments before objects
Fixes the build when selecting driver=osmesa and building static libraries.
Otherwise, mklib tries to add the ‘-ltalloc’ object to the archive, which
obviously fails.

Clients which statically link to osmesa will need to link to libtalloc also,
as specified in the Libs.private of osmesa.pc.

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

NOTE: This is a candidate for the 7.10 branch.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-24 07:53:24 -07:00
Michel Dänzer
be0665b461 st/xorg: Fix build failure against xserver with XF86_CRTC_VERSION < 3.
Reported by Vinson Lee.
2011-01-24 15:48:13 +01:00
Marek Olšák
db234176b1 r300g: remove unused function 2011-01-24 13:37:23 +01:00
Marek Olšák
09109c11d9 r300g: remove any traces of depth_clamp
I couldn't make it work.

GB_TILE_CONFIG.Z_EXTENDED, which enables per-pixel Z clamping, and
VAP_CLIP_CNTL.CLIP_DISABLE, which disables clipping, do help, but they
also add regressions like random graphics corruptions in some games.
2011-01-24 13:32:52 +01:00
Marek Olšák
d78a984baa r300g: handle PIPE_CAP_INSTANCED_DRAWING in get_param 2011-01-24 11:40:26 +01:00
Andre Maasikas
92767e9052 r600c: only colors can be flat shaded
fixes stellarium text and menu display
2011-01-24 10:23:19 +02:00
Jakob Bornecrantz
b7d2919e8e util: Add function logger helpers 2011-01-24 03:37:57 +01:00
Jakob Bornecrantz
a82408c353 Revert "r300g/swtcl: re-enable LLVM"
This reverts commit 88550083b3.
2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
4c73030d47 draw: Init llvm if not provided 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
832029e1c1 i915g: Remove draw_flushes and state that we don't need to track 2011-01-24 03:26:59 +01:00
Jakob Bornecrantz
9a9630dcf0 i915g: Improve constant handling 2011-01-24 03:26:59 +01:00
Tom Stellard
c40ec20c27 r300g: Increase fragment shader limits for r400 cards
r400 fragment shaders now support up to 64 temporary registers,
512 ALU instructions, and 512 TEX instructions.
2011-01-23 17:47:48 -08:00
Brian Paul
1bf3c75825 gldirect: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Brian Paul
c78b48d808 i965: remove _NEW_ACCUM 2011-01-23 14:06:21 -07:00
Christoph Bumiller
a287a758c6 nvc0: implement point coord replacement
But we have to cheat and peek at the GENERIC semantic indices the
state tracker uses for TEXn.
Only outputs from 0x300 to 0x37c can be replaced, and so we have to
know on shader compilation which ones to put there in order to keep
doing separate shader objects properly.

At some point I'll probably create a patch that makes gallium not
force us to discard the information about what is a TexCoord.
2011-01-23 21:35:27 +01:00
Marek Olšák
f154cd2315 mesa: add ARB_framebuffer_sRGB as alias of the EXT variant
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Marek Olšák
81ae8c6313 mesa: return GL_LINEAR for ..COLOR_ENCODING if framebuffer_sRGB is unsupported
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-23 20:59:46 +01:00
Brian Paul
2dac3f995b vega: sort filenames in Makefile, SConscript 2011-01-23 10:15:07 -07:00
Brian Paul
fb7efb1b19 mesa: get rid of _NEW_ACCUM, clean-up _NEW_* #defines
The _NEW_ACCUM flag was only set when changing the accumulation
buffer clear color and never used anywhere.  Reclaim that dirty bit.
Clean up the definitions of the other dirty bit flags.
2011-01-23 09:50:52 -07:00
Brian Paul
f4dc24a0b5 mesa: smarter glTexParameter state invalidation
Only a few texture object parameters can effect texture completeness:
min level, max level, minification filter.  Don't mark the texture
incomplete for other texture object state changes.
2011-01-23 09:50:52 -07:00
Marek Olšák
91eba2567e r300g: support sRGB colorbuffers
We are not required to do the linear->sRGB conversion if ARB_framebuffer_sRGB
is unsupported. However I think the conversion should work in hw except
for blending, which matches the D3D9 behavior.
2011-01-23 13:32:56 +01:00
Marek Olšák
ffcdd49c69 r300/compiler: remove any code related to relative addressing of temporaries
The hw can't do it and the code was useless anyway (it's lowered
in the GLSL compiler).
2011-01-23 13:32:56 +01:00
Christoph Bumiller
835c4ea105 nvc0: fix emit_cvt for ceil, floor and trunc 2011-01-23 13:09:10 +01:00
Christoph Bumiller
95eef7a705 nvc0: remove bad assert and emit TEMP movs instead 2011-01-23 13:07:30 +01:00
Christoph Bumiller
f9bb1c8b33 nvc0: fix address and value slot assignment in load combining 2011-01-23 13:05:44 +01:00
Christoph Bumiller
005d186d66 nvc0: don't omit highest bit of branch target
Fixes negative relative branch offsets.
2011-01-23 13:03:20 +01:00
Christoph Bumiller
419ff10b0e nvc0: recognize r63 as zero in constant folding 2011-01-23 13:03:15 +01:00
Christoph Bumiller
bf1df06773 nvc0: add MARK_RING where missing to avoid too many relocs errors 2011-01-23 13:03:10 +01:00
Christoph Bumiller
49f16c96f1 nvc0: don't apply base vertex to per-instance arrays 2011-01-23 13:03:00 +01:00
Christoph Bumiller
c18aa3c73f nvc0: commute sources of SET too if beneficial 2011-01-23 13:01:33 +01:00
Christoph Bumiller
8e572998fc nvc0: accept neg abs modifiers on lg2 2011-01-23 13:01:22 +01:00
Ian Romanick
2db46fe5f0 glsl: Don't assert when the value returned by a function has no rvalue
The rvalue of the returned value can be NULL if the shader says
'return foo();' and foo() is a function that returns void.

Existing GLSL specs do *NOT* say that this is an error.  The type of
the return value is void.  If the return type of the function is also
void, then this should compile without error.  I expect that future
versions of the GLSL spec will fix this (wink, wink, nudge, nudge).

Fixes piglit test glsl-1.10/compiler/expressions/return-01.vert and
bugzilla #33308.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-22 18:04:40 -08:00
Brian Paul
9d380f487a st/mesa: ensure that all pixel paths operation on linear RGB data, not sRGB
Before, we were converting between linear/sRGB in glReadPixels,
glDrawPixels, glAccum, etc if the renderbuffer was an sRGB texture.
Those all need to operate on pixel values as-is without conversion.

Also, when setting up render-to-texture, if the texture is sRGB the
pipe_surface view must be linear RGB.  This will change when we
support GL_ARB_framebuffer_sRGB.

This fixes http://bugs.freedesktop.org/show_bug.cgi?id=33353
2011-01-22 18:33:35 -07:00
Brian Paul
4c9ad084c1 softpipe: pass surface format to get/put_tile functions
When we read/write image tiles we need to use the format specified
in the pipe_surface, not the pipe_transfer format (which comes from
the underlying texture/resource format).

This comes up when rendering to sRGB surfaces (via OpenGL render to
texture).  Ignoring the new GL_ARB/EXT_framebuffer_sRGB extension
for now, when we render to a sRGB surface we need to treat it like
a regular, linear colorspace RGB surface.  Before, when we read/wrote
tiles to sRGB surfaces we were inadvertantly doing the color space
conversion.
2011-01-22 18:33:35 -07:00
Brian Paul
e75844b4e0 gallium/util: added pipe_put_tile_rgba_format() 2011-01-22 18:33:35 -07:00
Brian Paul
3ce1ec853b gallium/util: simplify pipe_get_tile_rgba()
Implement it in terms of pipe_get_tile_rgba_format()
2011-01-22 18:33:35 -07:00
Brian Paul
90671fcdda gallium/softpipe: replace pipe_get_tile_swizzle()
The new function, pipe_get_tile_rgba_format(), no longer takes a
swizzle (we weren't actually using it anywhere).  Rename it to
indicate that the format is passed explicitly.
2011-01-22 18:33:35 -07:00
Brian Paul
4e2c077879 softpipe: use proper type for format field 2011-01-22 18:33:35 -07:00
Brian Paul
11fbdf726d gallium/util: added util_format_linear() 2011-01-22 18:33:35 -07:00
Brian Paul
4c251b8861 st/mesa: update comment, use st_fb_orientation() 2011-01-22 18:33:35 -07:00
Brian Paul
bd67962c5e st/mesa: comments in update_viewport() 2011-01-22 18:33:35 -07:00
Chia-I Wu
bb770af3a5 scons: Add support for GLES.
GLES can be enabled by running scons with

  $ scons gles=yes

When gles=yes is given, the build is changed in three ways.  First,
libmesa.a will be built with FEATURE_ES1 and FEATURE_ES2.  This makes
DRI drivers and libEGL support and advertise GLES support.  Second, GLES
libraries will be created.  They are libGLESv1_CM, libGLESv2, and
libglapi.  Last, libGL or opengl32 will link to libglapi.  This change
is required as _glapi_* will be declared as __declspec(dllimport) in
libmesa.a on windows.  libmesa.a expects those symbols to be defined in
another DLL.  Due to this change to GL, GLES support is marked
experimental.

Note that GLES requires libxml2-python to generate some of its sources.
2011-01-22 11:59:05 +08:00
Chia-I Wu
3f04314ae2 mapi: ENTRY_CURRENT_TABLE_GET should be stringified.
So that it can be renamed to _glapi_get_dispatch.
2011-01-22 11:58:38 +08:00
Kenneth Graunke
0db3161036 glcpp: Regenerate parser files. 2011-01-21 15:41:19 -08:00
Kenneth Graunke
6ecee54a9a glcpp: Remove use of talloc reference counting.
We almost always want to simply steal; we only need to copy when copying
a token list (in which case we're already cloning stuff anyway).
2011-01-21 15:41:19 -08:00
Kenneth Graunke
e256e4743c glsl, i965: Remove unnecessary talloc includes.
These are already picked up by ir.h or glsl_types.h.
2011-01-21 15:41:19 -08:00
Kenneth Graunke
819f92deaa ra: Use the same context when realloc'ing arrays.
The original allocations use regs->regs as the context, so talloc will
happily ignore the context given here.  Change it to match to clarify
that it isn't changing.
2011-01-21 15:39:57 -08:00
Chad Versace
b66be7518a glsl: Improve error message when read-only vars are written
Improves the cases when:
* an explicit assignment references the read-only variable
* an 'out' or 'inout' function parameter references the read-only variable
2011-01-21 14:06:28 -08:00
Chad Versace
01a584d093 glsl: Mark 'in' variables at global scope as read-only
Fixes Piglit tests:
spec/glsl-1.30/compiler/storage-qualifiers/static-write-centroid-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-01.frag
spec/glsl-1.30/compiler/storage-qualifiers/static-write-in-02.frag
2011-01-21 14:06:28 -08:00
Chad Versace
f633b993b0 glsl: Remove unused class ast_declaration_statment 2011-01-21 14:06:25 -08:00
Jakob Bornecrantz
8af583f6e8 i915g: Don't (un)map vbuf on each (un)map call 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
0c3352b6df i915g: Don't do unnecessary copies of constants
Even tho st/mesa use user buffers for constants align buffers
other state trackers doesn't use user buffers.
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
2e60aa511d i915g: Don't emit FS constants when VS contants change 2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
7287964f94 i915g: Use slab allocator for transfers
Also remove unused i915_transfer struct
2011-01-21 20:53:29 +01:00
Jakob Bornecrantz
484edfc815 st/dri: Fix warning 2011-01-21 20:53:29 +01:00
Christian König
a40305dcdb r600g: check if hardware blits are possible bevore enabling tilling 2011-01-21 19:47:24 +01:00
Alex Deucher
4b3789427f r600g: FLT_TO_INT_FLOOR is trans instruction
Add missing evergreen FLT_TO_INT_FLOOR instruction.
2011-01-21 12:41:23 -05:00
Dave Airlie
a637280e42 mesa: EXT_framebuffer_sRGB interface additions.
This adds the get/enable enums and internal gl_config storage
for this extension.

In theory this is all that is needed to enable this extension
from what I can see, since its not mandatory to implement the
features if you don't advertise the visuals or the fb configs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-21 19:56:13 +10:00
Andre Maasikas
634e889bb5 r600c: get OQ results only for 4 DBs on r600 class
- since evergreen addition which increased this to 8 depth backends
  other bytes may contain garbage values
2011-01-21 11:48:03 +02:00
Brian Paul
af4e2f4665 docs: update README.WIN32 per Karl's request 2011-01-20 18:52:53 -07:00
Ian Romanick
2fb0aebd4a intel: Fix typeos from 3d028024 and 790ff232
...and remove egg from face.
2011-01-20 13:51:07 -08:00
Ian Romanick
790ff232e2 i915: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
3d028024e5 i965: Set correct values for range/precision of fragment shader types 2011-01-20 13:35:59 -08:00
Ian Romanick
04dca296e0 mesa: Set correct values for range/precision of shader integer types 2011-01-20 13:35:59 -08:00
Ian Romanick
dde3270c19 mesa: Connect glGetShaderPrecisionFormat into the dispatch table 2011-01-20 13:35:59 -08:00
Brian Paul
37233f1ee0 softpipe: check for null pointers during context create/destroy
See http://bugs.freedesktop.org/show_bug.cgi?id=32309
Apparently, malloc() is failing during context creation.  Not
checking for nulls here led to crashes elsewhere.
2011-01-20 13:46:57 -07:00
Brian Paul
4ef955a12a graw: fix logic error in pixel format selection
The loop to choose a pixel format for the window was incrementing
'i' after we succeeded in creating the window so if we chose format[0]
for graw_create_window_and_screen() we were putting format[1] in
the pipe_resource template for creating the render target.

This only worked because of the order of the elements in the formats[]
array.

The graw_xlib.c code now properly compares the requested gallium pixel
format against the visual's color layout.

Update all the graw demos to fix the off-by-one-i error.
2011-01-20 13:37:26 -07:00
Ian Romanick
22eeb1b331 Fix the build from 887d2b64
Thanks to all the include frobbing, GLuint is not known in some places
that included enums.h.
2011-01-20 11:30:14 -08:00
Brian Paul
887d2b647b mesa: clean-up _mesa_lookup_prim_by_nr()
Remove the redundant public _mesa_prim_name[] array.
2011-01-20 09:44:33 -07:00
Brian Paul
fe49dcb3b0 mesa: move extra prim mode #defines 2011-01-20 09:44:33 -07:00
Brian Paul
b62e78c783 vbo: added comment 2011-01-20 09:44:33 -07:00
Brian Paul
cfae745a8b mesa: minor formatting fixes 2011-01-20 09:10:03 -07:00
Brian Paul
7330f8b2bc st/mesa: clean up the sampler view format code 2011-01-20 08:56:36 -07:00
Brian Paul
751fe9058b mesa: document sRGBDecode field 2011-01-20 08:56:36 -07:00
Brian Paul
f579a05a9f st/mesa: formatting, whitespace fixes 2011-01-20 08:56:32 -07:00
Andre Maasikas
c20778e76f r600c: bump sq gpr resources if a shader needs more than default
ideally this should be set once in the beginning of CS but there's
no way to change values there while in the middle of rendering.
For now reemitting SQ setup seems to work probably due to
r700WaitForIdleClean after each render

currently does not to try to decrease values once increased

fixes hangs in glsl-vs-vec4-indexing-temp-src-in-nested-loop-combined
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined for my rv740
maybe more for other chips
2011-01-20 13:11:56 +02:00
Chia-I Wu
e8c7d7598f glapi: Fix OpenGL and OpenGL ES interop.
When --enable-shared-glapi is specified, libGL will share libglapi with
OpenGL ES instead of defining its own copy of glapi.  This makes sure an
app will get only one copy of glapi in its address space.

The new option is disabled by default.  When enabled, libGL and libglapi
must be built from the same source tree and distributed together.  This
requirement comes from the fact that the dispatch offsets used by these
libraries are re-assigned whenever GLAPI XMLs are changed.

For GLX, indirect rendering for has_different_protocol() functions is
tricky.  A has_different_protocol() function is assigned only one
dispatch offset, yet each entry point needs a different protocol opcode.
It cannot be supported by the shared glapi.  The fix to this is to make
glXGetProcAddress handle such functions specially before calling
_glapi_get_proc_address.

Note that these files are automatically generated/re-generated

 src/glx/indirect.c
 src/glx/indirect.h
 src/mapi/glapi/glapi_mapi_tmp.h
2011-01-20 17:15:50 +08:00
Chia-I Wu
9767d3b5ad glapi: Fix OpenGL ES 1.1 and 2.0 interop.
Move _glapi_* symbols from libGLESv1_CM.so and libGLESv2.so to
libglapi.so.  This makes sure an app will get only one copy of glapi in
its address space.

Note that with this change, libGLES* and libglapi must be built from the
same source tree and distributed together.  This requirement comes from
the fact that the dispatch offsets used by these libraries are
re-assigned whenever GLAPI XMLs are changed.
2011-01-20 17:15:50 +08:00
Chia-I Wu
97185bf265 mapi: Add support for bridge mode.
In bridge mode, mapi no longer implements glapi.h.  It becomes a user of
glapi.h.  Imagine an app that uses both libGL.so and libGLESv2.so.
There will be two copies of glapi in the app's memory.  It is possible
that _glapi_get_dispatch does not return what _glapi_set_dispatch set,
if they access different copies of the global variables.  The solution
to this situation to build either one of the libraries as a bridge to
the other.  Or build both libraries as bridges to another shared
glapi library.
2011-01-20 17:15:50 +08:00
Chia-I Wu
96c52d16c1 mapi: u_current_table may be renamed.
When MAPI_MODE_GLAPI is defined, u_current_table is renamed to
_glapi_Dispatch or _glapi_tls_Dispatch.  The ASM dispatchers should not
use hardcoded name.
2011-01-20 17:15:50 +08:00
Chia-I Wu
6fc152f660 mapi: Add a new glapi.h implementation.
The new implementation is based on mapi.  No new script is needed.  As
noted in sources.mk, the way to use it is to compile MAPI_GLAPI_SOURCES
with MAPI_MODE_GLAPI defined.
2011-01-20 17:15:50 +08:00
Chia-I Wu
23a89f1872 mapi: Fix glapi printers for gl_and_es_API.xml.
Fix GLAPIPrinter, ES1APIPrinter, and ES2APIPrinter to output files that
are ready for compilation.  Since gl_and_es_API.xml is based on
gl_API.xml, the hidden and handcode attributes of entries have to be
overridden for ES1APIPrinter and ES2APIPrinter.
2011-01-20 17:15:50 +08:00
Chia-I Wu
7828f554ab mapi: Allow prefix to be macro.
Treat prefix as macro when it is all uppercase.  Generate PREFIX(name)
instead of PREFIXname when it is a macro.
2011-01-20 17:15:49 +08:00
Chia-I Wu
f71a9acf59 mapi: Add the ability to parse GLAPI XML.
A prerequisite if we want to convert vgapi.csv to vgapi.xml, or to use
mapi for glapi.
2011-01-20 17:15:49 +08:00
Chia-I Wu
323b5e323a glapi: Add gl_and_es_API.xml.
gl_and_es_API.xml defines OpenGL ES 1.1 and 2.0 API as well as OpenGL
API.  It consists of gl_API.xml and the newly added es_EXT.xml,
ARB_get_program_binary.xml, OES_single_precision.xml, and
OES_fixed_point.xml.
2011-01-20 17:15:49 +08:00
Kenneth Graunke
4fafde6a8c doxygen: Add glsl to the Makefile and .gitignore. 2011-01-19 23:49:54 -08:00
twied
aec19381ec Add machine generated files to .gitignore 2011-01-19 23:48:47 -08:00
Kenneth Graunke
21031b4e88 glsl: Don't bother unsetting a destructor that was never set.
This was totally copied and pasted from glsl_symbol_table.
2011-01-19 23:40:33 -08:00
Chia-I Wu
c116a0e2dc autoconf: Fail when --with-state-trackers is incomplete.
When --enable-openvg or --enable-gallium-egl is enabled,
--with-state-trackers must have vega or egl.
2011-01-20 15:04:34 +08:00
Henri Verbeet
21148e6a88 softpipe: Bind samplers to views instead of the underlying resource.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Henri Verbeet
54fdc351dd softpipe: Get rid of the redundant resource parameter to get_sampler_variant().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-19 21:47:27 -07:00
Dave Airlie
8c68362d7c r200: fix up some problems with TFP on r200 2011-01-20 14:35:09 +10:00
Brian Paul
7e86d9bd8c llvmpipe: implement TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33284
2011-01-19 18:46:59 -07:00
Eric Anholt
b41d323c90 i965/fs: Take the shared mathbox into account in instruction scheduling.
I don't have evidence for this amounting to any improvement,
but it does codify a bit more what we understand so far about
the pipeline.
2011-01-19 16:30:00 -08:00
Eric Anholt
382c2d99da i965/fs: Add a helper function for detecting math opcodes. 2011-01-19 16:29:14 -08:00
Eric Anholt
1991d92207 i965/fs: Assign URB/CURB register numbers after instruction scheduling.
This fixes a bunch of unnecessary barriers due to the scheduler not
knowing what that arbitrary register description refers to when trying
to reason about its dependencies.

The result is rescheduling in the convolution kernel shader in
Lightsmark, which results in avoiding register spilling and increasing
the performance of the first scene from 6-7 fps midway through the
panning to 11fps.  The register spilling was a regression from Mesa
7.9 to Mesa 7.10.
2011-01-19 16:29:14 -08:00
Eric Anholt
63879d90ac i965/fs: Add an instruction scheduler.
Improves performance of my GLSL demo by 5.1% (+/- 1.4%, n=7).  It also
reschedules the giant multiply tree at the end of
glsl-fs-convolution-1 so that we end up not spilling registers,
producing the expected level of performance.
2011-01-19 16:29:11 -08:00
Eric Anholt
3f2fe31eee i965/fs: Add a helper for detecting texturing opcodes. 2011-01-19 16:29:10 -08:00
Christian König
a124490262 r600g: fix segfault if texture operand is a literal
This fixes Bug 33262
2011-01-19 23:48:02 +01:00
Brian Paul
3ee60a3558 mesa: implement glGetShaderPrecisionFormat()
Drivers should override the default range/precision info as needed.
No drivers do this yet.
2011-01-19 07:41:55 -07:00
Brian Paul
34613c66ac gallium/docs: document result type for some types of queries 2011-01-19 07:41:55 -07:00
Dave Airlie
a5da4acb95 radeon: avoid segfault on 3D textures.
This is a candidate for 7.9 and 7.10
2011-01-19 16:27:13 +10:00
Dave Airlie
4832403c38 radeon: oops didn't need this logbase2 fn 2011-01-19 16:17:03 +10:00
Dave Airlie
c6fb88fc5a radeon: calculate complete texture state inside TFP function
(really not sure why I'm doing this).

This is a candidate for 7.9 and 7.10 branches.
2011-01-19 16:11:29 +10:00
Ben Skeggs
c73a1c18b2 dri/nouveau: allow multiple maps of surface buffers
Can happen during swrast fallbacks if a buffer is somehow bound as
a render target and a texture.

Fixes gnome-shell on nv20, and gets it mostly working on nv10.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-19 15:51:57 +10:00
Dave Airlie
f7bab47e6c radeon/r200: fix fbo-clearmipmap + gen-teximage
sw clears were being used and not getting the correct offsets in the span
code.

also not emitting correct offsets for CB draws to texture levels.

(I've no idea why I'm playing with r100).

This is a candidate for 7.9 and 7.10
2011-01-19 12:55:04 +10:00
Eric Anholt
568e008365 i965: Fix a comment typo. 2011-01-18 16:30:59 -08:00
Eric Anholt
8ce425f3e3 i965: Fix a bug in i965 compute-to-MRF.
Fixes piglit glsl-fs-texture2d-branching.  I couldn't come up with a
testcase that didn't involve dead code, but it's still worthwhile to
fix I think.
2011-01-18 16:30:59 -08:00
Christian König
ba700d2ead r600g: fix reserve_cfile for R700+
According to R700 ISA we have only two channels for cfile constants.
This patch makes piglit tests "glsl1-constant array with constant
indexing" happy on RV710.
2011-01-19 00:40:28 +01:00
Chad Versace
46f7105df4 glsl: Fix segfault due to missing printf argument
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-18 15:23:18 -08:00
Chad Versace
45e8e6c6b1 glsl: Fix semantic checks on precision qualifiers
The check for
   Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
2011-01-18 14:43:49 -08:00
Brian Paul
42dbc2530b llvmpipe: make sure binning is active when we begin/end a query
This fixes a potential failure when a begin/end_query is the first
thing to happen after flushing the scene.

NOTE: This is a candidate for the 7.10 and 7.9 branches.
2011-01-18 14:02:01 -07:00
Brian Paul
fb7a8dedfa softpipe: rename some functions for consistency 2011-01-18 14:02:01 -07:00
Henri Verbeet
9e964baaf3 r600g: Kill trailing whitespace. 2011-01-18 20:57:04 +01:00
Henri Verbeet
7e2e8d09f7 r600g: Remove the unused eg_states_inc.h and r600_states_inc.h. 2011-01-18 20:57:04 +01:00
Henri Verbeet
495dec0a2b r600g: Simplify some r600_bc_add_alu_type() calls to r600_bc_add_alu(). 2011-01-18 20:57:04 +01:00
Brian Paul
90ff6178a2 vbo: initialize num_instances in a few places
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=33247
There might still be some issues with drawing multiple instances
with VBO splitting to investigate someday.
2011-01-18 12:18:32 -07:00
Eric Anholt
d5a53ad271 ra: Take advantage of the adjacency list in finding a node to spill.
This revealed a bug in ra_get_spill_benefit where we only considered
the benefit of the first adjacency we were to remove, explaining some
of the ugly spilling I've seen in shaders.  Because of the reduced
spilling, it reduces the runtime of glsl-fs-convolution-1 36.9% +/-
0.9% (n=5).
2011-01-18 10:17:50 -08:00
Eric Anholt
ea8e21856e ra: Remove unused "name" field in regs. 2011-01-18 10:17:48 -08:00
Eric Anholt
604022abed ra: Take advantage of the adjacency list in ra_select() too.
Reduces runtime of glsl-fs-convolution-1 another 13.9% +/- 0.6% (n=5).
2011-01-18 10:17:44 -08:00
Eric Anholt
7cf648da63 ra: Add an adjacency list to trade space for time in ra_simplify().
This was recommended in the original paper, but I figued "make it run"
before "make it fast".  Now we make it fast.  Reduces the runtime of
glsl-fs-convolution-1 by 12.7% +/- 0.6% (n=5).
2011-01-18 10:17:40 -08:00
Eric Anholt
58c988ada5 glsl: Skip the rest of loop unrolling if no loops were found.
Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time
(n=5).
2011-01-18 10:17:37 -08:00
Eric Anholt
754b9c5363 ra: Trade off some space to get time efficiency in ra_set_finalize().
Our use of the register allocator in i965 is somewhat unusual.
Whereas most architectures would have a smaller set of registers with
fewer register classes and reuse that across compilation, we have 1,
2, and 4-register classes (usually) and a variable number up to 128
registers per compile depending on how many setup parameters and push
constants are present.  As a result, when compiling large numbers of
programs (as with glean texCombine going through ff_fragment_shader),
we spent much of our CPU time in computing the q[] array.  By keeping
a separate list of what the conflicts are for a particular reg, we
reduce glean texCombine time 17.0% +/- 2.3% (n=5).

We don't expect this optimization to be useful for 915, which will
have a constant register set, but it would be useful if we were switch
to this register allocator for Mesa IR.
2011-01-18 10:17:34 -08:00
Brian Paul
5b58b8c579 softpipe: added some null pointer checks
This shouldn't really be needed but it may help with
http://bugs.freedesktop.org/show_bug.cgi?id=32309
2011-01-18 09:59:28 -07:00
Brian Paul
c97e4532bb softpipe: s/tex_cache/fragment_tex_cache/
Just to be more consistant with the vertex and geometry tex cache fields.
2011-01-18 09:59:28 -07:00
José Fonseca
843f537cfb Remove executables from source tree. 2011-01-18 15:25:30 +00:00
Andre Maasikas
4ef3e261a4 r600c: preserve correct buffer when using fbo
Hopefully better than previous - this passes more mipgen tests
2011-01-18 16:25:19 +02:00
Andre Maasikas
0a85845c9e r600: set border color as RGBA
border color is RGBA for samples - this passes texenv tests
2011-01-18 16:21:14 +02:00
Andre Maasikas
52fbff2130 r600c: use STATE_FB_WPOS_Y_TRANSFORM variable to do wpos transform
use introduced STATE_FB_WPOS_Y_TRANSFORM variable (thanks Marek)
this gets coords also right when using fbo
2011-01-18 16:21:13 +02:00
Eric Anholt
e4be665bbd i965: Fix dead pointers to fp->Parameters->ParameterValues[] after realloc.
Fixes texrect-many regression with ff_fragment_shader -- as we added
refs to the subsequent texcoord scaling paramters, the array got
realloced to a new address while our params[] still pointed at the old
location.
2011-01-17 16:27:55 -08:00
Brian Paul
96a2e89dde llvmpipe: enable PIPE_CAP_INDEP_BLEND_FUNC
The driver was saying that independend blend functions was not supported,
but it really was.  The driver was using the per-target independend blend
factors but the state tracker was only setting the 0th one (per the
Gallium spec).

Fixes a piglit fbo-drawbuffers2-blend regression.
See https://bugs.freedesktop.org/show_bug.cgi?id=33215
2011-01-17 16:51:13 -07:00
Brian Paul
afeebecd95 st/mesa: move PIPE_CAP_INDEP_BLEND_FUNC code 2011-01-17 16:51:12 -07:00
Chad Versace
774750a32f doxygen: Add doxyfile for glsl module 2011-01-17 13:52:40 -08:00
Chad Versace
a54e2de4bb glsl: Refresh autogenerated parser files 2011-01-17 10:20:47 -08:00
Chad Versace
a9bf8c12ee glsl: Remove redundant semantic check in parser
The removed semantic check also exists in ast_type_specifier::hir(), which
is a more natural location for it.

The check verified that precision statements are applied only to types
float and int.
2011-01-17 10:20:47 -08:00
Chad Versace
08a286c9cc glsl: Add support for default precision statements
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
2011-01-17 10:20:47 -08:00
Chad Versace
889e1a5b6c glsl: Add semantic checks for precision qualifiers
* Check that precision qualifiers only appear in language versions 1.00,
  1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.

Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag
2011-01-17 09:41:25 -08:00
Chad Versace
33279cd2d3 glsl: Fix parser rule for type_specifier
Do not assign a value to ast_type_specifier::precision when no precision
qualifier is present.
2011-01-17 09:41:25 -08:00
Chad Versace
aaa31bf8f4 glsl: Change default value of ast_type_specifier::precision
Change default value to ast_precision_none, which denotes the absence of
a precision of a qualifier.

Previously, the default value was ast_precision_high. This made it
impossible to detect if a precision qualifier was present or not.
2011-01-17 09:41:25 -08:00
Chad Versace
1eb0f17fa4 glsl: Check that 'centroid in' does not occur in vertex shader
The check is performed only in GLSL versions >= 1.30.

From section 4.3.4 of the GLSL 1.30 spec:
   "It is an error to use centroid in in a vertex shader."

Fixes Piglit test
spec/glsl-1.30/compiler/storage-qualifiers/vs-centroid-in-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
8faaa4a672 glsl: Check that interpolation quals only apply to vertex ins and fragment outs
The check is performed only in GLSL versions >= 1.30.

Fixes the following Piglit tests:
* spec/glsl-1.30/compiler/interpolation-qualifiers/fs-smooth-02.frag
* spec/glsl-1.30/compiler/interpolation-qualifiers/vs-smooth-01.vert
2011-01-17 09:41:25 -08:00
Chad Versace
605aacc67d glsl: Check that interpolation qualifiers do not precede 'varying'
... and 'centroid varying'. The check is performed only in GLSL
versions >= 1.30.

From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
   "interpolation qualifiers may only precede the qualifiers in, centroid
    in, out, or centroid out in a declaration. They do not apply to the
    deprecated storage qualifiers varying or centroid varying."

Fixes Piglit test
spec/glsl-1.30/compiler/interpolation-qualifiers/smooth-varying-01.frag.
2011-01-17 09:41:24 -08:00
Chad Versace
0e2f8936c8 glsl: Add method ast_type_qualifier::interpolation_string()
If an interpolation qualifier is present, then the method returns that
qualifier's string representation. For example, if the noperspective bit
is set, then it returns "noperspective".
2011-01-17 09:41:24 -08:00
Brian Paul
5a64626ee5 vbo: init num_instances in split_prims()
Fixes a VTK regression after adding GL_ARB_draw_instanced.
2011-01-17 09:56:58 -07:00
Brian Paul
6179f7e38e tnl: assert that num_instances > 0 2011-01-17 09:40:16 -07:00
Brian Paul
72f2551017 mesa: s/primcount/numInstances/
primcount is also a parameter to glMultiDrawElements().  Use numInstances
to avoid confusion between these things.
2011-01-17 09:33:49 -07:00
Dave Airlie
2bf52e7c28 nouveau: fix build against out of tree libdrm
For doing builds against a separated libdrm these cflags are needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-17 15:42:34 +10:00
Christian König
ef3b8042e0 r600g: fix PIPE_CAP_INSTANCED_DRAWING warning 2011-01-16 23:52:53 +01:00
Christian König
b61afe13f1 r600g: fix alu inst group merging for relative adressing 2011-01-16 21:43:17 +01:00
Christoph Bumiller
a4742c6a07 nvc0: fix and enable instanced drawing and arrays 2011-01-16 14:10:46 +01:00
Chia-I Wu
326332a130 d3d1x: Fix broken build.
st/egl native.h changed its interface in
a22a332fc7.
2011-01-16 20:58:17 +08:00
Brian Paul
d136d1d2e1 mesa: minor tweaks in _mesa_set_fetch_functions() 2011-01-15 20:41:26 -07:00
Brian Paul
aad7219f80 mesa: add comment for _mesa_get_srgb_format_linear() 2011-01-15 20:41:06 -07:00
Brian Paul
bfad484505 mesa: move declarations before code 2011-01-15 20:37:57 -07:00
Dave Airlie
608ccfe316 docs: add GL_EXT_texture_sRGB_decode to relnotes 2011-01-16 12:54:57 +10:00
Dave Airlie
527bf67682 gallium: add EXT_texture_sRGB_decode.
This uses a sampler view to access the texture with the alternate format.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:07 +10:00
Dave Airlie
9b1a15e1cb i965: add support for EXT_texture_sRGB_decode
We just choose the texture format depending on the srgb decode bit
for the sRGB formats.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Dave Airlie
edc2dd8e47 mesa/swrast: implement EXT_texture_sRGB_decode
This implements the extension by choosing a different set of texture
fetch functions when the texture parameter changes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Christian König
ac6334145e r600d: fix some bugs added reworking literal handling
If a literal slot isn't used it should be set
to 0 instead of an uninitialized value. Also the
channels for pre R700 trig functions were incorrect.
And most important literals were not counted against ndw,
resulting in an invalid force_add_cf detection.
2011-01-16 03:30:25 +01:00
Brian Paul
3bee900a72 docs: document GL_ARB_draw_buffers_blend 2011-01-15 18:38:46 -07:00
Brian Paul
b3ca110594 mesa: implement glGet queries for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
44c2122a73 mesa: display list support for GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
7f48278edc mesa: plug in GL_ARB_draw_buffers_blend functions 2011-01-15 18:35:45 -07:00
Brian Paul
561307844f glapi: regenerated files 2011-01-15 18:35:45 -07:00
Brian Paul
1cf6ff3046 glapi: new entrypoint specs for GL_ARB_draw_buffers_blend 2011-01-15 18:35:45 -07:00
Brian Paul
74713e2d29 mesa: begin implementation of GL_ARB_draw_buffers_blend 2011-01-15 18:35:39 -07:00
Brian Paul
3dab2b1795 docs: update GL3.txt status 2011-01-15 17:41:43 -07:00
Brian Paul
9473ca356f docs: document GL_ARB_instanced_arrays 2011-01-15 17:40:56 -07:00
Brian Paul
a6860f0913 st/mesa: GL_ARB_instanced_arrays support 2011-01-15 17:37:41 -07:00
Brian Paul
1d1eb95787 mesa: support for GL_ARB_instanced_arrays 2011-01-15 17:37:41 -07:00
Brian Paul
1250e2330b glapi: regenerated files 2011-01-15 17:37:41 -07:00
Brian Paul
caee0d024f glapi: GL_ARB_instanced_arrays support 2011-01-15 17:37:40 -07:00
Brian Paul
5700bc6bac draw: add missing LP_CHECK_MEMBER_OFFSET() 2011-01-15 17:37:40 -07:00
Brian Paul
d1e284407c st/mesa: move/consolidate an assignment 2011-01-15 17:37:40 -07:00
Brian Paul
889f44bc90 docs: document GL_ARB_draw_instanced 2011-01-15 17:37:40 -07:00
Henri Verbeet
a25473b535 r600g: Remove the redundant radeon_new() prototype. 2011-01-15 19:48:43 +01:00
Henri Verbeet
5a2abf7a85 r600g: Fix some register value name typos.
SFR -> SRF.
2011-01-15 19:48:43 +01:00
Henri Verbeet
f6f7808028 r600g: Get rid of r600_translate_vertex_data_type().
This has been replaced with r600_vertex_data_type().
2011-01-15 19:48:43 +01:00
Brian Paul
652901e95b Merge branch 'draw-instanced'
Conflicts:
	src/gallium/auxiliary/draw/draw_llvm.c
	src/gallium/drivers/llvmpipe/lp_state_fs.c
	src/glsl/ir_set_program_inouts.cpp
	src/mesa/tnl/t_vb_program.c
2011-01-15 10:24:08 -07:00
Christoph Bumiller
21001d2ba7 nvc0: try to swap immediates to first source too 2011-01-15 14:14:55 +01:00
Christoph Bumiller
52474d4246 nvc0: make sure all sources of the BIND op are distinct
They're supposed to be assigned consecutive registers so they can't
contain the same SSA value more than once.
2011-01-15 14:14:50 +01:00
Christoph Bumiller
1ae982adfd nvc0: update user vbufs on each draw call
This is required in case set_vertex_buffers is not called again.
2011-01-15 12:18:52 +01:00
Christoph Bumiller
b50d02e2e0 nvc0: enable early fragment tests where possible 2011-01-15 12:17:57 +01:00
Christoph Bumiller
5ec66c6e70 nvc0: upload small buffers through the command buffer 2011-01-15 12:17:00 +01:00
Chia-I Wu
a4a5a9a5ce mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.
Core mesa has gained support for GL_ARB_ES2_compatibility.  Make GLES
generated dispatch table use them.
2011-01-15 12:42:59 +08:00
Chia-I Wu
b70d0a6a51 targets/egl-static: Assorted cleanups and fixes.
Share more code between windows and non-windows platforms.  Check
env['x11'] for X11 and add env['X11_LIBS'] to LIBS.  Add ws_wrapper for
i965g.
2011-01-15 12:35:22 +08:00
Chia-I Wu
6f769a690b targets/egl: i965 needs libwsw.
Fix undefined symbol wrapper_sw_winsys_dewrap_pipe_screen.
2011-01-15 12:35:19 +08:00
Eric Anholt
4620de7eea mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.
Fixes piglit arb_es2_compatibility-shadercompiler
2011-01-14 16:55:35 -08:00
Eric Anholt
8395f206a8 mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.
Fixes piglit arb_es2_compatibility-maxvectors.
2011-01-14 16:55:35 -08:00
Eric Anholt
e12c4faf7e mesa: Add support for glDepthRangef and glClearDepthf.
These are ARB_ES2_compatibility float variants of the core double
entrypoints.  Fixes arb_es2_compatibility-depthrangef.
2011-01-14 16:55:35 -08:00
Eric Anholt
25beab10cd ir_to_mesa: Fix segfaults on ir_to_mesa invocation after MSVC change. 2011-01-14 16:55:35 -08:00
Brian Paul
d42acef139 glsl: fix implicit int to bool warning
Maybe preprocess() should return a bool.
2011-01-14 17:46:47 -07:00
Brian Paul
7ff89b030f docs: skeleton file for 7.11 release notes, add missing links 2011-01-14 17:46:38 -07:00
Vinson Lee
7772a34f3a mesa: Dynamically allocate acp array in ir_to_mesa_visitor::copy_propagate.
Fixes these MSVC errors.
ir_to_mesa.cpp(2644) : error C2057: expected constant expression
ir_to_mesa.cpp(2644) : error C2466: cannot allocate an array of constant size 0
ir_to_mesa.cpp(2644) : error C2133: 'acp' : unknown size
ir_to_mesa.cpp(2646) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2709) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
ir_to_mesa.cpp(2718) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
2011-01-14 16:18:52 -08:00
Eric Anholt
7b987578a9 mesa: Add actual support for glReleaseShaderCompiler from ES2.
Fixes no-op dispatch warning in piglit
arb_es2_compatibility-releaseshadercompiler.c.
2011-01-14 15:30:04 -08:00
Eric Anholt
ed93f9f3a3 intel: Expose GL_ARB_ES2_compatibility.
We don't have all of the features of this extension hooked up yet, but
the consensus yesterday was that since those features are things that
we should also be supporting in our ES2 implementation, claiming ES2
here too doesn't make anything worse and will make incremental
improvement through piglit easier.
2011-01-14 15:30:01 -08:00
Eric Anholt
9c6954fc9d mesa: Add extension enable bit for GL_ARB_ES2_compatibility. 2011-01-14 15:28:50 -08:00
Eric Anholt
841ad6bfad glapi: Regenerate for GL_ARB_ES2_compatibility. 2011-01-14 15:28:01 -08:00
Eric Anholt
8560cb939b glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility. 2011-01-14 15:28:00 -08:00
Alex Deucher
634dece281 r600g: compiler helper opcode fixes for evergreen
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:49 -05:00
Alex Deucher
9dfc68314d r600g: pass r600_bc to some addition compiler helper functions
needed for asic specific opcodes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-14 17:50:29 -05:00
Vinson Lee
57ef69dd88 generate_builtins.py: Whitespace fixes.
Also removed unnecessary semicolons.
2011-01-14 14:19:02 -08:00
Vinson Lee
0de6d7e991 generate_builtins.py: Fix builds using Python 2.5. 2011-01-14 14:17:03 -08:00
Eric Anholt
a6e4614ca1 i965: Replace broken handling of dead code with an assert.
This code should never have been triggered, but I often did anyway
when I disabled optimization passes during debugging, then spent my
time debugging that this code doesn't work.
2011-01-14 13:57:15 -08:00
Eric Anholt
7c7df146b5 i965: Add an invalidation of live intervals after register splitting.
No effect, since it was called before live intervals were calculated.
2011-01-14 13:57:15 -08:00
Eric Anholt
65c41d55a0 mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages.
The comment of "this is just like teximages except for..." is a pretty
good clue that we're handling this wrong.  By just using the teximage
code, we catch a bunch of cases we'd missed, like GL_RED and GL_RG.
2011-01-14 13:57:15 -08:00
Eric Anholt
34a9da4eb4 mesa: Add channel-wise copy propagation to ir_to_mesa.
This catches more opportunities than the prog_optimize.c code on
openarena's fixed function shaders turned to GLSL, mostly due to
looking at multiple source instructions for copy propagation
opportunities.  It should also be much more CPU efficient than
prog_optimize.c's code.
2011-01-14 13:57:14 -08:00
Eric Anholt
d53c8380bf i915: Fix compiler warning from sw fallback removal change. 2011-01-14 13:57:14 -08:00
Vinson Lee
4c6d6dd8fc r600g: Disable V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR case.
The usage of macro V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR was
introduced by commit 323ef3a1f0 but the
macro is undefined. Disable this case to fix the build for now.
2011-01-14 13:47:37 -08:00
Kristian Høgsberg
6e9b0f6807 gles2: Also support GL_BGRA_EXT for glTexSubImage2d 2011-01-14 16:12:21 -05:00
Christian König
323ef3a1f0 r600g: add more missing instructions to r600_bc_get_num_operands 2011-01-14 18:46:52 +01:00
Chia-I Wu
e7d8f92570 egl: Fix EGL_VERSION string.
Fix a copy-and-paste error in a4a38dcf61.
2011-01-14 14:29:19 +08:00
Chia-I Wu
36a59b29ef egl: Fix an assertion in _eglUpdateAPIsString.
dpy->ClientAPIs was renamed in a4a38dcf61.
2011-01-14 14:12:42 +08:00
Dave Airlie
483de8ef2e i965: fix fbo-srgb on i965.
Until we get the EXT_framebuffer_sRGB extension we should bind the sRGB
formats for FBO as linear.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-14 14:58:47 +10:00
Dave Airlie
7f652fc523 srgb: fix fbo base format picking.
Pointed out by Brian.
2011-01-14 14:58:47 +10:00
Chad Versace
7b9dc40b0d i915: Disable extension OES_standard_derivatives
OES_standard_derivatives must be manually disabled for i915 because Mesa
enables it by default.
2011-01-13 17:26:28 -08:00
Chad Versace
78838b2d1b mesa: Change OES_standard_derivatives to be stand-alone extension
Add a bit in struct gl_extensions for OES_standard_derivatives, and enable
the bit by default. Advertise the extension only if the bit is enabled.

Previously, OES_standard_derivatives was advertised in GLES2 contexts
if ARB_framebuffer_object was enabled.
2011-01-13 17:26:28 -08:00
Vinson Lee
a2ab929ab2 r600g: Move declaration before code in r600_asm.c.
Fixes SCons build.
2011-01-13 14:17:01 -08:00
Christian König
96f8f8db7b r600g: rework literal handling 2011-01-13 23:01:35 +01:00
Christian König
d7342f6a81 r600g: merge alu groups 2011-01-13 23:01:35 +01:00
Christian König
eea1d8199b r600g: implement replacing gpr with pv and ps 2011-01-13 23:01:35 +01:00
Ian Romanick
4bcff0c190 glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'
The specs that add 'layout' require the use of 'in' or 'out'.
However, a number of implementations, including Mesa, shipped several
of these extensions allowing the use of 'varying' and 'attribute'.
For these extensions only a warning is emitted.

This differs from the behavior of Mesa 7.10.  Mesa 7.10 would only
accept 'attribute' with 'layout(location)'.  This behavior was clearly
wrong.  Rather than carrying the broken behavior forward, we're just
doing the correct thing.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:38:50 -08:00
Ian Romanick
82c4b4f88a glsl: Allow 'in' and 'out' when 'layout' is also available
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.

This is related to (piglit) bugzilla #31804.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-13 13:35:50 -08:00
José Fonseca
e1bc68b014 scons: Fix cross-compilation.
Hairy stuff. Don't know how to do it better though.
2011-01-13 20:53:42 +00:00
Christian König
0448f73f06 r600g: add missing RECIPSQRT_CLAMPED to r600_bc_get_num_operands 2011-01-13 21:29:47 +01:00
Christian König
a25b91c2c2 r600g: rework bank swizzle code 2011-01-13 21:22:00 +01:00
Christian König
89275c0b36 r600g: fix alu slot assignment 2011-01-13 19:41:07 +01:00
Christian König
236e99fe05 r600g: optimize away CF ALU instructions even if type doesn't match 2011-01-13 19:41:07 +01:00
Christoph Bumiller
370ae0bd61 nvc0: identify POINT_RASTER_RULES, add POINT_SMOOTH state
Point smoothing requires rasterization rules to be set to OGL.

Sorry for the extra noise caused by the header update.
2011-01-13 19:36:25 +01:00
Chia-I Wu
abbb1c8f08 draw: Fix an off-by-one bug in a vsplit assertion.
When use_spoken is true, istart (the first vertex of this segment) is
replaced by i0 (the spoken vertex of the fan).  There are still icount
vertices.

Thanks to Brian Paul for spotting this.
2011-01-14 02:02:26 +08:00
Vinson Lee
1f66930332 i965: Remove unnecessary headers. 2011-01-13 09:28:47 -08:00
Vinson Lee
d599df8a8c targets/egl-static: Remove unnecessary header. 2011-01-13 09:16:25 -08:00
Vinson Lee
eb70e58caf r600g: Silence uninitialized variable warnings. 2011-01-13 09:07:19 -08:00
Vinson Lee
d76f1da7cb mesa: Add missing break statement in SARGB8 case. 2011-01-13 08:53:33 -08:00
Brian Paul
ca31c596e8 egl: need stdio.h for non-Windows build too to avoid compiler warning 2011-01-13 09:25:55 -07:00
Paulo Zanoni
dad914f6b2 dri_util: fail driCreateNewScreen if InitScreen is NULL
Without this, X doesn't start with UMS on r300g.

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-13 07:44:33 -07:00
José Fonseca
9277a62aa3 scons: Ensure the OpenVG/EGL import libs are also prefixed with 'lib'. 2011-01-13 12:33:41 +00:00
José Fonseca
63528c4510 scons: Build libOpenVG.dll & libEGL.dll
But without creating liblibOpenVG or liblibEGL elsewhere.

Thanks Chia-I Wu for pointing this out.
2011-01-13 11:54:43 +00:00
José Fonseca
80f18876f6 util: Undo spurious changes in last commit. 2011-01-13 11:45:40 +00:00
José Fonseca
fe2cfd9b19 util: Don't limit debug_printf message length on unices. 2011-01-13 11:44:16 +00:00
Chia-I Wu
a22a332fc7 egl: Improve driver selection.
The idea is to be able to match a driver using the following order

  try egl_gallium with hw renderer
  try egl_dri2
  try egl_gallium with sw renderer
  try egl_glx

given the module list

  egl_gallium
  egl_dri2
  egl_glx

For that, UseFallback initialization option is added.  The module list
is matched twice: with the option unset and with the option set.  In the
first pass, egl_gallium skips its sw renderer and egl_glx rejects to
initialize since UseFallback is not set.  In the second pass,
egl_gallium skips its hw renderer and egl_dri2 rejects to initialize
since UseFallback is set.  The process stops at the first driver that
initializes the display.
2011-01-13 18:15:45 +08:00
Chia-I Wu
655e459892 egl: Simplify driver matching.
Add initialization options that drv->API.Initialize should support.
Replace drv->Probe by TestOnly initialization option and simplify
_eglMatchDriver.
2011-01-13 18:10:38 +08:00
Chia-I Wu
a4a38dcf61 egl: Cleanup _EGLDisplay initialization.
Reorder/rename and document the fields that should be set by the driver during
initialization.  Drop the major/minor arguments from drv->API.Initialize.
2011-01-13 17:57:38 +08:00
Kenneth Graunke
47b2af2c62 glsl/s_expression: Read and ignore Scheme-style comments.
A single-semicolon until the end of the line, i.e.
; this is a comment.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
5bfb68cd0f glsl/builtins: Remove unnecessary (constant bool (1)) from assignments.
This isn't strictly necessary, but is definitely nicer.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
bbafd2b849 ir_reader: Make assignment conditions optional.
You can now simply write (assign (xy) <lhs> <rhs>) instead of the
verbose (assign (constant bool (1)) (xy) <lhs> <rhs>).
2011-01-12 23:55:34 -08:00
Kenneth Graunke
b74ff382a4 ir_reader: Convert to a class.
This makes it unnecessary to pass _mesa_glsl_parse_state around
everywhere, making at least the prototypes a lot easier to read.

It's also more C++-ish than a pile of static C functions.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
ec7e4f0ec5 ir_reader: Combine the three dereference reading functions into one.
These used to be more complicated, but now are so simple there's no real
point in keeping them separate.
2011-01-12 23:55:34 -08:00
Kenneth Graunke
e486fca2d3 ir_reader: Relax requirement that function arguments be s_lists.
All of these functions used to take s_list pointers so they wouldn't all
need SX_AS_LIST conversions and error checking.  However, the new
pattern matcher conveniently does this for us in one centralized place.

So there's no need to insist on s_list.  Switching to s_expression saves
a bit of code and is somewhat cleaner.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
d798815272 ir_reader: Remove s_list::length() method.
Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
2011-01-12 23:55:33 -08:00
Kenneth Graunke
daeb0c646e ir_reader: Add a pattern matching system and use it everywhere.
Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
   right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly.  Error checking had to be done
at both steps 1, 3, and 4.  Most code didn't even check the tag, relying
on the caller to do so.  Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
2011-01-12 23:55:33 -08:00
Dave Airlie
407184fe08 mesa/srgb: handle SARGB8 case in the sw fbo renderer. 2011-01-13 16:51:30 +10:00
Fredrik Höglund
71b889f904 st/mesa: fix a regression from cae2bb76
stObj->pt is null when a TFP texture is passed to st_finalize_texture,
and with the changes introduced in the above commit this resulted in a
new texture being created and the existing image being copied into it.

NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-13 01:22:20 -05:00
Ben Skeggs
bd2b72359e nvc0: disable calling of sw methods we don't implement
Left in the code as a marker of what NVIDIA do, just in case we need
to do this some day.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 15:26:31 +10:00
Dave Airlie
8c8e26d66a mesa/fbo: prevent assert trigger on i965 with piglit fbo-srgb test. 2011-01-13 15:17:34 +10:00
Ben Skeggs
0c1db2feb9 nvc0: fix mp_stack_bo relocation
Fixes a PT_NOT_PRESENT error cause by:
- allocating in VRAM
- emitting GART relocs to 0x17bc/0x17c0, moving the buffer
- telling the bufmgr that the buffer should be in VRAM when we use it,
  but not correcting the value sent to 0x17bc/0x17c0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-01-13 13:31:29 +10:00
Vinson Lee
31b1051663 mesa: Move loop variable declarations outside for loop in extensions.c.
Fixes MSVC build.
2011-01-12 17:43:28 -08:00
Brian Paul
dd973cd9e8 mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
Fixes a failed assertion when a renderbuffer ID that was gen'd but not
previously bound was passed to glFramebufferRenderbuffer().  Generate
the same error that NVIDIA does.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:14:18 -07:00
Brian Paul
67722ae403 mesa: don't assert in GetIntegerIndexed, etc
We were getting an assertion upon invalid pname.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 18:13:18 -07:00
Brian Paul
2fa6012f6a mesa: fix num_draw_buffers==0 in fixed-function fragment program generation
This fixes a problem when glDrawBuffers(GL_NONE).  The fragment program
was writing to color output[0] but OutputsWritten was 0.  That led to a
failed assertion in the Mesa->TGSI translation code.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 17:55:45 -07:00
Brian Paul
30616fdacf st/mesa: add st_BeginQuery() case for GL_ANY_SAMPLES_PASSED
Fixes piglit occlusion_query2 failure.
2011-01-12 17:55:44 -07:00
Brian Paul
1b173fb3ba glsl: remove trailing comma to silence warning 2011-01-12 17:55:44 -07:00
Brian Paul
4d96af9337 noop: change var type to silence warning 2011-01-12 17:55:44 -07:00
Kenneth Graunke
b076551e3b glsl/Makefile: Fix build with --as-needed. 2011-01-12 16:37:03 -08:00
Vinson Lee
356e2e962f mesa: Move declaration before code in extensions.c.
Fixes SCons build.
2011-01-12 16:23:11 -08:00
Chad Versace
a7b5664c05 mesa: Change OES_point_sprite to depend on ARB_point_sprite
The extension string in GLES1 contexts always advertised
GL_OES_point_sprite. Now advertisement depends on ARB_point_sprite being
enabled.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
039150169e mesa: Change dependencies of some OES extension strings
Change all OES extension strings that depend on ARB_framebuffer_object to
instead depend on EXT_framebuffer_object.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
19418e921a mesa: Add/remove extensions in extension string
Add GL_OES_stencil8 to ES2.

Remove the following:
   GL_OES_compressed_paletted_texture : ES1
   GL_OES_depth32                     : ES1, ES2
   GL_OES_stencil1                    : ES1, ES2
   GL_OES_stencil4                    : ES1, ES2
Mesa advertised these extensions, but did not actually support them.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-01-12 15:45:03 -08:00
Chad Versace
9b260c377f mesa: Refactor handling of extension strings
Place GL, GLES1, and GLES2 extensions in a unified extension table. This
allows one to enable, disable, and query the status of GLES1 and GLES2
extensions by name.

When tested on Intel Ironlake, this patch did not alter the extension
string [as given by glGetString(GL_EXTENSIONS)] for any API.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-01-12 15:45:03 -08:00
Ian Romanick
bd33055ef4 glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being
used.

Fixes piglit test invariant-05.vert and bugzilla #29164.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-12 14:30:31 -08:00
Eric Anholt
c3f000b392 i965/fs: Do flat shading when appropriate.
We were trying to interpolate, which would end up doing unnecessary
math, and doing so on undefined values.   Fixes glsl-fs-flat-color.
2011-01-12 13:51:01 -08:00
Christian König
6881262eff r600g: also look at tex inst when for maximum gpu count 2011-01-12 20:41:15 +01:00
Vinson Lee
a42906f862 generate_builtins.py: Add missing import.
Import sys for sys.exit.
2011-01-12 11:35:43 -08:00
Eric Anholt
e1fb511570 meta: Actually use mipmapping when generating mipmaps.
With the change to not reset baselevel, this GL_LINEAR filtering was
resulting in generating mipmaps off of the base level instead of the
next higher detail level.  Fixes fbo-generatemipmap-filtering.

Reported by: Neil Roberts <neil@linux.intel.com>
2011-01-12 11:08:07 -08:00
Eric Anholt
e880a57a71 i965: Clarify when we need to (re-)calculate live intervals.
The ad-hoc placement of recalculation somewhere between when they got
invalidated and when they were next needed was confusing.  This should
clarify what's going on here.
2011-01-12 11:08:07 -08:00
Christian König
c60cb25bfb r600g: implement output modifiers and use them to further optimize LRP 2011-01-12 19:44:49 +01:00
Christian König
7728bef290 r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2011-01-12 19:40:52 +01:00
Christian König
dffad730df r600g: optimize temp register handling for LRP 2011-01-12 19:36:55 +01:00
Christian König
8813842121 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2011-01-12 19:31:36 +01:00
Christian König
052b9e8fab r600g: make dumping of shaders an option 2011-01-12 19:17:49 +01:00
Christian König
95a2b265fa r600g: fix alu dumping 2011-01-12 19:17:49 +01:00
Christian König
47e7c6f571 r600g: improve r600_bc_dump 2011-01-12 19:17:49 +01:00
Eric Anholt
9351ef7a44 i965/vs: When MOVing to produce ABS, strip negate of the operand.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-vs-abs-neg.
2011-01-12 09:50:34 -08:00
Eric Anholt
ab56e3be9a i965/fs: When producing ir_unop_abs of an operand, strip negate.
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-fs-abs-neg.
2011-01-12 09:50:10 -08:00
José Fonseca
416ca90138 glsl: Make builtin_compiler build on Windows with MSVC. 2011-01-12 16:58:37 +00:00
José Fonseca
0035d1d902 glsl: Make builtin_compiler portable for non-unices. 2011-01-12 16:54:25 +00:00
José Fonseca
f9bb5323eb getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
José Fonseca
6d670f6c0f getopt: Import OpenBSD getopt implementation for MSVC. 2011-01-12 15:32:17 +00:00
José Fonseca
46662de68b scons: Update windows build for vgapi->openvg rename. 2011-01-12 15:13:57 +00:00
José Fonseca
b07ad1d6bd scons: Fix build on systems without libOpenVG.so 2011-01-12 15:06:57 +00:00
Chia-I Wu
1e4f412242 egl: When EGL_DRIVER is set, do not add other drivers.
Setting EGL_DRIVER forces the driver to be loaded, as documented.  There
should be no fallbacks.
2011-01-12 18:10:15 +08:00
Chia-I Wu
4924cb9036 egl: libEGL depends on LOCAL_LIBS.
So that libEGL is rebuilt whenever LOCAL_LIBS changes.
2011-01-12 18:10:15 +08:00
Chia-I Wu
39812c48df egl_dri2: Fix eglGetProcAddress.
The driver struct is zeroed after dri2_load.  Oops.
2011-01-12 18:10:15 +08:00
Chia-I Wu
a8b6b6555c scons: Updates for targets/egl-static.
Update SConscripts to re-enable or add support for EGL on windows and
x11 platforms respectively.  targets/egl-gdi is replaced by
targets/egl-static, where "-static" means pipe drivers and state
trackers are linked to statically by egl_gallium, and egl_gallium is a
built-in driver of libEGL.  There is no more egl_gallium.dll on Windows.
2011-01-12 17:40:01 +08:00
Chia-I Wu
49ed5bb28d targets/egl-static: New EGL target for scons.
This target is based on and replaces egl-gdi.  It is suitable for both
windows and x11.
2011-01-12 17:40:01 +08:00
Kenneth Graunke
1412dea949 glsl: Add type inference support for remaining expression opcodes. 2011-01-11 23:28:58 -08:00
Eric Anholt
4eb7284ef9 i965: Tighten up the check for flow control interfering with coalescing.
This greatly improves codegen for programs with flow control by
allowing coalescing for all instructions at the top level, not just
ones that follow the last flow control in the program.
2011-01-11 16:04:25 -08:00
Christian König
93a95ad8ff r600g: texture instructions also work fine with TGSI_FILE_INPUT 2011-01-12 00:44:30 +01:00
Christian König
a1146c1373 r600g: DP4 also supports writemasking 2011-01-12 00:41:49 +01:00
Christian König
7be5455796 r600g: Why all this fiddling with tgsi_helper_copy?
tgsi_helper_copy is used on several occasions to copy a temporary result
into the real destination register to emulate writemasks for OP3 and
reduction operations. According to R600 ISA that's unnecessary.

This patch fixes this use for MAD, CMP and DP4.
2011-01-12 00:40:55 +01:00
Christian König
cc0f604241 r600g: fix tex and vtx joining 2011-01-12 00:06:48 +01:00
Eric Anholt
c00bc13564 glsl: Fix the lowering of variable array indexing to not lose write_masks.
Fixes glsl-complex-subscript on 965.
2011-01-11 14:50:19 -08:00
Eric Anholt
5acf94e955 i965: Remove dead fallback for stencil _Enabled but no stencil buffer.
The _Enabled field is the thing that takes into account whether
there's a stencil buffer.  Tested with piglit glx-visuals-stencil.
2011-01-11 13:48:31 -08:00
Tilman Sauerbeck
242205404d r600g: Fixed SIN/COS/SCS for the case where the operand is a literal.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-11 22:37:01 +01:00
Alberto Milone
ca8960234e r600c: add evergreen ARL support.
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
2011-01-11 14:48:44 -05:00
Jerome Glisse
0865af4b42 noop: remove dead dri target
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:46:09 -05:00
Jerome Glisse
63b9790a55 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:34:25 -05:00
Brian Paul
483f566222 configure: bump libdrm version requirement to 2.4.23
NOTE: This is a candidate for the 7.10 (and 7.9?) branch.
2011-01-11 09:42:54 -07:00
Brian Paul
167db6d34f mesa: include teximage.h to silence warning 2011-01-11 09:37:35 -07:00
Brian Paul
d92e56460e mesa: do a debug check of _mesa_format_to_type_and_comps()
Make sure that all formats are handled in this function.  It's
easy to miss this function when adding new pixel formats.

See also http://bugs.freedesktop.org/show_bug.cgi?id=31544
2011-01-11 09:27:06 -07:00
Brian Paul
0073f50cd4 mesa: fix a few format table mistakes, assertions
The BaseFormat field was incorrect for a few R and RG formats.
Fix a couple assertions too.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-11 09:27:06 -07:00
Kenneth Graunke
33d0c44910 glsl: Autogenerate builtin_functions.cpp as part of the build process.
Python is already necessary for other parts of Mesa, so there's no
reason we can't just generate it.  This patch updates both make and
SCons to do so.
2011-01-10 19:03:27 -08:00
Ian Romanick
469ea695bb glsl: Disallow 'in' and 'out' on globals in GLSL 1.20
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.

NOTE: This is a candidate for the 7.9 and 7.10 branches.  This patch
also depends on the previous two commits.
2011-01-10 17:39:16 -08:00
Ian Romanick
a0c2ec8e2d glsl: Refresh autogenerated parser file.
For the previous commit.
2011-01-10 17:39:16 -08:00
Ian Romanick
eebdfdfbcf glsl: Add version_string containing properly formatted GLSL version 2011-01-10 17:39:16 -08:00
Ian Romanick
a302d740bd glcpp: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-10 17:38:56 -08:00
Ian Romanick
9ca5300b6e glcpp: Generate an error for division by zero
When GCC encounters a division by zero in a preprocessor directive, it
generates an error.  Since the GLSL spec says that the GLSL
preprocessor behaves like the C preprocessor, we should generate that
same error.

It's worth noting that I cannot find any text in the C99 spec that
says this should be an error.  The only text that I can find is line 5
on page 82 (section 6.5.5 Multiplicative Opertors), which says,

    "The result of the / operator is the quotient from the division of
    the first operand by the second; the result of the % operator is
    the remainder. In both operations, if the value of the second
    operand is zero, the behavior is undefined."

Fixes 093-divide-by-zero.c test and bugzilla #32831.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-10 17:37:51 -08:00
Chad Versace
4e09a786d2 glcpp: Regenerate glcpp-parse.c 2011-01-10 17:28:24 -08:00
Chad Versace
4fff52f1c9 glcpp: Fix segfault when validating macro redefinitions
In _token_list_equal_ignoring_space(token_list_t*, token_list_t*), add
a guard that prevents dereferncing a null token list.

This fixes test src/glsl/glcpp/tests/092-redefine-macro-error-2.c and
Bugzilla #32695.
2011-01-10 17:28:24 -08:00
Eric Anholt
c0cdae0368 i965: Use a new miptree to avoid software fallbacks due to drawing offset.
When attaching a small mipmap level to an FBO, the original gen4
didn't have the bits to support rendering to it.  Instead of falling
back, just blit it to a new little miptree just for it, and let it get
revalidated into the stack later just like any other new teximage.

Bug #30365.
2011-01-10 17:21:54 -08:00
Eric Anholt
6bdc319421 intel: Drop the speculatively-use-firstImage-mt in validation.
It's been replaced by just setting texObj->mt to image->mt at TexImage
time.
2011-01-10 17:21:11 -08:00
Eric Anholt
bdc6dc1d7e intel: Don't relayout the texture on maxlevel change.
This avoids relayouts in the common case of glGenerateMipmap() or
people doing similar things.

Bug #30366.
2011-01-10 17:21:11 -08:00
Eric Anholt
48024fb44c intel: When making a new teximage miptree, make a full one.
If we hit this path, we're level 1+ and the base level got allocated
as a single level instead of a full tree (so we don't match
intelObj->mt).  This tries to recover from that so that we end up with
2 allocations and 1 validation blit (old -> new) instead of
allocations equal to number of levels and levels - 1 blits.
2011-01-10 17:21:11 -08:00
Eric Anholt
bd4a2e9209 meta: Don't tweak BaseLevel when doing glGenerateMipmap().
We don't need to worry about levels other than MaxLevel because we're
minifying -- the lower levels (higher detail) won't contribute to the
result.  By changing BaseLevel, we forced hardware that doesn't
support BaseLevel != 0 to relayout the texture object.
2011-01-10 17:21:11 -08:00
Eric Anholt
5b3eb7538c Revert "intel: Always allocate miptrees from level 0, not tObj->BaseLevel."
This reverts commit 7ce6517f3a.
This reverts commit d60145d06d.

I was wrong about which generations supported baselevel adjustment --
it's just gen4, nothing earlier.  This meant that i915 would have
never used the mag filter when baselevel != 0.  Not a severe bug, but
not an intentional regression.  I think we can fix the performance
issue another way.
2011-01-10 17:21:10 -08:00
Kenneth Graunke
da0c0dbab0 i965: Add #defines for HiZ and separate stencil buffer commands. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
4b929c75e2 i965: Add new HiZ related bits to WM_STATE. 2011-01-10 15:44:32 -08:00
Kenneth Graunke
1feee7b1b3 i965: Rename more #defines to 3DSTATE rather than CMD or CMD_3D.
Again, this makes it match the documentation.
2011-01-10 15:44:32 -08:00
Kenneth Graunke
6c5e6cd130 i965: Remove unused #defines which only contain the sub-opcode.
Most _3DSTATE defines contain the command type, sub-type, opcode, and
sub-opcode (i.e. 0x7905).  These, however, contain only the sub-opcode
(i.e. 0x05).  Since they are inconsistent with the rest of the code and
nothing uses them, simply delete them.

The _3DOP and _3DCONTROL defines seemed similar, and were also unused.
2011-01-10 15:44:32 -08:00
Chad Versace
61428dd2ab glsl: At link-time, check that globals have matching centroid qualifiers
Fixes bug 31923: http://bugs.freedesktop.org/show_bug.cgi?id=31923
2011-01-10 15:29:30 -08:00
Tom Fogal
0e3ff159f9 Add GLX_TLS setting to configs/default.
Should have gone in with 31351dc029,
thanks to Dan Nicholson for noticing.
2011-01-10 15:39:21 -07:00
Dave Airlie
a988ddf379 mesa/swrast: handle sRGB FBOs correctly (v2)
From reading EXT_texture_sRGB and EXT_framebuffer_sRGB and interactions
with FBO I've found that swrast is converting the sRGB values to linear for
blending when an sRGB texture is bound as an FBO. According to the spec
and further explained in the framebuffer_sRGB spec this behaviour is not
required unless the GL_FRAMEBUFFER_SRGB is enabled and the Visual/config
exposes GL_FRAMEBUFFER_SRGB_CAPABLE_EXT.

This patch fixes swrast to use a separate Fetch call for FBOs bound to
SRGB and avoid the conversions.

v2: export _mesa_get_texture_dimensions as per Brian's comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-11 08:32:33 +10:00
Tom Fogal
31351dc029 Export TLS support in gl.pc. 2011-01-10 12:34:02 -07:00
Marek Olšák
9d33e4e16c r300g: add debug option for buffer upload logging 2011-01-10 05:45:10 +01:00
Chia-I Wu
97e9a0e23f st/egl: Fix a void pointer arithmetic warning. 2011-01-10 11:51:13 +08:00
Chia-I Wu
12583174c5 mesa: Remove GLES overlay.
With core mesa doing runtime API checks, GLES overlay is no longer
needed.  Make --enable-gles-overlay equivalent to --enable-gles[12].
There may still be places where compile-time checks are done.  They
could be fixed case by case.
2011-01-10 11:50:35 +08:00
Chia-I Wu
c98ea26e16 egl: Make egl_dri2 and egl_glx built-in drivers.
These two drivers are small in size.  Making them built-in should
simplify packaging.
2011-01-10 11:50:34 +08:00
Chia-I Wu
15f0223931 egl_glx: Load libGL dynamically.
This is a step forward for compatibility with really old GLX.  But the
real reason for making this change now is so that we can make egl_glx a
built-in driver without having to link to libGL.
2011-01-10 11:25:31 +08:00
Chia-I Wu
fef5d14494 egl_dri2: Look up _glapi_get_proc_address dynamically.
In preparation for making egl_dri2 built-in.  It also handles

  symbol lookup error: /usr/local/lib/egl/egl_dri2.so: undefined symbol:
  _glapi_get_proc_address

more gracefully.
2011-01-10 11:23:24 +08:00
Vinson Lee
231ca0ec85 r600: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:29:02 -08:00
Vinson Lee
c45814d6d3 r300: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:25:36 -08:00
Vinson Lee
7a1cdef6c4 r200: Include mfeatures.h in files that perform feature tests. 2011-01-09 18:22:07 -08:00
Jerome Glisse
3349517351 noop: make noop useable like trace or rbug
If you want to enable noop set GALLIUM_NOOP=1 as an env variable.
You need first to enable noop wrapping for your driver see change
to src/gallium/targets/dri-r600/ in this commit as an example.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-09 21:04:41 -05:00
Marek Olšák
ac6306e9ca r300g: do not upload the same user buffer several times
Performance++.
2011-01-09 22:43:41 +01:00
Christoph Bumiller
b3d8e1fb3b nvc0: implement queries 2011-01-09 21:50:06 +01:00
Juan Zhao
e59fa4c46c dri2: release texture image.
Add release function for texture_from_pixmap extension.
Some platform need to release texture image for texture_from_pixmap
extension, add this interface for those platforms.
2011-01-09 14:55:16 -05:00
Vinson Lee
fb9c6e681f radeon: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:45:04 -08:00
Vinson Lee
1933e97034 dri/nouveau: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:33:14 -08:00
Vinson Lee
45a56e4730 intel: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:25:54 -08:00
Vinson Lee
14b36cd568 vbo: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:18:23 -08:00
Vinson Lee
edc09358f7 st/mesa: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:04:19 -08:00
Vinson Lee
21750a2d9d mesa: Include mfeatures.h in program.c.
Include mfeatures.h for feature tests.
2011-01-09 00:47:33 -08:00
Dave Airlie
97195d04fd i965g: fix warnings 2011-01-09 17:25:12 +10:00
Dave Airlie
5e044e3900 i965g: update intel_decode from upstream. 2011-01-09 17:21:52 +10:00
Dave Airlie
3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Dave Airlie
9562284114 i965g: update brw_defines.h from classic driver 2011-01-09 17:21:10 +10:00
Dave Airlie
571b317d02 i965g: update brw_structs.h from classic driver. 2011-01-09 17:21:10 +10:00
Dave Airlie
5826967d2e i965g: update to similiar gen stuff as i965 2011-01-09 17:21:10 +10:00
Marek Olšák
3332229b3b r300g: fix crash when flushing ZMASK
https://bugs.freedesktop.org/show_bug.cgi?id=32912

The fix is to call update_derived_state before user buffer uploads.
I've also moved some code around.

Unfortunately, there are still some ZMASK-related bugs which cause
misrendering, i.e. flushing doesn't always work and glean/fbo fails.
2011-01-09 06:14:23 +01:00
Marcin Slusarz
69191d4123 targets/egl: add libnvc0.a to nouveau libs 2011-01-09 00:46:35 +01:00
Christoph Bumiller
90e29afcb6 nvfx,nv50: pipe_reference the constant buffers 2011-01-08 15:40:14 +01:00
Christoph Bumiller
703f3597ad nvc0: fix primitive restart in immediate mode 2011-01-08 14:25:20 +01:00
Vinson Lee
d8cfe46442 mesa: Clean up header file inclusion in cpuinfo.c. 2011-01-08 03:03:17 -08:00
Marek Olšák
7c16a77b00 r300g: fix a surface leak when flushing ZMASK 2011-01-08 09:42:17 +01:00
Marek Olšák
1f0348c4a2 r300g: rework command submission and resource space checking
The motivation behind this rework is to get some speed by reducing
CPU overhead. The performance increase depends on many factors,
but it's measurable (I think it's about 10% increase in Torcs).

This commit replaces libdrm's radeon_cs_gem with our own implemention.
It's optimized specifically for r300g, but r600g could use it as well.
Reloc writes and space checking are faster and simpler than their
counterparts in libdrm (the time complexity of all the functions
is O(1) in nearly all scenarios, thanks to hashing).
(libdrm's radeon_bo_gem is still being used in the driver.)

It works like this:

cs_add_reloc(cs, buf, read_domain, write_domain) adds a new relocation and
also adds the size of 'buf' to the used_gart and used_vram winsys variables
based on the domains, which are simply or'd for the accounting purposes.
The adding is skipped if the reloc is already present in the list, but it
accounts any newly-referenced domains.

cs_validate is then called, which just checks:
    used_vram/gart < vram/gart_size * 0.8
The 0.8 number allows for some memory fragmentation. If the validation
fails, the pipe driver flushes CS and tries do the validation again,
i.e. it validates only that one operation. If it fails again, it drops
the operation on the floor and prints some nasty message to stderr.

cs_write_reloc(cs, buf) just writes a reloc that has been added using
cs_add_reloc. The read_domain and write_domain parameters have been removed,
because we already specify them in cs_add_reloc.

The space checking has been tested by putting small values in vram/gart_size
variables.
2011-01-08 07:05:42 +01:00
Eric Anholt
29c4f95cbc intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
2011-01-07 18:25:54 -08:00
Eric Anholt
8f593597fc intel: Use the _BaseFormat from MESA_FORMAT_* in renderbuffer setup. 2011-01-07 18:25:54 -08:00
Marek Olšák
aa6456dcd1 docs: fix messed up names with special characters in relnotes-7.9.1
(cherry picked from commit 67aeab0b77)
2011-01-08 03:10:18 +01:00
Marek Olšák
8d61a3f408 docs: fix messed up names with special characters in relnotes-7.10
(cherry picked from commit 36009724fd)
2011-01-08 03:09:47 +01:00
Eric Anholt
5df51c2bb0 i915: Drop old checks for the settexoffset hack. 2011-01-07 17:49:03 -08:00
Eric Anholt
372dc4cd6c i915: Don't claim to support AL1616 when neither 830 nor 915 does it.
Fixes an abort in fbo-generatemipmap-formats.
2011-01-07 17:49:03 -08:00
Eric Anholt
a7bf723056 intel: Add a vtbl hook for determining if a format is renderable.
By relying on just intel_span_supports_format, some formats that
aren't supported pre-gen4 were not reporting FBO incomplete.  And we
also complained in stderr when it happened on i915 because draw_region
gets called before framebuffer completeness validation.
2011-01-07 17:49:03 -08:00
Eric Anholt
f3240547f9 intel: expose ARB_framebuffer_object in the i915 driver.
ARB_fbo no longer disallows mismatched width/height on attachments
(shouldn't be any problem), mixed format color attachments (we only
support 1), and L/A/LA/I color attachments (we already reject them on
965 too).  It requires Gen'ed names (driver doesn't care), and adds
FramebufferTextureLayer (we don't do texture arrays).  So it looks
like we're already in the position we need to be for this extension.

Bug #27468, #32381.
2011-01-07 17:49:03 -08:00
Christoph Bumiller
8b2a46c0de nvc0: fix reloc domain conflict on buffer migration
Occurred because the code assumed that buf->domain would remain
equal to old_domain.
2011-01-08 02:14:00 +01:00
Christoph Bumiller
b2a79953a6 nvc0: upload user buffers only from draw info min to max index
There are actually applications that profit immensely from this.
2011-01-08 02:13:54 +01:00
Christoph Bumiller
64b639959f nvc0: fix emission of first 3 u8 indices to RING_NI 2011-01-08 02:13:10 +01:00
Christoph Bumiller
f5f086ca92 nvc0: reset mt transfer address after read loop over layers 2011-01-08 02:12:56 +01:00
Christoph Bumiller
bd301dfc12 nvc0: tie buffer memory release to the buffer fence
... instead of the next fence to be emitted. This way we have a
chance to reclaim the storage earlier.
2011-01-08 02:12:20 +01:00
Łukasz Krotowski
96d8a54716 r300g: Remove invalid assertion.
Invalid after be1af4394e (user buffer
creation with width0 == ~0).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-01-08 01:35:02 +01:00
Ian Romanick
1e1aef567f docs: Import 7.10 release notes from 7.10 branch 2011-01-07 14:38:23 -08:00
Eric Anholt
1d1ad6306d i965: Avoid double-negation of immediate values in the VS.
In general, we have to negate in immediate values we pass in because
the src1 negate field in the register description is in the bits3 slot
that the 32-bit value is loaded into, so it's ignored by the hardware.
However, the src0 negate field is in bits1, so after we'd negated the
immediate value loaded in, it would also get negated through the
register description.  This broke this VP instruction in the position
calculation in civ4:

MAD TEMP[1], TEMP[1], CONST[256].zzzz, CONST[256].-y-y-y-y;

Bug #30156
2011-01-07 14:35:42 -08:00
Ian Romanick
46a360b26a docs: Import 7.9.1 release notes from 7.9 branch 2011-01-07 13:39:40 -08:00
Henri Verbeet
82acc3b14c r600g: Also set const_offset if the buffer is not a user buffer in r600_upload_const_buffer(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
f39dfa0ab0 r600g: Update some comments for Evergreen. 2011-01-07 18:21:12 +01:00
Henri Verbeet
97e2aa31c6 r600g: Split ALU clauses based on used constant cache lines. 2011-01-07 18:21:12 +01:00
Henri Verbeet
2a134534a6 r600g: Consistently use the copy of the alu instruction in r600_bc_add_alu_type(). 2011-01-07 18:21:12 +01:00
Henri Verbeet
8273921b7a r600g: Store kcache settings as an array. 2011-01-07 18:21:12 +01:00
Marek Olšák
be1af4394e r300g: derive user buffer sizes at draw time
This only uploads the [min_index, max_index] range instead of [0, userbuf size],
which greatly speeds up user buffer uploads.

This is also a prerequisite for atomizing vertex arrays in st/mesa.
2011-01-07 16:23:49 +01:00
Jian Zhao
2a7380e9c3 mesa: fix an error in uniform arrays in row calculating.
Fix the error in uniform row calculating, it may alloc one line
more which may cause out of range on memory usage, sometimes program
aborted when free the memory.

NOTE: This is a candidate for 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-07 07:22:18 -07:00
Vinson Lee
db61b9ce39 mesa: Directly include mfeatures.h in files that perform feature tests. 2011-01-07 00:13:00 -08:00
Alex Deucher
7c320a869b r600c: fix up SQ setup in blit code for Ontario/NI 2011-01-07 03:10:50 -05:00
Dave Airlie
6d9ca78ef7 r600g: allow constant buffers to be user buffers.
This provides an upload facility for the constant buffers since Marek's
constants in user buffers changes.

gears at least work on my evergreen now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-07 10:35:41 +10:00
Alex Deucher
7b97bdba40 r600c: add support for NI asics 2011-01-06 18:40:17 -05:00
Alex Deucher
f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Kenneth Graunke
e31defc825 i965: Rename various gen6 #defines to match the documentation.
This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
2011-01-06 13:56:26 -08:00
Jakob Bornecrantz
ff0f087513 svga: Ensure that the wrong vdecls don't get used in swtnl path
The draw module set new state that didn't require swtnl which caused need_swtnl to
be unset. This caused the call from to svga_update_state(svga, SVGA_STATE_SWTNL_DRAW)
from the vbuf backend to overwrite the vdecls we setup there to be overwritten with
the real buffers vdecls.
2011-01-06 20:09:07 +00:00
Ian Romanick
f2d0f776b1 glsl: Refresh autogenerated lexer and parser files.
For the previous commit.
2011-01-06 10:53:38 -08:00
Ian Romanick
86b4398cd1 glsl: Support the 'invariant(all)' pragma
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler.  This adds support for setting all
variable invariant.

In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.

Fixes piglit test glsl-invariant-pragma and bugzilla #31925.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-06 10:49:56 -08:00
Ian Romanick
e942f32836 glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
2011-01-06 10:06:59 -08:00
Marek Olšák
c60f1d8b00 r300g: fix corruption when nr_cbufs==0 and multiwrites enabled
https://bugs.freedesktop.org/show_bug.cgi?id=32634
2011-01-06 19:05:31 +01:00
Marek Olšák
6125cbe983 r300g: remove the buffer range checking
It's no longer needed because the upload buffer remains mapped while the CS
is being filled (openarena, ut2004 and others that this code was for do not
use VBOs by default).
2011-01-06 16:59:32 +01:00
Marek Olšák
31afa7616e r300g: skip buffer validation of upload buffers when appropriate
because the upload buffers are reused for subsequent draw operations.
2011-01-06 16:51:54 +01:00
Marek Olšák
45b51a9e70 util: add comments to u_upload_mgr and u_inlines 2011-01-06 16:16:30 +01:00
Marek Olšák
984d64881f vbo: remove a redundant call to _ae_invalidate_state
It's called in vbo_exec_invalidate_state too.
2011-01-06 16:16:30 +01:00
Marek Olšák
009cecf246 st/mesa: remove unused members in st_context
What were these for?
2011-01-06 16:16:30 +01:00
Marek Olšák
92209314df tgsi: remove redundant name tables from tgsi_text, use those from tgsi_dump
I also specified the array sizes in the header so that one can use
the Elements macro on it.
2011-01-06 16:16:30 +01:00
Marek Olšák
3c9aa3a7b1 gallium: drivers should reference vertex buffers
So that a state tracker can unreference them after set_vertex_buffers.
2011-01-06 16:16:29 +01:00
Marek Olšák
58c5e782e3 st/mesa: optimize constant buffer uploads
The overhead of resource_create, transfer_inline_write, and resource_destroy
to upload constant data is very visible with some apps in sysprof, and
as such should be eliminated.

My approach uses a user buffer to pass a pointer to a driver. This gives
the driver the freedom it needs to take the fast path, which may differ
for each driver.

This commit addresses the same issue as Jakob's one that suballocates out
of a big constant buffer, but it also eliminates the copy to the buffer.
2011-01-06 16:16:29 +01:00
Marek Olšák
5adcd9c911 st/mesa: do sanity checks on states only in debug builds 2011-01-06 16:16:29 +01:00
Marek Olšák
06286110b4 u_upload_mgr: new features
- Added a parameter to specify a minimum offset that should be returned.
  r300g needs this to better implement user buffer uploads. This weird
  requirement comes from the fact that the Radeon DRM doesn't support negative
  offsets.

- Added a parameter to notify a driver that the upload flush occured.
  A driver may skip buffer validation if there was no flush, resulting
  in a better performance.

- Added a new upload function that returns a pointer to the upload buffer
  directly, so that the buffer can be filled e.g. by the translate module.
2011-01-06 16:16:29 +01:00
Marek Olšák
8b7bd3ce88 u_upload_mgr: keep the upload buffer mapped until it is flushed
The map/unmap overhead can be significant even though there is no waiting on busy
buffers. There is simply a huge number of uploads.

This is a performance optimization for Torcs, a car racing game.
2011-01-06 16:16:29 +01:00
Pierre Allegraud
8fd8de3995 mesa: fix build for NetBSD
See http://bugs.freedesktop.org/show_bug.cgi?id=32859

NOTE: This is a candidate for the 7.9 and 7.10 branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-06 08:00:01 -07:00
Brian Paul
1384aea50f glext: upgrade to version 67 2011-01-06 07:56:00 -07:00
Vinson Lee
ab564b516e mesa: Clean up header file inclusion in version.c.
Include imports.h directly instead of indirectly through context.h.
version.c does use any symbols that are added by context.h.
2011-01-06 00:45:08 -08:00
Vinson Lee
84ebd8e2d7 nvc0: Fix typo of nvc0_mm.c in SConscript. 2011-01-06 00:06:38 -08:00
Vinson Lee
becd98018b mesa: bump version to 7.11 2011-01-05 23:27:30 -08:00
Vinson Lee
0117da40cd mesa: Include mtypes.h in files that use gl_context struct.
Directly include mtypes.h if a file uses a gl_context struct. This
allows future removal of headers that are not strictly necessary but
indirectly include mtypes.h for a file.
2011-01-05 23:11:54 -08:00
Zou Nan hai
a728646fb5 i965: skip too small size mipmap
this fixes doom3 crash.
2011-01-06 11:36:23 +08:00
Eric Anholt
d60145d06d i915: Fix build for previous commit. 2011-01-05 18:28:13 -08:00
Eric Anholt
7ce6517f3a intel: Always allocate miptrees from level 0, not tObj->BaseLevel.
BaseLevel/MaxLevel are mostly used for two things: clamping texture
access for FBO rendering, and limiting the used mipmap levels when
incrementally loading textures.  By restricting our mipmap trees to
just the current BaseLevel/MaxLevel, we caused reallocation thrashing
in the common case, for a theoretical win if someone really did want
just levels 2..4 or whatever of their texture object.

Bug #30366
2011-01-05 18:23:54 -08:00
Eric Anholt
01b70c0628 intel: Drop unused first/lastlevel args to miptree_create_for_region.
We're always making a single-level, 0-baselevel miptree.
2011-01-05 18:11:31 -08:00
Vinson Lee
f84573d039 swrast: Include mtypes.h in s_triangle.c.
Include mtypes.h for gl_context symbol.
2011-01-05 17:46:39 -08:00
Vinson Lee
20d85865ec st/mesa: Include mtypes.h in st_cb_drawpixels.c.
Include mtypes.h for gl_context symbol.
2011-01-05 16:34:29 -08:00
Eric Anholt
1b18b45d79 intel: Clarify first_level/last_level vs baselevel/maxlevel by deletion.
This has always been ugly about our texture code -- object base/max
level vs intel object first/last level vs image level vs miptree
first/last level.  We now get rid of intelObj->first_level which is
just tObj->BaseLevel, and make intelObj->_MaxLevel clearly based off
of tObj->_MaxLevel instead of duplicating its code (incorrectly, as
image->MaxLog2 only considers width/height and not depth!)
2011-01-05 16:11:30 -08:00
Eric Anholt
9b7f57b18e mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification.  There's no way to do
anything sane with that, and drivers would get all sorts of angry.
2011-01-05 15:51:37 -08:00
Eric Anholt
39cc0ee3ea i915: Enable LOD preclamping on 8xx like on 915/965.
Fixes lodclamp-between and lodclamp-between-max.
2011-01-05 14:50:27 -08:00
Eric Anholt
973e821a63 i915: Implement min/max lod clamping in hardware on 8xx.
This avoids 8xx-specific texture relayout for min/max lod changes.
One step closer to avoiding relayout for base/maxlevel changes!
2011-01-05 14:50:24 -08:00
Eric Anholt
6f31da584f intel: Drop TEXTURE_RECTANGLE check in miptree layout setup.
It's already handled by our non-mipmapped MinFilter, since
TEXTURE_RECTANGLE is always NEAREST or LINEAR.
2011-01-05 14:45:16 -08:00
Eric Anholt
8f0005bfd5 intel: Clean up redundant setup of firstLevel.
It's always BaseLevel (since TEXTURE_RECTANGLE's baselevel can't be
changed from 0), except for 8xx minlod hilarity.
2011-01-05 14:45:16 -08:00
Eric Anholt
e2ee0c55d3 intel: Drop a check for GL_TEXTURE_4D_SGIS.
The SGIS_texture4D extension was thankfully never completed, so we
couldn't implement it if we wanted to.
2011-01-05 14:45:16 -08:00
Vinson Lee
d5435b3f0c swrast: Remove unnecessary headers. 2011-01-05 13:47:02 -08:00
Eric Anholt
332a90e101 i965: Simplify the renderbuffer setup code.
It was quite a mess by trying to do NULL renderbuffers and real
renderbuffers in the same function.  This clarifies the common case of
real renderbuffers.
2011-01-05 10:28:10 -08:00
Michel Dänzer
c7c1e5338c st/xorg: Flesh out colour map support and support depth 8. 2011-01-05 11:41:56 +01:00
Xiang, Haihao
266d8eed69 i965: use BLT to clear buffer if possible on Sandybridge
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32713
2011-01-05 14:12:40 +08:00
Eric Anholt
06cb1a6a5b i965: Add support for SRGB DXT1 formats.
This makes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc
match
fbo-generatemipmap-formats GL_EXT_texture_compression_s3tc

and swrast in bad DXT1_RGBA alpha=0 handling, but it means we won't
unpack and repack someone's textures into uncompressed SARGB8 format.
2011-01-04 16:43:35 -08:00
Vinson Lee
5a3f31575b glcpp: Add test for recursive #define. 2011-01-04 16:39:19 -08:00
Eric Anholt
3488b14a04 mesa: Fix the baseFormat for GL_COMPRESSED_SLUMINANCE_EXT.
It's just LUMINANCE, not LUMINANCE_ALPHA.  Fixes
fbo-generatemipmap-formats GL_EXT_texture_sRGB-s3tc assertion failure
when it tries to pack the L8 channels into LUMINANCE_ALPHA and wonders
why it's trying to do that.
2011-01-04 15:25:35 -08:00
Eric Anholt
5dbb856e96 intel: Merge our choosetexformat fallbacks into core.
We now share the type/format -> MESA_FORMAT_* mappings with software
mesa, and the core supports most of the fallbacks hardware drivers
will want.
2011-01-04 14:42:54 -08:00
Eric Anholt
001d944fd5 mesa: Make _mesa_choose_tex_format() choose formats out of a supported table.
Right now this is just tweaking the current code to look at the table.
Choosing actually supported formats will come later.
2011-01-04 14:14:17 -08:00
Vinson Lee
6530944b50 glcpp: Add division by zero test cases. 2011-01-04 13:18:19 -08:00
Marek Olšák
50630f9016 mesa: preserve 10 bits of precision in the texstore general path for ARGB2101010
Use make_temp_float_image instead of _make_temp_chan_image.
The latter converts the texture to 8 bits/component, losing 2 bits.
2011-01-04 21:59:56 +01:00
Marek Olšák
73e8a27387 st/mesa: advertise GL_ARB_half_float_pixel
This extension doesn't appear to need any driver-specific parts.
2011-01-04 21:59:56 +01:00
Marek Olšák
8543902bfb r300/compiler: disable the rename_regs pass for loops
This workaround fixes rendering of kwin thumbnails.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-04 21:58:51 +01:00
Alex Deucher
f28bb6bdd1 r600g: support up to 64 shader constants
From the r600 ISA:
Each ALU clause can lock up to four sets of constants
into the constant cache.  Each set (one cache line) is
16 128-bit constants. These are split into two groups.
Each group can be from a different constant buffer
(out of 16 buffers). Each group of two constants consists
of either [Line] and [Line+1] or [line + loop_ctr]
and [line + loop_ctr +1].

For supporting more than 64 constants, we need to
break the code into multiple ALU clauses based
on what sets of constants are needed in that clause.

Note: This is a candidate for the 7.10 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-04 15:37:12 -05:00
Tom Stellard
e96e86d07b r300/compiler: Fix black terrain in Civ4
rc_inst_can_use_presub() wasn't checking for too many RGB sources in
Alpha instructions or too many Alpha sources in RGB instructions.

Note: This is a candidate for the 7.10 branch.
2011-01-04 11:25:27 -08:00
Chad Versace
68d06b1454 glsl: Check that integer vertex outputs are qualified with flat
Perform this check in ast_declarator_list::hir().

From section 4.3.6 of the GLSL 1.30 spec:
   "If a vertex output is a signed or unsigned integer or integer
   vector, then it must be qualified with the interpolation
   qualifier
   flat."
2011-01-04 10:49:10 -08:00
Chad Versace
b84e3f570f glsl: Allow redeclaration of gl_Color and its variants in GLSL 1.30
Allow redeclaration of the following built-in variables with an
interpolation qualifier in language versions >= 1.30:
   * gl_FrontColor
   * gl_BackColor
   * gl_FrontSecondaryColor
   * gl_BackSecondaryColor
   * gl_Color
   * gl_SecondaryColor

See section 4.3.7 of the GLSL 1.30 spec.
2011-01-04 10:49:10 -08:00
Chad Versace
4a62a1c366 glsl: Comment ast_type_qualifier.flags 2011-01-04 10:49:10 -08:00
Eric Anholt
b7b2791c6b intel: When validating an FBO's combined depth/stencil, use the given FBO.
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.
2011-01-04 10:04:19 -08:00
Eric Anholt
0ea49380e2 intel: Fix segfaults from trying to use _ColorDrawBuffers in FBO validation.
The _ColorDrawBuffers is a piece of computed state that gets for the
current draw/read buffers at _mesa_update_state time.  However, this
function actually gets used for non-current draw/read buffers when
checking if an FBO is complete from the driver's perspective.  So,
instead of trying to just look at the attachment points that are
currently referenced by glDrawBuffers, look at all attachment points
to see if they're driver-supported formats.  This appears to actually
be more in line with the intent of the spec, too.

Fixes a segfault in my upcoming fbo-clear-formats piglit test, and
hopefully bug #30278
2011-01-04 10:04:15 -08:00
Christoph Bumiller
cd1cf78828 Merge remote branch 'origin/nvc0' 2011-01-04 18:20:05 +01:00
Brian Paul
c94996f057 st/mesa: skip glDrawPixels/glBitmap-related code for ES build
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32560
2011-01-04 08:28:17 -07:00
Christoph Bumiller
4884ca5f67 nvc0: fix index size method value for u8 indices 2011-01-04 16:16:52 +01:00
Christoph Bumiller
2f08d872b2 nvc0: set the correct FP header bit for multiple colour outputs 2011-01-04 16:14:58 +01:00
Christoph Bumiller
6de94e1012 nvc0: delete memory caches and fence on screen destruction 2011-01-04 16:14:46 +01:00
Christoph Bumiller
471025929c nvc0: use mov instead of ld for scalar const loads 2011-01-04 16:14:42 +01:00
Christoph Bumiller
c024c1d75f nvc0: fix resource unmap after vertex push 2011-01-04 16:14:38 +01:00
Christoph Bumiller
e1e29395df nvc0: use the proper typed opcodes in constant folding 2011-01-04 16:14:33 +01:00
Christoph Bumiller
92caa65c24 nvc0: demagic GP invocation count bitfield 2011-01-04 16:14:26 +01:00
Christoph Bumiller
997f84ff4e nvc0: rewrite the 9097 GRAPH macros 2011-01-04 16:13:42 +01:00
Brian Paul
6a102074bb i965g: include brw_types.h instead of GL/gl.h
Alternately, some search&replace could be used to replace all
occurances of GLint with int, etc. in the driver.
2011-01-04 07:24:38 -07:00
Brian Paul
c8a6a8bf2c osmesa: pass context to _mesa_update_framebuffer_visual()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32814
2011-01-04 07:13:52 -07:00
Vinson Lee
90b7a4cc1a llvmpipe: Include p_compiler.h in lp_scene_queue.h.
Include p_compiler.h for boolean symbol.
2011-01-04 01:08:47 -08:00
Vinson Lee
f67dad7b82 llvmpipe: Include p_compiler.h in lp_perf.h.
Include p_compiler.h for int64_t symbol.
2011-01-04 01:01:18 -08:00
Vinson Lee
c72eb72ca6 llvmpipe: Include missing headers in lp_bld_depth.h
Include p_compiler.h for boolean symbol.
Include p_state.h for pipe_stencil_state symbol.
2011-01-04 00:54:14 -08:00
Vinson Lee
deb9a6ae79 llvmpipe: Include p_compiler.h in lp_bld_alpha.h.
Include p_compiler.h for boolean symbol.
Add forward declaration for gallivm_state struct.
2011-01-04 00:50:48 -08:00
Vinson Lee
7bfc54ea5d i965g: Include p_compiler.h in intel_decode.h.
Include p_compiler.h for uint32_t symbol.
2011-01-04 00:44:23 -08:00
Vinson Lee
cf15e9b343 i965g: Include gl.h in intel_structs.h.
Include gl.h for OpenGL symbols.
2011-01-04 00:41:10 -08:00
Zhenyu Wang
bea6539abf i965: Use last vertex convention for quad provoking vertex on sandybridge
Until we know how hw converts quads to polygon in beginning of
3D pipeline, for now unconditionally use last vertex convention.

Fix glean/clipFlat case.
2011-01-04 15:56:26 +08:00
Vinson Lee
9095947fa7 mesa: Include mtypes.h in renderbuffer.h.
Include mtypes.h for gl_buffer_index symbol.

This is a follow-up to commit 65da73c5f8.
2011-01-03 22:42:12 -08:00
Zhenyu Wang
1df795f958 i965: Correct comment for gen6 fb write control message setting
Remove incorrect headless comment for gen6 fb write message.
Note current SIMD16 mode has already done right for control message.
2011-01-04 13:57:16 +08:00
Zhenyu Wang
9977297ad9 i965: Fix provoking vertex select in clip state for sandybridge
Triangle fan provoking vertex for first convention should be
'vertex 1' in sandybridge clip state.

Partly fix glean/clipFlat case
2011-01-04 13:51:39 +08:00
Brian Paul
7bd2c5d1f9 mesa: fix AL44 texture fetch function nybble -> float conversion
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32804
2011-01-03 17:16:48 -07:00
Eric Anholt
bd8e658884 intel: Bump libdrm configure.ac requirement for the gen6 BLT ring support. 2011-01-03 15:04:19 -08:00
Eric Anholt
30fef21aa3 intel: Use tri clears when we don't know how to blit clear the format.
Bug #32207.  Fixes ARB_texture_rg/fbo-clear-formats (see my
fbo-clear-formats piglit branch currently)
2011-01-03 13:28:26 -08:00
Eric Anholt
5f13c39484 mesa: Also report the number of renderbuffer alpha bits for GL_LUMINANCE_ALPHA.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
f45aea0ec9 mesa: Also report renderbuffer red/green size for GL_RED and GL_RG.
Noticed by code inspection.
2011-01-03 13:28:26 -08:00
Eric Anholt
059cca92a8 mesa: Use the common logic for "is this baseformat a color format?"
When figuring out whether a renderbuffer should be used to set the
visual bits of an FBO, we were missing important baseformats like
GL_RED, GL_RG, and GL_LUMINANCE.
2011-01-03 13:28:24 -08:00
Eric Anholt
beac6ee62a mesa: Allow color renderbuffers besides just RGB and RGBA.
We did so already for textures to do ARB_fbo's
GL_ALPHA/GL_LUMINANCE/etc. support and for ARB_texture_rg's GL_RED and
GL_RG, but this path was missed.
2011-01-03 13:22:38 -08:00
Eric Anholt
2d29349c00 mesa: Update comment about the list of BaseFormats for gl_formats. 2011-01-03 13:22:38 -08:00
Eric Anholt
94ed481131 intel: Handle forced swrast clears before other clear bits.
Fixes a potential segfault on a non-native depthbuffer, and possible
accidental swrast fallback on extra color buffers.
2011-01-03 13:22:38 -08:00
Brian Paul
efbd33aff9 st/mesa: fix renderbuffer pointer check in st_Clear()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=30694

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2011-01-03 14:01:41 -07:00
Brian Paul
65da73c5f8 mesa: s/GLuint/gl_buffer_index/ 2011-01-03 14:01:41 -07:00
Brian Paul
35266fbe4f st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Brian Paul
337f6e7b0e st/mesa: 80-column wrapping 2011-01-03 14:01:41 -07:00
Chia-I Wu
ada9c78c29 autoconf: Fix --with-driver=xlib --enable-openvg.
st/egl should be enabled with --enable-openvg even the driver is xlib or
osmesa.  Also, GLX_DIRECT_RENDERING should not be defined because libdrm
is not checked.
2011-01-04 01:13:49 +08:00
Chia-I Wu
cba7786954 docs: Add an example for EGL_DRIVERS_PATH.
EGL_DRIVERS_PATH can be set to test EGL without installation.
2011-01-04 00:54:55 +08:00
Dave Airlie
fb03510738 radeon: fix build on non-KMS systems.
Reported on irc by adamk.
2011-01-03 06:03:44 +10:00
Kenneth Graunke
1d40cf57f8 glsl: Really remove unused "instructions" parameter.
I forgot about this file, and it didn't show up until I tried to do
"make builtins" from a clean build.
2011-01-01 12:29:24 -08:00
Kenneth Graunke
81168351a7 glsl: Remove unused "instructions" parameter.
I think was used long ago, when we actually read the builtins into the
shader's instruction stream directly, rather than creating a separate
shader and linking the two.  It doesn't seem to serve any purpose now.
2011-01-01 12:01:54 -08:00
Brian Paul
1eceb9d323 mapi: add missing newline in error message 2010-12-31 16:37:41 -07:00
Brian Paul
e227f4bf50 egl: add missing case in _eglError() 2010-12-31 09:14:25 -07:00
Henri Verbeet
59051ad443 st/mesa: Handle wrapped depth buffers in st_copy_texsubimage(). 2010-12-31 07:49:59 +01:00
Vinson Lee
8d79765feb util: Add forward declarations in u_index_modify.h. 2010-12-30 01:54:35 -08:00
Vinson Lee
8114cf9ad8 tgsi: Clean up header file inclusion in tgsi_text.h. 2010-12-30 01:51:27 -08:00
Vinson Lee
8bfb9061b7 graw: Include p_shader_tokens.h for tgsi_token struct. 2010-12-30 01:49:26 -08:00
Vinson Lee
20a0f34283 tgsi: Clean up header file inclusion in tgsi_sanity.h. 2010-12-30 01:40:53 -08:00
Vinson Lee
79fa5acf26 x86: Clean up header file inclusion in mmx.h. 2010-12-30 01:26:47 -08:00
Vinson Lee
a1cd093a72 tnl: Clean up header file inclusion in t_vertex.h. 2010-12-30 01:05:33 -08:00
Vinson Lee
43c291683c vbo: Clean up header file inclusion in vbo.h. 2010-12-30 00:57:03 -08:00
Vinson Lee
176a8359b9 tnl: Clean up header file inclusion in t_vp_build.h. 2010-12-30 00:50:56 -08:00
Vinson Lee
9db9761874 tnl: Clean up header file inclusion in tnl.h. 2010-12-30 00:46:13 -08:00
Ben Skeggs
5b0e5e7389 drm/nvc0: don't un-bind every subchannel on init
The initial values in the grctx are 0x0000 anyway, and re-binding them
all to 0x0000 destroys some init done by the nouveau drm.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-30 12:34:12 +10:00
Marek Olšák
76db330e2c util: add a way to store translated indices to a user memory in u_index_modify
I am about to use the upload buffer in r300g instead.
2010-12-29 18:32:41 +01:00
Marek Olšák
48ed458e87 r300g: support user buffers as constant buffers 2010-12-29 18:32:41 +01:00
Eric Anholt
df4d83dca4 i965: Do lowering of array indexing of a vector in the FS.
Fixes a regression in ember since switching to the native FS backend,
and the new piglit tests glsl-fs-vec4-indexing-{2,3} for catching this.
2010-12-28 17:32:20 -08:00
Eric Anholt
54df8e48bc i965: Fix regression in FS comparisons on original gen4 due to gen6 changes.
Fixes 26 piglit cases on my GM965.
2010-12-28 15:35:00 -08:00
Eric Anholt
74dffb39c3 i965: Factor out the ir comparision to BRW_CONDITIONAL_* code. 2010-12-28 14:23:52 -08:00
Vinson Lee
f3319561a4 glcpp: Add negative tests for redefintions with valueless macros. 2010-12-27 23:20:35 -08:00
Dave Airlie
17004b3954 tgsi_dump: fix assert due to missing property name. 2010-12-28 16:52:19 +10:00
Marek Olšák
33e0b726e8 r300g: rename aos to vertex arrays 2010-12-28 04:52:36 +01:00
Marek Olšák
d9b84017e0 r300g: mark vertex arrays as dirty after a buffer_offset change
We shouldn't hit this bug in theory.

NOTE: This is a candidate for the 7.10 branch.
2010-12-28 04:40:05 +01:00
Zhenyu Wang
689aca7822 i965: Fix occlusion query on sandybridge
Clear target query buffer fixed occlusion query on sandybridge.

https://bugs.freedesktop.org/show_bug.cgi?id=32167
2010-12-28 11:11:40 +08:00
Zhenyu Wang
59fa8600d8 Revert "i965: upload multisample state for fragment program change"
This reverts commit de6fd527a5.

Revert this workaround as it seems the real trouble is caused by
lineloop, which doesn't require GS convert on sandybridge actually.
2010-12-28 09:36:43 +08:00
Kenneth Graunke
6bb1e4541e i965: Internally enable GL_NV_blend_square on ES2.
Hopefully should fix bug #32520.
2010-12-27 15:44:52 -08:00
Christoph Bumiller
0cb6d1a4eb nvc0: reference the vertex buffers 2010-12-27 21:00:40 +01:00
Christoph Bumiller
4fa429c876 nvc0: reenable some shader optimizations
CSE and constants folding.
2010-12-27 20:59:53 +01:00
Christoph Bumiller
a10b1c1204 nvc0: use VTX_ATTR for stride 0 vertex attributes 2010-12-27 13:59:43 +01:00
Christoph Bumiller
e4349027f6 nvc0: implement VRAM buffer transfers with bounce buffers 2010-12-27 13:57:46 +01:00
Christoph Bumiller
abd08f4c01 nvc0: init miptree transfer layer stride 2010-12-27 13:29:10 +01:00
Xiang, Haihao
b832ae8a4a i965: don't spawn GS thread for LINELOOP on Sandybridge
LINELOOP is converted to LINESTRIP at the beginning of the 3D pipeline.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=32596
2010-12-27 17:05:58 +08:00
Kenneth Graunke
634a7dce9c i965: Flatten if-statements beyond depth 16 on pre-gen6.
Gen4 and Gen5 hardware can have a maximum supported nesting depth of 16.
Previously, shaders with control flow nested 17 levels deep would
cause a driver assertion or segmentation fault.

Gen6 (Sandybridge) hardware no longer has this restriction.

Fixes fd.o bug #31967.
2010-12-27 00:59:31 -08:00
Kenneth Graunke
9ac6a9b2fa glsl: Support if-flattening beyond a given maximum nesting depth.
This adds a new optional max_depth parameter (defaulting to 0) to
lower_if_to_cond_assign, and makes the pass only flatten if-statements
nested deeper than that.

By default, all if-statements will be flattened, just like before.

This patch also renames do_if_to_cond_assign to lower_if_to_cond_assign,
to match the new naming conventions.
2010-12-27 00:59:31 -08:00
Christoph Bumiller
780fbecc20 nvc0: respond please inline to PIPE_SHADER_CAP_SUBROUTINES 2010-12-23 15:22:00 +01:00
Christoph Bumiller
96def0c314 nvc0: fix layer stride state 2010-12-23 15:21:36 +01:00
Christoph Bumiller
2c20aae233 nvc0: use most defs/decls from nouveau_pushbuf.h 2010-12-23 15:19:22 +01:00
Ben Skeggs
82e0a38eed nvc0: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-21 06:41:09 +10:00
Ben Skeggs
317a1445c8 nvc0: BEGIN_RING->BEGIN_RING_NI in a couple of places 2010-12-21 06:33:17 +10:00
Ben Skeggs
e4e1a85bf8 nvc0: fence.bo is mappable, mark it as such 2010-12-21 06:32:13 +10:00
Ben Skeggs
e52ebd6e85 Merge remote branch 'origin/master' into nvc0-new
Conflicts:
	src/gallium/drivers/nouveau/nouveau_winsys.h
2010-12-21 06:30:39 +10:00
Ben Skeggs
5c102dd94f nouveau: fix includes for latest libdrm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21 06:28:08 +10:00
Tom Fogal
cd9ed3da68 Regenerate gl_mangle.h.
NOTE: This is a candidate for the 7.10 branch.
2010-12-20 19:29:48 -07:00
Jerome Glisse
abe9ffc25c r600g: properly unset vertex buffer
Fix bug http://bugs.freedesktop.org/show_bug.cgi?id=32455

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-20 15:33:28 -05:00
Vinson Lee
a14f79f801 st/python: remove unused 'buf' parameter in pipe_buffer_unmap
This is a follow-up to commit ec51092a72.

Fixes SCons build.
2010-12-20 11:40:54 -08:00
Marek Olšák
ec51092a72 gallium: remove unused 'buf' parameter in pipe_buffer_unmap 2010-12-20 17:42:55 +01:00
Vinson Lee
c451aade88 st/mesa: Remove comment cruft from st_context.h.
This was unintentionally added by commit
1525fb4afe.
2010-12-20 01:24:26 -08:00
Vinson Lee
2dd788663a st/mesa: Clean up header file inclusion in st_cb_texture.h. 2010-12-20 01:15:04 -08:00
Vinson Lee
10eb0c39d5 st/mesa: Clean up header file inclusion in st_cb_readpixels.h. 2010-12-20 01:00:26 -08:00
Christoph Bumiller
9f2cf89957 nvc0: s/INLIN_RING/IMMED_RING 2010-12-19 22:53:47 +01:00
Christoph Bumiller
608b3c4432 nvc0: improve shader support for texturing
Fixed shadow and cube texture fetches, add array texture fetches.
2010-12-19 21:49:32 +01:00
Christoph Bumiller
ca5deb0c35 nvc0: adapt to array textures interface change 2010-12-19 21:48:39 +01:00
Christoph Bumiller
0f68236a24 Merge remote branch 'origin/master' into nvc0-new 2010-12-19 21:46:33 +01:00
Christoph Bumiller
d047168d81 nvc0: fix clipping with scissors/viewport
Also setup optional path to use proper primitive clipping instead,
which is probably slower.
2010-12-19 21:42:00 +01:00
Christoph Bumiller
e9de2a31a5 nvc0: use BIND_RING to set subchannel classes 2010-12-19 21:40:24 +01:00
Christoph Bumiller
f0f1cce962 nvc0: switch to the proper constants upload path
Makes things suddenly go surprisingly fast.
2010-12-19 21:38:42 +01:00
Christoph Bumiller
99f9a9727c nvc0: add the index buffer offset where missing 2010-12-19 21:33:37 +01:00
Marek Olšák
237880463d r300g: optimize the fallback for misaligned ushort indices 2010-12-19 04:05:34 +01:00
Vinson Lee
c87f82bc40 st/mesa: Clean up header file inclusion in st_cb_program.h. 2010-12-18 01:44:52 -08:00
Vinson Lee
ac09685d2a st/mesa: Clean up header file inclusion in st_cb_accum.h. 2010-12-18 01:28:18 -08:00
Vinson Lee
488e994ba9 mesa: Clean up header file inclusion in prog_statevars.h. 2010-12-18 01:16:53 -08:00
Dave Airlie
aa4d311873 mesa: fix queryobj whitespace.
Had done this before pushing but forgot to amend, doh.
2010-12-18 17:48:21 +10:00
Dave Airlie
ff7aa554a1 mesa/swrast/st: add ARB_occlusion_query2 support.
This gets my vote for most pointless extension of all time, I'm guessing
some driver could possibly optimise for this instead of counting it might
just get a true/false, but I'm not really sure.

need this to eventually advertise 3.3 despite its total uselessness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-18 17:33:25 +10:00
Chia-I Wu
7048095513 mapi: Clean up sources.mk.
Rename MAPI_GLAPI_SOURCES to MAPI_UTIL_SOURCES.  Rename macro
MAPI_GLAPI_CURRENT to MAPI_MODE_UTIL.  Update the comments to make it
clear that mapi may be used in two ways and how.
2010-12-18 15:05:58 +08:00
Chia-I Wu
c17d4999f1 mapi: Clean up u_current interface.
Try not to use macros to make u_current.h appear to be glapi.h.  Use
u_current.h to implement glapi.h instead whenever possible.
2010-12-18 15:05:52 +08:00
Chia-I Wu
c7119e281b mapi: Add ABI-tag note.
TLS requires kernel >= 2.4.20.  Per glapi.
2010-12-18 14:46:10 +08:00
Kenneth Graunke
a954dbeb8c Refresh autogenerated file builtin_function.cpp.
NOTE: The 7.9 and 7.10 branches will need their builtins refreshed too.
Rather than cherry-picking this commit, run 'make builtins'.
2010-12-17 19:40:56 -08:00
Kenneth Graunke
d7423a6531 glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).
These mistakenly computed 't' instead of t * t * (3.0 - 2.0 * t).

Also, properly vectorize the smoothstep(float, float, vec) variants.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-17 19:29:22 -08:00
José Fonseca
3f94d96fce gallivm: Cleanup util_format_xxx_fetch_xxx call generation.
No need to register function prototypes in the module now that we call
the C function pointer directly -- less LLVM objects lying around.

Limited testing with lp_test_format.
2010-12-17 20:14:31 +00:00
Kenneth Graunke
5c229e5fbd glsl: Expose a public glsl_type::void_type const pointer.
This is analogous to glsl_type::int_type and all the others.
2010-12-17 10:55:17 -08:00
Marek Olšák
daffaca53e r300g: finally fix the texture corruption on r3xx-r4xx
Even though a bound texture stays bound when calling set_fragment_sampler_views,
it must be assigned a new cache region depending on the occupancy of other
texture units.

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

Thanks to Álmos <aaalmosss@gmail.com> for finding the bug in the code.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-17 13:17:52 +01:00
Kenneth Graunke
d0f8eea9a0 Remove OES_compressed_paletted_texture from the ES2 extension list.
We don't support it.
2010-12-16 17:40:50 -08:00
Brian Paul
42a0967a36 softpipe: remove sp_tex_tile_cache_border_color()
With swizzling done at the end of texture sampling, we can greatly
simplify swizzling of the border color.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32460
2010-12-16 18:18:57 -07:00
Brian Paul
9d9f8aba0a softpipe: fix depth texture sampling regression
We need to keep using the pipe_get_tile_swizzle() even though there's
no swizzling because we need to explicitly pass in the surface format.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32459
2010-12-16 17:40:09 -07:00
Brian Paul
3ecf47af12 gallivm: fix copy&paste error from previous commit
Fixes piglit regression, http://bugs.freedesktop.org/show_bug.cgi?id=32452

NOTE: This is a candidate for the 7.10 branch
2010-12-16 14:30:39 -07:00
richard
fcc7024afe r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well. 2010-12-16 15:52:55 -05:00
Eric Anholt
290a1141bc intel: Support glCopyTexImage() from XRGB8888 to ARGB8888.
The only mismatch between the two is that we have to clear the
destination's alpha to 1.0.  Fixes WOW performance on my Ironlake,
from a few frames a second to almost playable.
2010-12-16 10:48:19 -08:00
Eric Anholt
ec03b316b4 intel: Try to sanely check that formats match for CopyTexImage.
Before, we were going off of a couple of known (hopeful) matches
between internalFormats and the cpp of the read buffer.  Instead, we
can now just look at the gl_format of the two to see if they match.
We should avoid bad blits that might have been possible before, but
also allow different internalFormats to work without having to
enumerate each one.
2010-12-16 10:48:19 -08:00
Eric Anholt
e65c643792 intel: Drop commented intel_flush from copy_teximage.
The blit that follows appears in the command stream so it's serialized
with previous rendering.  Any queued vertices in the tnl layer were
already flushed up in mesa/main/.
2010-12-16 10:48:19 -08:00
Eric Anholt
99c7840b0c intel: Update renderbuffers before looking up CopyTexImage's read buffer.
Not fixing a particular bug, just noticed by code inspection.
2010-12-16 10:48:19 -08:00
Brian Paul
ee16e97ed1 gallivm: work around LLVM 2.6 bug when calling C functions
Create a constant int pointer to the C function, then cast it to the
function's type.  This avoids using trampoline code which seem to be
inadvertantly freed by LLVM in some situations (which leads to segfaults).
The root issue and work-around were found by José.

NOTE: This is a candidate for the 7.10 branch
2010-12-16 10:19:16 -07:00
Brian Paul
b7e150605d draw: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
2bd9b386e6 svga: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
bd75e4b8be i965g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
a185d439bd i915g: s/varient/variant/ 2010-12-16 10:18:24 -07:00
Brian Paul
f3955f6fcd softpipe: s/varient/variant 2010-12-16 10:18:23 -07:00
Brian Paul
aa5ba96d29 st/mesa: s/varient/variant 2010-12-16 10:18:23 -07:00
Eric Anholt
c52adfc2e1 i965: Set the alternative floating point mode on gen6 VS and WM.
This matches how we did the math instructions pre-gen6, though it
applies to non-math as well.

Fixes vp1-LIT test 2 (degenerate case: 0 ^ 0 -> 1)
2010-12-16 09:01:14 -08:00
Shuang He
2bd11ea119 i915: Fix INTEL_DEBUG=wm segmentation fault
The program should be disassembled after it's uploaded
2010-12-16 09:01:14 -08:00
Jakob Bornecrantz
23aa3c552c svga, glhd: Remove incorrect assert and add note
Stride can be lower then the size of the attribute.
But should probably be aligned to component size atleast for floats.
2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
1138775d79 svga: Minor debug text fix 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
c28debbf6f svga: Remove debug print in winsys 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz
486da2cfc0 svga: Correct spelling in swtnl backend 2010-12-16 09:44:01 +01:00
Jakob Bornecrantz
d7ff6dd09c svga: Fix newline at EOF 2010-12-16 09:36:51 +01:00
Jakob Bornecrantz
f75549a9d8 svga: Add Galahad and Softpipe to scons build 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
0967d77a9a wrapper: Flush pipe on unmap
For drivers that does DMA transfers instead of mapping directly
2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
8b60bf4e9f wrapper: Fix width and height given to map and remove uneeded fields 2010-12-16 08:53:26 +01:00
Jakob Bornecrantz
b7a73c72a6 i915g: Ignore color0 writes all cbufs tgsi property 2010-12-27 00:18:55 +01:00
Chia-I Wu
9f2062fb12 st/egl: Fix eglChooseConfig when configs is NULL.
When configs is NULL, the app wants to know the number of matching
configs.
2010-12-26 23:35:50 +08:00
Vinson Lee
aa68dd9a49 swrast: Clean up header file inclusion in ss_vb.h. 2010-12-25 20:53:27 -08:00
Vinson Lee
da0bdc7cd5 swrast: Clean up header file inclusion in ss_triangle.h. 2010-12-25 20:48:29 -08:00
Vinson Lee
77d1d35163 swrast: Clean up header file inclusion in s_texfilter.h. 2010-12-25 20:28:17 -08:00
Vinson Lee
06fa986112 swrast: Clean up header file inclusion in s_texcombine.h. 2010-12-25 20:12:06 -08:00
Vinson Lee
77aaaf5fd5 swrast: Clean up header file inclusion in s_masking.h. 2010-12-25 20:03:33 -08:00
Vinson Lee
8ca0aca8dd nvfx: Remove unused variable.
Fixes this GCC warning.
nvfx_vbo.c: In function 'nvfx_idxbuf_emit':
nvfx_vbo.c:410: warning: unused variable 'eng3d'
2010-12-25 19:09:54 -08:00
Xavier Chantry
5f0f9f0486 nvfx: restore BEGIN_RING usage
Michel Hermier reported libdrm segfault (and kernel crash) on nv40 using
gallium :
http://www.mail-archive.com/nouveau@lists.freedesktop.org/msg06563.html

It turns out these were caused by some missing WAIT_RING (or wrong
computation of the WAIT_RING sizes). Unlike all other libdrm_nouveau users,
nvfx gallium tried to use a mininum calls of WAIT_RING, one WAIT_RING could
apply to many methods for different code paths and spread across several
functions. This made it too tricky to find out what the missing or wrong
WAIT_RING was.

By restoring BEGIN_RING, we force one WAIT_RING per method, and it's much
easier to check if the free size required in the pushbuffer is correct.  As
curro said, "let's keep it simple for the maintainers until the big
bottlenecks are gone"

Benchmarked on nv35 with openarena, nexuiz and ut2004 and no performance
regression.

The core of this patch was made with Coccinelle, with minor manual fixes
made on top.

Tested-by: Michel Hermier <hermier@frugalware.org>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-12-25 20:37:39 +01:00
Eric Anholt
b01b73c482 intel: Only do frame throttling at glFlush time when using frontbuffer.
This is the hack for input interactivity of frontbuffer rendering
(like we do for backbuffer at intelDRI2Flush()) by waiting for the n-2
frame to complete before starting a new one.  However, for an
application doing multiple contexts or regular rebinding of a single
context, this would end up lockstepping the CPU to the GPU because
every unbind was considered the end of a frame.

Improves WOW performance on my Ironlake by 48.8% (+/- 2.3%, n=5)
2010-12-25 09:06:52 -08:00
Marek Olšák
b606c8a015 r300g: simplify buffer_transfer_inline_write 2010-12-25 16:07:13 +01:00
Marek Olšák
7e752760d4 r300g: simplify the code for buffer uploads 2010-12-25 16:07:13 +01:00
Marek Olšák
9c448817f7 r300g: user index buffers are always aligned 2010-12-25 16:07:13 +01:00
Marek Olšák
b10bff1135 r300g: increase the size of upload buffers 2010-12-25 16:07:13 +01:00
Vinson Lee
ecc6b7c002 swrast: Clean up header file inclusion in s_logic.h. 2010-12-24 20:43:35 -08:00
Vinson Lee
8dfeb98eb1 swrast: Clean up header file inclusion in s_fragprog.h. 2010-12-24 20:34:53 -08:00
Vinson Lee
3e2ea145b1 swrast: Clean up header file inclusion in s_span.h. 2010-12-24 20:17:18 -08:00
Vinson Lee
7d5f5d3843 swrast: Clean up header file inclusion in s_fog.h. 2010-12-24 20:11:44 -08:00
Vinson Lee
ec891d78a0 swrast: Clean up header file inclusion in s_depth.h. 2010-12-24 20:06:11 -08:00
Vinson Lee
b3c59acca6 swrast: Clean up header file inclusion in s_blend.h. 2010-12-24 19:55:42 -08:00
Vinson Lee
c9a0e25919 swrast: Clean up header file inclusion in s_atifragshader.h. 2010-12-24 19:47:54 -08:00
Vinson Lee
eadb90f045 swrast: Clean up header file inclusion in s_alpha.h. 2010-12-24 19:30:38 -08:00
Vinson Lee
ebe95d3796 swrast: Clean up header file inclusion in s_accum.h. 2010-12-24 19:25:30 -08:00
Vinson Lee
775e373dd9 swrast: Clean up header file inclusion in s_aatriangle.h. 2010-12-24 18:48:00 -08:00
Vinson Lee
d59075303a swrast: Clean up header file inclusion in s_aaline.h. 2010-12-24 18:35:10 -08:00
Vinson Lee
499c77edf1 st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h. 2010-12-24 18:27:55 -08:00
Vinson Lee
b20dac4e2d st/mesa: Clean up header file inclusion in st_gen_mipmap.h. 2010-12-24 18:06:20 -08:00
Chia-I Wu
65e8f81110 docs/egl: Update egl.html.
Various updates and a new section about packaging.
2010-12-25 02:53:49 +08:00
Marek Olšák
88550083b3 r300g/swtcl: re-enable LLVM
Based on a patch from Drill <drill87@gmail.com>.

NOTE: This is a candidate for the 7.10 branch.
2010-12-24 18:38:03 +01:00
Henri Verbeet
8fc6c5fb36 r600g: r600_blit_uncompress_depth() can't fail. 2010-12-24 11:41:26 +01:00
Henri Verbeet
878519b73e r600g: Get rid of r600_blit_uncompress_depth_ptr. 2010-12-24 11:41:25 +01:00
Chia-I Wu
a91a337a7d mapi: Move mapi_func typedef to entry.h.
Make it clear that entry.h does not depend on stub.h.
2010-12-24 17:33:50 +08:00
Chia-I Wu
a33e9f049d mapi: Define MAPI_TMP_DEFINES only when needed.
Since struct mapi_table is opaque, MAPI_TMP_DEFINES is not needed in
table.h.
2010-12-24 17:33:49 +08:00
Chia-I Wu
e6a7ef3ca6 mapi: Add and use entry_get_public.
Given a dispatch slot, entry_get_public returns the address of the
corresponding public entry point.  There may be more than one of them.
But since they are all equivalent, it is fine to return any one of them.

With entry_get_public, the address of any public entry point can be
calculated at runtime when an assembly dispatcher is used.  There is no
need to have a mapping table in such case.  This omits the unnecessary
relocations from the binary.
2010-12-24 17:33:49 +08:00
Chia-I Wu
897bff6773 mapi: Make struct mapi_stub opaque.
Add accessors for struct mapi_stub and make it opaque.
2010-12-24 17:28:52 +08:00
Chia-I Wu
0c205484bf mapi: Allow blocks to be disabled from the output.
For example, a printer may ask not to output noop dispatch table.
2010-12-24 17:28:52 +08:00
Chia-I Wu
b765b1269f mapi: Fix hidden entries.
Hidden entries are just like normal entries except that they are not
exported.  Since it is not always possible to hide them, and two hidden
aliases can share the same entry, the name of hidden aliases are mangled
to '_dispatch_stub_<slot>'.
2010-12-24 17:28:52 +08:00
Chia-I Wu
52ca153349 mapi: Add "handcode" attribute to the script.
Entries with handcode attribute will be handled normally, except no
entry point will be generated for them.
2010-12-24 17:28:52 +08:00
Chia-I Wu
8eee1d522e mapi: Minor ABIPrinter refactoring.
Split out function name generation from _c_decl to _c_function, and use
it everywhere.  Add an optional 'export' argument to _cdecl.  It is
prepended to the returned string.
2010-12-24 17:28:51 +08:00
Chia-I Wu
86d29eab48 mapi: Store alias entry instead of alias name.
An entry can hold more info than plain name.
2010-12-24 17:28:51 +08:00
Dave Airlie
876effb0e7 r600g: hack around property unknown issues.
should fix https://bugs.freedesktop.org/show_bug.cgi?id=32619

Need to add proper support for properties later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 17:34:40 +10:00
Dave Airlie
ac38ad6156 r300g: turn back on rv530 hiz.
still needs RADEON_HYPERZ=y env var.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:12 +10:00
Dave Airlie
7a5fac56b2 r300g: hyperz fixing typo.
Really no idea why I didn't see this before, but these values were opposite
the register spec.

this seems to fix rv530 HiZ on my laptop, will reenable in next commit.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 15:46:11 +10:00
Vinson Lee
a57e2c436b mesa: Assert format is not MESA_FORMAT_COUNT in _mesa_format_to_type_and_comps.
The case of format being MESA_FORMAT_COUNT should never occur.
2010-12-23 18:19:42 -08:00
Xiang, Haihao
dc987adc9f i965: use align1 access mode for instructions with execSize=1 in VS
All operands must be 16-bytes aligned in aligh16 mode. This fixes l_xxx.c
in oglconform.
2010-12-24 09:51:44 +08:00
Xiang, Haihao
8249321604 i965: fix register region description
This fixes
 brw_eu_emit.c:179: validate_reg: Assertion `width == 1' failed.
2010-12-24 09:51:22 +08:00
Vinson Lee
1039f36c47 r600g: Rearrange print order of outputs of R600_ERR. 2010-12-23 17:26:36 -08:00
Vinson Lee
38eff56f7e mesa: Assert _mesa_DeleteFragmentShaderATI doesn't ever free static DummyShader. 2010-12-23 16:44:42 -08:00
Vinson Lee
7f178ffbf1 st/egl: Remove unnecessary header. 2010-12-23 16:23:53 -08:00
Vinson Lee
070f5da96d libgl-xlib: Remove unnecessary header. 2010-12-23 16:19:11 -08:00
Vinson Lee
075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08:00
Dave Airlie
aaccb73276 tgsi_text: just parse as an integer (value is a boolean).
fixes warning reported by vlee on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 09:29:19 +10:00
Vinson Lee
0b76255714 mapi: Remove unnecessary header. 2010-12-23 15:25:38 -08:00
Vinson Lee
bf4dffb8ef intel: Remove unnecessary headers. 2010-12-23 15:08:53 -08:00
Dave Airlie
4e52e8f746 r300g: add support for color0 writes to all bound color buffers.
Thanks to Marek Olšák for making my initial attempt actually work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:58 +10:00
Dave Airlie
07498075b5 mesa/st: set the color write cbuf property for fragColor writes 2010-12-24 07:19:58 +10:00
Dave Airlie
2f4860f2ab softpipe: add support for color writes all color bufs property 2010-12-24 07:19:57 +10:00
Dave Airlie
c9c8a5ed02 gallium: add fragment shader property for color writes to all buffers. (v2)
For GL fragColor semantics we need to tell the pipe drivers that the fragment
shader color result is to be replicated to all bound color buffers, this
adds the basic TGSI + documentation.

v2: fix missing comma pointed out by Tilman on mesa-dev.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-24 07:19:57 +10:00
Vinson Lee
eccffe2328 i965: Remove unnecessary headers. 2010-12-23 11:54:29 -08:00
Vinson Lee
280750c5ca mesa: Fix #ifdef typo in _mesa_format_to_type_and_comps.
According to the comment, the warning should be for debug builds.
2010-12-23 11:32:16 -08:00
Marek Olšák
aedbf05d31 r300g: use a simpler fallback for misaligned ushort indices with triangles
If 'start' is odd, render the first triangle with indices embedded
in the command stream, which adds 3 to 'start' and makes it even.
Then continue with the fast path.
2010-12-23 16:54:59 +01:00
Marek Olšák
c420c0e7d6 r300g: add support for B2G3R3 texturing 2010-12-23 16:54:59 +01:00
Marek Olšák
bf7b6f60ae mesa: fix texel store functions for some float formats
These are copy-paste errors obviously.
2010-12-23 16:54:58 +01:00
Marek Olšák
4a710469e0 st/mesa: do not require all texture formats to be renderable
This is a bandaid on the problem that if some formats were not renderable
(like luminance_alpha), st/mesa fell back to some RGBA format, so basically
some non-renderable formats were actually not used at all. This is only
a problem with hardware drivers, softpipe can render to anything.

Instead, require only RGB8/RGBA8 to be renderable.
2010-12-23 16:54:58 +01:00
Marek Olšák
998657112b st/mesa: use the formats RGB233, ARGB2101010, AL44, AL1616, A16, L16, I16 2010-12-23 16:54:58 +01:00
Marek Olšák
a780490374 gallium: add new formats L16A16_UNORM, A16_UNORM, I16_UNORM, B2G3R3_UNORM 2010-12-23 16:54:58 +01:00
Marek Olšák
fd8aa7ac71 mesa: implement new texture format I16 2010-12-23 16:54:58 +01:00
Marek Olšák
bb5ace68ce mesa: implement new texture format L16 2010-12-23 16:54:58 +01:00
Marek Olšák
eb31837a0d mesa: implement new texture format A16 2010-12-23 16:54:58 +01:00
Marek Olšák
bae9d511f3 mesa: implement new texture format AL44
Radeon GPUs can do this. R600 can even do render-to-texture.
Packing and extracting aren't implemented, but we shouldn't hit them (I think).
Tested with swrast, softpipe, and r300g.
2010-12-23 16:54:58 +01:00
Marek Olšák
621e5254ef mesa: implement new texture format ARGB2101010
Radeon GPUs do support GL_RGB10_A2.
2010-12-23 16:54:58 +01:00
Marek Olšák
0a7b60f7ed st/mesa: if Z32 is unsupported, prefer Z24 to Z16 2010-12-23 16:54:58 +01:00
Marek Olšák
888e59fce8 st/mesa: use RGBA16 for RGB12 and RGB16
To provide enough precision if a user wants it.
2010-12-23 16:54:58 +01:00
Marek Olšák
3f9e78ac39 st/mesa: use DXT SRGB formats for COMPRESSED_SRGB
And also check if the formats are supported to return something meaningful
if compression cannot be used.
2010-12-23 16:54:57 +01:00
Eric Anholt
bf15ad3782 i965: Keep around a copy of the VS constant surface dumping code.
Just like everywhere else, I never trust my constant uploads to
correctly put constants in the right places, even though that's so
rarely where the issue is.
2010-12-23 01:32:44 -08:00
Eric Anholt
5dc53444c8 i965: Correct the dp_read message descriptor setup on g4x.
It's mostly like gen4 message descriptor setup, except that the sizes
of type/control changed to be like gen5.  Fixes 21 piglit cases on
gm45, including the regressions in bug #32311 from increased VS
constant buffer usage.
2010-12-23 01:32:43 -08:00
Zhenyu Wang
de6fd527a5 i965: upload multisample state for fragment program change
This makes conformance tests stable on sandybridge D0 to track
multisample state before SF/WM state.
2010-12-23 17:30:03 +08:00
Zhenyu Wang
845d651cf6 i965: Use MI_FLUSH_DW for blt ring flush on sandybridge
Old MI_FLUSH command is deprecated on sandybridge blt.
2010-12-23 17:29:46 +08:00
Vinson Lee
1e7bfcc707 st/mesa: Remove unnecessary header. 2010-12-23 01:03:32 -08:00
Vinson Lee
492afbce18 gallivm: Disable MMX-disabling code on llvm-2.9.
The disable-mmx option was removed in llvm-2.9svn by revisions 122188
and 122189.

Fixes FDO bug 32564.
2010-12-22 19:56:10 -08:00
Vinson Lee
adaa310e39 gallivm: Fix 'cast from pointer to integer of different size' warning.
Fixes this GCC warning.
lp_bld_const.h: In function 'lp_build_const_int_pointer':
lp_bld_const.h:137: warning: cast from pointer to integer of different size
2010-12-22 16:48:19 -08:00
Vinson Lee
38c8b034e2 i915g: Remove unnecessary header. 2010-12-22 00:57:52 -08:00
Vinson Lee
442fcd0620 llvmpipe: Remove unnecessary headers. 2010-12-22 00:55:41 -08:00
Vinson Lee
013fc33462 r300g: Remove unnecessary headers. 2010-12-22 00:52:05 -08:00
Vinson Lee
f39d0c791a svga: Remove unnecessary header. 2010-12-22 00:42:23 -08:00
Vinson Lee
a91128030e st/vega: Remove unnecessary headers. 2010-12-22 00:38:42 -08:00
Henri Verbeet
ca8b4ca478 r600g: Remove the unused "pframebuffer" field from r600_pipe_context. 2010-12-22 09:19:48 +01:00
Henri Verbeet
2fd718d560 r600g: r600_new() and r600_delete() are unused. 2010-12-22 09:19:48 +01:00
Zhenyu Wang
4374703a9b i965: explicit tell header present for fb write on sandybridge
Determine header present for fb write by msg length is not right
for SIMD16 dispatch, and if there're more output attributes, header
present is not easy to tell from msg length. This explicitly adds
new param for fb write to say header present or not.

Fixes many cases' hang and failure in GL conformance test.
2010-12-22 11:08:51 -05:00
Chia-I Wu
445cb9e53b st/egl: Assorted fixes for dri2_display_get_configs.
Set window_bit only when the visual id is greater than zero.  Correct
visual types.  Skip slow configs as they are not relevant.  Finally, do
not return duplicated configs.
2010-12-22 16:05:27 +08:00
Alex Deucher
341d048e45 r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-22 01:30:41 -05:00
Chia-I Wu
a31e2e3312 st/egl: Fix eglCopyBuffers.
Flush before presenting.
2010-12-22 14:21:47 +08:00
Chia-I Wu
18bc427ade st/egl: Plug pbuffer leaks.
Unreference validated resources or remove unnecessary validations.
2010-12-22 14:12:33 +08:00
Chia-I Wu
0fb2dcc98f st/egl: Allow single-buffered pixmaps.
All single-buffered configs were ignored before to make sure
EGL_RENDER_BUFFER is settable for window surfaces.  It is better to
allow single-buffered configs and set EGL_WINDOW_BIT only for
double-buffered ones.  This way there can be single-buffered pixmaps.
2010-12-22 14:12:33 +08:00
Dave Airlie
f431e0452b r600g: drop unused code in evergreen.
this code was pretty much duplicated, thanks to Henri Verbeet on irc for
pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 15:58:29 +10:00
Chia-I Wu
975b7ef92a st/egl: Remove native_config::samples.
Multisample buffers are never requested.
2010-12-22 13:22:36 +08:00
Chia-I Wu
3a93c34828 st/egl: Remove native_config::slow_config.
In direct rendering scenario, it is not needed until an EGLDisplay can
support both HW and SW pipe screens.
2010-12-22 13:22:36 +08:00
Chia-I Wu
0364c08d7f st/egl: Remove unnecessary egl_g3d_find_pixmap_config.
It was used to find a compatible config for a given pixmap.  Now that a
config is optional for pixmap surface creation, the function is not
needed.
2010-12-22 13:22:36 +08:00
Chia-I Wu
af767ee113 st/egl: Make config optional for create_pixmap_surface.
eglCopyBuffers or EGL_KHR_image_pixmap require creating a pixmap surface
without a config.  Make it just work without relying on
is_pixmap_supported.
2010-12-22 13:22:36 +08:00
Dave Airlie
2dd189a824 r600g: fix evergreen segfaults.
evergreen was crashing running even gears here.

This is a 7.10 candidate if its broken the same.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 14:54:17 +10:00
Marek Olšák
cb4f367b26 r300g: fix precision issues with B10G10R10A2 2010-12-22 03:39:37 +01:00
Marek Olšák
2a95542088 r300g: support B10G10R10A2 render targets only with DRM 2.8.0 or later versions 2010-12-22 03:39:37 +01:00
Eric Anholt
4fe78d3e12 i965: Avoid using float type for raw moves, to work around SNB issue.
The SNB alt-mode math does the denorm and inf reduction even for a
"raw MOV" like we do for g0 message header setup, where we are moving
values that aren't actually floats.  Just use UD type, where raw MOVs
really are raw MOVs.

Fixes glxgears since c52adfc2e1, but no
piglit tests had regressed(!)
2010-12-21 13:06:15 -08:00
Jerome Glisse
fa62cf7450 r600g: avoid segfault
Candidates 7.10

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-21 10:51:32 -05:00
Chris Wilson
8b9570e685 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-21 11:58:35 +00:00
Vinson Lee
c1f0f90a97 st/mesa: Clean up header file inclusion in st_format.h. 2010-12-21 01:25:04 -08:00
Vinson Lee
3d03b4d839 st/mesa: Clean up header file inclusion in st_draw.h. 2010-12-21 01:17:37 -08:00
Ben Skeggs
57dcd800ca nvfx: fix fragprog word swapping on big-endian machines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-16 11:13:21 +10:00
Jerome Glisse
dbb679e51d gallium: properly check for src->dst blit compatibilities
Spotted by Christoph Bumiller & Jose Fonseca

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 15:29:31 -05:00
Fredrik Höglund
66f55de31e r600g: fix pow(0, 0) evaluating to NaN
We have to use the non-IEEE compliant version of MUL here, since
log2(0) is -inf, and 0 * -inf is NaN in IEEE arithmetic.

candidates for 7.10 branch
2010-12-15 14:07:00 -05:00
Jerome Glisse
3861a1001c r600g: need to reference upload buffer as the might still live accross flush
Can't get away from referencing upload buffer as after flush a vertex buffer
using the upload buffer might still be active. Likely need to simplify the
pipe_refence a bit so we don't waste so much cpu time in it.

candidates for 7.10 branch

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-15 12:07:09 -05:00
Brian Paul
a8ca30bc58 st/mesa: fix incorrect prev pointer in destroy_program_variants() 2010-12-14 14:15:22 -07:00
Brian Paul
c62bb90d6a softpipe: do texture swizzle during texture sampling
Instead of when we read texture tiles.  Now swizzling happens after
the shadow depth compare step.  This fixes the piglit glsl-fs-shadow2d*
tests (except for proj+bias because of a GLSL bug).
2010-12-14 13:01:03 -07:00
Brian Paul
be2aa81f5f mesa: more program debug code 2010-12-14 12:46:01 -07:00
Brian Paul
2a77c3cc0b tgsi: document texture opcodes 2010-12-14 12:45:36 -07:00
Brian Paul
bb10e081c8 glsl: new glsl_strtod() wrapper to fix decimal point interpretation
We always want to use '.' as the decimal point.

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

NOTE: this is a candidate for the 7.10 branch.
2010-12-14 12:38:38 -07:00
Brian Paul
dfbc20593e gallivm: do texture swizzle after shadow compare
We need to swizzle after the shadow comparison so that the GL_DEPTH_MODE
functionality is handled properly.

This fixes all the piglit glsl-fs-shadow2d*.shader_test cases, except
for glsl-fs-shadow2dproj-bias.shader_test which fails because of a
bug in the GLSL compiler (fd.o 32395).
2010-12-14 12:17:10 -07:00
Brian Paul
68c41a25b4 st/mesa: rename the varient release functions 2010-12-14 12:17:10 -07:00
Jerome Glisse
54773415f4 r600g: fix segfault when translating vertex buffer
Note the support for non float vertex draw likely regressed need to
find what we want to do there.

candidates for 7.10 branches

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-14 13:50:46 -05:00
Vinson Lee
4d1b2df6c0 mesa: Clean up header file inclusion in prog_optimize.h. 2010-12-14 00:39:57 -08:00
Vinson Lee
2c582dd25f mesa: Clean up header file inclusion in prog_cache.h. 2010-12-14 00:30:24 -08:00
Vinson Lee
71af07bf40 mesa: Clean up header file inclusion in nvvertparse.h. 2010-12-14 00:22:27 -08:00
Eric Anholt
c27285610c i965: Add support for using the BLT ring on gen6. 2010-12-13 19:41:58 -08:00
Eric Anholt
d88aa6fe3e i965: Improve the hacks for ARB_fp scalar^scalar POW on gen6.
This is still awful, but my ability to care about reworking the old
backend so we can just get a temporary value into a POW is awfully low
since the new backend does this all sensibly.

Fixes:
fp1-LIT test 1
fp1-LIT test 3 (case x < 0)
fp1-POW test (exponentiation)
fp-lit-mask
2010-12-13 16:47:57 -08:00
Brian Paul
43b7b9d02a st/mesa: 80-columns wrapping, whitespace fixes in st_cb_bitmap.c 2010-12-13 17:34:07 -07:00
Brian Paul
c21807d2f7 st/mesa: add geom program code in destroy_program_variants() 2010-12-13 17:29:56 -07:00
Brian Paul
b830b62a47 st/mesa: program struct comments 2010-12-13 17:28:02 -07:00
Brian Paul
4312569410 st/mesa: use st_fragment_program() instead of cast 2010-12-13 17:25:29 -07:00
Brian Paul
6c669d0c07 st/mesa: rename variable 2010-12-13 17:25:10 -07:00
Brian Paul
83d50c3ee1 st/mesa: minor re-indenting 2010-12-13 17:20:56 -07:00
Brian Paul
8d8e9491df st/mesa: make st_delete_program() static 2010-12-13 17:20:56 -07:00
Brian Paul
9b4433fe58 st/mesa: add comments, fix formatting in st_cb_program.c 2010-12-13 17:20:56 -07:00
Brian Paul
3d203b6100 Squashed commit of the following (st-mesa-per-context-shaders branch):
commit 4f106f44a32eaddb6cf3fea6ba5ee9787bff609a
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 14:06:08 2010 -0700

    st/mesa: reorganize vertex program translation code

    Now it looks like the fragment and geometry program code.
    Also remove the serial number fields from programs.  It was used to
    determine when new translations were needed.  Now the variant key is
    used for that.  And the st_program_string_notify() callback removes all
    variants when the program's code is changed.

commit e12d6791c5e4bff60bb2e6c04414b1b4d1325f3e
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 13 13:38:12 2010 -0700

    st/mesa: implement geometry shader varients

    Only needed in order to support per-context gallium shaders.

commit c5751c673644808ab069259a852f24c4c0e92b9d
Author: Brian Paul <brianp@vmware.com>
Date:   Sun Dec 12 15:28:57 2010 -0700

    st/mesa: restore glDraw/CopyPixels using new fragment program variants

    Clean up the logic for fragment programs for glDraw/CopyPixels.  We now
    generate fragment program variants for glDraw/CopyPixels as needed which
    do texture sampling, pixel scale/bias, pixelmap lookups, etc.

commit 7b0bb99bab6547f503a0176b5c0aef1482b02c97
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 17:03:23 2010 -0700

    st/mesa: checkpoint: implement fragment program variants

    The fragment programs variants are per-context, as the vertex programs.

    NOTE: glDrawPixels is totally broken at this point.

commit 2cc926183f957f8abac18d71276dd5bbd1f27be2
Author: Brian Paul <brianp@vmware.com>
Date:   Fri Dec 10 14:59:32 2010 -0700

    st/mesa: make vertex shader variants per-context

    Gallium shaders are per-context but OpenGL shaders aren't.  So we need
    to make a different variant for each context.

    During context tear-down we need to walk over all shaders/programs and
    free all variants for the context being destroyed.
2010-12-13 17:20:53 -07:00
Brian Paul
bb7c2691d2 mesa, st/mesa: disable GL_ARB_geometry_shader4
The new GLSL compiler doesn't support geom shaders yet so disable the
GL_ARB_geometry_shader4 extension.  Undo this when geom shaders work again.

NOTE: This is a candidate for the 7.10 branch.
2010-12-13 17:02:48 -07:00
Ian Romanick
2d577ee730 ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does.

Fixes piglit test glsl-link-struct-array (bugzilla #31648).

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 15:47:56 -08:00
Ian Romanick
cb2b547a47 linker: Allow built-in arrays to have different sizes between shader stages
Fixes pitlit test glsl-link-varying-TexCoord (bugzilla #31650).
2010-12-13 15:16:39 -08:00
Eric Anholt
036c817f77 i965: Fix gl_FragCoord.z setup on gen6.
Fixes glsl-bug-22603.
2010-12-13 14:02:34 -08:00
Eric Anholt
5fbd8da8df i956: Fix the old FP path fragment position setup on gen6.
Fixes fp-arb-fragment-coord-conventions-none
2010-12-13 14:02:34 -08:00
Eric Anholt
7cec7bf56c i965: Fix ARL to work on gen6.
RNDD isn't one of the instructions that can do conversion from
execution type to destination type.

Fixes glsl-vs-arrays-3.
2010-12-13 14:02:34 -08:00
Eric Anholt
df9f891544 intel: Include stdbool so we can stop using GLboolean when we want to.
This requires shuffling the driconf XML macros around, since they use
true and false tokens expecting them to not get expanded to anything.
2010-12-13 14:02:34 -08:00
Brian Paul
b363dd43d6 gallivm: store callbacks in a linked list rather than fixed size array
Should fix http://bugs.freedesktop.org/show_bug.cgi?id=32308
2010-12-13 11:47:28 -07:00
Brian Paul
6577f753b2 tnl: a better way to initialize the gl_program_machine memory
This improves commit ef3f7e61b3

NOTE: This is a candidate for the 7.9 and 7.10 branches.
2010-12-13 08:11:58 -07:00
Alex Deucher
4523285e51 r600g: fix rendering with a vertex attrib having a zero stride
The hardware supports zero stride just fine.  This is a port
of 2af8a19831 from r300g.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-12 23:35:37 -05:00
Dave Airlie
d19b5cbd31 r300g: fixup rs690 tiling stride alignment calculations.
The RS690 memory controller prefers things to be on a different
boundary than the discrete GPUs, we had an attempt to fix this,
but it still failed, this consolidates the stride calculation
into one place and removes the really special case check.

This fixes gnome-shell and 16 piglit tests on my rs690 system.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-13 11:29:21 +10:00
Chia-I Wu
d6b1478ff0 egl: Do not unload drivers.
When the driver is the last reference to libEGL.so, unloading it will
cause libEGL.so to be unmapped and give problems.  Disable the unloading
for now.  Still have to figure out the right timing to unload drivers.
2010-12-12 18:31:48 +08:00
Chia-I Wu
1c01bedb02 mapi: Fix a warning in !THREADS build.
It should be u_thread_self, not _glthread_GetID.
2010-12-12 17:59:47 +08:00
Vinson Lee
bf8242684a mesa: Clean up header file inclusion in nvfragparse.h. 2010-12-11 14:37:18 -08:00
Vinson Lee
7d8c067460 mesa: Clean up header file inclusion in ir_to_mesa.h. 2010-12-11 13:30:13 -08:00
Christoph Bumiller
5138ac033a nvc0: support user clip planes 2010-12-11 16:24:27 +01:00
Christoph Bumiller
67d0c3dd79 nvc0: enable vertex color clamping 2010-12-11 16:24:21 +01:00
Marek Olšák
2af8a19831 r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.

This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 14:49:28 +01:00
Marek Olšák
c398f1544e tgsi: fix rbug compile error
../mesa/src/gallium/auxiliary/tgsi/tgsi_parse.h:139:
error: dereferencing pointer ‘tokens.25’ does break strict-aliasing rules

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2010-12-11 13:37:57 +01:00
Marek Olšák
d0990db6bd r300/compiler: fix swizzle lowering with a presubtract source operand
If a source operand has a non-native swizzle (e.g. the KIL instruction
cannot have a swizzle other than .xyzw), the lowering pass uses one or more
MOV instructions to move the operand to an intermediate temporary with
native swizzles.

This commit fixes that the presubtract information was lost during
the lowering.

NOTE: This is a candidate for both the 7.9 and 7.10 branches.
2010-12-11 13:37:57 +01:00
Marek Olšák
9e1fbd3d6e r300/compiler: fix LIT in VS
This fixes broken rendering of trees in ETQW. The trees still disappear
for an unknown reason when they are close.

Broken since:
2ff9d4474b
r300/compiler: make lowering passes possibly use up to two less temps

NOTE: This is a candidate for the 7.10 branch.
2010-12-11 07:32:24 +01:00
Ian Romanick
d7f27e2e76 glsl: Inherrit type of declared variable from initializer after processing assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared.  Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
probably also fixes bugzilla #32273.

NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
2010-12-10 17:52:35 -08:00
Ian Romanick
ec53010c4d glsl: Minor clean-up in validate_assignment
This code has been changed around a lot, and there were some temporary
variables left around from previous versions.
2010-12-10 17:52:35 -08:00
Eric Anholt
783e7caadf i965: Put common info on converting MESA_FORMAT to BRW_FORMAT in a table.
There are exceptions to the table for depth texturing or rendering to
not-quite-supported formats thanks to the non-orthogonal component
selection for surface formats, but it's still a lot simpler.
2010-12-10 16:17:01 -08:00
Eric Anholt
be72efb4f2 intel: Just use ChooseTextureFormat for renderbuffer format choice.
One less place to forget to put your new MESA_FORMAT support in.
2010-12-10 16:16:13 -08:00
Eric Anholt
e339b669a1 intel: Add a couple of helper functions to reduce rb code duplication. 2010-12-10 15:37:16 -08:00
Eric Anholt
28bab24e16 intel: Add spans code for the ARB_texture_rg support.
This starts spantmp2.h down the path of using MESA_FORMAT_* for
specifying the format instead of the crazy GL format/type combo.
2010-12-10 15:37:10 -08:00
Eric Anholt
a7e2d64971 mesa: Don't assertion fail for _mesa_get_format_name(MESA_FORMAT_NONE) 2010-12-10 15:29:52 -08:00
Vinson Lee
ef3f7e61b3 tnl: Initialize gl_program_machine memory in run_vp.
Fixes piglit valgrind glsl-array-bounds-04 failure (FDO bug 29946).

NOTE:
This is a candidate for the 7.10 branch.
This is a candidate for the 7.9 branch.
2010-12-10 14:24:05 -08:00
Christoph Bumiller
dea9d60400 nvc0: fix FACE state and and handle FACE sysval/varying offset 2010-12-10 20:20:37 +01:00
Christoph Bumiller
51f22689a4 nvc0: fix branching ops
- bra is PC relative
- jump to else condition was inverted
- handle integer comparisons
2010-12-10 20:20:34 +01:00
Mathias Fröhlich
b3d2ec9942 vbo: Avoid the copy to current in dlists if not required.
The current state is allowed to be undefined past DrawElements et al.
Consequently omit that copying at least in the display list code.
This pays us some percents performance.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-12-10 10:17:48 -07:00
Brian Paul
2a4df8933e mesa/meta: fix broken assertion, rename stack depth var
assert(current_save_state < MAX_META_OPS_DEPTH) did not compile.

Rename current_save_state to SaveStackDepth to be more consistent with
the style of the other fields.
2010-12-10 10:02:37 -07:00
Brian Paul
b7c38734c9 mesa: enable GL_ARB_draw_instanced for software drivers 2010-12-10 09:29:41 -07:00
Brian Paul
a63486ac68 tnl: implement instanced drawing 2010-12-10 09:29:13 -07:00
Brian Paul
6a0d3b7696 mesa: implement system values in program interpreter 2010-12-10 09:29:00 -07:00
Jerome Glisse
b22c8e8bbc r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-10 11:17:27 -05:00
Vinson Lee
d5810efca6 mesa: Clean up header file inclusion in arbprogparse.h. 2010-12-09 23:52:28 -08:00
Xiang, Haihao
e47eacdc53 i965: support for two-sided lighting on Sandybridge
VS places color attributes together so that SF unit can fetch the right
attribute according to object orientation. This fixes light issue in
mesa demo geartrain, projtex.
2010-12-10 13:25:22 +08:00
Xiang, Haihao
d1196bbc19 meta: allow nested meta operations
_mesa_meta_CopyPixels results in nested meta operations on Sandybridge.
Previoulsy the second meta operation overrides all states saved by the
first meta function.
2010-12-10 13:25:17 +08:00
Eric Anholt
3a3b1bd722 i965: Add support for gen6 reladdr VS constant loading. 2010-12-09 20:25:34 -08:00
Eric Anholt
15566183a6 i965: Add support for gen6 constant-index constant loading. 2010-12-09 20:25:34 -08:00
Chia-I Wu
83bdd402aa targets/egl: Improve st_GL.so loading.
When the application is not linked to any libGL*.so, loading st_GL.so
would give

  /usr/local/lib/egl/st_GL.so: undefined symbol: _glapi_tls_Context

In that case, load libGL.so and try again.  This works because
util_dl_open loads with RTLD_GLOBAL.

Fix "clear" OpenGL ES 1.1 demo.
2010-12-10 11:01:05 +08:00
Chia-I Wu
6efd963a23 target/egl: Fix misleading debug message.
When the name of the module is NULL, the process itself is dlopen()ed.
Do not print

  libEGL debug: searching for st module (null)
2010-12-10 11:00:31 +08:00
Brian Paul
becc4bb90c draw/llvm: don't flush in vs_llvm_delete()
Fixes piglit glx-shader-sharing crash.

When shaders are shared by multiple contexts, the shader's draw context
pointer may point to a previously destroyed context.  Dereferencing the
context pointer will lead to a crash.

In this case, simply removing the flushing code avoids the crash (the
exec and sse shader paths don't flush here either).

There's a deeper issue here, however, that needs examination.  Shaders
should not keep pointers to contexts since contexts might get destroyed
at any time.

NOTE: This is a candidate for the 7.10 branch (after this has been
tested for a while).
2010-12-09 18:41:22 -07:00
Brian Paul
70ca064454 draw/llvm: remove redundant comment 2010-12-09 18:40:48 -07:00
Brian Paul
bd995cf6c0 draw/llvm: remove extraneous conditional 2010-12-09 18:40:48 -07:00
Christoph Bumiller
e32ec11278 nvc0: call grobj_alloc for all used classes
Only doing this to notify the DRM that we need a PGRAPH context,
nvc0 hardware doesn't use actual grobjs anymore.
2010-12-09 17:41:13 +01:00
Christoph Bumiller
92f3642a4f nvc0: write texture address to TIC with a RELOC
Direct access to the bo address requires an API change.
2010-12-09 15:22:17 +01:00
Christoph Bumiller
6e753e3c29 nvc0: use tile flags in a way compatible with nouveau 2010-12-09 15:08:29 +01:00
Christoph Bumiller
3ef1616b63 nvc0: buffer suballocation with a primitive slab allocator 2010-12-09 15:01:37 +01:00
Christoph Bumiller
0d1a2bd0fb nvc0: generate shader header for geometry programs 2010-12-09 14:44:21 +01:00
Christoph Bumiller
14a09095d3 nvc0: fix immediate arg for SHL/SHR 2010-12-09 14:43:11 +01:00
Christoph Bumiller
2bb377ee02 nvc0: index buffers are back
Probably because long methods are gone index buffers must be
explicit again.
2010-12-09 14:41:33 +01:00
Christoph Bumiller
7fa7229560 nvc0: upload constants with m2mf for the time being
I get mysterious lockups with the dedicated CB upload ...
2010-12-09 14:35:26 +01:00
Christoph Bumiller
5655f8d42d nvc0: support primitive restart 2010-12-09 12:08:25 +01:00
Christoph Bumiller
548967f9fa nvc0: rcp f32 also supports neg and abs modifiers 2010-12-09 12:05:03 +01:00
Brian Paul
dcb48e7eb4 llvmpipe: enable instanced drawing cap 2010-12-08 19:06:22 -07:00
Brian Paul
cf2184f057 softpipe: enable instanced drawing cap 2010-12-08 19:04:16 -07:00
Brian Paul
1d6f3543a0 gallivm/llvmpipe: implement system values and instanceID 2010-12-08 19:04:11 -07:00
Brian Paul
2b5e1e5287 st/mesa: translate shader system inputs 2010-12-08 19:01:15 -07:00
Brian Paul
2d62fb6c3f draw: setup instance ID for SSE generator 2010-12-08 19:00:44 -07:00
Brian Paul
0be042cb4d draw: setup instance ID for VS interpreter 2010-12-08 19:00:32 -07:00
Brian Paul
691048a22a mesa: ir_to_mesa support for system values 2010-12-08 18:25:58 -07:00
Brian Paul
7ce186358e glsl: add support for system values and GL_ARB_draw_instanced 2010-12-08 18:25:38 -07:00
Brian Paul
379332f629 mesa: program printing for PROGRAM_SYSTEM_VALUE 2010-12-08 18:24:48 -07:00
Brian Paul
c6d74bcbfc mesa: add PROGRAM_SYSTEM_VALUE and related tokens
System values are shader inputs which don't necessarily change from
vertex to vertex or fragment to fragment.  gl_InstanceID and
gl_FrontFacing are examples.
2010-12-08 18:21:20 -07:00
Brian Paul
975418a654 tgsi/ppc: add case for system values and assert 2010-12-08 18:20:44 -07:00
Brian Paul
e8154eeae5 tgsi/sse: add support for system values 2010-12-08 18:20:05 -07:00
Brian Paul
b550d8d76b tgsi: new tgsi_shader_info fields for system values 2010-12-08 18:19:47 -07:00
Brian Paul
859f45a921 tgsi: add support for system values to TGSI interpreter 2010-12-08 18:19:14 -07:00
Brian Paul
9cd277684d st/mesa: GL_ARB_draw_instanced depends on PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:34:02 -07:00
Brian Paul
d87bc015dc gallium: added PIPE_CAP_INSTANCED_DRAWING 2010-12-05 13:32:59 -07:00
Christoph Bumiller
4c22475383 nvc0: import nvc0 gallium driver 2010-11-12 15:17:40 +01:00
2066 changed files with 182837 additions and 181375 deletions

136
Makefile
View File

@@ -5,7 +5,10 @@ TOP = .
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
@@ -180,7 +183,7 @@ ultrix-gcc:
# Rules for making release tarballs
VERSION=7.10-devel
VERSION=7.11.2
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
@@ -197,8 +200,12 @@ MAIN_FILES = \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
@@ -209,7 +216,6 @@ MAIN_FILES = \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
@@ -224,29 +230,37 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/Makefile \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
@@ -283,8 +297,7 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/windows/VC8/
$(DIRECTORY)/src/mesa/x86-64/Makefile
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
@@ -306,10 +319,12 @@ MAPI_FILES = \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in \
$(DIRECTORY)/src/mapi/vgapi/*.h
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
@@ -320,9 +335,22 @@ EGL_FILES = \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
@@ -344,14 +372,17 @@ GALLIUM_FILES = \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
@@ -359,6 +390,7 @@ DRI_FILES = \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/SConscript \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
@@ -388,14 +420,13 @@ GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
$(DIRECTORY)/src/glw/glw.pc.in
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
@@ -403,29 +434,35 @@ GLUT_FILES = \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
$(GLW_FILES)
# Everything for new a Mesa release:
tarballs: rm_depend configure aclocal.m4 lib_gz glut_gz \
lib_bz2 glut_bz2 lib_zip glut_zip md5
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
@@ -437,53 +474,41 @@ aclocal.m4: configure.ac acinclude.m4
configure: configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config:
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
lib_gz: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar: rm_config
cd .. ; tar --dereference -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
glut_gz:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
lib_bz2: rm_config
cd .. ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar:
cd .. ; tar --dereference -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
glut_bz2:
cd .. ; \
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
bzip2 $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
lib_zip: rm_config
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
glut_zip:
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5:
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@@ -491,7 +516,4 @@ md5:
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5 \
lib_gz glut_gz \
lib_bz2 glut_bz2 \
lib_zip glut_zip
.PHONY: tarballs rm_config md5

View File

@@ -40,6 +40,8 @@ env = Environment(
ENV = os.environ,
)
opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:
targets = ARGUMENTS['targets']
@@ -56,6 +58,12 @@ else:
Help(opts.GenerateHelpText(env))
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
@@ -74,49 +82,54 @@ env.Append(CPPPATH = [
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# Embedded
if env['platform'] == 'embedded':
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# Posix
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
env.Append(CPPDEFINES = [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
])
if env['gcc']:
env.Append(CFLAGS = ['-fvisibility=hidden'])
if env['platform'] == 'darwin':
env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
env.Append(LIBS = [
'm',
'pthread',
'dl',
])
# for debugging
#print env.Dump()
Export('env')
#######################################################################
# Invoke host SConscripts
#
# For things that are meant to be run on the native host build machine, instead
# of the target machine.
#
# Create host environent
if env['crosscompile'] and not env['embedded']:
host_env = Environment(
options = opts,
# no tool used
tools = [],
toolpath = ['#scons'],
ENV = os.environ,
)
# Override options
host_env['platform'] = common.host_platform
host_env['machine'] = common.host_machine
host_env['toolchain'] = 'default'
host_env['llvm'] = False
host_env.Tool('gallium')
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')
SConscript(
'src/SConscript',
variant_dir = host_env['build_dir'],
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
env = target_env
Export('env')
#######################################################################
# Invoke SConscripts
@@ -130,3 +143,18 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
########################################################################
# List all aliases
try:
from SCons.Node.Alias import default_ans
except ImportError:
pass
else:
aliases = default_ans.keys()
aliases.sort()
env.Help('\n')
env.Help('Recognized targets:\n')
for alias in aliases:
env.Help(' %s\n' % alias)

20
bin/extract_git_sha1 Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

View File

@@ -307,7 +307,7 @@ fi
#
case $ARCH in
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*)
'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/* | 'NetBSD')
# we assume gcc
if [ "x$LINK" = "x" ] ; then
@@ -574,20 +574,6 @@ case $ARCH in
fi
;;
'NetBSD')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}_pic.a"
echo "mklib: Making NetBSD PIC static library: " ${LIBNAME}
FINAL_LIBS=`make_ar_static_lib cq 1 ${LIBNAME} ${OBJECTS}`
else
LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME}
rm -f ${LIBNAME}
ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
fi
;;
'IRIX' | 'IRIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
@@ -781,9 +767,8 @@ case $ARCH in
OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
fi
LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
# examine first object to determine ABI
set ${OBJECTS}
@@ -796,9 +781,6 @@ case $ARCH in
OPTS=${ALTOPTS}
fi
# XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk
# to OPTS here?
# determine linker
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -810,8 +792,7 @@ case $ARCH in
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME} ${LINKNAME}
ln -s ${LIBNAME} ${LINKNAME2}
FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
FINAL_LIBS="${LIBNAME} ${LINKNAME}"
fi
;;

View File

@@ -14,22 +14,16 @@ import SCons.Script.SConscript
#######################################################################
# Defaults
_platform_map = {
'linux2': 'linux',
'win32': 'windows',
}
default_platform = sys.platform
default_platform = _platform_map.get(default_platform, default_platform)
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
if 'platform' in SCons.Script.ARGUMENTS:
selected_platform = SCons.Script.ARGUMENTS['platform']
target_platform = SCons.Script.ARGUMENTS['platform']
else:
selected_platform = default_platform
cross_compiling = selected_platform != default_platform
target_platform = host_platform
_machine_map = {
'x86': 'x86',
@@ -38,19 +32,22 @@ _machine_map = {
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}
# find default_machine value
# find host_machine value
if 'PROCESSOR_ARCHITECTURE' in os.environ:
default_machine = os.environ['PROCESSOR_ARCHITECTURE']
host_machine = os.environ['PROCESSOR_ARCHITECTURE']
else:
default_machine = _platform.machine()
default_machine = _machine_map.get(default_machine, 'generic')
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
default_machine = host_machine
default_toolchain = 'default'
if selected_platform == 'windows' and cross_compiling:
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
@@ -61,7 +58,7 @@ if 'LLVM' in os.environ:
else:
default_llvm = 'no'
try:
if selected_platform != 'windows' and \
if target_platform != 'windows' and \
subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
default_llvm = 'yes'
except:
@@ -82,13 +79,17 @@ def AddOptions(opts):
from SCons.Options.EnumOption import EnumOption
opts.Add(EnumOption('build', 'build type', 'debug',
allowed_values=('debug', 'checked', 'profile', 'release')))
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
opts.Add(BoolOption('verbose', 'verbose output', 'no'))
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', default_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
opts.Add(BoolOption('quiet', 'DEPRECATED: quiet command lines', 'yes'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

View File

@@ -15,15 +15,19 @@ ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
GLES_OVERLAY = @GLES_OVERLAY@
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_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_LDFLAGS = @RADEON_LDFLAGS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
@@ -33,9 +37,9 @@ LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
@@ -56,6 +60,10 @@ INSTALL = @INSTALL@
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
@@ -65,6 +73,9 @@ OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -76,6 +87,9 @@ EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -87,6 +101,9 @@ EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -94,6 +111,7 @@ SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -103,7 +121,10 @@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
@@ -129,12 +150,17 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
@@ -182,11 +208,19 @@ GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@

View File

@@ -25,27 +25,29 @@ DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
GLUT_LIB_NAME = libglut.dylib
GLW_LIB_NAME = libGLw.dylib
OSMESA_LIB_NAME = libOSMesa.dylib
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = libGL.*dylib
GLU_LIB_GLOB = libGLU.*dylib
GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
@@ -57,3 +59,5 @@ GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -9,7 +9,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=10
MESA_MINOR=11
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
@@ -25,6 +25,7 @@ CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
@@ -37,6 +38,8 @@ MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
@@ -58,7 +61,9 @@ EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
@@ -70,6 +75,9 @@ EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -81,9 +89,12 @@ EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
TALLOC_LIBS = `pkg-config --libs talloc`
TALLOC_CFLAGS = `pkg-config --cflags talloc`
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
@@ -104,10 +115,13 @@ DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
@@ -119,7 +133,7 @@ EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread $(TALLOC_LIBS)
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
@@ -129,6 +143,9 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
@@ -148,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -177,3 +197,9 @@ GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =

View File

@@ -30,9 +30,11 @@ ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)

View File

@@ -43,9 +43,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl -ltalloc $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
@@ -61,11 +63,16 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon \
DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = `pkg-config --libs libdrm_intel`
INTEL_CFLAGS = `pkg-config --cflags libdrm_intel`
INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
RADEON_LIBS = `pkg-config --libs libdrm_radeon`
RADEON_CFLAGS = `pkg-config --cflags libdrm_radeon`
NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -41,9 +41,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)

View File

@@ -38,9 +38,11 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)

View File

@@ -42,7 +42,8 @@ MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl

View File

@@ -12,7 +12,7 @@ GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
@@ -31,9 +31,9 @@ endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
@@ -41,4 +41,4 @@ else
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
Known issues in the ARB_color_buffer_float implementation:
- Rendering to multiple render targets, some fixed-point, some floating-point, with FIXED_ONLY fragment clamping and polygon smooth enabled may write incorrect values to the fixed point buffers (depends on spec interpretation)
- For fragment programs with ARB_fog_* options, colors are clamped before fog application regardless of the fragment clamping setting (this depends on spec interpretation)

View File

@@ -12,43 +12,48 @@ Feature Status
GL 3.0:
GLSL changes (GL_EXT_gpu_shader4, etc) not started
Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe)
GLSL 1.30 (GL_EXT_gpu_shader4, etc.) started
Conditional rendering (GL_NV_conditional_render) DONE (swrast, softpipe, i965)
Map buffer subranges (GL_ARB_map_buffer_range) DONE
Float textures, renderbuffers some infrastructure done
(incl. GL_EXT_packed_float, GL_EXT_shared_exponent)
Clamping controls (GL_ARB_color_buffer_float) DONE
Float textures, renderbuffers (GL_ARB_texture_float) DONE (gallium r300)
GL_EXT_packed_float DONE (gallium r600)
GL_EXT_texture_shared_exponent DONE (gallium, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) not started
Framebuffer objects (GL_EXT_framebuffer_object) DONE
Half-float some infrastructure done
Half-float DONE
Multisample blit DONE
Non-normalized Integer texture/framebuffer formats ~50% done
1D/2D Texture arrays core Mesa, swrast done
Packed depth/stencil formats DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE
GL_EXT_texture_compression_rgtc not started
GL_EXT_texture_compression_rgtc DONE (swrast, gallium r600)
Red and red/green texture formats DONE (swrast, i965, gallium)
Transform feedback (GL_EXT_transform_feedback) ~50% done
glBindFragDataLocation, glGetFragDataLocation,
glBindBufferRange, glBindBufferBase commands
Vertex array objects (GL_APPLE_vertex_array_object) DONE
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) core GL done (i965, gallium), GLX todo
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands DONE (but converts int
values to floats)
Depth format cube textures 0% done
GL 3.1:
GLSL 1.30 and 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) ~50% done
GLSL 1.40 not started
Instanced drawing (GL_ARB_draw_instanced) DONE (gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE
Primitive restart (GL_NV_primitive_restart) DONE (gallium)
16 vertex texture image units not started
Texture buffer objs (GL_ARB_texture_buffer_object) not started
Rectangular textures (GL_ARB_texture_rectangle) DONE
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Signed normalized texture formats ~50% done
Signed normalized textures (GL_EXT_texture_snorm) DONE (gallium)
GL 3.2:
@@ -60,7 +65,7 @@ BGRA vertex order (GL_ARB_vertex_array_bgra) DONE
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium)
Provoking vertex (GL_ARB_provoking_vertex) DONE
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly?
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE
Multisample textures (GL_ARB_texture_multisample) not started
Frag depth clamp (GL_ARB_depth_clamp) DONE
Fence objects (GL_ARB_sync) DONE
@@ -71,12 +76,12 @@ GL 3.3:
GLSL 3.30 not started
GL_ARB_blend_func_extended not started
GL_ARB_explicit_attrib_location DONE (swrast, i915, i965)
GL_ARB_occlusion_query2 not started
GL_ARB_sampler_objects not started
GL_ARB_occlusion_query2 DONE (swrast, gallium)
GL_ARB_sampler_objects DONE (gallium)
GL_ARB_texture_rgb10_a2ui not started
GL_ARB_texture_swizzle DONE (same as EXT version)
GL_ARB_timer_query DONE (only Xlib sw driver)
GL_ARB_instanced_arrays not started
GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (gallium)
GL_ARB_vertex_type_2_10_10_10_rev not started
@@ -84,7 +89,7 @@ GL 4.0:
GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend not started
GL_ARB_draw_buffers_blend DONE (gallium softpipe)
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
@@ -100,7 +105,7 @@ GL_ARB_transform_feedback3 not started
GL 4.1:
GLSL 4.1 not started
GL_ARB_ES2_compatibility not started
GL_ARB_ES2_compatibility DONE (i965)
GL_ARB_get_program_binary not started
GL_ARB_separate_shader_objects some infrastructure done
GL_ARB_shader_precision not started

View File

@@ -67,7 +67,7 @@ Additions to Chapter 3 the GLX 1.4 Specification (Functions and Errors)
On "PC" computers, AGP memory can be allocated with glXAllocateMemoryNV
and freed with glXFreeMemoryNV. Sometimes it's useful to know where a
block of AGP memory is located with respect to the start of the AGP
aperature. The function
aperture. The function
GLuint glXGetAGPOffsetMESA( const GLvoid *pointer )

View File

@@ -24,7 +24,7 @@ Number
Dependencies
Reguires EGL 1.4 or later. This extension is written against the
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
@@ -66,6 +66,7 @@ New Tokens
EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
Accepted in the <target> parameter of eglCreateImageKHR:
@@ -89,13 +90,16 @@ Additions to the EGL 1.4 Specification:
extension is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, where each pixel
is a CPU-endian, 32-bit quantity, with alpha in the upper 8 bits,
then red, then green, then blue. The bit values accepted by
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA and
EGL_DRM_BUFFER_USE_SHARE_MESA. EGL_DRM_BUFFER_USE_SCANOUT_MESA
requests that the created EGLImage should be usable as a scanout
buffer with the DRM kernel modesetting API. The
EGL_DRM_BUFFER_USE_SHARE_MESA bit requests that the EGLImage can
be shared with other processes by passing the underlying DRM
buffer name.
EGL_DRM_BUFFER_USE_MESA are EGL_DRM_BUFFER_USE_SCANOUT_MESA,
EGL_DRM_BUFFER_USE_SHARE_MESA and EGL_DRM_BUFFER_USE_CURSOR_MESA.
EGL_DRM_BUFFER_USE_SCANOUT_MESA requests that the created EGLImage
should be usable as a scanout buffer with the DRM kernel
modesetting API. EGL_DRM_BUFFER_USE_SHARE_MESA requests that the
EGLImage can be shared with other processes by passing the
underlying DRM buffer name. EGL_DRM_BUFFER_USE_CURSOR_MESA
requests that the image must be usable as a cursor with KMS. When
EGL_DRM_BUFFER_USE_CURSOR_MESA is set, width and height must both
be 64.
To create a process local handle or a global DRM name for a
buffer, call
@@ -134,7 +138,7 @@ Issues
RESOLVED: The eglQueryImage function has been proposed often,
but it goes against the EGLImage design. EGLImages are opaque
handles to a 2D array of pixels, which can be passed between
client APIs. By referenceing an EGLImage in a client API, the
client APIs. By referencing an EGLImage in a client API, the
EGLImage target (a texture, a renderbuffer or such) can be
used to query the attributes of the EGLImage. We don't have a
full client API for creating and querying DRM buffers, though,

View File

@@ -0,0 +1,158 @@
Name
MESA_multithread_makecurrent
Name Strings
GLX_MESA_multithread_makecurrent
Contact
Eric Anholt (eric@anholt.net)
Status
Not shipping.
Version
Last Modified Date: 21 February 2011
Number
TBD
Dependencies
OpenGL 1.0 or later is required.
GLX 1.3 or later is required.
Overview
The GLX context setup encourages multithreaded applications to
create a context per thread which each operate on their own
objects in parallel, and leaves synchronization for write access
to shared objects up to the application.
For some applications, maintaining per-thread contexts and
ensuring that the glFlush happens in one thread before another
thread starts working on that object is difficult. For them,
using the same context across multiple threads and protecting its
usage with a mutex is both higher performance and easier to
implement. This extension gives those applications that option by
relaxing the context binding requirements.
This new behavior matches the requirements of AGL, while providing
a feature not specified in WGL.
IP Status
Open-source; freely implementable.
Issues
None.
New Procedures and Functions
None.
New Tokens
None.
Changes to Chapter 2 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 2.2 Rendering Contexts:
In addition, a rendering context can be current for only one
thread at a time.
with:
In addition, an indirect rendering context can be current for
only one thread at a time. A direct rendering context may be
current to multiple threads, with synchronization of access to
the context thruogh the GL managed by the application through
mutexes.
Changes to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Replace the following sentence from section 3.3.7 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeContextCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeContextCurrent will generate a BadAccess error.
Replace the following sentence from section 3.5 Rendering Contexts:
If ctx is current to some other thread, then
glXMakeCurrent will generate a BadAccess error.
with:
If ctx is an indirect context current to some other thread,
then glXMakeCurrent will generate a BadAccess error.
GLX Protocol
None. The GLX extension only extends to direct rendering contexts.
Errors
None.
New State
None.
Issues
(1) What happens if the app binds a context/drawable in multiple
threads, then binds a different context/thread in one of them?
As with binding a new context from the current thread, the old
context's refcount is reduced and the new context's refcount is
increased.
(2) What happens if the app binds a context/drawable in multiple
threads, then binds None/None in one of them?
The GLX context is unreferenced from that thread, and the other
threads retain their GLX context binding.
(3) What happens if the app binds a context/drawable in 7 threads,
then destroys the context in one of them?
As with GLX context destruction previously, the XID is destroyed
but the context remains usable by threads that have the context
current.
(4) What happens if the app binds a new drawable/readable with
glXMakeCurrent() when it is already bound to another thread?
The context becomes bound to the new drawable/readable, and
further rendering in either thread will use the new
drawable/readable.
(5) What requirements should be placed on the user managing contexts
from multiple threads?
The intention is to allow multithreaded access to the GL at the
minimal performance cost, so requiring that the GL do general
synchronization (beyond that already required by context sharing)
is not an option, and synchronizing of GL's access to the GL
context between multiple threads is left to the application to do
across GL calls. However, it would be unfortunate for a library
doing multithread_makecurrent to require that other libraries
share in synchronization for binding of their own contexts, so the
refcounting of the contexts is required to be threadsafe.
(6) Does this apply to indirect contexts?
This was ignored in the initial revision of the spec. Behavior
for indirect contexts is left as-is.
Revision History
20 November 2009 Eric Anholt - initial specification
22 November 2009 Eric Anholt - added issues from Ian Romanick.
3 February 2011 Eric Anholt - updated with resolution to issues 1-3
3 February 2011 Eric Anholt - added issue 4, 5
21 February 2011 Eric Anholt - Include glXMakeCurrent() sentence
along with glXMakeContextCurrent() for removal.

View File

@@ -48,7 +48,7 @@ IP Status
Issues
1. Should we also defined UNPACK_INVERT_MESA for glDrawPixels, etc?
1. Should we also define UNPACK_INVERT_MESA for glDrawPixels, etc?
Resolved: No, we're only concerned with pixel packing. There are other
solutions for inverting images when using glDrawPixels (negative Y pixel

View File

@@ -31,12 +31,12 @@ Overview
Mesa's implementation of GLX is entirely implemented on the client side.
Therefore, Mesa cannot immediately detect when an X window or pixmap is
destroyed in order to free any ancilliary data associated with the window
destroyed in order to free any ancillary data associated with the window
or pixmap.
The glxMesaReleaseBuffers() function can be used to explicitly indicate
when the back color buffer, depth buffer, stencil buffer, and/or accum-
ulation buffer associated with a drawable can be freed.
when the back color buffer, depth buffer, stencil buffer, and/or accumu-
lation buffer associated with a drawable can be freed.
IP Status
@@ -60,7 +60,7 @@ Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors)
Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
causes all software ancilliary buffers (back buffer, depth, stencil,
causes all software ancillary buffers (back buffer, depth, stencil,
accum, etc) associated with the named drawable to be immediately
deallocated. True is returned if <d> is a valid Mesa GLX drawable,
else False is returned. After calling glXReleaseBuffersMESA, the

View File

@@ -35,7 +35,7 @@ Overview
Mesa's glViewport command queries the current window size and updates
its internal data structors accordingly. This normally works fine
since most applications call glViewport in responce to window size
since most applications call glViewport in response to window size
changes.
In some situations, however, the application may not call glViewport
@@ -65,7 +65,7 @@ Additions to the AGL/GLX/WGL Specifications
Errors
INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen
INVALID_OPERATION is generated if glResizeBuffersMESA is called between
Begin and End.
New State

View File

@@ -88,8 +88,8 @@ Additions to the GLX 1.3 Specification
this is typically the time required to display both the even and odd
fields of a frame of video data.
If <interval> is set to a value of 0, buffer swaps are not synchron-
ized to a video frame. The <interval> value is silently clamped to
If <interval> is set to a value of 0, buffer swaps are not synchro-
nized to a video frame. The <interval> value is silently clamped to
the maximum implementation-dependent value supported before being
stored.

View File

@@ -328,7 +328,7 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
-- Section 3.8.10 "Texture Completeness"
Change the second paragaph (page 177) to say (spec changes identical
Change the second paragraph (page 177) to say (spec changes identical
to EXT_texture_array):
"For one-, two-, or three-dimensional textures and one- or
@@ -443,10 +443,10 @@ Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
Change second through fourth paragraphs (page 188) to say:
"Let D_t be the depth texture value, in the range [0, 1]. For
texture lookups from one- and two-dimesional, rectangle, and
texture lookups from one- and two-dimensional, rectangle, and
one-dimensional array targets, let R be the interpolated <r>
texture coordinate, clamped to the range [0, 1]. For texture lookups
from two-dimesional array texture targets, let R be the interpolated
from two-dimensional array texture targets, let R be the interpolated
<q> texture coordinate, clamped to the range [0, 1]. Then the
effective texture value L_t, I_t, or A_t is computed as follows:
@@ -604,7 +604,7 @@ Additions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
-- Section 5.4 "Display Lists"
Change the first paragraphi on page 242 to say (spec changes
Change the first paragraph on page 242 to say (spec changes
identical to EXT_texture_array):
"TexImage3D, TexImage2D, TexImage1D, Histogram, and ColorTable are

View File

@@ -44,7 +44,7 @@ Overview
ARB_texture_compression_rgtc introduces some compressed red and
red_green signed formats but no uncompressed ones, which might
still be useful. NV_texture_shader adds signed texture formats,
but also a lot of functionality which has been superceded by fragment
but also a lot of functionality which has been superseded by fragment
shaders.
It is usually possible to get the same functionality
using a unsigned format by doing scale and bias in a shader, but this
@@ -105,7 +105,7 @@ Issues
This is also different to what NV_texture_shader used.
The above mapping should be considered the reference, but there
is some leeway so other mappings are allowed for implementations which
cannot do this. Particulary the mapping given in NV_texture_shader or
cannot do this. Particularly the mapping given in NV_texture_shader or
the standard OpenGL byte/float mapping is considered acceptable too, as
might be a mapping which represents -1.0 by -128, 0.0 by 0 and 1.0 by
127 (that is, uses different scale factors for negative and positive

View File

@@ -88,7 +88,7 @@ Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
WindosPos4MESA takes four values indicating x, y, z, and w.
WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only
x, y, and z with w implicitly set to 1 (or only x and y with z
implicititly set to 0 and w implicitly set to 1).
implicitly set to 0 and w implicitly set to 1).
WindowPosMESA operates like RasterPos except that the current modelview
matrix, projection matrix and viewport parameters are ignored and the
@@ -108,7 +108,7 @@ GLX Protocol
Errors
INVALID_OPERATION is generated if WindowPosMESA is called betweeen
INVALID_OPERATION is generated if WindowPosMESA is called between
Begin and End.
New State

View File

@@ -26,7 +26,7 @@ Number
Dependencies
OpenGL 1.0 or later is required
This extensions is written against the OpenGL 1.4 Specification.
This extension is written against the OpenGL 1.4 Specification.
NV_texture_rectangle effects the definition of this extension.
Overview
@@ -104,7 +104,7 @@ Additions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
In section 3.6.4, Rasterization of Pixel Rectangles, on page 104,
add the following to Table 3.12 (Packed pixel fiedl assignments):
add the following to Table 3.12 (Packed pixel field assignments):
First Second Third Fourth
Format Element Element Element Element

View File

@@ -1,110 +1,33 @@
File: docs/README.WIN32
Last updated: Apr 25, 2007 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: 23 April 2011
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
Windows drivers are build with SCons. Makefiles or Visual Studio projects are
no longer shipped or supported.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
the top-level "windows" directory. For example, Visual Studio 8 files
are in windows/VC8.
Run
Support has been dropped for versions of Visual Studio prior to 8. The
main reason is because Microsoft now provides a free compiler and
developer environment. Visual Studio Express can be found at
scons osmesa mesagdi
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
to build classic mesa Windows GDI drivers; or
You'll also need the Platform SDK. Instructions for obtaining and
using the SDK with Visual Studio Express can be found at
scons libgl-gdi
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
Makefiles are no longer shipped or supported, but can be generated
from the projects using Visual Studio.
to build gallium based GDI driver.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
At this time, only the gallium GDI driver is known to work.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
recently cleaned up and rewitten and so may have bugs or may be
missing some functionality. The older versions of the CVS source may
be useful in figuring out any problems, or report them to me.
To build Mesa with the GDI driver, build the mesa, gdi, and glu
projects in the Visual Studio workspace found at
windows/VC8/mesa/mesa.sln
The osmesa DLL can also be built with the osmesa project.
The build system creates a lib top-level directory and copies
resulting LIB and DLL files to this lib directory. The files are:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
If the MesaDemos ZIP file was extracted, the DLL files are also copied
to the demos directory. This facilitates running the demos as described
below.
GLUT and Demos
---- --- -----
A Visual Studio workspace can be found at
windows/VC8/progs/progs.sln
It can be used to build GLUT and a few demos. The GLUT lib and DLL
are copied to the top-level lib directory, along with the Mesa libs.
The demo build system expects to find the LIB files in the top level
lib directory, so you must build the Mesa libs first. The demo
executables are placed in the demos directory, because some of them
rely on data files found there. Also, the Mesa lib DLL's were copied
there by the Mesa lib build process. Therefore, you should be able to
simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
VC8
---
No notes.
General
-------
@@ -124,17 +47,5 @@ the linker import files associated with the DLL files.
The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to
change all the gl* symbols to mgl*. Because this is easy to do with a
global replace operation in a text editor, no additional mangled
version of mesa.def is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you as
much as I can. I also monitor the Mesa mailing lists and will answer
questions in this area there as well.
Karl Schultz
If you have a Windows-related build problem or question, please post
to the mesa-dev or mesa-users list.

View File

@@ -0,0 +1,92 @@
Name
WL_bind_wayland_display
Name Strings
EGL_WL_bind_wayland_display
Contact
Kristian Høgsberg <krh@bitplanet.net>
Benjamin Franzke <benjaminfranzke@googlemail.com>
Status
Proposal
Version
Version 1, March 1, 2011
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
EGL_KHR_base_image is required.
Overview
This extension provides entry points for binding and unbinding the
wl_display of a Wayland compositor to an EGLDisplay. Binding a
wl_display means that the EGL implementation should provide one or
more interfaces in the Wayland protocol to allow clients to create
wl_buffer objects. On the server side, this extension also
provides a new target for eglCreateImageKHR, to create an EGLImage
from a wl_buffer
Adding an implementation specific wayland interface, allows the
EGL implementation to define specific wayland requests and events,
needed for buffer sharing in an EGL wayland platform.
IP Status
Open-source; freely implementable.
New Procedures and Functions
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
EGLBoolean eglBindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
To unbind a server side wl_display from an EGLDisplay, call
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
eglBindWaylandDisplayWL returns EGL_FALSE when there is already a
wl_display bound to EGLDisplay otherwise EGL_TRUE.
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.
Issues
Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)

View File

@@ -62,6 +62,7 @@ a:visited {
<LI><A HREF="perf.html" target="MainFrame">Performance Tips</A>
<LI><A HREF="extensions.html" target="MainFrame">Mesa Extensions</A>
<LI><A HREF="mangling.html" target="MainFrame">Function Name Mangling</A>
<LI><A href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</A>
</ul>
<b>Developer Topics</b>

View File

@@ -21,76 +21,52 @@ When a new release is coming, release candidates (betas) may be found
<p>
Mesa is distributed in several parts:
The Mesa package is named MesaLib-x.y.z.{tar.bz2, tar.gz, zip} where x.y.z
is the version. There are three types of compressed archives.
</p>
<ul>
<li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers
and documentation.
</li>
<li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs.
Most of the programs require GLUT (either the
<a href="http://www.opengl.org/resources/libraries/glut"
target="_parent">original GLUT by Mark Kilgard</a> or
<a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or
<a href="http://openglut.sourceforge.net" target="_parent">OpenGLUT</a>).
</li>
<li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used
with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc.
</li>
</ul>
<p>
If you're not interested in running the demos, you'll only need the first
package.
There's also the MesaGLUT-x.y.z.{tar.bz2, tar.gz, zip} packages which
contain Mark Kilgard's GLUT library.
This is optional.
Most Linux distributions include an implementation of GLUT (such as freeglut).
</p>
<p>
In the past, the Mesa demos collection was distributed as
MesaDemos-x.y.z.{tar.bz2, tar.gz, zip}.
Now, the
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">
Mesa demos</a> are distributed separately.
</p>
<p>
If you're new to this and not sure what you're doing, grab all three packages.
</p>
<p>
The packages are available in .tar.gz, .tar.bz2 and .zip formats.
Other sites might offer additional package formats.
</p>
<H1>Unpacking</H1>
<p>
All the packages should be in the same directory prior to unpacking.
To unpack .tar.gz files:
</p>
<ul>
<li>To unpack .tar.gz files:
<pre>
tar zxf MesaLib-X.Y.tar.gz
tar zxf MesaDemos-X.Y.tar.gz
tar zxf MesaGLUT-X.Y.tar.gz
tar zxf MesaLib-x.y.z.tar.gz
</pre>
or
<pre>
gzcat MesaLib-X.Y.tar.gz | tar xf -
gzcat MesaDemos-X.Y.tar.gz | tar xf -
gzcat MesaGLUT-X.Y.tar.gz | tar xf -
gzcat MesaLib-x.y.z.tar.gz | tar xf -
</pre>
or
<pre>
gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
gunzip MesaLib-x.y.z.tar.gz ; tar xf MesaLib-x.y.z.tar
</pre>
<li>To unpack .tar.bz2 files:
<p>
To unpack .tar.bz2 files:
</p>
<pre>
bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
bunzip2 -c MesaLib-x.y.z.tar.gz | tar xf -
</pre>
<li>To unpack .zip files:
<p>
To unpack .zip files:
</p>
<pre>
unzip MesaLib-X.Y.zip
unzip MesaDemos-X.Y.zip
unzip MesaGLUT-X.Y.zip
unzip MesaLib-x.y.z.zip
</pre>
</ul>
<h1>Contents</h1>
@@ -106,22 +82,13 @@ bin/ - shell scripts for making shared libraries, etc
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
src/glw - Xt/Motif/OpenGL widget code
</pre>
If you downloaded and unpacked the MesaDemos.X.Y package:
<pre>
progs/demos - original Mesa demos
progs/xdemos - GLX OpenGL/Mesa demos
progs/redbook - examples from the OpenGL Programming Guide
progs/samples - examples from SGI
progs/images/ - image files
</pre>
If you downloaded and unpacked the MesaGLUT.X.Y package:
If you downloaded and unpacked the MesaGLUT.x.y.z package:
<pre>
src/glut - GLUT library source code
</pre>

View File

@@ -19,10 +19,7 @@ API entry points and helper functions for use by the drivers. Drivers are
dynamically loaded by the main library and most of the EGL API calls are
directly dispatched to the drivers.</p>
<p>The driver in use decides the window system to support. For drivers that
support hardware rendering, there are usually multiple drivers supporting the
same window system. Each one of of them supports a certain range of graphics
cards.</p>
<p>The driver in use decides the window system to support.</p>
<h2>Build EGL</h2>
@@ -32,12 +29,14 @@ cards.</p>
the driver for your hardware. For example</p>
<pre>
$ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
$ ./configure --enable-gles1 --enable-gles2 \
--with-dri-drivers=... \
--with-gallium-drivers=...
</pre>
<p>The main library and OpenGL is enabled by default. The first option above
enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
<a href="openvg.html">OpenVG</a>.</p>
<p>The main library and OpenGL is enabled by default. The first two options
above enables <a href="opengles.html">OpenGL ES 1.x and 2.x</a>. The last two
options enables the listed classic and and Gallium drivers respectively.</p>
</li>
@@ -45,8 +44,8 @@ enables <a href="opengles.html">OpenGL ES 2.x</a>. The second option enables
</ol>
<p>In the given example, it will build and install <code>libEGL</code>,
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>,
<code>libOpenVG</code>, and one or more EGL drivers.</p>
<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, and one
or more EGL drivers.</p>
<h3>Configure Options</h3>
@@ -68,6 +67,12 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</li>
<li><code>--enable-gallium-egl</code>
<p>Enable the optional <code>egl_gallium</code> driver.</p>
</li>
<li><code>--with-egl-platforms</code>
<p>List the platforms (window systems) to support. Its argument is a comma
@@ -86,16 +91,16 @@ select the right platforms automatically.</p>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<p>These options enable OpenGL ES support in OpenGL. The result is
one big library that supports multiple APIs.</p>
<p>These options enable OpenGL ES support in OpenGL. The result is one big
internal library that supports multiple APIs.</p>
</li>
<li><code>--enable-gles-overlay</code>
<li><code>--enable-shared-glapi</code>
<p>This option enables OpenGL ES as separate libraries. This is an alternative
approach to enable OpenGL ES. It is only supported by
<code>egl_gallium</code>.</p>
<p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
This options makes <code>libGL</code> use the shared <code>libglapi</code>. This
is required if applications mix OpenGL and OpenGL ES.</p>
</li>
@@ -105,12 +110,6 @@ approach to enable OpenGL ES. It is only supported by
</li>
<li><code>--enable-gallium-egl</code>
<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
</li>
</ul>
<h2>Use EGL</h2>
@@ -134,13 +133,24 @@ colon-separated directories where the main library will look for drivers, in
addition to the default directory. This variable is ignored for setuid/setgid
binaries.</p>
<p>This variable is usually set to test an uninstalled build. For example, one
may set</p>
<pre>
$ export LD_LIBRARY_PATH=$mesa/lib
$ export EGL_DRIVERS_PATH=$mesa/lib/egl
</pre>
<p>to test a build without installation</p>
</li>
<li><code>EGL_DRIVER</code>
<p>This variable specifies a full path to an EGL driver and it forces the
specified EGL driver to be loaded. It comes in handy when one wants to test a
specific driver. This variable is ignored for setuid/setgid binaries.</p>
<p>This variable specifies a full path to or the name of an EGL driver. It
forces the specified EGL driver to be loaded. It comes in handy when one wants
to test a specific driver. This variable is ignored for setuid/setgid
binaries.</p>
</li>
@@ -180,8 +190,10 @@ variable to true forces the use of software rendering.</p>
<li><code>egl_dri2</code>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI2 driver loader. For <code>x11</code> support, it talks
to the X server directly using (XCB-)DRI2 protocol.</p>
It functions as a DRI driver loader. For <code>x11</code> support, it talks to
the X server directly using (XCB-)DRI2 protocol.</p>
<p>This driver can share DRI drivers with <code>libGL</code>.</p>
</li>
@@ -191,6 +203,10 @@ to the X server directly using (XCB-)DRI2 protocol.</p>
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
The supported platforms are X11, DRM, FBDEV, and GDI.</p>
<p>This driver comes with its own hardware drivers
(<code>pipe_&lt;hw&gt;</code>) and client API modules
(<code>st_&lt;api&gt;</code>).</p>
</li>
<li><code>egl_glx</code>
@@ -202,6 +218,20 @@ is not available in GLX or GLX extensions.</p>
</li>
</ul>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
there a plan to stabilize it at the moment. Of the EGL drivers,
<code>egl_gallium</code> has its own hardware drivers and client API modules.
They are considered internal to <code>egl_gallium</code> and there is also no
stable ABI between them. These should be kept in mind when packaging for
distribution.</p>
<p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
when the system already has DRI drivers. As <code>egl_gallium</code> is loaded
before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
is disabled by default.</p>
<h2>Developers</h2>
<p>The sources of the main library and the classic drivers can be found at
@@ -286,17 +316,5 @@ not be called with the sample display at the same time. If a driver has access
to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
should as well lock the display before using it.
<h3>TODOs</h3>
<ul>
<li>Pass the conformance tests</li>
<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported. But
which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
<code>libGLESv2.so</code> should an application link to? Bad things may happen
when, say, an application is linked to <code>libGLESv2.so</code> and
<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
</ul>
</body>
</html>

View File

@@ -9,17 +9,38 @@
<H1>Environment Variables</H1>
<p>
Mesa supports the following environment variables:
Normally, no environment variables need to be set. Most of the environment
variables used by Mesa/Gallium are for debugging purposes, but they can
sometimes be useful for debugging end-user issues.
</p>
<H2>LibGL environment variables</H2>
<ul>
<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
If set to 'verbose' additional information will be printed.
<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
</ul>
<H2>Core Mesa environment variables</H2>
<ul>
<li>MESA_NO_ASM - if set, disables all assembly language optimizations
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
if the application generates a GL_INVALID_ENUM error, a corresponding error
message indicating where the error occured, and possibly why, will be
printed to stderr.<br>
If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
generate exceptions.
<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
fragment programs (intended for developers only)
<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
@@ -28,11 +49,23 @@ Setting this variable automatically sets the MESA_TEX_PROG variable as well.
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
and disable the GL_EXT_bar extension.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language options</a>
<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
by extension year.
If this variable is set to year X, only extensions defined on or before year
X will be reported.
This is to work-around a bug in some games where the extension string is
copied into a fixed-size buffer without truncating.
If the extension string is too long, the buffer overrun can cause the game
to crash.
This is a work-around for that.
<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
</ul>
<H2>Mesa Xlib driver environment variables</H2>
<p>
The following are only applicable to the Xlib software driver.
The following are only applicable to the Mesa Xlib software driver.
See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</p>
<ul>
@@ -51,9 +84,8 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
</ul>
<p>
These environment variables are for the Intel i945/i965 drivers:
</p>
<h2>i945/i965 driver environment variables (non-Gallium)</h2>
<ul>
<li>INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve
OpenGL conformance. If set to 2, always use software rendering.
@@ -62,17 +94,71 @@ These environment variables are for the Intel i945/i965 drivers:
</ul>
<p>
These environment variables are for the Radeon R300 driver:
</p>
<h2>Radeon R300 driver environment variables (non-Gallium)</h2>
<ul>
<li>R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
</ul>
<h2>EGL environment variables</h2>
<p>
Mesa EGL supports different sets of environment variables. See the
<a href="egl.html">Mesa EGL</a> page for the details.
</p>
<h2>Gallium environment variables</h2>
<ul>
<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
variables which are used, and their current values.
<li>GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for
shader execution
<li>GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for
shader execution
<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
print any errors to stderr.
<LI>DRAW_FSE - ???
<LI>DRAW_NO_FSE - ???
<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
shaders, vertex fetch, etc.
</ul>
<h3>Softpipe driver environment variables</h3>
<ul>
<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
to stderr
<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
to stderr
<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
</ul>
<h3>LLVMpipe driver environment variables</h3>
<ul>
<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
<li>LP_DEBUG - a comma-separated list of debug options is acceptec. See the
source code for details.
<li>LP_PERF - a comma-separated list of options to selectively no-op various
parts of the driver. See the source code for details.
<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Zero turns of threading completely. The default value is the number of CPU
cores present.
</ul>
<p>
Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
<br>
<br>
</BODY>
</HTML>

View File

@@ -12,16 +12,16 @@
<ol>
<li><a href="#unix-x11">Unix / X11</a>
<ul>
<li><a href="#prereq">Prerequisites for DRI and hardware acceleration</a>
<li><a href="#prereq-general">General prerequisites for building</a>
<li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
<li><a href="#autoconf">Building with autoconf</a>
<li><a href="#traditional">Building with traditional Makefiles</a>
<li><a href="#libs">The Libraries</a>
<li><a href="#demos">Running the demos
<li><a href="#install">Installing the header and library files
<li><a href="#pkg-config">Building OpenGL programs with pkg-config
</ul>
<li><a href="#windows">Windows</a>
<li><a href="#scons">SCons</a>
<li><a href="#scons">Building with SCons</a>
<li><a href="#other">Other</a>
</ol>
<br>
@@ -31,8 +31,22 @@
<H2>1. Unix/X11 Compilation and Installation</H1>
<a name="prereq">
<h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
<a name="prereq-general">
<h3>1.1 General prerequisites for building</h3>
<ul>
<li>lex / yacc - for building the GLSL compiler.
On Linux systems, flex and bison are used.
Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
</li>
<li>python - Python is needed for building the Gallium components.
Version 2.6.4 or later should work.
</li>
</ul>
<a name="prereq-dri">
<h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
<p>
The following are required for DRI-based hardware acceleration with Mesa:
@@ -49,7 +63,7 @@ version 2.4.15 or later
<a name="autoconf">
<h3>1.2 Building with Autoconf</h3>
<h3>1.3 Building with Autoconf</h3>
<p>
Mesa may be <a href="autoconf.html">built using autoconf</a>.
@@ -59,7 +73,7 @@ If that fails the traditional Mesa build system is available.
<a name="traditional">
<h3>1.3 Building with traditional Makefiles</h3>
<h3>1.4 Building with traditional Makefiles</h3>
<p>
The traditional Mesa build system is based on a collection of pre-defined
@@ -126,7 +140,7 @@ Later, if you want to rebuild for a different configuration run
<a name="libs">
<h3>1.4 The libraries</h3>
<h3>1.5 The libraries</h3>
<p>
When compilation has finished, look in the top-level <code>lib/</code>
@@ -185,81 +199,11 @@ If you built the DRI hardware drivers, you'll also see the DRI drivers:
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
</pre>
<a name="demos">
<h3>1.5 Running the demos</h3>
<p>
If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or
obtained Mesa from CVS, the <b>progs/</b> directory will contain a
bunch of demonstration programs.
If you built with Gallium support, look in lib/gallium/ for Gallium-based
versions of libGL and device drivers.
</p>
<p>
Before running a demo, you'll probably have to set two environment variables
to indicate where the libraries are located. For example:
<p>
<blockquote>
<b>cd lib/</b>
<br>
<b>export LD_LIBRARY_PATH=${PWD}</b>
<br>
<b>export LIBGL_DRIVERS_PATH=${PWD}</b> (if using DRI drivers)
</blockquote>
<p>
Next, change to the Mesa/demos/ directory:
</p>
<blockquote>
<b>cd ../progs/demos</b>
</blockquote>
<p>
Run a demo such as gears:
</p>
<blockquote>
<b>./gears</b>
</blockquote>
<p>
If this doesn't work, try the <b>Mesa/progs/xdemos/glxinfo</b> program
and see that it prints the expected Mesa version number.
</p>
<p>
If you're using Linux or a similar OS, verify that the demo program is
being linked with the proper library files:
</p>
<blockquote>
<b>ldd gears</b>
</blockquote>
<p>
You should see something like this:
</p>
<pre>
libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libdl.so.2 => /lib/libdl.so.2 (0x40644000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
</pre>
<p>
Retrace your steps if this doesn't look right.
</p>
<a name="install">
@@ -330,7 +274,6 @@ For example, compiling and linking a GLUT application can be done with:
<p>
Please see the <a href="#scons">instructions on building with SCons</a>.
Alternatively see <a href="README.WIN32">README.WIN32</a> file.
</p>

View File

@@ -1,74 +1,114 @@
LLVMPIPE -- a fork of softpipe that employs LLVM for code generation.
<HTML>
<TITLE>llvmpipe</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<H1>Introduction</H1>
<p>
The Gallium llvmpipe driver is a software rasterizer that uses LLVM to
do runtime code generation.
Shaders, point/line/triangle rasterization and vertex processing are
implemented with LLVM IR which is translated to x86 or x86-64 machine
code.
Also, the driver is multithreaded to take advantage of multiple CPU cores
(up to 8 at this time).
It's the fastest software rasterizer for Mesa.
</p>
Requirements
============
<h1>Requirements</h1>
- A x86 or amd64 processor. 64bit mode is preferred.
Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will
<ul>
<li>
<p>An x86 or amd64 processor; 64-bit mode recommended.</p
<p>
Support for SSE2 is strongly encouraged. Support for SSSE3, and SSE4.1 will
yield the most efficient code. The less features the CPU has the more
likely is that you ran into underperforming, buggy, or incomplete code.
</p>
<p>
See /proc/cpuinfo to know what your CPU supports.
- LLVM 2.6 (or later)
</p>
</li>
<li>
<p>LLVM: version 2.9 recommended; 2.6 or later required.</p>
<b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
<pre>
aptitude install llvm-dev
</pre>
For a RPM-based distribution do:
</p>
<pre>
yum install llvm-devel
</pre>
For Windows download pre-built MSVC 9.0 or MinGW binaries from
http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment
variable to the extracted path.
<p>
For Windows you will need to build LLVM from source with MSVC or MINGW
(either natively or through cross compilers) and CMake, and set the LLVM
environment variable to the directory you installed it to.
For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and
llvm-x.x-msvc32mtd.7z .
LLVM will be statically linked, so when building on MSVC it needs to be
built with a matching CRT as Mesa, and you'll need to pass
-DLLVM_USE_CRT_RELEASE=MTd for debug and checked builds,
-DLLVM_USE_CRT_RELEASE=MTd for profile and release builds.
You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing
debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with
debug=no. This is necessary as LLVM builds as static library so the chosen
MS CRT must match.
You can build only the x86 target by passing -DLLVM_TARGETS_TO_BUILD=X86
to cmake.
</p>
</li>
The version of LLVM from SVN ("2.7svn") from mid-March 2010 is pretty
stable and has some features not in version 2.6.
<li>
<p>scons (optional)</p>
</li>
</ul>
- scons (optional)
- udis86, http://udis86.sourceforge.net/ (optional). My personal repository
supports more opcodes which haven't been merged upstream yet:
git clone git://anongit.freedesktop.org/~jrfonseca/udis86
cd udis86
./autogen.sh
./configure --with-pic
make
sudo make install
Building
========
<h1>Building</h1>
To build everything on Linux invoke scons as:
<pre>
scons build=debug libgl-xlib
</pre>
Alternatively, you can build it with GNU make, if you prefer, by invoking it as
<pre>
make linux-llvm
</pre>
but the rest of these instructions assume that scons is used.
For windows is everything the except except the winsys:
For Windows the procedure is similar except the target:
<pre>
scons build=debug libgl-gdi
</pre>
Using
=====
<h1>Using</h1>
On Linux, building will create a drop-in alternative for libGL.so into
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
</pre>
or
<pre>
lib/gallium/libGL.so
</pre>
To use it set the LD_LIBRARY_PATH environment variable accordingly.
@@ -81,26 +121,21 @@ replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
Profiling
=========
<h1>Profiling</h1>
To profile llvmpipe you should pass the options
<pre>
scons build=profile <same-as-before>
</pre>
This will ensure that frame pointers are used both in C and JIT functions, and
that no tail call optimizations are done by gcc.
To better profile JIT code you'll need to build LLVM with oprofile integration.
source_dir=$PWD/llvm-2.6
build_dir=$source_dir/build/profile
install_dir=$source_dir-profile
mkdir -p "$build_dir"
cd "$build_dir" && \
$source_dir/configure \
<pre>
./configure \
--prefix=$install_dir \
--enable-optimized \
--disable-profiling \
@@ -111,43 +146,57 @@ To better profile JIT code you'll need to build LLVM with oprofile integration.
make -C "$build_dir" install
find "$install_dir/lib" -iname '*.a' -print0 | xargs -0 strip --strip-debug
</pre>
The you should define
<pre>
export LLVM=/path/to/llvm-2.6-profile
</pre>
and rebuild.
Unit testing
============
<h1>Unit testing</h1>
<p>
Building will also create several unit tests in
build/linux-???-debug/gallium/drivers/llvmpipe:
</p>
- lp_test_blend: blending
- lp_test_conv: SIMD vector conversion
- lp_test_format: pixel unpacking/packing
</ul>
<li> lp_test_blend: blending
<li> lp_test_conv: SIMD vector conversion
<li> lp_test_format: pixel unpacking/packing
</ul>
<p>
Some of this tests can output results and benchmarks to a tab-separated-file
for posterior analysis, e.g.:
</p>
<pre>
build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv
</pre>
Development Notes
=================
<h1>Development Notes</h1>
- When looking to this code by the first time start in lp_state_fs.c, and
<ul>
<li>
When looking to this code by the first time start in lp_state_fs.c, and
then skim through the lp_bld_* functions called in there, and the comments
at the top of the lp_bld_*.c functions.
- The driver-independent parts of the LLVM / Gallium code are found in
</li>
<li>
The driver-independent parts of the LLVM / Gallium code are found in
src/gallium/auxiliary/gallivm/. The filenames and function prefixes
need to be renamed from "lp_bld_" to something else though.
- We use LLVM-C bindings for now. They are not documented, but follow the C++
</li>
<li>
We use LLVM-C bindings for now. They are not documented, but follow the C++
interfaces very closely, and appear to be complete enough for code
generation. See
http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html
for a stand-alone example. See the llvm-c/Core.h file for reference.
</li>
</ul>

View File

@@ -11,6 +11,53 @@
<H1>News</H1>
<h2>November 27, 2011</h2>
<p>
<a href="relnotes-7.11.2.html">Mesa 7.11.2</a> is released.
This release was made primarily to fix build problems with 7.11.1 on
Mandriva and to fix problems related to glCopyTexImage to
luminance-alpha textures. That later was believed to have been fixed
in 7.11.1 but was not.
</p>
<h2>November 17, 2011</h2>
<p>
<a href="relnotes-7.11.1.html">Mesa 7.11.1</a> is released. This is a bug fix
release.
</p>
<h2>July 31, 2011</h2>
<p>
<a href="relnotes-7.11.html">Mesa 7.11</a> is released. This is a new
release with many new features.
</p>
<h2>June 13, 2011</h2>
<p>
<a href="relnotes-7.10.3.html">Mesa 7.10.3</a> is released. This is a bug
fix release.
</p>
<h2>April 6, 2011</h2>
<p>
<a href="relnotes-7.10.2.html">Mesa 7.10.2</a> is released. This is a bug
fix release.
</p>
<h2>March 2, 2011</h2>
<p>
<a href="relnotes-7.9.2.html">Mesa 7.9.2</a> and
<a href="relnotes-7.10.1.html">Mesa 7.10.1</a> are released. These are
stable releases containing bug fixes since the 7.9.1 and 7.10 releases.
</p>
<h2>October 4, 2010</h2>
<p>

View File

@@ -17,7 +17,7 @@ target="_parent"> http://www.khronos.org/opengles/</a>.</p>
<h2>Build the Libraries</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-gles-overlay</code> and enable the Gallium driver for your hardware.</li>
<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code> and enable the Gallium driver for your hardware.</li>
<li>Build and install Mesa as usual.</li>
</ol>
@@ -34,29 +34,10 @@ EGL drivers for your hardware.</p>
<h2>Run the Demos</h2>
<p>There are some demos in <code>progs/egl/</code>. You can use them to test
your build. For example,</p>
<pre>
$ cd progs/egl/eglut
$ make
$ cd ../opengles1
$ make
$ ./torus_x11
</pre>
<p>There are some demos in <code>mesa/demos</code> repository.</p>
<h2>Developers</h2>
<h3>Internal Libraries</h3>
<table border="1" style="text-align: center;">
<tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
<tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
<tr><td><code>libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr>
<tr><td><code>libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr>
</table>
<h3>Dispatch Table</h3>
<p>OpenGL ES has an additional indirection when dispatching fucntions</p>

View File

@@ -11,7 +11,7 @@
<H1>OpenVG State Tracker</H1>
<p>
The current version of the OpenVG state tracker implements OpenVG 1.0.
The current version of the OpenVG state tracker implements OpenVG 1.1.
</p>
<p>
More informations about OpenVG can be found at
@@ -26,9 +26,9 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
<h2>Building the library</h2>
<ol>
<li>Run <code>configure</code> with <code>--enable-openvg</code>. If you do
not need OpenGL, you can add <code>--disable-opengl</code> to save the
compilation time.</li>
<li>Run <code>configure</code> with <code>--enable-openvg</code> and
<code>--enable-gallium-egl</code>. If you do not need OpenGL, you can add
<code>--disable-opengl</code> to save the compilation time.</li>
<li>Build and install Mesa as usual.</li>
</ol>
@@ -36,7 +36,7 @@ compilation time.</li>
<h3>Sample build</h3>
A sample build looks as follows:
<pre>
$ ./configure --disable-opengl --enable-openvg
$ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
$ make
$ make install
</pre>

31
docs/patents.txt Normal file
View File

@@ -0,0 +1,31 @@
ARB_texture_float:
Silicon Graphics, Inc. owns US Patent #6,650,327, issued November 18,
2003 [1].
SGI believes this patent contains necessary IP for graphics systems
implementing floating point rasterization and floating point
framebuffer capabilities described in ARB_texture_float extension, and
will discuss licensing on RAND terms, on an individual basis with
companies wishing to use this IP in the context of conformant OpenGL
implementations [2].
The source code to implement ARB_texture_float extension is included
and can be toggled on at compile time, for those who purchased a
license from SGI, or are in a country where the patent does not apply,
etc.
The software is provided "as is", without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
You should contact a lawyer or SGI's legal department if you want to
enable this extension.
[1] http://www.google.com/patents/about?id=mIIOAAAAEBAJ&dq=6650327
[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt

380
docs/relnotes-7.10.1.html Normal file
View File

@@ -0,0 +1,380 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.1 Release Notes / TBD</H1>
<p>
Mesa 7.10.1 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.1 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
4b4cee19f3bf16eb78bd4cc278ccf812 MesaLib-7.10.1.tar.gz
efe8da4d80c2a5d32a800770b8ce5dfa MesaLib-7.10.1.tar.bz2
0fd2b1a025934de3f8cecf9fb9b57f4c MesaLib-7.10.1.zip
42beb0f5188d544476c19496f725fa67 MesaGLUT-7.10.1.tar.gz
637bb8a20fdad89f7382b4ea83f896e3 MesaGLUT-7.10.1.tar.bz2
bdbf3ffb2606d6aa8afabb6c6243b91b MesaGLUT-7.10.1.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34030">Bug 34030</a> - [bisected] Starcraft 2: some effects are corrupted or too big</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34179">Bug 34179</a> - Nouveau 3D driver: nv50_pc_emit.c:863 assertion error kills Compiz</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</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-7.10..mesa-7.10.1
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (21):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>docs: add links to 7.9.1 and 7.10 release notes</li>
<li>docs: added news item for 7.9.1 and 7.10 release</li>
<li>gallivm: work around LLVM 2.6 bug when calling C functions</li>
<li>gallivm: fix copy&amp;paste error from previous commit</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: fix incorrect glCopyPixels position on fallback path</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add link to 7.10.1 release notes</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (20):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>mesa: Refactor handling of extension strings</li>
<li>mesa: Add/remove extensions in extension string</li>
<li>mesa: Change dependencies of some OES extension strings</li>
<li>mesa: Change OES_point_sprite to depend on ARB_point_sprite</li>
<li>mesa: Change OES_standard_derivatives to be stand-alone extension</li>
<li>i915: Disable extension OES_standard_derivatives</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Christoph Bumiller (1):
<ul>
<li>nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (3):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: calculate complete texture state inside TFP function</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (16):
<ul>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>i965/fs: When producing ir_unop_abs of an operand, strip negate.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>i965/fs: Do flat shading when appropriate.</li>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>i965: Fix dead pointers to fp-&gt;Parameters-&gt;ParameterValues[] after realloc.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
<li>i965: Fix a bug in i965 compute-to-MRF.</li>
<li>i965/fs: Add a helper function for detecting math opcodes.</li>
</ul></p>
<p>Fredrik Höglund (1):
<ul>
<li>st/mesa: fix a regression from cae2bb76</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.10 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial bits of 7.10.1 release notes</li>
<li>mesa: bump version to 7.10.1-devel</li>
<li>doc: Update 7.10.1 release notes</li>
<li>glsl: Emit errors or warnings when 'layout' is used with 'attribute' or 'varying'</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.10.1 release notes</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>docs: Update 7.10.1 release notes</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>docs: update 7.10.1 release notes with Ian's recent cherry picks</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.10.1 with (hopefully) the last of the cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.10.1 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (20):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>i965/fs: Apply source modifier workarounds to POW as well.</li>
<li>i965: Fix shaders that write to gl_PointSize on Sandybridge.</li>
<li>i965/fs: Avoid register coalescing away gen6 MATH workarounds.</li>
<li>i965/fs: Correctly set up gl_FragCoord.w on Sandybridge.</li>
<li>i965: Increase Sandybridge point size clamp.</li>
<li>i965/fs: Refactor control flow stack handling.</li>
<li>i965: Increase Sandybridge point size clamp in the clip state.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
<li>Revert "i965/fs: Correctly set up gl_FragCoord.w on Sandybridge."</li>
</ul></p>
<p>Marek Olšák (4):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.10</li>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Tom Fogal (1):
<ul>
<li>Regenerate gl_mangle.h.</li>
</ul></p>
<p>Tom Stellard (2):
<ul>
<li>r300/compiler: Disable register rename pass on r500</li>
<li>r300/compiler: Don't erase sources when converting RGB-&gt;Alpha</li>
</ul></p>
<p>Vinson Lee (3):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
<li>mesa: Move declaration before code in extensions.c.</li>
<li>mesa: Move loop variable declarations outside for loop in extensions.c.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

206
docs/relnotes-7.10.2.html Normal file
View File

@@ -0,0 +1,206 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.2 Release Notes / April 6, 2011</H1>
<p>
Mesa 7.10.2 is a bug fix release which fixes bugs found since the 7.10 release.
</p>
<p>
Mesa 7.10.2 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
2f9f444265534a2cfd9a99d1a8291089 MesaLib-7.10.2.tar.gz
f5de82852f1243f42cc004039e10b771 MesaLib-7.10.2.tar.bz2
47836e37bab6fcafe3ac90c9544ba0e9 MesaLib-7.10.2.zip
175120325828f313621cc5bc6c504803 MesaGLUT-7.10.2.tar.gz
8c71d273f5f8d6c5eda4ffc39e0fe03e MesaGLUT-7.10.2.tar.bz2
03036c8efe7b791a90fa0f2c41b43f43 MesaGLUT-7.10.2.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=29172">Bug 29172</a> - Arrandale - Pill Popper Pops Pills</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31159">Bug 31159</a> - shadow problem in 0ad game</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32688">Bug 32688</a> - [RADEON:KMS:R300G] some games have a wireframe or outline visible</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32949">Bug 32949</a> - [glsl wine] Need for Speed renders incorrectly with GLSL enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34203">Bug 34203</a> - [GLSL] fail to call long chains across shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34376">Bug 34376</a> - [GLSL] allowing assignment to unsized array
<ul>
<li>The commit message incorrectly
lists <a href="https://bugs.freedesktop.org/show_bug.cgi?id=34367">bug
34367</a>.</li>
</ul>
</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34370">Bug 34370</a> - [GLSL] "i&lt;5 &amp;&amp; i&lt;4" in for loop fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34374">Bug 34374</a> - [GLSL] fail to redeclare an array using initializer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35073">Bug 35073</a> - [GM45] Alpha test is broken when rendering to FBO with no color attachment</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35483">Bug 35483</a> - util_blit_pixels_writemask: crash in line 322 of src/gallium/auxiliary/util/u_blit.c</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-7.10.1..mesa-7.10.2
</pre>
<p><em>Note:</em> Reverted commits and the reverts are not included in this list.</p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new ontario pci ids</li>
<li>r600g: add some additional ontario pci ids</li>
</ul></p>
<p>Benjamin Franzke (1):
<ul>
<li>st/dri: Fix surfaceless gl using contexts with previous bound surfaces</li>
</ul></p>
<p>Brian Paul (9):
<ul>
<li>docs: pull 7.9.2 release notes into 7.10 branch</li>
<li>docs: update news.html with 7.10.1 and 7.9.2 releases</li>
<li>docs: fill in 7.10.1 release data</li>
<li>docs: add, fix release notes links</li>
<li>docs: update info about Mesa packaging/contents</li>
<li>docs: update prerequisites, remove old demo info</li>
<li>mesa: Guard against null pointer deref in fbo validation</li>
<li>st/mesa: Apply LOD bias from correct texture unit</li>
<li>glsl: silence warning in printf() with a cast</li>
</ul></p>
<p>Chad Versace (1):
<ul>
<li>i965: Fix tex_swizzle when depth mode is GL_RED</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r600: don't close fd on failed load</li>
</ul></p>
<p>Eric Anholt (2):
<ul>
<li>i965: Apply a workaround for the Ironlake "vertex flashing".</li>
<li>i965: Fix alpha testing when there is no color buffer in the FBO.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>st/mesa: Apply LOD from texture object</li>
</ul></p>
<p>Henri Verbeet (1):
<ul>
<li>st/mesa: Validate state before doing blits.</li>
</ul></p>
<p>Ian Romanick (13):
<ul>
<li>docs: Add 7.10.1 md5sums</li>
<li>glsl: Refactor AST-to-HIR code handling variable initializers</li>
<li>glsl: Refactor AST-to-HIR code handling variable redeclarations</li>
<li>glsl: Process redeclarations before initializers</li>
<li>glsl: Function signatures cannot have NULL return type</li>
<li>glsl: Add several function / call related validations</li>
<li>linker: Add imported functions to the linked IR</li>
<li>glsl: Use insert_before for lists instead of open coding it</li>
<li>glsl: Only allow unsized array assignment in an initializer</li>
<li>glcpp: Refresh autogenerated lexer files</li>
<li>docs: Initial bits of 7.10.2 release notes</li>
<li>mesa: set version string to 7.10.2</li>
<li>mesa: Remove nonexistant files from _FILES lists</li>
</ul></p>
<p>Jerome Glisse (1):
<ul>
<li>r600g: move user fence into base radeon structure</li>
</ul></p>
<p>José Fonseca (2):
<ul>
<li>mesa: Fix typo glGet*v(GL_TEXTURE_COORD_ARRAY_*).</li>
<li>mesa: More glGet* fixes.</li>
</ul></p>
<p>Kenneth Graunke (4):
<ul>
<li>glcpp: Rework lexer to use a SKIP state rather than REJECT.</li>
<li>glcpp: Remove trailing contexts from #if rules.</li>
<li>i965/fs: Fix linear gl_Color interpolation on pre-gen6 hardware.</li>
<li>glsl: Accept precision qualifiers on sampler types, but only in ES.</li>
</ul></p>
<p>Marek Olšák (15):
<ul>
<li>st/mesa: fix crash when DrawBuffer-&gt;_ColorDrawBuffers[0] is NULL</li>
<li>st/mesa: fail to alloc a renderbuffer if st_choose_renderbuffer_format fails</li>
<li>r300/compiler: fix the saturate modifier when applied to TEX instructions</li>
<li>r300/compiler: fix translating the src negate bits in pair_translate</li>
<li>r300/compiler: Abs doesn't cancel Negate (in the conversion to native swizzles)</li>
<li>r300/compiler: TEX instructions don't support negation on source arguments</li>
<li>r300/compiler: do not set TEX_IGNORE_UNCOVERED on r500</li>
<li>r300/compiler: saturate Z before the shadow comparison</li>
<li>r300/compiler: fix equal and notequal shadow compare functions</li>
<li>r300/compiler: remove unused variables</li>
<li>st/mesa: fix crash when using both user and vbo buffers with the same stride</li>
<li>r300g: fix alpha-test with no colorbuffer</li>
<li>r300g: tell the GLSL compiler to lower the continue opcode</li>
<li>r300/compiler: propagate SaturateMode down to the result of shadow comparison</li>
<li>r300/compiler: apply the texture swizzle to shadow pass and fail values too</li>
</ul></p>
<p>Michel Dänzer (1):
<ul>
<li>Use proper source row stride when getting depth/stencil texels.</li>
</ul></p>
<p>Tom Stellard (4):
<ul>
<li>r300/compiler: Use a 4-bit writemask in pair instructions</li>
<li>prog_optimize: Fix reallocating registers for shaders with loops</li>
<li>r300/compiler: Fix vertex shader MAD instructions with constant swizzles</li>
<li>r300/compiler: Don't try to convert RGB to Alpha in full instructions</li>
</ul></p>
</body>
</html>

303
docs/relnotes-7.10.3.html Normal file
View File

@@ -0,0 +1,303 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.10.3 Release Notes / June 13, 2011</H1>
<p>
Mesa 7.10.3 is a bug fix release which fixes bugs found since the 7.10.2 release.
</p>
<p>
Mesa 7.10.3 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
8c38fe8266be8e1ed1d84076ba5a703b MesaLib-7.10.3.tar.bz2
614d063ecd170940d9ae7b355d365d59 MesaLib-7.10.3.zip
8768fd562ede7ed763d92b2d22232d7a MesaGLUT-7.10.3.tar.gz
1496415b89da9549f0f3b34d9622e2e2 MesaGLUT-7.10.3.tar.bz2
1f29d0e7398fd3bf9f36f5db02941198 MesaGLUT-7.10.3.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=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31590">Bug 31590</a> - Black space between colors on mole hill example</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32395">Bug 32395</a> - [glsl] Incorrect code generation for shadow2DProj() with bias</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32564">Bug 32564</a> - [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32835">Bug 32835</a> - [glsl] recursive #define results in infinite stack recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33303">Bug 33303</a> - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33314">Bug 33314</a> - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33512">Bug 33512</a> - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34280">Bug 34280</a> - r200 mesa-7.10 font distortion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34321">Bug 34321</a> - The ARB_fragment_program subset of ARB_draw_buffers not implemented</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35603">Bug 35603</a> - GLSL compiler freezes compiling shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36173">Bug 36173</a> - struct renderbuffer's 'format' field never set when using FBO</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36238">Bug 36238</a> - Mesa release files don't contain scons control files</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36410">Bug 36410</a> - [SNB] Rendering errors in 3DMMES subtest taiji</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36527">Bug 36527</a> - [wine] Wolfenstein: Failed to translate rgb instruction.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36651">Bug 36651</a> - mesa requires bison and flex to build but configure does not check for them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36738">Bug 36738</a> - Openarena crash with r300g, swrastg + llvm &gt; 2.8</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37648">Bug 37648</a> - Logic error in mesa/main/teximage.c:texsubimage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37739">Bug 37739</a> - Color clear of FBO without color buffer crashes</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-7.10.2..mesa-7.10.3
</pre>
<p>Alan Hourihane (1):
<ul>
<li>Check for out of memory when creating fence</li>
</ul></p>
<p>Alex Buell (1):
<ul>
<li>configure: bump LIBDRM_REQUIRED to 2.4.24</li>
</ul></p>
<p>Alex Deucher (2):
<ul>
<li>r600c: add new pci ids</li>
<li>r600g: add new pci ids</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>docs: add link to 7.10.2 release notes</li>
<li>scons: remove dangling reference to state_trackers/python/SConscript</li>
<li>Makefile: add missing Scons files</li>
<li>llvmpipe: document issue with LLVM 2.8 and earlier with AVX</li>
<li>docs: replace llvmpipe/README with docs/llvmpipe.html</li>
<li>glsl: add static qualifier to silence warning</li>
<li>glsl: add cast to silence signed/unsigned comparison warning</li>
<li>mesa: s/height/depth/ in texsubimage()</li>
<li>mesa: fix void pointer arithmetic warnings</li>
<li>mesa: add some missing GLAPIENTRY keywords</li>
<li>mesa: check that flex/bison are installed</li>
<li>st/mesa: fix incorrect texture level/face/slice accesses</li>
<li>draw: fix edge flag handling in clipper (for unfilled tris/quads/polygons)</li>
<li>vbo: check array indexes to prevent negative indexing</li>
<li>vbo: remove node-&gt;count &gt; 0 test in vbo_save_playback_vertex_list()</li>
<li>st/mesa: fix software accum buffer format bug</li>
<li>mesa: add include/c99/inttypes.h include/c99/stdbool.h include/c99/stdint.h files to tarballs</li>
<li>docs: 7.10.3 release notes skeleton file, links</li>
<li>mesa: bump version to 7.10.3</li>
</ul></p>
<p>Carl Worth (2):
<ul>
<li>glcpp: Simplify calling convention of parser's active_list functions</li>
<li>glcpp: Fix attempts to expand recursive macros infinitely (bug #32835).</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>st/mesa: fix compressed mipmap generation.</li>
</ul></p>
<p>Eric Anholt (19):
<ul>
<li>i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.</li>
<li>glsl: Avoid cascading errors when looking for a scalar boolean and failing.</li>
<li>glsl: Semantically check the RHS of `&amp;&amp;' even when short-circuiting.</li>
<li>glsl: Semantically check the RHS of `||' even when short-circuiting.</li>
<li>glsl: When we've emitted a semantic error for ==, return a bool constant.</li>
<li>glsl: Perform type checking on "^^" operands.</li>
<li>intel: Use _mesa_base_tex_format for FBO texture attachments.</li>
<li>swrast: Don't assert against glReadPixels of GL_RED and GL_RG.</li>
<li>mesa: Add a gl_renderbuffer.RowStride field like textures have.</li>
<li>mesa: Add a function to set up the default renderbuffer accessors.</li>
<li>intel: Use Mesa core's renderbuffer accessors for depth.</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*</li>
<li>mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*</li>
<li>mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.</li>
<li>swrast: Don't try to adjust_colors for &lt8bpc when handling R16, RG1616.</li>
<li>intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.</li>
<li>Revert "intel: Add spans code for the ARB_texture_rg support."</li>
<li>mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.</li>
<li>mesa: Add support for OPTION ATI_draw_buffers to ARB_fp.</li>
</ul></p>
<p>Hans de Goede (1):
<ul>
<li>texstore: fix regression stricter check for memcpy path for unorm88 and unorm1616</li>
</ul></p>
<p>Henri Verbeet (3):
<ul>
<li>mesa: Also update the color draw buffer if it's explicitly set to GL_NONE.</li>
<li>glx: Destroy dri2Hash on DRI2 display destruction.</li>
<li>glx: Only remove the glx_display from the list after it's destroyed.</li>
</ul></p>
<p>Ian Romanick (9):
<ul>
<li>docs: Add 7.10.2 md5sums</li>
<li>glsl: Fix off-by-one error setting max_array_access for non-constant indexing</li>
<li>ir_to_mesa: Handle shadow compare w/projection and LOD bias correctly</li>
<li>intel: Fix ROUND_DOWN_TO macro</li>
<li>glsl: Regenerate compiler and glcpp files from cherry picks</li>
<li>i965: Remove hint_gs_always and resulting dead code</li>
<li>mesa: Don't try to clear a NULL renderbuffer</li>
<li>mesa: Ignore blits to/from missing buffers</li>
<li>docs: Add list of bugs fixed in 7.10.3 release</li>
</ul></p>
<p>Jeremy Huddleston (18):
<ul>
<li>apple: Update GL specs</li>
<li>apple: Rename glcontextmodes.[ch] to glxconfig.[ch]</li>
<li>apple: Rename __GLcontextModes to struct glx_config</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Re-add driContext and do_destroy</li>
<li>apple: Rename _gl_context_modes_find_visual to glx_config_find_visual</li>
<li>apple: Rename GLXcontext</li>
<li>apple: Change from XExtDisplayInfo to struct glx_display</li>
<li>apple: ifdef out come glapi-foo on darwin</li>
<li>glx: Dead code removal</li>
<li>apple: Build darwin using applegl rather than indirect</li>
<li>apple: Fix build failures in applegl_glx.c</li>
<li>darwin: Define GALLIUM_DRIVERS_DIRS in darwin config</li>
<li>apple: Package applegl source into MesaLib tarball</li>
<li>darwin: Set VG_LIB_{NAME,GLOB} to fix make install</li>
<li>darwin: Don't link against libGL when building libOSMesa</li>
<li>darwin: Fix VG_LIB_GLOB to also match the unversioned symlink</li>
<li>osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.</li>
</ul></p>
<p>José Fonseca (13):
<ul>
<li>llvmpipe: Update readme.</li>
<li>mesa: GL_PROVOKING_VERTEX_EXT is a GLenum, not GLboolean.</li>
<li>mesa: Fix GetVertexAttrib* inside display lists.</li>
<li>draw: Fix draw_variant_output::format's type.</li>
<li>gallivm: Tell LLVM to not assume a 16-byte aligned stack on x86.</li>
<li>gallivm: Fix for dynamically linked LLVM 2.8 library.</li>
<li>st/wgl: Adjust the pbuffer invisible window size.</li>
<li>st/wgl: Fix debug output format specifiers of stw_framebuffer_get_size().</li>
<li>st/wgl: Prevent spurious framebuffer sizes when the window is minimized.</li>
<li>st/wgl: Cope with zero width/height windows.</li>
<li>st/wgl: Allow to create pbuffers bigger than the desktop.</li>
<li>st/wgl: Remove buggy assertion.</li>
<li>wgl: Don't hold on to user supplied HDC.</li>
</ul></p>
<p>Kenneth Graunke (10):
<ul>
<li>i965/fs: Switch W and 1/W in Sandybridge interpolation setup.</li>
<li>i965: Refactor Sandybridge implied move handling.</li>
<li>i965: Resolve implied moves in brw_dp_READ_4_vs_relative.</li>
<li>intel: Add IS_GT2 macro for recognizing Sandybridge GT2 systems.</li>
<li>i965: Allocate the whole URB to the VS and fix calculations for Gen6.</li>
<li>intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.</li>
<li>glsl: Fix memory error when creating the supported version string.</li>
<li>glsl: Regenerate autogenerated file builtin_function.cpp.</li>
<li>i965: Rename various gen6 #defines to match the documentation.</li>
<li>i965: Never enable the GS on Gen6.</li>
</ul></p>
<p>Kostas Georgiou (1):
<ul>
<li>r600c/g: Add pci id for FirePro 2270</li>
</ul></p>
<p>Marek Olšák (18):
<ul>
<li>tgsi/ureg: bump the limit of immediates</li>
<li>st/mesa: fix changing internal format via RenderbufferStorage</li>
<li>st/mesa: GenerateMipmap should not be killed by conditional rendering</li>
<li>swrast: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: BlitFramebuffer should not be killed by conditional rendering</li>
<li>st/mesa: CopyTex(Sub)Image should not be killed by conditional rendering</li>
<li>st/mesa: conditional rendering should not kill texture decompression via blit</li>
<li>mesa: forbid UseProgram to be called inside Begin/End</li>
<li>mesa: UseShaderProgramEXT and Uniform* shouldn't be allowed inside Begin/End</li>
<li>mesa: queries of non-existent FBO attachments should return INVALID_OPERATION</li>
<li>r300g: fix draw_vbo splitting on r3xx-r4xx</li>
<li>r300g: fix texturing with non-3D textures and wrap R mode set to sample border</li>
<li>r300g: fix occlusion queries when depth test is disabled or zbuffer is missing</li>
<li>r300g: clear can be killed by render condition</li>
<li>st/mesa: remove asserts in st_texture_image_copy</li>
<li>mesa: fix up assertion in _mesa_source_buffer_exists</li>
<li>mesa: invalidate framebuffer if internal format of renderbuffer is changed</li>
<li>mesa: return after invalidating renderbuffer</li>
</ul></p>
<p>Matt Turner (1):
<ul>
<li>r300/compiler: align memory allocations to 8-bytes</li>
</ul></p>
<p>Tom Stellard (3):
<ul>
<li>r300/compiler: Fix incorrect presubtract conversion</li>
<li>r300/compiler: Fix dataflow analysis bug with ELSE blocks</li>
<li>r300/compiler: Limit instructions to 3 source selects</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>gallivm: Disable MMX-disabling code on llvm-2.9.</li>
</ul></p>
<p>Zou Nan hai (1):
<ul>
<li>i965: Align interleaved URB write length to 2</li>
</ul></p>
<p>pepp (1):
<ul>
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
</ul></p>
</body>
</html>

File diff suppressed because it is too large Load Diff

391
docs/relnotes-7.11.1.html Normal file
View File

@@ -0,0 +1,391 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11.1 Release Notes / November 17, 2011</H1>
<p>
Mesa 7.11.1 is a bug fix release which fixes bugs found since the 7.11 release.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
ac0181a4076770fb657c1169af43aa09 MesaLib-7.11.1.tar.gz
a77307102cee844ff6544ffa8fafeac1 MesaLib-7.11.1.tar.bz2
dfcb11516c1730f3981b55a65a835623 MesaLib-7.11.1.zip
2cb2b9ecb4fb7d1a6be69346ee886952 MesaGLUT-7.11.1.tar.gz
3f54e314290d4dacbab089839197080b MesaGLUT-7.11.1.tar.bz2
5d66c7ee8c5cc2f27e1ffb037ad4172c MesaGLUT-7.11.1.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=3165">Bug 3165</a> - texImage.IsCompressed and texImage.CompressedSize issues</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=23525">Bug 23525</a> - Software rendering on QEMU guests badly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28125">Bug 28125</a> - DRI2 prevents indirect glx</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34628">Bug 34628</a> - [ilk] skybox errors in quake4</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36371">Bug 36371</a> - r200: piglit readPixSanity failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36669">Bug 36669</a> - EmitNoMainReturn set to 1 doesn't make the GLSL compiler lower all the RET opcodes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36939">Bug 36939</a> - multitexturing is messed up in quake wars (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37907">Bug 37907</a> - [swrast] SIGSEGV swrast/s_depth.c:569</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38163">Bug 38163</a> - Gnome Shell Display Bug</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38625">Bug 38625</a> - ast_to_hir.cpp:1761: const glsl_type* process_array_type(YYLTYPE*, const glsl_type*, ast_node*, _mesa_glsl_parse_state*): Assertion `dummy_instructions.is_empty()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38729">Bug 38729</a> - [softpipe] sp_quad_depth_test.c:215:convert_quad_stencil: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38863">Bug 38863</a> - [IVB]GPU hang when running 3D games like openarena</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39193">Bug 39193</a> - [llvmpipe and r600g] glCheckFramebufferStatusEXT segfaults in Gallium when checking status on a framebuffer bound to a texture that's bound to a pixmap</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39651">Bug 39651</a> - [glsl] Assertion failure when implicitly converting out parameters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39991">Bug 39991</a> - [regression]GL_PALETTE8_RGBA8_OES format of glCompressedTexImage2D will cause err GL_INVALID_ENUM with GLES1.x</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40022">Bug 40022</a> - [i915] out-of-bounds write src/mesa/drivers/dri/i915/i915_fragprog.c:321</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40062">Bug 40062</a> - in etqw the strogg radar is black (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40324">Bug 40324</a> - [SNB] gpu hang in mesa 7.11</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=40533">Bug 40533</a> - i915: piglit glean/readPixSanity: DRI2SwapBuffers: BadDrawable (invalid Pixmap or Window parameter)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41096">Bug 41096</a> - [sandybridge-m-gt2+] GPU lockup render.IPEHR: 0x7a000002</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=41969">Bug 41969</a> - The Mesa meta save/restore code doesn't always save the active program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=42175">Bug 42175</a> - RV730: Display errors in glxgears &amp; WebGL</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=42268">Bug 42268</a> - [bisected] oglc pbo(negative.invalidOffsetValue) aborts on 7.11 branch</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-7.11..mesa-7.11.1
</pre>
<p>Adam Jackson (2):
<ul>
<li>drisw: Remove cargo culting that breaks GLX 1.3 ctors</li>
<li>glx: Don't enable INTEL_swap_event unconditionally</li>
</ul></p>
<p>Alex Deucher (1):
<ul>
<li>r600g: fix up vs export handling</li>
</ul></p>
<p>Ben Widawsky (1):
<ul>
<li>intel: GetBuffer fix</li>
</ul></p>
<p>Brian Paul (15):
<ul>
<li>docs: add 7.11 md5 sums</li>
<li>docs: news item for 7.11 release</li>
<li>st/mesa: Convert size assertions to conditionals in st_texture_image_copy.</li>
<li>softpipe: add missing stencil format case in convert_quad_stencil()</li>
<li>mesa: fix texstore addressing bugs for depth/stencil formats</li>
<li>mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries</li>
<li>swrast: don't try to do depth testing if there's no depth buffer</li>
<li>meta: fix/add checks for GL_EXT_framebuffer_sRGB</li>
<li>mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros</li>
<li>meta: fix broken sRGB mipmap generation</li>
<li>mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()</li>
<li>mesa: fix error handling for dlist image unpacking</li>
<li>mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End</li>
<li>mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()</li>
<li>mesa: fix format/type check in unpack_image() for bitmaps</li>
</ul></p>
<p>Carl Simonson (1):
<ul>
<li>i830: Add missing vtable entry for i830 from the hiz work.</li>
</ul></p>
<p>Carl Worth (5):
<ul>
<li>glcpp: Fix two (or more) successive applications of token pasting</li>
<li>glcpp: Test a non-function-like macro using the token paste operator</li>
<li>glcpp: Implement token pasting for non-function-like macros</li>
<li>glcpp: Raise error if defining any macro containing two consecutive underscores</li>
<li>glcpp: Add a test for #elif with an undefined macro.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Add method glsl_type::can_implicitly_convert_to()</li>
<li>glsl: Fix implicit conversions in non-constructor function calls</li>
<li>glsl: Remove ir_function.cpp:type_compare()</li>
<li>glsl: Fix conversions in array constructors</li>
<li>x86-64: Fix compile error with clang</li>
</ul></p>
<p>Chia-I Wu (3):
<ul>
<li>glsl: empty declarations should be valid</li>
<li>intel: rename intel_extensions_es2.c to intel_extensions_es.c</li>
<li>intel: fix GLESv1 support</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>i915: out-of-bounds write in calc_live_regs()</li>
</ul></p>
<p>Christopher James Halse Rogers (1):
<ul>
<li>glx/dri2: Paper over errors in DRI2Connect when indirect</li>
</ul></p>
<p>David Reveman (1):
<ul>
<li>i915g: Fix off-by-one in scissors.</li>
</ul></p>
<p>Eric Anholt (16):
<ul>
<li>mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.</li>
<li>mesa: Fix glGetUniform() type conversions.</li>
<li>mesa: Add support for Begin/EndConditionalRender in display lists.</li>
<li>mesa: Throw an error instead of asserting for condrender with query == 0.</li>
<li>mesa: Throw an error when starting conditional render on an active query.</li>
<li>mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.</li>
<li>glsl: Allow ir_assignment() constructor to not specify condition.</li>
<li>glsl: Clarify error message about whole-array assignment in GLSL 1.10.</li>
<li>glsl: When assigning to a whole array, mark the array as accessed.</li>
<li>glsl: When assiging from a whole array, mark it as used.</li>
<li>i965/fs: Respect ARB_color_buffer_float clamping.</li>
<li>i965: Add missing _NEW_POLYGON flag to polygon stipple upload.</li>
<li>i965: Fix polygon stipple offset state flagging.</li>
<li>intel: Mark MESA_FORMAT_X8_Z24 as always supported.</li>
<li>mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)</li>
<li>glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.</li>
</ul></p>
<p>Henri Verbeet (6):
<ul>
<li>mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().</li>
<li>r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.</li>
<li>mesa: Check the texture against all units in unbind_texobj_from_texunits().</li>
<li>mesa: Allow sampling from units &gt;= MAX_TEXTURE_UNITS in shaders.</li>
<li>mesa: Use the Elements macro for the sampler index assert in validate_samplers().</li>
<li>mesa: Fix a couple of TexEnv unit limits.</li>
</ul></p>
<p>Ian Romanick (17):
<ul>
<li>mesa: Add utility function to get base format from a GL compressed format</li>
<li>mesa: Return the correct internal fmt when a generic compressed fmt was used</li>
<li>mesa: Make _mesa_get_compressed_formats match the texture compression specs</li>
<li>linker: Make linker_error set LinkStatus to false</li>
<li>linker: Make linker_{error,warning} generally available</li>
<li>mesa: Ensure that gl_shader_program::InfoLog is never NULL</li>
<li>ir_to_mesa: Use Add linker_error instead of fail_link</li>
<li>ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered</li>
<li>i915: Fail without crashing if a Mesa IR program uses too many registers</li>
<li>i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks</li>
<li>mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format</li>
<li>mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format</li>
<li>mesa: Refactor expected texture size check in cpal_get_info</li>
<li>mesa: Add _mesa_cpal_compressed_format_type</li>
<li>mesa: Refactor compressed texture error checks to work with paletted textures</li>
<li>mesa: Remove redundant compressed paletted texture error checks</li>
<li>mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x</li>
</ul></p>
<p>Jeremy Huddleston (3):
<ul>
<li>apple: Silence some debug spew</li>
<li>apple: Use the correct (OpenGL.framework) glViewport and glScissor during init</li>
<li>apple: Implement applegl_unbind_context</li>
</ul></p>
<p>José Fonseca (1):
<ul>
<li>docs: Update llvmpipe docs.</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.</li>
<li>mesa: In validate_program(), initialize errMsg for safety.</li>
<li>i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.</li>
<li>i965: Use proper texture alignment units for cubemaps on Gen5+.</li>
<li>i965: Fix incorrect maximum PS thread count shift on Ivybridge.</li>
<li>i965: Emit depth stalls and flushes before changing depth state on Gen6+.</li>
<li>i965/fs: Allow SIMD16 with control flow on Ivybridge.</li>
<li>i965: Allow SIMD16 color writes on Ivybridge.</li>
<li>i965: Fix inconsistent indentation in brw_eu_emit.c.</li>
<li>intel: Depth format fixes</li>
<li>i965: Apply post-sync non-zero workaround to homebrew workaround.</li>
<li>mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>glx: Don't flush twice if we fallback to dri2CopySubBuffer</li>
</ul></p>
<p>Marc Pignat (1):
<ul>
<li>drisw: Fix 24bpp software rendering, take 2</li>
</ul></p>
<p>Marcin Baczyński (2):
<ul>
<li>configure: fix gcc version check</li>
<li>configure: allow C{,XX}FLAGS override</li>
</ul></p>
<p>Marcin Slusarz (3):
<ul>
<li>nouveau: fix nouveau_fence leak</li>
<li>nouveau: fix crash during fence emission</li>
<li>nouveau: fix fence hang</li>
</ul></p>
<p>Marek Olšák (19):
<ul>
<li>vbo: do not call _mesa_max_buffer_index in debug builds</li>
<li>winsys/radeon: fix space checking</li>
<li>r300/compiler: fix a warning that a variable may be uninitialized</li>
<li>r300/compiler: remove an unused-but-set variable and simplify the code</li>
<li>u_vbuf_mgr: cleanup original vs real vertex buffer arrays</li>
<li>u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index</li>
<li>u_vbuf_mgr: fix max_index computation for large src_offset</li>
<li>u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_</li>
<li>u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED</li>
<li>u_vbuf_mgr: rework user buffer uploads</li>
<li>u_vbuf_mgr: fix uploading with a non-zero index bias</li>
<li>configure.ac: fix xlib-based softpipe build</li>
<li>r600g: add index_bias to index buffer bounds</li>
<li>r300g: fix rendering with a non-zero index bias in draw_elements_immediate</li>
<li>Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"</li>
<li>pb_bufmgr_cache: flush cache when create_buffer fails and try again</li>
<li>r300g: don't return NULL in resource_from_handle if the resource is too small</li>
<li>r600g: set correct tiling flags in depth info</li>
<li>r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo</li>
</ul></p>
<p>Michel Dänzer (4):
<ul>
<li>st/mesa: Finalize texture on render-to-texture.</li>
<li>glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.</li>
<li>gallium/util: Add macros for converting from little endian to CPU byte order.</li>
<li>r300g: Fix queries on big endian hosts.</li>
</ul></p>
<p>Neil Roberts (1):
<ul>
<li>meta: Fix saving the active program</li>
</ul></p>
<p>Paul Berry (18):
<ul>
<li>glsl: Lower unconditional return statements.</li>
<li>glsl: Refactor logic for determining whether to lower return statements.</li>
<li>glsl: lower unconditional returns and continues in loops.</li>
<li>glsl: Use foreach_list in lower_jumps.cpp</li>
<li>glsl: In lower_jumps.cpp, lower both branches of a conditional.</li>
<li>glsl: Lower break instructions when necessary at the end of a loop.</li>
<li>glsl: improve the accuracy of the radians() builtin function</li>
<li>glsl: improve the accuracy of the atan(x,y) builtin function.</li>
<li>Revert "glsl: Skip processing the first function's body in do_dead_functions()."</li>
<li>glsl: Emit function signatures at toplevel, even for built-ins.</li>
<li>glsl: Constant-fold built-in functions before outputting IR</li>
<li>glsl: Check array size is const before asserting that no IR was generated.</li>
<li>glsl: Perform implicit type conversions on function call out parameters.</li>
<li>glsl: Fix type error when lowering integer divisions</li>
<li>glsl: Rework oversize array check for gl_TexCoord.</li>
<li>glsl: Remove field array_lvalue from ir_variable.</li>
<li>glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.</li>
<li>glsl: improve the accuracy of the asin() builtin function.</li>
</ul></p>
<p>Tobias Droste (1):
<ul>
<li>r300/compiler: simplify code in peephole_add_presub_add</li>
</ul></p>
<p>Tom Fogal (1):
<ul>
<li>Only use gcc visibility support with gcc4+.</li>
</ul></p>
<p>Tom Stellard (1):
<ul>
<li>r300/compiler: Fix regalloc for values with multiple writers</li>
</ul></p>
<p>Vadim Girlin (5):
<ul>
<li>st/mesa: flush bitmap cache on query and conditional render boundaries</li>
<li>r600g: use backend mask for occlusion queries</li>
<li>r600g: take into account force_add_cf in pops</li>
<li>r600g: fix check_and_set_bank_swizzle</li>
<li>r600g: fix replace_gpr_with_pv_ps</li>
</ul></p>
<p>Yuanhan Liu (17):
<ul>
<li>i965: fix the constant interp bitmask for flat mode</li>
<li>mesa: fix error handling for glEvalMesh1/2D</li>
<li>mesa: fix error handling for some glGet* functions</li>
<li>mesa: fix error handling for glTexEnv</li>
<li>mesa: fix error handling for glIsEnabled</li>
<li>mesa: fix error handling for glPixelZoom</li>
<li>mesa: fix error handling for glSelectBuffer</li>
<li>mesa: fix error handling for glMapBufferRange</li>
<li>mesa: fix error handling for glMaterial*</li>
<li>intel: fix the wrong code to detect null texture.</li>
<li>mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image</li>
<li>i965: setup address rounding enable bits</li>
<li>mesa: generate error if pbo offset is not aligned with the size of specified type</li>
<li>mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB</li>
<li>mesa: handle the pbo case for save_Bitmap</li>
<li>mesa: handle PBO access error in display list mode</li>
<li>intel: don't call unmap pbo if pbo is not mapped</li>
</ul></p>
</body>
</html>

85
docs/relnotes-7.11.2.html Normal file
View File

@@ -0,0 +1,85 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11.2 Release Notes / November 27, 2011</H1>
<p>
Mesa 7.11.2 is a bug fix release which fixes bugs found since the 7.11 release.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
b9e84efee3931c0acbccd1bb5a860554 MesaLib-7.11.2.tar.gz
0837c52698fe3252369c3fdb5195afcc MesaLib-7.11.2.tar.bz2
141273c274d12e0d2bafb497fe937da3 MesaLib-7.11.2.zip
39ae9926794794503815ffdc069521eb MesaGLUT-7.11.2.tar.gz
35ca3a0b54cb6f9d2e0e4eae8f6bb95e MesaGLUT-7.11.2.tar.bz2
f8705fcff2510b6c39cd27b575c05dba MesaGLUT-7.11.2.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=43143">Bug 43143</a> - Mesa 7.11.1 fails to build at main/dlist.c:4532 with error message: "format not a string literal and no format arguments"</li>
<li>Incorrect handling of CopyTexImage from RGBA window to LA texture.</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-7.11.1..mesa-7.11.2
</pre>
<p>Brian Paul (4):
<ul>
<li>mesa: stop using ctx-&gt;Driver.CopyTexImage1D/2D() hooks</li>
<li>mesa: fix format selection for meta CopyTexSubImage()</li>
<li>docs: update news.html and relnotes.html for 7.11.1 release</li>
<li>mesa: use format string in _mesa_error() call to silence warning</li>
</ul></p>
<p>Chad Versace (3):
<ul>
<li>intel: Simplify stencil detiling arithmetic</li>
<li>intel: Fix region dimensions for stencil buffers received from DDX</li>
<li>intel: Fix separate stencil in builtin DRI2 backend</li>
</ul></p>
<p>Ian Romanick (3):
<ul>
<li>docs: Add 7.11.1 release md5sums</li>
<li>mesa: set version string to 7.11.2-devel</li>
<li>mesa: Bump version to 7.11.2 (final)</li>
</ul></p>
</body>
</html>

348
docs/relnotes-7.11.html Normal file
View File

@@ -0,0 +1,348 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.11 Release Notes / July 31, 2011</H1>
<p>
Mesa 7.11 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 7.11.1.
</p>
<p>
Mesa 7.11 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
fa2c7068503133fb2453244cda11cb2a MesaLib-7.11.tar.gz
ff03aca82d0560009a076a87c888cf13 MesaLib-7.11.tar.bz2
ede1ac0976f6f05df586093fc17d63ed MesaLib-7.11.zip
b4fb81a47c5caedaefad49af7702c23d MesaGLUT-7.11.tar.gz
77a9a0bbd7f8bca882aa5709b88cb071 MesaGLUT-7.11.tar.bz2
c19ef0c6eb61188c96ed4ccedd70717c MesaGLUT-7.11.zip
</pre>
<h2>New features</h2>
<ul>
<li>GL_ARB_ES2_compatibility (gallium drivers)
<li>GL_ARB_color_buffer_float (gallium drivers, i965)
<li>GL_ARB_draw_buffers_blend (gallium)
<li>GL_ARB_draw_instanced extension (gallium drivers, swrast)
<li>GL_ARB_instanced_arrays extension (gallium drivers)
<li>GL_ARB_occlusion_query2 (gallium drivers, swrast)
<li>GL_ARB_robustness (all drivers)
<li>GL_ARB_sampler_objects (gallium drivers)
<li>GL_ARB_seamless_cube_map (gallium r600)
<li>GL_ARB_shader_texture_lod (gallium drivers, i965)
<li>GL_ARB_sync (gallium drivers only, intel support was in 7.6)
<li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_ARB_texture_float (gallium, i965)
<li>GL_EXT_packed_float (gallium r600)
<li>GL_EXT_texture_compression_latc (gallium drivers, swrast)
<li>GL_EXT_texture_compression_rgtc (gallium drivers, swrast, i965)
<li>GL_EXT_texture_filter_anisotropic (swrast)
<li>GL_EXT_texture_shared_exponent (gallium drivers, swrast)
<li>GL_EXT_texture_sRGB_decode (gallium drivers, swrast, i965)
<li>GL_EXT_texture_snorm (gallium drivers)
<li>GL_AMD_draw_buffers_blend (alias of the ARB variant)
<li>GL_AMD_seamless_cubemap_per_texture (gallium r600)
<li>GL_AMD_shader_stencil_export (alias of the ARB variant)
<li>GL_ATI_draw_buffers (all drivers)
<li>GL_ATI_texture_compression_3dc (gallium drivers, swrast)
<li>GL_ATI_texture_float (gallium, i965)
<li>GL_NV_conditional_render (i965)
<li>GL_NV_texture_barrier (gallium drivers)
<li>Enable 16-wide fragment shader execution in i965 driver. This should improve performance in many applications.
<li>Initial alpha-level support for Intel "Ivybridge" chipsets in the i965 driver.
</ul>
<h2>Bug fixes</h2>
<p>This list is likely incomplete. This list only includes bug fixes not
included in the previous release (7.10.3). Many of these are regressions that
did not exist in the 7.10 release series at all.</p>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=25871">Bug 25871</a> - nearest neighbour samples wrong texel (precision/rounding problem)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29162">Bug 29162</a> - mesa/darwin is severly broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30080">Bug 30080</a> - [i915] piglit nodepth-test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30217">Bug 30217</a> - Possible sources of memory leaks reported by valgrind</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30266">Bug 30266</a> - Regression, segfault in libdrm_intel when calling glBitmap</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31561">Bug 31561</a> - [i915] intel_regions.c:289: intel_region_release: Assertion `region-&gt;map_refcount == 0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31744">Bug 31744</a> - [GLSL] overriding built-in function impacts another shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32308">Bug 32308</a> - [llvmpipe] src/gallium/auxiliary/gallivm/lp_bld_init.c:319:gallivm_register_garbage_collector_callback: Assertion `NumCallbacks &lt; 32' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32309">Bug 32309</a> - [softpipe] SIGSEGV sp_state_derived.c:204</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32459">Bug 32459</a> - [softpipe] glean depthStencil regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32460">Bug 32460</a> - [softpipe] piglit texwrap 1D regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32534">Bug 32534</a> - [arrandale/sandybridge] Mesa swallowing GEM ioctl failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32560">Bug 32560</a> - To fix: 64-bit-portabilty-issue state_tracker/st_program.c:427</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32634">Bug 32634</a> - [r300g, bisected] Massive corruption in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32768">Bug 32768</a> - VBO rendering using glDrawArrays causes program termination and "cs IB too big" message</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32804">Bug 32804</a> - [swrast] glean pixelFormats regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32814">Bug 32814</a> - Build error in osmesa.c due to change in _mesa_update_framebuffer_visual() signature</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32859">Bug 32859</a> - Mesa doesn't compile under NetBSD</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32912">Bug 32912</a> - [bisected, r300g] Unigine Sanctuary: r300_emit.c:902:r300_emit_vertex_arrays: Assertion `&amp;buf-&gt;b.b' failed with RADEON_HYPERZ=1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32945">Bug 32945</a> - [RADEON:KMS:R300G] HiZ: Weird behavior with 3 pipes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33046">Bug 33046</a> - [bisected]glean/pixelFormats and 3 oglc cases segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33185">Bug 33185</a> - [RADEON:KMS:R300G] X crashes when kwin effects are turned on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33215">Bug 33215</a> - [llvmpipe] piglit fbo-drawbuffers2-blend regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33247">Bug 33247</a> - [swrast] tnl/t_draw.c:471: _tnl_draw_prims: Assertion `prim[i].num_instances &gt; 0' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33284">Bug 33284</a> - [llvmpipe] piglit fbo-drawbuffers-fragcolor fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - [glsl] GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33353">Bug 33353</a> - [softpipe] piglit fbo-srgb looks incorrect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33360">Bug 33360</a> - inclusion of $(TALLOC_LIBS) in src/mesa/drivers/osmesa/Makefile causes a build failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33374">Bug 33374</a> - [bisect] FTBFS on commit 9767d3b5 (glapi: Fix OpenGL ES 1.1 and 2.0 interop)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33555">Bug 33555</a> - [softpipe] tgsi/tgsi_sse2.c:1527:emit_tex: Assertion `0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33885">Bug 33885</a> - [glsl] GLSL compiler allows recursion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33823">Bug 33823</a> - [glsl] ralloc.c:78: get_header: Assertion `info-&gt;canary == 0x5A1106' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33934">Bug 33934</a> - 3D blitting is orders of magnitude slower than equivalent 2D blitting.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33946">Bug 33946</a> - Crash: Mesa checks for invalid pointer, then uses it anyway.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34008">Bug 34008</a> - r600g: piglit failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34009">Bug 34009</a> - Automatic Mipmap Generation produces very blurry image.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34042">Bug 34042</a> - Surfaceless eglMakeCurrent() fails if the supplied EGLContext is not a dummy context</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34049">Bug 34049</a> - r600g: assertion failure (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34119">Bug 34119</a> - [glsl] piglit glsl-texcoord-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34323">Bug 34323</a> - [i915 GLSL gles2] gl_FragCoord.w not correct</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34346">Bug 34346</a> - src/glsl relies on $PWD which can be unset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34378">Bug 34378</a> - st/mesa: 2a904fd6a0cb80eec6dec2bae07fd8778b04caf3 breaks sauerbraten</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34419">Bug 34419</a> - Kwin crashes screensaver exits</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34463">Bug 34463</a> - state_tracker/st_texture.c:370:st_texture_image_copy: Assertion `u_minify(src-&gt;width0, srcLevel) == width' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34468">Bug 34468</a> - src/glsl/Makefile fix</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34541">Bug 34541</a> - [ilk, wine] massive render corruption after recent patchset</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34589">Bug 34589</a> - [pineview bisected]many cases regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34595">Bug 34595</a> - [bisected piketon]oglc half_float_vertex(misc.fillmode.wireframe) regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34597">Bug 34597</a> - [bisected piketon]oglc blend-constcolor and 7 draw-buffers2 subcases regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34603">Bug 34603</a> - [bisected piketon]oglc vbo subcase basic.bufferdata regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34604">Bug 34604</a> - [bisected piketon]piglit fbo/fbo-depth-sample-compare regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34646">Bug 34646</a> - [bisected piketon]ogles2conform GL2Tests/GL/gl_FragCoord/gl_FragCoord_w_frag.test</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34656">Bug 34656</a> - i965: Crash when running WebGL Conformance Test in firefox-4 nightly build</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34691">Bug 34691</a> - [GLSL] matrix array member assignment with a complex subscript fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34906">Bug 34906</a> - [Pineview] Some WebGL conformance tests will crash firefox</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34968">Bug 34968</a> - Bad fps in Lightsmark benchmark</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35025">Bug 35025</a> - [Patch] Serious compiler warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35312">Bug 35312</a> - r600g: Automatic mipmap generation doesn't work properly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35373">Bug 35373</a> - [[GM45] OpenGL] GL_EXT_texture_sRGB_decode broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35434">Bug 35434</a> - [RADEON:KMS:R600G] etqw: broken ground textures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35441">Bug 35441</a> - [PATCH] Mesa does not find nouveau include files with --enable-shared-dricore</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35614">Bug 35614</a> - [SNB] random hang on piglit case shaders/glsl-max-varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35820">Bug 35820</a> - [bisected SNB] System hangs when Gnome with compiz start up</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35822">Bug 35822</a> - [bisected pineview] many cases related to depth and stencil failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35849">Bug 35849</a> - when sampling textures from both fragment and vertex shaders the vertex texture has the incorrect texture bound</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35852">Bug 35852</a> - [bisected pineview] oglc case pxconv-read failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=35961">Bug 35961</a> - src/gallium/auxiliary/util/u_draw.c:77:util_draw_max_index: Assertion `buffer_size - format_size &lt;= buffer_size' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36032">Bug 36032</a> - piglit fdo9833 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36033">Bug 36033</a> - main/shaderapi.c:1044: validate_samplers: Assertion `(sizeof(targetName)/sizeof(*(targetName))) == NUM_TEXTURE_TARGETS' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36086">Bug 36086</a> - [wine] Segfault r300_resource_copy_region with some wine apps and RADEON_HYPERZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36182">Bug 36182</a> - Game Trine from http://www.humblebundle.com/ needs ATI_draw_buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36268">Bug 36268</a> - [r300g, bisected] minor flickering in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36282">Bug 36282</a> - 34a5d3b9f4740601708c82093e2114356d749e65: glxgears segfaults when compiled with shared glapi</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36333">Bug 36333</a> - can't build demos if mesa build with --enable-selinux</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36473">Bug 36473</a> - [bisected] piglit bugs/fdo23670-depth_test failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36572">Bug 36572</a> - [bisected]oglc case texenv segfaults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36609">Bug 36609</a> - 45920d2ecb38b14fdda5253fecce996570c22863 breaks sauerbraten on r300g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36648">Bug 36648</a> - [bisected SNB]piglit fbo/fbo-alphatest-nocolor failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36649">Bug 36649</a> - [bisected SNB]oglc draw-buffers2 failed with 16-wide</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36753">Bug 36753</a> - Some textures now rendered as completely black after register allocator rewrite.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36821">Bug 36821</a> - [bisected SNB]oglc api-texcoord causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36914">Bug 36914</a> - r600g: add rv670 flushing workaround. Causes games and some mesa demos to segfault.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36917">Bug 36917</a> - Rendering glitches in ETQW</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36939">Bug 36939</a> - multitexturing is messed up in quake wars (regression)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=36987">Bug 36987</a> - Intel GMA 4500 ARB_shader_texture_lod support</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37028">Bug 37028</a> - Amnesia/HPL2 Demo: Strange graphical bugs on r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37150">Bug 37150</a> - sRGB textures are too bright in Starcraft 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37154">Bug 37154</a> - main/texstore.c:4187: _mesa_texstore_rgb9_e5: Assertion `baseInternalFormat == 0x1907' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37157">Bug 37157</a> - [bisected] KDE KWin crashes on start with delayed BO mapping</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37168">Bug 37168</a> - Regression: Severe memory leak when running Second Life</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37366">Bug 37366</a> - [i965 bisected ILK] Fragment shader discard tests occasionally fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37383">Bug 37383</a> - incorrect GLSL optimization</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37476">Bug 37476</a> - [wine] Devil May Cry 4: TXD tgsi opcode unsupported / translation from TGSI failed / missing vertex shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37743">Bug 37743</a> - [bisected i965]oglc GLSLlinker subcase negative.varying.beyondMaxVaryingFloats aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37766">Bug 37766</a> - Crash in dri2InvalidateBuffers when resizing Java window with OpenGL pipeline enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37839">Bug 37839</a> - main/teximage.c:2393: _mesa_choose_texture_format: Assertion `f != MESA_FORMAT_NONE' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=37934">Bug 37934</a> - Corruption with topogun trace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38015">Bug 38015</a> - Some extensions enabled even when not supported by the underlying driver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38134">Bug 38134</a> - [bisected i965]piglit fbo/fbo-blit-d24s8 crashed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38145">Bug 38145</a> - r600g/evergreen: Incorrect rendering of some effects in doom3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38440">Bug 38440</a> - ETQW: Model in team select rendering too bright</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38566">Bug 38566</a> - [regression] ETQW crashes with 21972c85ea734dbfcf69629c6b0b940efb42d4ba</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38584">Bug 38584</a> - MESA_GLSL=dump causes SEGV in ir_print_visitor::unique_name</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38599">Bug 38599</a> - THe value of WGL_PBUFFER_HEIGHT_ARB is returned as width in wglQueryPbufferARB</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38602">Bug 38602</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38624">Bug 38624</a> - program/ir_to_mesa.cpp:1440: virtual void ir_to_mesa_visitor::visit(ir_dereference_variable*): Assertion `var-&gt;location != -1' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38626">Bug 38626</a> - vbo: Don't discount stride breaks piglit on softpipe/r600g</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38649">Bug 38649</a> - piglit fbo-copyteximage regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38762">Bug 38762</a> - [IVB bisected]3D demos like glxgears abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38771">Bug 38771</a> - [[GM45] DRI] GPU hangs with current Mesa GIT when running certain OpenGL applications</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38842">Bug 38842</a> - Various valid GLX attributes are rejected by MESA glxChooseFBConfig</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38971">Bug 38971</a> - [bisected]oglc glsl-autointconv subcase negative.function.ambiguousMatch failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=38987">Bug 38987</a> - sampler allowed as non-uniform / non-function parameters</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39024">Bug 39024</a> - [Pineview webgl] many webgl conformance cases crash the browser</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39083">Bug 39083</a> - [regression, bisected, r600g] Wrong rendering of Bubbles3D screensaver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39119">Bug 39119</a> - setting SQ_LDS_RESOURCE_MGMT register to zero in other applications muddles up font rendering permanently</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39209">Bug 39209</a> - [bisected] Wrong display after "prefer native texture formats when possible" commit - part2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39219">Bug 39219</a> - libgl conflict with xbmc causes lock up on xbmc exit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39257">Bug 39257</a> - [bisected SNB]Mesa demos engine causes GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39487">Bug 39487</a> - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw-&gt>has_surface_tile_offset || (tile_x == 0 &amp;&amp; tile_y == 0)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39515">Bug 39515</a> - FTBFS: libEGL depends on libgbm, but libEGL builds first</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=39572">Bug 39572</a> - Cogs: GPU hang</li>
</ul>
<h2>Changes</h2>
<ul>
<li>The Windows MSVC project files have been removed.
They haven't been maintained in quite a while.
Building with SCons is an alternative.
<li>Removed GL_SGI_texture_color_table support from swrast driver - the only
driver that implemented it.
</ul>
<p>The full set of changes can be viewed by using the following GIT command:</p>
<pre>
git log mesa-7.10..mesa-7.11
</pre>
</body>
</html>

406
docs/relnotes-7.9.1.html Normal file
View File

@@ -0,0 +1,406 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.1 Release Notes / January 7, 2011</H1>
<p>
Mesa 7.9.1 is a bug fix release which fixes bugs found since the 7.9 release.
</p>
<p>
Mesa 7.9.1 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
78422843ea875ad4eac35b9b8584032b MesaLib-7.9.1.tar.gz
07dc6cfb5928840b8b9df5bd1b3ae434 MesaLib-7.9.1.tar.bz2
c8eaea5b3c3d6dee784bd8c2db91c80f MesaLib-7.9.1.zip
ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
41fc477d524e7dc5c84da8ef22422bea MesaGLUT-7.9.1.tar.bz2
90b287229afdf19317aa989d19462e7a MesaGLUT-7.9.1.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=28800">Bug 28800</a> - [r300c, r300g] Texture corruption with World of Warcraft</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29420">Bug 29420</a> - Amnesia / HPL2 RendererFeatTest - not rendering correctly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29946">Bug 29946</a> - [swrast] piglit valgrind glsl-array-bounds-04 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30261">Bug 30261</a> - [GLSL 1.20] allowing inconsistent invariant declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30632">Bug 30632</a> - [softpipe] state_tracker/st_manager.c:489: st_context_notify_invalid_framebuffer: Assertion `stfb &amp;&amp; stfb-&gt;iface == stfbi' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30694">Bug 30694</a> - wincopy will crash on Gallium drivers when going to front buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30787">Bug 30787</a> - Invalid asm shader does not generate draw-time error when used with GLSL shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30993">Bug 30993</a> - getFramebufferAttachmentParameteriv wrongly generates error</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31101">Bug 31101</a> - [glsl2] abort() in ir_validate::visit_enter(ir_assignment *ir)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31193">Bug 31193</a> - [regression] aa43176e break water reflections</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31194">Bug 31194</a> - The mesa meta save/restore code doesn't ref the current GLSL program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31371">Bug 31371</a> - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type &gt;= 0) &amp;&amp; (type->base_type &lt;= 3)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31439">Bug 31439</a> - Crash in glBufferSubData() with size == 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31495">Bug 31495</a> - [i965 gles2c bisected] OpenGL ES 2.0 conformance GL2Tests_GetBIFD_input.run regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31514">Bug 31514</a> - isBuffer returns true for unbound buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31560">Bug 31560</a> - [tdfx] tdfx_tex.c:702: error: const struct gl_color_table has no member named Format</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31617">Bug 31617</a> - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31648">Bug 31648</a> - [GLSL] array-struct-array gets assertion: `(size &gt;= 1) && (size &lt;= 4)' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31650">Bug 31650</a> - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31673">Bug 31673</a> - GL_FRAGMENT_PRECISION_HIGH preprocessor macro undefined in GLSL ES</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31690">Bug 31690</a> - i915 shader compiler fails to flatten if in Aquarium webgl demo.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31832">Bug 31832</a> - [i915] Bad renderbuffer format: 21</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31841">Bug 31841</a> - [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31894">Bug 31894</a> - Writing to gl_PointSize with GLES2 corrupts other varyings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31909">Bug 31909</a> - [i965] brw_fs.cpp:1461: void fs_visitor::emit_bool_to_cond_code(ir_rvalue*): Assertion `expr-&gt;operands[i]-&gt;type-&gt;is_scalar()' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31934">Bug 31934</a> - [gallium] Mapping empty buffer object causes SIGSEGV</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31983">Bug 31983</a> - [i915 gles2] "if (expression with builtin/varying variables) discard" breaks linkage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31985">Bug 31985</a> - [GLSL 1.20] initialized uniform array considered as "unsized"</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31987">Bug 31987</a> - [gles2] if input a wrong pname(GL_NONE) to glGetBoolean, it will not case GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32035">Bug 32035</a> - [GLSL bisected] comparing unsized array gets segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32070">Bug 32070</a> - llvmpipe renders stencil demo incorrectly</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32273">Bug 32273</a> - assertion fails when starting vdrift 2010 release with shaders enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32287">Bug 32287</a> - [bisected GLSL] float-int failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32311">Bug 32311</a> - [965 bisected] Array look-ups broken on GM45</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32520">Bug 32520</a> - [gles2] glBlendFunc(GL_ZERO, GL_DST_COLOR) will result in GL_INVALID_ENUM</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32825">Bug 32825</a> - egl_glx driver completely broken in 7.9 branch [fix in master]</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-7.9..mesa-7.9.1
</pre>
<p>Alex Deucher (5):
<ul>
<li>r100: revalidate after radeon_update_renderbuffers</li>
<li>r600c: add missing radeon_prepare_render() call on evergreen</li>
<li>r600c: properly align mipmaps to group size</li>
<li>gallium/egl: fix r300 vs r600 loading</li>
<li>r600c: fix some opcodes on evergreen</li>
</ul></p>
<p>Aras Pranckevicius (2):
<ul>
<li>glsl: fix crash in loop analysis when some controls can't be determined</li>
<li>glsl: fix matrix type check in ir_algebraic</li>
</ul></p>
<p>Brian Paul (27):
<ul>
<li>swrast: fix choose_depth_texture_level() to respect mipmap filtering state</li>
<li>st/mesa: replace assertion w/ conditional in framebuffer invalidation</li>
<li>egl/i965: include inline_wrapper_sw_helper.h</li>
<li>mesa: Add missing else in do_row_3D</li>
<li>mesa: add missing formats in _mesa_format_to_type_and_comps()</li>
<li>mesa: handle more pixel types in mipmap generation code</li>
<li>mesa: make glIsBuffer() return false for never bound buffers</li>
<li>mesa: fix glDeleteBuffers() regression</li>
<li>swrast: init alpha value to 1.0 in opt_sample_rgb_2d()</li>
<li>meta: Mask Stencil.Clear against stencilMax in _mesa_meta_Clear</li>
<li>st/mesa: fix mapping of zero-sized buffer objects</li>
<li>mesa: check for posix_memalign() errors</li>
<li>llvmpipe: fix broken stencil writemask</li>
<li>mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query</li>
<li>mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type</li>
<li>mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM</li>
<li>mesa: test for cube map completeness in glGenerateMipmap()</li>
<li>tnl: Initialize gl_program_machine memory in run_vp.</li>
<li>tnl: a better way to initialize the gl_program_machine memory</li>
<li>mesa, st/mesa: disable GL_ARB_geometry_shader4</li>
<li>glsl: fix off by one in register index assertion</li>
<li>st/mesa: fix mipmap generation bug</li>
<li>glsl: new glsl_strtod() wrapper to fix decimal point interpretation</li>
<li>mesa: no-op glBufferSubData() on size==0</li>
<li>tdfx: s/Format/_BaseFormat/</li>
<li>st/mesa: fix renderbuffer pointer check in st_Clear()</li>
<li>mesa: Bump the number of bits in the register index.</li>
</ul></p>
<p>Chad Versace (5):
<ul>
<li>glsl: Fix lexer rule for ^=</li>
<li>glsl: Fix ast-to-hir for ARB_fragment_coord_conventions</li>
<li>glsl: Fix ir_expression::constant_expression_value()</li>
<li>glsl: Fix erroneous cast in ast_jump_statement::hir()</li>
<li>glsl: Fix linker bug in cross_validate_globals()</li>
</ul></p>
<p>Chia-I Wu (10):
<ul>
<li>targets/egl: Fix linking with libdrm.</li>
<li>st/vega: Fix version check in context creation.</li>
<li>st/egl: Do not finish a fence that is NULL.</li>
<li>egl: Fix a false negative check in _eglCheckMakeCurrent.</li>
<li>st/mesa: Unreference the sampler view in st_bind_surface.</li>
<li>egl_dri2: Fix __DRI_DRI2 version 1 support.</li>
<li>st/vega: Do not wait NULL fences.</li>
<li>mesa: Do not advertise GL_OES_texture_3D.</li>
<li>egl_glx: Fix borken driver.</li>
<li>egl: Check extensions.</li>
</ul></p>
<p>Daniel Lichtenberger (1):
<ul>
<li>radeon: fix potential segfault in renderbuffer update</li>
</ul></p>
<p>Daniel Vetter (1):
<ul>
<li>r200: revalidate after radeon_update_renderbuffers</li>
</ul></p>
<p>Dave Airlie (1):
<ul>
<li>r300g: fixup rs690 tiling stride alignment calculations.</li>
</ul></p>
<p>Eric Anholt (13):
<ul>
<li>intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.</li>
<li>glsl: Free the loop state context when we free the loop state.</li>
<li>i965: Allow OPCODE_SWZ to put immediates in the first arg.</li>
<li>i965: Add support for rendering to SARGB8 FBOs.</li>
<li>glsl: Add a helper constructor for expressions that works out result type.</li>
<li>glsl: Fix structure and array comparisions.</li>
<li>glsl: Quiet unreachable no-return-from-function warning.</li>
<li>glsl: Mark the array access for whole-array comparisons.</li>
<li>glsl: Fix flipped return of has_value() for array constants.</li>
<li>mesa: Add getters for the rest of the supported draw buffers.</li>
<li>mesa: Add getters for ARB_copy_buffer's attachment points.</li>
<li>i965: Correct the dp_read message descriptor setup on g4x.</li>
<li>glsl: Correct the marking of InputsRead/OutputsWritten on in/out matrices.</li>
</ul></p>
<p>Fabian Bieler (1):
<ul>
<li>glsl: fix lowering conditional returns in subroutines</li>
</ul></p>
<p>Francisco Jerez (3):
<ul>
<li>meta: Don't leak alpha function/reference value changes.</li>
<li>meta: Fix incorrect rendering of the bitmap alpha component.</li>
<li>meta: Don't try to disable cube maps if the driver doesn't expose the extension.</li>
</ul></p>
<p>Henri Verbeet (2):
<ul>
<li>r600: Evergreen has two extra frac_bits for the sampler LOD state.</li>
<li>st/mesa: Handle wrapped depth buffers in st_copy_texsubimage().</li>
</ul></p>
<p>Ian Romanick (33):
<ul>
<li>Add 7.9 md5sums</li>
<li>docs: Import 7.8.x release notes from 7.8 branch.</li>
<li>docs: download.html does not need to be updated for each release</li>
<li>docs: Update mailing lines from sf.net to freedesktop.org</li>
<li>docs: added news item for 7.9 release</li>
<li>mesa: Validate assembly shaders when GLSL shaders are used</li>
<li>linker: Reject shaders that have unresolved function calls</li>
<li>mesa: Refactor validation of shader targets</li>
<li>glsl: Slightly change the semantic of _LinkedShaders</li>
<li>linker: Improve handling of unread/unwritten shader inputs/outputs</li>
<li>glsl: Commit lexer files changed by previous cherry picking</li>
<li>mesa: Make metaops use program refcounts instead of names.</li>
<li>glsl: Fix incorrect gl_type of sampler2DArray and sampler1DArrayShadow</li>
<li>mesa: Allow query of MAX_SAMPLES with EXT_framebuffer_multisample</li>
<li>glsl: better handling of linker failures</li>
<li>mesa: Fix glGet of ES2's GL_MAX_*_VECTORS properties.</li>
<li>i915: Disallow alpha, red, RG, and sRGB as render targets</li>
<li>glsl/linker: Free any IR discarded by optimization passes.</li>
<li>glsl: Add an optimization pass to simplify discards.</li>
<li>glsl: Add a lowering pass to move discards out of if-statements.</li>
<li>i915: Correctly generate unconditional KIL instructions</li>
<li>glsl: Add unary ir_expression constructor</li>
<li>glsl: Ensure that equality comparisons don't return a NULL IR tree</li>
<li>glcpp: Commit changes in generated files cause by previous commit</li>
<li>glsl: Inherrit type of declared variable from initializer</li>
<li>glsl: Inherrit type of declared variable from initializer after processing assignment</li>
<li>linker: Ensure that unsized arrays have a size after linking</li>
<li>linker: Fix regressions caused by previous commit</li>
<li>linker: Allow built-in arrays to have different sizes between shader stages</li>
<li>ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors</li>
<li>Refresh autogenerated file builtin_function.cpp.</li>
<li>docs: Initial set of release notes for 7.9.1</li>
<li>mesa: set version string to 7.9.1</li>
</ul></p>
<p>Julien Cristau (1):
<ul>
<li>Makefile: don't include the same files twice in the tarball</li>
</ul></p>
<p>Kenneth Graunke (19):
<ul>
<li>glcpp: Return NEWLINE token for newlines inside multi-line comments.</li>
<li>generate_builtins.py: Output large strings as arrays of characters.</li>
<li>glsl: Fix constant component count in vector constructor emitting.</li>
<li>ir_dead_functions: Actually free dead functions and signatures.</li>
<li>glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version &gt;= 1.30.</li>
<li>glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.</li>
<li>glsl: Fix constant expression handling for &lt, &gt;, &lt=, &gt;= on vectors.</li>
<li>glsl: Use do_common_optimization in the standalone compiler.</li>
<li>glsl: Don't inline function prototypes.</li>
<li>glsl: Add a virtual as_discard() method.</li>
<li>glsl: Remove "discard" support from lower_jumps.</li>
<li>glsl: Refactor get_num_operands.</li>
<li>glcpp: Don't emit SPACE tokens in conditional_tokens production.</li>
<li>glsl: Clean up code by adding a new is_break() function.</li>
<li>glsl: Consider the "else" branch when looking for loop breaks.</li>
<li>Remove OES_compressed_paletted_texture from the ES2 extension list.</li>
<li>glsl/builtins: Compute the correct value for smoothstep(vec, vec, vec).</li>
<li>Fix build on systems where "python" is python 3.</li>
<li>i965: Internally enable GL_NV_blend_square on ES2.</li>
</ul></p>
<p>Kristian Høgsberg (1):
<ul>
<li>i965: Don't write mrf assignment for pointsize output</li>
</ul></p>
<p>Luca Barbieri (1):
<ul>
<li>glsl: Unroll loops with conditional breaks anywhere (not just the end)</li>
</ul></p>
<p>Marek Olšák (17):
<ul>
<li>r300g: fix microtiling for 16-bits-per-channel formats</li>
<li>r300g: fix texture border for 16-bits-per-channel formats</li>
<li>r300g: add a default channel ordering of texture border for unhandled formats</li>
<li>r300g: fix texture border color for all texture formats</li>
<li>r300g: fix rendering with no vertex elements</li>
<li>r300/compiler: fix rc_rewrite_depth_out for it to work with any instruction</li>
<li>r300g: fix texture border color once again</li>
<li>r300g: fix texture swizzling with compressed textures on r400-r500</li>
<li>r300g: disable ARB_texture_swizzle if S3TC is enabled on r3xx-only</li>
<li>mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium</li>
<li>st/mesa: initialize key in st_vp_varient</li>
<li>r300/compiler: fix swizzle lowering with a presubtract source operand</li>
<li>r300g: fix rendering with a vertex attrib having a zero stride</li>
<li>ir_to_mesa: Add support for conditional discards.</li>
<li>r300g: finally fix the texture corruption on r3xx-r4xx</li>
<li>mesa: fix texel store functions for some float formats</li>
<li>r300/compiler: disable the rename_regs pass for loops</li>
</ul></p>
<p>Mario Kleiner (1):
<ul>
<li>mesa/r300classic: Fix dri2Invalidate/radeon_prepare_render for page flipping.</li>
</ul></p>
<p>Peter Clifton (1):
<ul>
<li>intel: Fix emit_linear_blit to use DWORD aligned width blits</li>
</ul></p>
<p>Robert Hooker (2):
<ul>
<li>intel: Add a new B43 pci id.</li>
<li>egl_dri2: Add missing intel chip ids.</li>
</ul></p>
<p>Roland Scheidegger (1):
<ul>
<li>r200: fix r200 large points</li>
</ul></p>
<p>Thomas Hellstrom (17):
<ul>
<li>st/xorg: Don't try to use option values before processing options</li>
<li>xorg/vmwgfx: Make vmwarectrl work also on 64-bit servers</li>
<li>st/xorg: Add a customizer option to get rid of annoying cursor update flicker</li>
<li>xorg/vmwgfx: Don't hide HW cursors when updating them</li>
<li>st/xorg: Don't try to remove invalid fbs</li>
<li>st/xorg: Fix typo</li>
<li>st/xorg, xorg/vmwgfx: Be a bit more frendly towards cross-compiling environments</li>
<li>st/xorg: Fix compilation errors for Xservers compiled without Composite</li>
<li>st/xorg: Don't use deprecated x*alloc / xfree functions</li>
<li>xorg/vmwgfx: Don't use deprecated x*alloc / xfree functions</li>
<li>st/xorg: Fix compilation for Xservers &gt;= 1.10</li>
<li>mesa: Make sure we have the talloc cflags when using the talloc headers</li>
<li>egl: Add an include for size_t</li>
<li>mesa: Add talloc includes for gles</li>
<li>st/egl: Fix build for include files in nonstandard places</li>
<li>svga/drm: Optionally resolve calls to powf during link-time</li>
<li>gallium/targets: Trivial crosscompiling fix</li>
</ul></p>
<p>Tom Stellard (7):
<ul>
<li>r300/compiler: Make sure presubtract sources use supported swizzles</li>
<li>r300/compiler: Fix register allocator's handling of loops</li>
<li>r300/compiler: Fix instruction scheduling within IF blocks</li>
<li>r300/compiler: Use zero as the register index for unused sources</li>
<li>r300/compiler: Ignore alpha dest register when replicating the result</li>
<li>r300/compiler: Use correct swizzles for all presubtract sources</li>
<li>r300/compiler: Don't allow presubtract sources to be remapped twice</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>glsl: Fix 'control reaches end of non-void function' warning.</li>
</ul></p>
<p>richard (1):
<ul>
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul></p>
</body>
</html>

336
docs/relnotes-7.9.2.html Normal file
View File

@@ -0,0 +1,336 @@
<HTML>
<head>
<TITLE>Mesa Release Notes</TITLE>
<link rel="stylesheet" type="text/css" href="mesa.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.9.2 Release Notes / TBD</H1>
<p>
Mesa 7.9.2 is a bug fix release which fixes bugs found since the 7.9.1 release.
</p>
<p>
Mesa 7.9.2 implements the OpenGL 2.1 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 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
eb4ab8c1a03386def3ea34b1358e9cda MesaLib-7.9.2.tar.gz
8f6d1474912787ce13bd35f3bae9938a MesaLib-7.9.2.tar.bz2
427a81dd43ac97603768dc5c6af3df26 MesaLib-7.9.2.zip
aacb8f4db997e346db40c6066942140a MesaGLUT-7.9.2.tar.gz
18abe6cff4fad8ad4752c7b7ab548e5d MesaGLUT-7.9.2.tar.bz2
3189e5732d636c71baf3d8bc23ce7b11 MesaGLUT-7.9.2.zip
</pre>
<h2>New features</h2>
<p>None.</p>
<h2>Bug fixes</h2>
<p>This list is likely incomplete.</p>
<ul>
<li>Fix an off-by-one bug in a vsplit assertion.</li>
<li>Fix incorrect handling of <tt>layout</tt> qualifier
with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>Fix an i965 GPU hang in GLSL shaders that contain an unconditional <tt>discard</tt> statement.</li>
<li>Fix an i965 shader bug where the negative absolute value was generated instead of the absolute value of a negation.</li>
<li>Fix numerous issues handling precision qualifiers in GLSL ES.</li>
<li>Fixed a few GLX protocol encoder bugs (Julien Cristau)</li>
<li>Assorted Gallium llvmpipe driver bug fixes</li>
<li>Assorted Mesa/Gallium state tracker bug fixes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=26795">Bug 26795</a> - gl_FragCoord off by one in Gallium drivers.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29164">Bug 29164</a> - [GLSL 1.20] invariant variable shouldn't be used before declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29823">Bug 29823</a> - GetUniform[if]v busted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=29927">Bug 29927</a> - [glsl2] fail to compile shader with constructor for array of struct type</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=30156">Bug 30156</a> - [i965] After updating to Mesa 7.9, Civilization IV starts to show garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31923">Bug 31923</a> - [GLSL 1.20] allowing inconsistent centroid declaration between two vertex shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=31925">Bug 31925</a> - [GLSL 1.20] "#pragma STDGL invariant(all)" fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32214">Bug 32214</a> - [gles2]no link error happens when missing vertex shader or frag shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32375">Bug 32375</a> - [gl gles2] Not able to get the attribute by function glGetVertexAttribfv</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32541">Bug 32541</a> - Segmentation Fault while running an HDR (high dynamic range) rendering demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32569">Bug 32569</a> - [gles2] glGetShaderPrecisionFormat not implemented yet</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32695">Bug 32695</a> - [glsl] SIGSEGV glcpp/glcpp-parse.y:833</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32831">Bug 32831</a> - [glsl] division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=32910">Bug 32910</a> - Keywords 'in' and 'out' not handled properly for GLSL 1.20 shaders</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33219">Bug 33219</a> -[GLSL bisected] implicit sized array triggers segfault in ir_to_mesa_visitor::copy_propagate</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33306">Bug 33306</a> - GLSL integer division by zero crashes GLSL compiler</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33308">Bug 33308</a> -[glsl] ast_to_hir.cpp:3016: virtual ir_rvalue* ast_jump_statement::hir(exec_list*, _mesa_glsl_parse_state*): Assertion `ret != __null' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33316">Bug 33316</a> - uniform array will be allocate one line more and initialize it when it was freed will abort</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33386">Bug 33386</a> - Dubious assembler in read_rgba_span_x86.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33388">Bug 33388</a> - Dubious assembler in xform4.S</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33433">Bug 33433</a> - Error in x86-64 API dispatch code.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33507">Bug 33507</a> - [glsl] GLSL preprocessor modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33508">Bug 33508</a> - [glsl] GLSL compiler modulus by zero crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=33916">Bug 33916</a> - Compiler accepts reserved operators % and %=</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34047">Bug 34047</a> - Assert in _tnl_import_array() when using GLfixed vertex datatypes with GLESv2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34114">Bug 34114</a> - Sun Studio build fails due to standard library functions not being in global namespace</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=34198">Bug 34198</a> - [GLSL] implicit sized array with index 0 used gets assertion</li>
<li><a href="https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/691653">Ubuntu bug 691653</a> - compiz crashes when using alt-tab (the radeon driver kills it) </li>
<li><a href="https://bugs.meego.com/show_bug.cgi?id=13005">Meego bug 13005</a> - Graphics GLSL issue lead to camera preview fail on Pinetrail</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-7.9.1..mesa-7.9.2
</pre>
<p>Alberto Milone (1):
<ul>
<li>r600c: add evergreen ARL support.</li>
</ul></p>
<p>Brian Paul (19):
<ul>
<li>draw: Fix an off-by-one bug in a vsplit assertion.</li>
<li>mesa: fix a few format table mistakes, assertions</li>
<li>mesa: fix num_draw_buffers==0 in fixed-function fragment program generation</li>
<li>mesa: don't assert in GetIntegerIndexed, etc</li>
<li>mesa: check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
<li>llvmpipe: make sure binning is active when we begin/end a query</li>
<li>st/mesa: fix incorrect fragcoord.x translation</li>
<li>softpipe: fix off-by-one error in setup_fragcoord_coeff()</li>
<li>cso: fix loop bound in cso_set_vertex_samplers()</li>
<li>st/mesa: set renderbuffer _BaseFormat in a few places</li>
<li>st/mesa: fix the default case in st_format_datatype()</li>
<li>st/mesa: need to translate clear color according to surface's base format</li>
<li>docs: update 7.9.2 release notes with Brian's cherry-picks</li>
<li>docs: add links to 7.9.1 and 7.9.2 release notes</li>
<li>mesa: include compiler.h for ASSERT macro</li>
<li>glsl: add ir_shader case in switch stmt to silence warning</li>
<li>glsl2: fix signed/unsigned comparison warning</li>
<li>mesa: implement glGetShaderPrecisionFormat()</li>
<li>docs: updated environment variable list</li>
</ul></p>
<p>Bryce Harrington (1):
<ul>
<li>r300g: Null pointer check for buffer deref in gallium winsys</li>
</ul></p>
<p>Chad Versace (14):
<ul>
<li>glsl: At link-time, check that globals have matching centroid qualifiers</li>
<li>glcpp: Fix segfault when validating macro redefinitions</li>
<li>glsl: Fix parser rule for type_specifier</li>
<li>glsl: Change default value of ast_type_specifier::precision</li>
<li>glsl: Add semantic checks for precision qualifiers</li>
<li>glsl: Add support for default precision statements</li>
<li>glsl: Remove redundant semantic check in parser</li>
<li>glsl: Fix semantic checks on precision qualifiers</li>
<li>glsl: Fix segfault due to missing printf argument</li>
<li>glsl: Mark 'in' variables at global scope as read-only</li>
<li>glcpp: Raise error when modulus is zero</li>
<li>glsl: Set operators '%' and '%=' to be reserved when GLSL &lt 1.30</li>
<li>glsl: Reinstate constant-folding for division by zero</li>
<li>tnl: Add support for datatype GL_FIXED in vertex arrays</li>
</ul></p>
<p>Chia-I Wu (1):
<ul>
<li>mesa: Add glDepthRangef and glClearDepthf to APIspec.xml.</li>
</ul></p>
<p>Chris Wilson (1):
<ul>
<li>intel: Check for unsupported texture when finishing using as a render target</li>
</ul></p>
<p>Cyril Brulebois (1):
<ul>
<li>Point to bugs.freedesktop.org rather than bugzilla.freedesktop.org</li>
</ul></p>
<p>Dave Airlie (2):
<ul>
<li>radeon/r200: fix fbo-clearmipmap + gen-teximage</li>
<li>radeon: avoid segfault on 3D textures.</li>
</ul></p>
<p>Dimitry Andric (4):
<ul>
<li>mesa: s/movzx/movzbl/</li>
<li>mesa: s/movzxw/movzwl/ in read_rgba_span_x86.S</li>
<li>glapi: adding @ char before type specifier in glapi_x86.S</li>
<li>glapi: add @GOTPCREL relocation type</li>
</ul></p>
<p>Eric Anholt (11):
<ul>
<li>i965: Avoid double-negation of immediate values in the VS.</li>
<li>docs: Add a relnote for the Civ IV on i965.</li>
<li>i965/vs: When MOVing to produce ABS, strip negate of the operand.</li>
<li>glsl: Fix the lowering of variable array indexing to not lose write_masks.</li>
<li>intel: Make renderbuffer tiling choice match texture tiling choice.</li>
<li>glapi: Add entrypoints and enums for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add extension enable bit for GL_ARB_ES2_compatibility.</li>
<li>mesa: Add actual support for glReleaseShaderCompiler from ES2.</li>
<li>mesa: Add support for glDepthRangef and glClearDepthf.</li>
<li>mesa: Add getters for ARB_ES2_compatibility MAX_*_VECTORS.</li>
<li>mesa: Add getter for GL_SHADER_COMPILER with ARB_ES2_compatibility.</li>
</ul></p>
<p>Ian Romanick (42):
<ul>
<li>docs: Add 7.9.1 md5sums</li>
<li>glsl: Support the 'invariant(all)' pragma</li>
<li>glcpp: Generate an error for division by zero</li>
<li>glsl: Add version_string containing properly formatted GLSL version</li>
<li>glsl &amp; glcpp: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Disallow 'in' and 'out' on globals in GLSL 1.20</li>
<li>glsl: Track variable usage, use that to enforce semantics</li>
<li>glsl: Allow 'in' and 'out' when 'layout' is also available</li>
<li>docs: Initial set of release notes for 7.9.2</li>
<li>mesa: bump version to 7.9.2-devel</li>
<li>docs: Update 7.9.2 release notes</li>
<li>i965: Make OPCODE_KIL_NV do its work in a temp, not the null reg!</li>
<li>glsl: Refresh autogenerated lexer and parser files.</li>
<li>glsl: Don't assert when the value returned by a function has no rvalue</li>
<li>linker: Set sizes for non-global arrays as well</li>
<li>linker: Propagate max_array_access while linking functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>Use C-style system headers in C++ code to avoid issues with std:: namespace</li>
<li>mesa: glGetUniform only returns a single element of an array</li>
<li>linker: Generate link errors when ES shaders are missing stages</li>
<li>mesa: Fix error checks in GetVertexAttrib functions</li>
<li>docs: Update 7.9.2 release notes</li>
<li>mesa: Remove unsupported OES extensions</li>
<li>glapi: Regenerate for GL_ARB_ES2_compatibility.</li>
<li>mesa: Connect glGetShaderPrecisionFormat into the dispatch table</li>
<li>i965: Set correct values for range/precision of fragment shader types</li>
<li>i915: Set correct values for range/precision of fragment shader types</li>
<li>intel: Fix typeos from 3d028024 and 790ff232</li>
<li>glsl: Ensure that all GLSL versions are supported in the stand-alone compiler</li>
<li>glsl: Reject shader versions not supported by the implementation</li>
<li>mesa: Initial size for secondary color array is 3</li>
<li>glcpp: Regenerate files from recent cherry picks</li>
<li>glsl: Finish out the reduce/reduce error fixes</li>
<li>glsl: Regenerate compiler files from cherry picks</li>
<li>linker: Fix off-by-one error implicit array sizing</li>
<li>i915: Only mark a register as available if all components are written</li>
<li>i915: Calculate partial result to temp register first</li>
<li>i915: Force lowering of all types of indirect array accesses in the FS</li>
<li>docs: Update 7.9.2 release notes for recent cherry picks</li>
<li>docs: Clean up bug fixes list</li>
<li>intel: Remove driver date and related bits from renderer string</li>
<li>mesa: set version string to 7.9.2 (final)</li>
</ul></p>
<p>Jian Zhao (1):
<ul>
<li>mesa: fix an error in uniform arrays in row calculating.</li>
</ul></p>
<p>Julien Cristau (3):
<ul>
<li>glx: fix request lengths</li>
<li>glx: fix GLXChangeDrawableAttributesSGIX request</li>
<li>glx: fix length of GLXGetFBConfigsSGIX</li>
</ul></p>
<p>Keith Packard (1):
<ul>
<li>glsl: Eliminate reduce/reduce conflicts in glsl grammar</li>
</ul></p>
<p>Kenneth Graunke (12):
<ul>
<li>glsl: Expose a public glsl_type::void_type const pointer.</li>
<li>glsl: Don't bother unsetting a destructor that was never set.</li>
<li>glsl, i965: Remove unnecessary talloc includes.</li>
<li>glcpp: Remove use of talloc reference counting.</li>
<li>ralloc: Add a fake implementation of ralloc based on talloc.</li>
<li>Convert everything from the talloc API to the ralloc API.</li>
<li>ralloc: a new MIT-licensed recursive memory allocator.</li>
<li>Remove talloc from the make and automake build systems.</li>
<li>Remove talloc from the SCons build system.</li>
<li>Remove the talloc sources from the Mesa repository.</li>
<li>glsl: Fix use of uninitialized values in _mesa_glsl_parse_state ctor.</li>
<li>glsl: Use reralloc instead of plain realloc.</li>
</ul></p>
<p>Marek Olšák (3):
<ul>
<li>docs: fix messed up names with special characters in relnotes-7.9.1</li>
<li>mesa: fix texture3D mipmap generation for UNSIGNED_BYTE_3_3_2</li>
<li>st/dri: Track drawable context bindings</li>
</ul></p>
<p>Paulo Zanoni (1):
<ul>
<li>dri_util: fail driCreateNewScreen if InitScreen is NULL</li>
</ul></p>
<p>Sam Hocevar (2):
<ul>
<li>docs: add glsl info</li>
<li>docs: fix glsl_compiler name</li>
</ul></p>
<p>Vinson Lee (1):
<ul>
<li>ralloc: Add missing va_end following va_copy.</li>
</ul></p>
<p>nobled (1):
<ul>
<li>glx: Put null check before use</li>
</ul></p>
</p>
</body>
</html>

View File

@@ -13,6 +13,15 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<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>
<LI><A HREF="relnotes-7.10.1.html">7.10.1 release notes</A>
<LI><A HREF="relnotes-7.10.html">7.10 release notes</A>
<LI><A HREF="relnotes-7.9.2.html">7.9.2 release notes</A>
<LI><A HREF="relnotes-7.9.1.html">7.9.1 release notes</A>
<LI><A HREF="relnotes-7.9.html">7.9 release notes</A>
<LI><A HREF="relnotes-7.8.3.html">7.8.3 release notes</A>
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>

View File

@@ -167,7 +167,7 @@ Here's an example of using the compiler to compile a vertex shader and
emit GL_ARB_vertex_program-style instructions:
</p>
<pre>
src/glsl/glslcompiler --dump-ast myshader.vert
src/glsl/glsl_compiler --dump-ast myshader.vert
</pre>
Options include

View File

@@ -23,6 +23,7 @@ each directory.
<ul>
<li><b>docs</b> - EGL documentation
<li><b>drivers</b> - EGL drivers
<li><b>glsl</b> - the GLSL compiler
<li><b>main</b> - main EGL library implementation. This is where all
the EGL API functions are implemented, like eglCreateContext().
</ul>

1
doxygen/.gitignore vendored
View File

@@ -6,6 +6,7 @@ core
core_subset
gallium
glapi
glsl
main
math
math_subset

View File

@@ -11,6 +11,7 @@ FULL = \
math.doxy \
vbo.doxy \
glapi.doxy \
glsl.doxy \
shader.doxy \
swrast.doxy \
swrast_setup.doxy \

39
doxygen/glsl.doxy Normal file
View File

@@ -0,0 +1,39 @@
# Doxyfile 0.1
@INCLUDE = common.doxy
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa GLSL module"
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/glsl/
RECURSIVE = NO
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
../src/glsl/glsl_lexer.h \
../src/glsl/glsl_parser.cpp \
../src/glsl/glsl_parser.h
EXCLUDE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
HTML_OUTPUT = glsl
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = glsl.tag

View File

@@ -7,6 +7,7 @@
<div class="qindex">
<a class="qindex" href="../main/index.html">core</a> |
<a class="qindex" href="../glapi/index.html">glapi</a> |
<a class="qindex" href="../glsl/index.html">glsl</a> |
<a class="qindex" href="../vbo/index.html">vbo</a> |
<a class="qindex" href="../math/index.html">math</a> |
<a class="qindex" href="../shader/index.html">shader</a> |

View File

@@ -131,6 +131,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
/* EGL_DRM_BUFFER_USE_MESA bits */
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x0001
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x0002
#define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 /* eglCreateImageKHR attribute */
@@ -143,6 +144,19 @@ typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESA) (EGLDisplay dpy, con
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESA) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
struct wl_display;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
#endif
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
#endif
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1

View File

@@ -78,6 +78,18 @@ typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
#elif defined(WL_EGL_PLATFORM)
typedef struct wl_display *EGLNativeDisplayType;
typedef struct wl_egl_pixmap *EGLNativePixmapType;
typedef struct wl_egl_window *EGLNativeWindowType;
#elif defined(__GBM__)
typedef struct gbm_device *EGLNativeDisplayType;
typedef struct gbm_bo *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
#elif defined(__unix__) || defined(__unix)
#ifdef MESA_EGL_NO_X11_HEADERS

View File

@@ -67,7 +67,7 @@
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define GLAPI __attribute__((visibility("default")))
# define GLAPIENTRY
#endif /* WIN32 && !CYGWIN */
@@ -655,6 +655,8 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_TEXTURE_ENV_COLOR 0x2201
#define GL_TEXTURE_GEN_S 0x0C60
#define GL_TEXTURE_GEN_T 0x0C61
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
#define GL_TEXTURE_GEN_MODE 0x2500
#define GL_TEXTURE_BORDER_COLOR 0x1004
#define GL_TEXTURE_WIDTH 0x1000
@@ -685,8 +687,6 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_T 0x2001
#define GL_R 0x2002
#define GL_Q 0x2003
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
/* Utility */
#define GL_VENDOR 0x1F00

View File

@@ -31,6 +31,7 @@
#define glAccum MANGLE(Accum)
#define glActiveProgramEXT MANGLE(ActiveProgramEXT)
#define glActiveShaderProgram MANGLE(ActiveShaderProgram)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glActiveTexture MANGLE(ActiveTexture)
@@ -56,6 +57,7 @@
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginPerfMonitorAMD MANGLE(BeginPerfMonitorAMD)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQueryIndexed MANGLE(BeginQueryIndexed)
#define glBeginQuery MANGLE(BeginQuery)
#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
@@ -75,22 +77,27 @@
#define glBindBufferRange MANGLE(BindBufferRange)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
#define glBindFragDataLocationIndexed MANGLE(BindFragDataLocationIndexed)
#define glBindFragDataLocation MANGLE(BindFragDataLocation)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
#define glBindFramebuffer MANGLE(BindFramebuffer)
#define glBindImageTextureEXT MANGLE(BindImageTextureEXT)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
#define glBindParameterEXT MANGLE(BindParameterEXT)
#define glBindProgramARB MANGLE(BindProgramARB)
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindProgramPipeline MANGLE(BindProgramPipeline)
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
#define glBindRenderbuffer MANGLE(BindRenderbuffer)
#define glBindSampler MANGLE(BindSampler)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
#define glBindTransformFeedback MANGLE(BindTransformFeedback)
#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
#define glBindVertexArray MANGLE(BindVertexArray)
@@ -112,18 +119,22 @@
#define glBlendColorEXT MANGLE(BlendColorEXT)
#define glBlendColor MANGLE(BlendColor)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendEquationiARB MANGLE(BlendEquationiARB)
#define glBlendEquationi MANGLE(BlendEquationi)
#define glBlendEquationIndexedAMD MANGLE(BlendEquationIndexedAMD)
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI)
#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT)
#define glBlendEquationSeparateiARB MANGLE(BlendEquationSeparateiARB)
#define glBlendEquationSeparatei MANGLE(BlendEquationSeparatei)
#define glBlendEquationSeparateIndexedAMD MANGLE(BlendEquationSeparateIndexedAMD)
#define glBlendEquationSeparate MANGLE(BlendEquationSeparate)
#define glBlendFunciARB MANGLE(BlendFunciARB)
#define glBlendFunci MANGLE(BlendFunci)
#define glBlendFuncIndexedAMD MANGLE(BlendFuncIndexedAMD)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparateiARB MANGLE(BlendFuncSeparateiARB)
#define glBlendFuncSeparatei MANGLE(BlendFuncSeparatei)
#define glBlendFuncSeparateIndexedAMD MANGLE(BlendFuncSeparateIndexedAMD)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
@@ -153,6 +164,7 @@
#define glClearColor MANGLE(ClearColor)
#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA)
#define glClearDepthdNV MANGLE(ClearDepthdNV)
#define glClearDepthf MANGLE(ClearDepthf)
#define glClearDepth MANGLE(ClearDepth)
#define glClearIndex MANGLE(ClearIndex)
#define glClear MANGLE(Clear)
@@ -215,6 +227,10 @@
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
#define glColorP3ui MANGLE(ColorP3ui)
#define glColorP3uiv MANGLE(ColorP3uiv)
#define glColorP4ui MANGLE(ColorP4ui)
#define glColorP4uiv MANGLE(ColorP4uiv)
#define glColorPointerEXT MANGLE(ColorPointerEXT)
#define glColorPointerListIBM MANGLE(ColorPointerListIBM)
#define glColorPointer MANGLE(ColorPointer)
@@ -236,6 +252,7 @@
#define glCombinerParameterivNV MANGLE(CombinerParameterivNV)
#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
#define glCompileShaderARB MANGLE(CompileShaderARB)
#define glCompileShaderIncludeARB MANGLE(CompileShaderIncludeARB)
#define glCompileShader MANGLE(CompileShader)
#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
@@ -310,10 +327,18 @@
#define glCreateShader MANGLE(CreateShader)
#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB)
#define glCreateShaderProgramEXT MANGLE(CreateShaderProgramEXT)
#define glCreateShaderProgramv MANGLE(CreateShaderProgramv)
#define glCreateSyncFromCLeventARB MANGLE(CreateSyncFromCLeventARB)
#define glCullFace MANGLE(CullFace)
#define glCullParameterdvEXT MANGLE(CullParameterdvEXT)
#define glCullParameterfvEXT MANGLE(CullParameterfvEXT)
#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB)
#define glDebugMessageCallbackAMD MANGLE(DebugMessageCallbackAMD)
#define glDebugMessageCallbackARB MANGLE(DebugMessageCallbackARB)
#define glDebugMessageControlARB MANGLE(DebugMessageControlARB)
#define glDebugMessageEnableAMD MANGLE(DebugMessageEnableAMD)
#define glDebugMessageInsertAMD MANGLE(DebugMessageInsertAMD)
#define glDebugMessageInsertARB MANGLE(DebugMessageInsertARB)
#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX)
#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX)
#define glDeformSGIX MANGLE(DeformSGIX)
@@ -326,20 +351,25 @@
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteNamedStringARB MANGLE(DeleteNamedStringARB)
#define glDeleteNamesAMD MANGLE(DeleteNamesAMD)
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
#define glDeletePerfMonitorsAMD MANGLE(DeletePerfMonitorsAMD)
#define glDeleteProgram MANGLE(DeleteProgram)
#define glDeleteProgramPipelines MANGLE(DeleteProgramPipelines)
#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
#define glDeleteQueries MANGLE(DeleteQueries)
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteSamplers MANGLE(DeleteSamplers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteSync MANGLE(DeleteSync)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTransformFeedbacks MANGLE(DeleteTransformFeedbacks)
#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
@@ -348,7 +378,10 @@
#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
#define glDepthFunc MANGLE(DepthFunc)
#define glDepthMask MANGLE(DepthMask)
#define glDepthRangeArrayv MANGLE(DepthRangeArrayv)
#define glDepthRangedNV MANGLE(DepthRangedNV)
#define glDepthRangef MANGLE(DepthRangef)
#define glDepthRangeIndexed MANGLE(DepthRangeIndexed)
#define glDepthRange MANGLE(DepthRange)
#define glDetachObjectARB MANGLE(DetachObjectARB)
#define glDetachShader MANGLE(DetachShader)
@@ -363,6 +396,7 @@
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawArraysIndirect MANGLE(DrawArraysIndirect)
#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArraysInstanced MANGLE(DrawArraysInstanced)
@@ -374,6 +408,7 @@
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElementsBaseVertex MANGLE(DrawElementsBaseVertex)
#define glDrawElementsIndirect MANGLE(DrawElementsIndirect)
#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedBaseVertex MANGLE(DrawElementsInstancedBaseVertex)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
@@ -386,7 +421,9 @@
#define glDrawRangeElementsBaseVertex MANGLE(DrawRangeElementsBaseVertex)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawTransformFeedback MANGLE(DrawTransformFeedback)
#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glDrawTransformFeedbackStream MANGLE(DrawTransformFeedbackStream)
#define glEdgeFlagFormatNV MANGLE(EdgeFlagFormatNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
@@ -414,6 +451,7 @@
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndPerfMonitorAMD MANGLE(EndPerfMonitorAMD)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQueryIndexed MANGLE(EndQueryIndexed)
#define glEndQuery MANGLE(EndQuery)
#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
#define glEndTransformFeedback MANGLE(EndTransformFeedback)
@@ -447,6 +485,7 @@
#define glFlush MANGLE(Flush)
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
#define glFlushMappedNamedBufferRangeEXT MANGLE(FlushMappedNamedBufferRangeEXT)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
@@ -498,7 +537,6 @@
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
#define glFramebufferTextureFace MANGLE(FramebufferTextureFace)
#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
@@ -521,23 +559,30 @@
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
#define glGenFramebuffers MANGLE(GenFramebuffers)
#define glGenLists MANGLE(GenLists)
#define glGenNamesAMD MANGLE(GenNamesAMD)
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
#define glGenPerfMonitorsAMD MANGLE(GenPerfMonitorsAMD)
#define glGenProgramPipelines MANGLE(GenProgramPipelines)
#define glGenProgramsARB MANGLE(GenProgramsARB)
#define glGenProgramsNV MANGLE(GenProgramsNV)
#define glGenQueriesARB MANGLE(GenQueriesARB)
#define glGenQueries MANGLE(GenQueries)
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
#define glGenRenderbuffers MANGLE(GenRenderbuffers)
#define glGenSamplers MANGLE(GenSamplers)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
#define glGenTextures MANGLE(GenTextures)
#define glGenTransformFeedbacks MANGLE(GenTransformFeedbacks)
#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
#define glGenVertexArrays MANGLE(GenVertexArrays)
#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
#define glGetActiveSubroutineName MANGLE(GetActiveSubroutineName)
#define glGetActiveSubroutineUniformiv MANGLE(GetActiveSubroutineUniformiv)
#define glGetActiveSubroutineUniformName MANGLE(GetActiveSubroutineUniformName)
#define glGetActiveUniformARB MANGLE(GetActiveUniformARB)
#define glGetActiveUniformBlockiv MANGLE(GetActiveUniformBlockiv)
#define glGetActiveUniformBlockName MANGLE(GetActiveUniformBlockName)
@@ -589,16 +634,21 @@
#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv)
#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
#define glGetDebugMessageLogAMD MANGLE(GetDebugMessageLogAMD)
#define glGetDebugMessageLogARB MANGLE(GetDebugMessageLogARB)
#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
#define glGetDoublei_v MANGLE(GetDoublei_v)
#define glGetDoublev MANGLE(GetDoublev)
#define glGetError MANGLE(GetError)
#define glGetFenceivNV MANGLE(GetFenceivNV)
#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
#define glGetFloati_v MANGLE(GetFloati_v)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataIndex MANGLE(GetFragDataIndex)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
#define glGetFragDataLocation MANGLE(GetFragDataLocation)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
@@ -608,6 +658,7 @@
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
#define glGetGraphicsResetStatusARB MANGLE(GetGraphicsResetStatusARB)
#define glGetHandleARB MANGLE(GetHandleARB)
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
#define glGetHistogram MANGLE(GetHistogram)
@@ -678,6 +729,26 @@
#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetNamedStringARB MANGLE(GetNamedStringARB)
#define glGetNamedStringivARB MANGLE(GetNamedStringivARB)
#define glGetnColorTableARB MANGLE(GetnColorTableARB)
#define glGetnCompressedTexImageARB MANGLE(GetnCompressedTexImageARB)
#define glGetnConvolutionFilterARB MANGLE(GetnConvolutionFilterARB)
#define glGetnHistogramARB MANGLE(GetnHistogramARB)
#define glGetnMapdvARB MANGLE(GetnMapdvARB)
#define glGetnMapfvARB MANGLE(GetnMapfvARB)
#define glGetnMapivARB MANGLE(GetnMapivARB)
#define glGetnMinmaxARB MANGLE(GetnMinmaxARB)
#define glGetnPixelMapfvARB MANGLE(GetnPixelMapfvARB)
#define glGetnPixelMapuivARB MANGLE(GetnPixelMapuivARB)
#define glGetnPixelMapusvARB MANGLE(GetnPixelMapusvARB)
#define glGetnPolygonStippleARB MANGLE(GetnPolygonStippleARB)
#define glGetnSeparableFilterARB MANGLE(GetnSeparableFilterARB)
#define glGetnTexImageARB MANGLE(GetnTexImageARB)
#define glGetnUniformdvARB MANGLE(GetnUniformdvARB)
#define glGetnUniformfvARB MANGLE(GetnUniformfvARB)
#define glGetnUniformivARB MANGLE(GetnUniformivARB)
#define glGetnUniformuivARB MANGLE(GetnUniformuivARB)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
@@ -700,6 +771,7 @@
#define glGetPointervEXT MANGLE(GetPointervEXT)
#define glGetPointerv MANGLE(GetPointerv)
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
#define glGetProgramBinary MANGLE(GetProgramBinary)
#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
#define glGetProgramEnvParameterIivNV MANGLE(GetProgramEnvParameterIivNV)
@@ -716,28 +788,42 @@
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramPipelineInfoLog MANGLE(GetProgramPipelineInfoLog)
#define glGetProgramPipelineiv MANGLE(GetProgramPipelineiv)
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
#define glGetProgramStageiv MANGLE(GetProgramStageiv)
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
#define glGetProgramSubroutineParameteruivNV MANGLE(GetProgramSubroutineParameteruivNV)
#define glGetQueryIndexediv MANGLE(GetQueryIndexediv)
#define glGetQueryivARB MANGLE(GetQueryivARB)
#define glGetQueryiv MANGLE(GetQueryiv)
#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
#define glGetQueryObjecti64v MANGLE(GetQueryObjecti64v)
#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
#define glGetQueryObjectui64v MANGLE(GetQueryObjectui64v)
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
#define glGetSamplerParameterfv MANGLE(GetSamplerParameterfv)
#define glGetSamplerParameterIiv MANGLE(GetSamplerParameterIiv)
#define glGetSamplerParameterIuiv MANGLE(GetSamplerParameterIuiv)
#define glGetSamplerParameteriv MANGLE(GetSamplerParameteriv)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
#define glGetShaderiv MANGLE(GetShaderiv)
#define glGetShaderPrecisionFormat MANGLE(GetShaderPrecisionFormat)
#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
#define glGetShaderSource MANGLE(GetShaderSource)
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetSubroutineIndex MANGLE(GetSubroutineIndex)
#define glGetSubroutineUniformLocation MANGLE(GetSubroutineUniformLocation)
#define glGetSynciv MANGLE(GetSynciv)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
@@ -770,14 +856,17 @@
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBlockIndex MANGLE(GetUniformBlockIndex)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformdv MANGLE(GetUniformdv)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
#define glGetUniformfv MANGLE(GetUniformfv)
#define glGetUniformi64vNV MANGLE(GetUniformi64vNV)
#define glGetUniformIndices MANGLE(GetUniformIndices)
#define glGetUniformivARB MANGLE(GetUniformivARB)
#define glGetUniformiv MANGLE(GetUniformiv)
#define glGetUniformLocationARB MANGLE(GetUniformLocationARB)
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformSubroutineuiv MANGLE(GetUniformSubroutineuiv)
#define glGetUniformui64vNV MANGLE(GetUniformui64vNV)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
#define glGetUniformuiv MANGLE(GetUniformuiv)
@@ -803,6 +892,10 @@
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
#define glGetVertexAttribLdvEXT MANGLE(GetVertexAttribLdvEXT)
#define glGetVertexAttribLdv MANGLE(GetVertexAttribLdv)
#define glGetVertexAttribLi64vNV MANGLE(GetVertexAttribLi64vNV)
#define glGetVertexAttribLui64vNV MANGLE(GetVertexAttribLui64vNV)
#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv)
#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
@@ -864,20 +957,25 @@
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsNameAMD MANGLE(IsNameAMD)
#define glIsNamedBufferResidentNV MANGLE(IsNamedBufferResidentNV)
#define glIsNamedStringARB MANGLE(IsNamedStringARB)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
#define glIsProgram MANGLE(IsProgram)
#define glIsProgramNV MANGLE(IsProgramNV)
#define glIsProgramPipeline MANGLE(IsProgramPipeline)
#define glIsQueryARB MANGLE(IsQueryARB)
#define glIsQuery MANGLE(IsQuery)
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsSampler MANGLE(IsSampler)
#define glIsShader MANGLE(IsShader)
#define glIsSync MANGLE(IsSync)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
#define glIsTransformFeedback MANGLE(IsTransformFeedback)
#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
@@ -915,6 +1013,8 @@
#define glLogicOp MANGLE(LogicOp)
#define glMakeBufferNonResidentNV MANGLE(MakeBufferNonResidentNV)
#define glMakeBufferResidentNV MANGLE(MakeBufferResidentNV)
#define glMakeNamedBufferNonResidentNV MANGLE(MakeNamedBufferNonResidentNV)
#define glMakeNamedBufferResidentNV MANGLE(MakeNamedBufferResidentNV)
#define glMap1d MANGLE(Map1d)
#define glMap1f MANGLE(Map1f)
#define glMap2d MANGLE(Map2d)
@@ -928,6 +1028,7 @@
#define glMapGrid2d MANGLE(MapGrid2d)
#define glMapGrid2f MANGLE(MapGrid2f)
#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
#define glMapNamedBufferRangeEXT MANGLE(MapNamedBufferRangeEXT)
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
@@ -963,8 +1064,10 @@
#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMemoryBarrierEXT MANGLE(MemoryBarrierEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMinSampleShadingARB MANGLE(MinSampleShadingARB)
#define glMinSampleShading MANGLE(MinSampleShading)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
@@ -1048,6 +1151,14 @@
#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
#define glMultiTexCoordP1ui MANGLE(MultiTexCoordP1ui)
#define glMultiTexCoordP1uiv MANGLE(MultiTexCoordP1uiv)
#define glMultiTexCoordP2ui MANGLE(MultiTexCoordP2ui)
#define glMultiTexCoordP2uiv MANGLE(MultiTexCoordP2uiv)
#define glMultiTexCoordP3ui MANGLE(MultiTexCoordP3ui)
#define glMultiTexCoordP3uiv MANGLE(MultiTexCoordP3uiv)
#define glMultiTexCoordP4ui MANGLE(MultiTexCoordP4ui)
#define glMultiTexCoordP4uiv MANGLE(MultiTexCoordP4uiv)
#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
@@ -1080,6 +1191,7 @@
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
#define glNamedCopyBufferSubDataEXT MANGLE(NamedCopyBufferSubDataEXT)
#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
@@ -1087,8 +1199,6 @@
#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
#define glNamedMakeBufferNonResidentNV MANGLE(NamedMakeBufferNonResidentNV)
#define glNamedMakeBufferResidentNV MANGLE(NamedMakeBufferResidentNV)
#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
@@ -1104,6 +1214,7 @@
#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNamedStringARB MANGLE(NamedStringARB)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
#define glNormal3b MANGLE(Normal3b)
@@ -1121,6 +1232,8 @@
#define glNormal3s MANGLE(Normal3s)
#define glNormal3sv MANGLE(Normal3sv)
#define glNormalFormatNV MANGLE(NormalFormatNV)
#define glNormalP3ui MANGLE(NormalP3ui)
#define glNormalP3uiv MANGLE(NormalP3uiv)
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointer MANGLE(NormalPointer)
@@ -1140,6 +1253,9 @@
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
#define glPatchParameterfv MANGLE(PatchParameterfv)
#define glPatchParameteri MANGLE(PatchParameteri)
#define glPauseTransformFeedback MANGLE(PauseTransformFeedback)
#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
#define glPixelMapfv MANGLE(PixelMapfv)
@@ -1191,6 +1307,7 @@
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
#define glProgramBinary MANGLE(ProgramBinary)
#define glProgramBufferParametersfvNV MANGLE(ProgramBufferParametersfvNV)
#define glProgramBufferParametersIivNV MANGLE(ProgramBufferParametersIivNV)
#define glProgramBufferParametersIuivNV MANGLE(ProgramBufferParametersIuivNV)
@@ -1231,39 +1348,123 @@
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glProgramSubroutineParametersuivNV MANGLE(ProgramSubroutineParametersuivNV)
#define glProgramUniform1dEXT MANGLE(ProgramUniform1dEXT)
#define glProgramUniform1d MANGLE(ProgramUniform1d)
#define glProgramUniform1dvEXT MANGLE(ProgramUniform1dvEXT)
#define glProgramUniform1dv MANGLE(ProgramUniform1dv)
#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
#define glProgramUniform1f MANGLE(ProgramUniform1f)
#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
#define glProgramUniform1fv MANGLE(ProgramUniform1fv)
#define glProgramUniform1i64NV MANGLE(ProgramUniform1i64NV)
#define glProgramUniform1i64vNV MANGLE(ProgramUniform1i64vNV)
#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
#define glProgramUniform1i MANGLE(ProgramUniform1i)
#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
#define glProgramUniform1iv MANGLE(ProgramUniform1iv)
#define glProgramUniform1ui64NV MANGLE(ProgramUniform1ui64NV)
#define glProgramUniform1ui64vNV MANGLE(ProgramUniform1ui64vNV)
#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
#define glProgramUniform1ui MANGLE(ProgramUniform1ui)
#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
#define glProgramUniform1uiv MANGLE(ProgramUniform1uiv)
#define glProgramUniform2dEXT MANGLE(ProgramUniform2dEXT)
#define glProgramUniform2d MANGLE(ProgramUniform2d)
#define glProgramUniform2dvEXT MANGLE(ProgramUniform2dvEXT)
#define glProgramUniform2dv MANGLE(ProgramUniform2dv)
#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
#define glProgramUniform2f MANGLE(ProgramUniform2f)
#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
#define glProgramUniform2fv MANGLE(ProgramUniform2fv)
#define glProgramUniform2i64NV MANGLE(ProgramUniform2i64NV)
#define glProgramUniform2i64vNV MANGLE(ProgramUniform2i64vNV)
#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
#define glProgramUniform2i MANGLE(ProgramUniform2i)
#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
#define glProgramUniform2iv MANGLE(ProgramUniform2iv)
#define glProgramUniform2ui64NV MANGLE(ProgramUniform2ui64NV)
#define glProgramUniform2ui64vNV MANGLE(ProgramUniform2ui64vNV)
#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
#define glProgramUniform2ui MANGLE(ProgramUniform2ui)
#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
#define glProgramUniform2uiv MANGLE(ProgramUniform2uiv)
#define glProgramUniform3dEXT MANGLE(ProgramUniform3dEXT)
#define glProgramUniform3d MANGLE(ProgramUniform3d)
#define glProgramUniform3dvEXT MANGLE(ProgramUniform3dvEXT)
#define glProgramUniform3dv MANGLE(ProgramUniform3dv)
#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
#define glProgramUniform3f MANGLE(ProgramUniform3f)
#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
#define glProgramUniform3fv MANGLE(ProgramUniform3fv)
#define glProgramUniform3i64NV MANGLE(ProgramUniform3i64NV)
#define glProgramUniform3i64vNV MANGLE(ProgramUniform3i64vNV)
#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
#define glProgramUniform3i MANGLE(ProgramUniform3i)
#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
#define glProgramUniform3iv MANGLE(ProgramUniform3iv)
#define glProgramUniform3ui64NV MANGLE(ProgramUniform3ui64NV)
#define glProgramUniform3ui64vNV MANGLE(ProgramUniform3ui64vNV)
#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
#define glProgramUniform3ui MANGLE(ProgramUniform3ui)
#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
#define glProgramUniform3uiv MANGLE(ProgramUniform3uiv)
#define glProgramUniform4dEXT MANGLE(ProgramUniform4dEXT)
#define glProgramUniform4d MANGLE(ProgramUniform4d)
#define glProgramUniform4dvEXT MANGLE(ProgramUniform4dvEXT)
#define glProgramUniform4dv MANGLE(ProgramUniform4dv)
#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
#define glProgramUniform4f MANGLE(ProgramUniform4f)
#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
#define glProgramUniform4fv MANGLE(ProgramUniform4fv)
#define glProgramUniform4i64NV MANGLE(ProgramUniform4i64NV)
#define glProgramUniform4i64vNV MANGLE(ProgramUniform4i64vNV)
#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
#define glProgramUniform4i MANGLE(ProgramUniform4i)
#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
#define glProgramUniform4iv MANGLE(ProgramUniform4iv)
#define glProgramUniform4ui64NV MANGLE(ProgramUniform4ui64NV)
#define glProgramUniform4ui64vNV MANGLE(ProgramUniform4ui64vNV)
#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
#define glProgramUniform4ui MANGLE(ProgramUniform4ui)
#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
#define glProgramUniform4uiv MANGLE(ProgramUniform4uiv)
#define glProgramUniformMatrix2dvEXT MANGLE(ProgramUniformMatrix2dvEXT)
#define glProgramUniformMatrix2dv MANGLE(ProgramUniformMatrix2dv)
#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
#define glProgramUniformMatrix2fv MANGLE(ProgramUniformMatrix2fv)
#define glProgramUniformMatrix2x3dvEXT MANGLE(ProgramUniformMatrix2x3dvEXT)
#define glProgramUniformMatrix2x3dv MANGLE(ProgramUniformMatrix2x3dv)
#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
#define glProgramUniformMatrix2x3fv MANGLE(ProgramUniformMatrix2x3fv)
#define glProgramUniformMatrix2x4dvEXT MANGLE(ProgramUniformMatrix2x4dvEXT)
#define glProgramUniformMatrix2x4dv MANGLE(ProgramUniformMatrix2x4dv)
#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
#define glProgramUniformMatrix2x4fv MANGLE(ProgramUniformMatrix2x4fv)
#define glProgramUniformMatrix3dvEXT MANGLE(ProgramUniformMatrix3dvEXT)
#define glProgramUniformMatrix3dv MANGLE(ProgramUniformMatrix3dv)
#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
#define glProgramUniformMatrix3fv MANGLE(ProgramUniformMatrix3fv)
#define glProgramUniformMatrix3x2dvEXT MANGLE(ProgramUniformMatrix3x2dvEXT)
#define glProgramUniformMatrix3x2dv MANGLE(ProgramUniformMatrix3x2dv)
#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
#define glProgramUniformMatrix3x2fv MANGLE(ProgramUniformMatrix3x2fv)
#define glProgramUniformMatrix3x4dvEXT MANGLE(ProgramUniformMatrix3x4dvEXT)
#define glProgramUniformMatrix3x4dv MANGLE(ProgramUniformMatrix3x4dv)
#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
#define glProgramUniformMatrix3x4fv MANGLE(ProgramUniformMatrix3x4fv)
#define glProgramUniformMatrix4dvEXT MANGLE(ProgramUniformMatrix4dvEXT)
#define glProgramUniformMatrix4dv MANGLE(ProgramUniformMatrix4dv)
#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
#define glProgramUniformMatrix4fv MANGLE(ProgramUniformMatrix4fv)
#define glProgramUniformMatrix4x2dvEXT MANGLE(ProgramUniformMatrix4x2dvEXT)
#define glProgramUniformMatrix4x2dv MANGLE(ProgramUniformMatrix4x2dv)
#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
#define glProgramUniformMatrix4x2fv MANGLE(ProgramUniformMatrix4x2fv)
#define glProgramUniformMatrix4x3dvEXT MANGLE(ProgramUniformMatrix4x3dvEXT)
#define glProgramUniformMatrix4x3dv MANGLE(ProgramUniformMatrix4x3dv)
#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramUniformMatrix4x3fv MANGLE(ProgramUniformMatrix4x3fv)
#define glProgramUniformui64NV MANGLE(ProgramUniformui64NV)
#define glProgramUniformui64vNV MANGLE(ProgramUniformui64vNV)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
@@ -1274,6 +1475,7 @@
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
#define glPushName MANGLE(PushName)
#define glQueryCounter MANGLE(QueryCounter)
#define glRasterPos2d MANGLE(RasterPos2d)
#define glRasterPos2dv MANGLE(RasterPos2dv)
#define glRasterPos2f MANGLE(RasterPos2f)
@@ -1300,6 +1502,7 @@
#define glRasterPos4sv MANGLE(RasterPos4sv)
#define glReadBuffer MANGLE(ReadBuffer)
#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX)
#define glReadnPixelsARB MANGLE(ReadnPixelsARB)
#define glReadPixels MANGLE(ReadPixels)
#define glRectd MANGLE(Rectd)
#define glRectdv MANGLE(Rectdv)
@@ -1310,6 +1513,7 @@
#define glRects MANGLE(Rects)
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glReleaseShaderCompiler MANGLE(ReleaseShaderCompiler)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
#define glRenderbufferStorage MANGLE(RenderbufferStorage)
#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
@@ -1345,6 +1549,7 @@
#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
#define glResetMinmax MANGLE(ResetMinmax)
#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
#define glResumeTransformFeedback MANGLE(ResumeTransformFeedback)
#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
#define glRotated MANGLE(Rotated)
#define glRotatef MANGLE(Rotatef)
@@ -1357,8 +1562,17 @@
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
#define glSamplerParameterf MANGLE(SamplerParameterf)
#define glSamplerParameterfv MANGLE(SamplerParameterfv)
#define glSamplerParameterIiv MANGLE(SamplerParameterIiv)
#define glSamplerParameteri MANGLE(SamplerParameteri)
#define glSamplerParameterIuiv MANGLE(SamplerParameterIuiv)
#define glSamplerParameteriv MANGLE(SamplerParameteriv)
#define glScaled MANGLE(Scaled)
#define glScalef MANGLE(Scalef)
#define glScissorArrayv MANGLE(ScissorArrayv)
#define glScissorIndexed MANGLE(ScissorIndexed)
#define glScissorIndexedv MANGLE(ScissorIndexedv)
#define glScissor MANGLE(Scissor)
#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
#define glSecondaryColor3b MANGLE(SecondaryColor3b)
@@ -1395,6 +1609,8 @@
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColorFormatNV MANGLE(SecondaryColorFormatNV)
#define glSecondaryColorP3ui MANGLE(SecondaryColorP3ui)
#define glSecondaryColorP3uiv MANGLE(SecondaryColorP3uiv)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
@@ -1408,6 +1624,7 @@
#define glSetInvariantEXT MANGLE(SetInvariantEXT)
#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT)
#define glShadeModel MANGLE(ShadeModel)
#define glShaderBinary MANGLE(ShaderBinary)
#define glShaderOp1EXT MANGLE(ShaderOp1EXT)
#define glShaderOp2EXT MANGLE(ShaderOp2EXT)
#define glShaderOp3EXT MANGLE(ShaderOp3EXT)
@@ -1509,6 +1726,14 @@
#define glTexCoord4s MANGLE(TexCoord4s)
#define glTexCoord4sv MANGLE(TexCoord4sv)
#define glTexCoordFormatNV MANGLE(TexCoordFormatNV)
#define glTexCoordP1ui MANGLE(TexCoordP1ui)
#define glTexCoordP1uiv MANGLE(TexCoordP1uiv)
#define glTexCoordP2ui MANGLE(TexCoordP2ui)
#define glTexCoordP2uiv MANGLE(TexCoordP2uiv)
#define glTexCoordP3ui MANGLE(TexCoordP3ui)
#define glTexCoordP3uiv MANGLE(TexCoordP3uiv)
#define glTexCoordP4ui MANGLE(TexCoordP4ui)
#define glTexCoordP4uiv MANGLE(TexCoordP4uiv)
#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT)
#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM)
#define glTexCoordPointer MANGLE(TexCoordPointer)
@@ -1569,73 +1794,108 @@
#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
#define glTransformFeedbackStreamAttribsNV MANGLE(TransformFeedbackStreamAttribsNV)
#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
#define glUniform1d MANGLE(Uniform1d)
#define glUniform1dv MANGLE(Uniform1dv)
#define glUniform1fARB MANGLE(Uniform1fARB)
#define glUniform1f MANGLE(Uniform1f)
#define glUniform1fvARB MANGLE(Uniform1fvARB)
#define glUniform1fv MANGLE(Uniform1fv)
#define glUniform1i64NV MANGLE(Uniform1i64NV)
#define glUniform1i64vNV MANGLE(Uniform1i64vNV)
#define glUniform1iARB MANGLE(Uniform1iARB)
#define glUniform1i MANGLE(Uniform1i)
#define glUniform1ivARB MANGLE(Uniform1ivARB)
#define glUniform1iv MANGLE(Uniform1iv)
#define glUniform1ui64NV MANGLE(Uniform1ui64NV)
#define glUniform1ui64vNV MANGLE(Uniform1ui64vNV)
#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
#define glUniform1ui MANGLE(Uniform1ui)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
#define glUniform1uiv MANGLE(Uniform1uiv)
#define glUniform2d MANGLE(Uniform2d)
#define glUniform2dv MANGLE(Uniform2dv)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
#define glUniform2fv MANGLE(Uniform2fv)
#define glUniform2i64NV MANGLE(Uniform2i64NV)
#define glUniform2i64vNV MANGLE(Uniform2i64vNV)
#define glUniform2iARB MANGLE(Uniform2iARB)
#define glUniform2i MANGLE(Uniform2i)
#define glUniform2ivARB MANGLE(Uniform2ivARB)
#define glUniform2iv MANGLE(Uniform2iv)
#define glUniform2ui64NV MANGLE(Uniform2ui64NV)
#define glUniform2ui64vNV MANGLE(Uniform2ui64vNV)
#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
#define glUniform2ui MANGLE(Uniform2ui)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
#define glUniform2uiv MANGLE(Uniform2uiv)
#define glUniform3d MANGLE(Uniform3d)
#define glUniform3dv MANGLE(Uniform3dv)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
#define glUniform3fv MANGLE(Uniform3fv)
#define glUniform3i64NV MANGLE(Uniform3i64NV)
#define glUniform3i64vNV MANGLE(Uniform3i64vNV)
#define glUniform3iARB MANGLE(Uniform3iARB)
#define glUniform3i MANGLE(Uniform3i)
#define glUniform3ivARB MANGLE(Uniform3ivARB)
#define glUniform3iv MANGLE(Uniform3iv)
#define glUniform3ui64NV MANGLE(Uniform3ui64NV)
#define glUniform3ui64vNV MANGLE(Uniform3ui64vNV)
#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
#define glUniform3ui MANGLE(Uniform3ui)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
#define glUniform3uiv MANGLE(Uniform3uiv)
#define glUniform4d MANGLE(Uniform4d)
#define glUniform4dv MANGLE(Uniform4dv)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
#define glUniform4fv MANGLE(Uniform4fv)
#define glUniform4i64NV MANGLE(Uniform4i64NV)
#define glUniform4i64vNV MANGLE(Uniform4i64vNV)
#define glUniform4iARB MANGLE(Uniform4iARB)
#define glUniform4i MANGLE(Uniform4i)
#define glUniform4ivARB MANGLE(Uniform4ivARB)
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniform4ui64NV MANGLE(Uniform4ui64NV)
#define glUniform4ui64vNV MANGLE(Uniform4ui64vNV)
#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
#define glUniform4ui MANGLE(Uniform4ui)
#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
#define glUniform4uiv MANGLE(Uniform4uiv)
#define glUniformBlockBinding MANGLE(UniformBlockBinding)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2dv MANGLE(UniformMatrix2dv)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
#define glUniformMatrix2x3dv MANGLE(UniformMatrix2x3dv)
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv)
#define glUniformMatrix2x4dv MANGLE(UniformMatrix2x4dv)
#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv)
#define glUniformMatrix3dv MANGLE(UniformMatrix3dv)
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB)
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv)
#define glUniformMatrix3x2dv MANGLE(UniformMatrix3x2dv)
#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv)
#define glUniformMatrix3x4dv MANGLE(UniformMatrix3x4dv)
#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv)
#define glUniformMatrix4dv MANGLE(UniformMatrix4dv)
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB)
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv)
#define glUniformMatrix4x2dv MANGLE(UniformMatrix4x2dv)
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv)
#define glUniformMatrix4x3dv MANGLE(UniformMatrix4x3dv)
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv)
#define glUniformSubroutinesuiv MANGLE(UniformSubroutinesuiv)
#define glUniformui64NV MANGLE(Uniformui64NV)
#define glUniformui64vNV MANGLE(Uniformui64vNV)
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
@@ -1646,9 +1906,11 @@
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
#define glUseProgram MANGLE(UseProgram)
#define glUseProgramObjectARB MANGLE(UseProgramObjectARB)
#define glUseProgramStages MANGLE(UseProgramStages)
#define glUseShaderProgramEXT MANGLE(UseShaderProgramEXT)
#define glValidateProgramARB MANGLE(ValidateProgramARB)
#define glValidateProgram MANGLE(ValidateProgram)
#define glValidateProgramPipeline MANGLE(ValidateProgramPipeline)
#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI)
#define glVariantbvEXT MANGLE(VariantbvEXT)
#define glVariantdvEXT MANGLE(VariantdvEXT)
@@ -1659,6 +1921,16 @@
#define glVariantubvEXT MANGLE(VariantubvEXT)
#define glVariantuivEXT MANGLE(VariantuivEXT)
#define glVariantusvEXT MANGLE(VariantusvEXT)
#define glVDPAUFiniNV MANGLE(VDPAUFiniNV)
#define glVDPAUGetSurfaceivNV MANGLE(VDPAUGetSurfaceivNV)
#define glVDPAUInitNV MANGLE(VDPAUInitNV)
#define glVDPAUIsSurfaceNV MANGLE(VDPAUIsSurfaceNV)
#define glVDPAUMapSurfacesNV MANGLE(VDPAUMapSurfacesNV)
#define glVDPAURegisterOutputSurfaceNV MANGLE(VDPAURegisterOutputSurfaceNV)
#define glVDPAURegisterVideoSurfaceNV MANGLE(VDPAURegisterVideoSurfaceNV)
#define glVDPAUSurfaceAccessNV MANGLE(VDPAUSurfaceAccessNV)
#define glVDPAUUnmapSurfacesNV MANGLE(VDPAUUnmapSurfacesNV)
#define glVDPAUUnregisterSurfaceNV MANGLE(VDPAUUnregisterSurfaceNV)
#define glVertex2d MANGLE(Vertex2d)
#define glVertex2dv MANGLE(Vertex2dv)
#define glVertex2f MANGLE(Vertex2f)
@@ -1692,6 +1964,7 @@
#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE)
#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE)
#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
#define glVertexArrayVertexAttribLOffsetEXT MANGLE(VertexArrayVertexAttribLOffsetEXT)
#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
#define glVertexAttrib1d MANGLE(VertexAttrib1d)
#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
@@ -1800,6 +2073,7 @@
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
#define glVertexAttribDivisorARB MANGLE(VertexAttribDivisorARB)
#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
#define glVertexAttribFormatNV MANGLE(VertexAttribFormatNV)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
#define glVertexAttribI1i MANGLE(VertexAttribI1i)
@@ -1844,6 +2118,49 @@
#define glVertexAttribIFormatNV MANGLE(VertexAttribIFormatNV)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribL1dEXT MANGLE(VertexAttribL1dEXT)
#define glVertexAttribL1d MANGLE(VertexAttribL1d)
#define glVertexAttribL1dvEXT MANGLE(VertexAttribL1dvEXT)
#define glVertexAttribL1dv MANGLE(VertexAttribL1dv)
#define glVertexAttribL1i64NV MANGLE(VertexAttribL1i64NV)
#define glVertexAttribL1i64vNV MANGLE(VertexAttribL1i64vNV)
#define glVertexAttribL1ui64NV MANGLE(VertexAttribL1ui64NV)
#define glVertexAttribL1ui64vNV MANGLE(VertexAttribL1ui64vNV)
#define glVertexAttribL2dEXT MANGLE(VertexAttribL2dEXT)
#define glVertexAttribL2d MANGLE(VertexAttribL2d)
#define glVertexAttribL2dvEXT MANGLE(VertexAttribL2dvEXT)
#define glVertexAttribL2dv MANGLE(VertexAttribL2dv)
#define glVertexAttribL2i64NV MANGLE(VertexAttribL2i64NV)
#define glVertexAttribL2i64vNV MANGLE(VertexAttribL2i64vNV)
#define glVertexAttribL2ui64NV MANGLE(VertexAttribL2ui64NV)
#define glVertexAttribL2ui64vNV MANGLE(VertexAttribL2ui64vNV)
#define glVertexAttribL3dEXT MANGLE(VertexAttribL3dEXT)
#define glVertexAttribL3d MANGLE(VertexAttribL3d)
#define glVertexAttribL3dvEXT MANGLE(VertexAttribL3dvEXT)
#define glVertexAttribL3dv MANGLE(VertexAttribL3dv)
#define glVertexAttribL3i64NV MANGLE(VertexAttribL3i64NV)
#define glVertexAttribL3i64vNV MANGLE(VertexAttribL3i64vNV)
#define glVertexAttribL3ui64NV MANGLE(VertexAttribL3ui64NV)
#define glVertexAttribL3ui64vNV MANGLE(VertexAttribL3ui64vNV)
#define glVertexAttribL4dEXT MANGLE(VertexAttribL4dEXT)
#define glVertexAttribL4d MANGLE(VertexAttribL4d)
#define glVertexAttribL4dvEXT MANGLE(VertexAttribL4dvEXT)
#define glVertexAttribL4dv MANGLE(VertexAttribL4dv)
#define glVertexAttribL4i64NV MANGLE(VertexAttribL4i64NV)
#define glVertexAttribL4i64vNV MANGLE(VertexAttribL4i64vNV)
#define glVertexAttribL4ui64NV MANGLE(VertexAttribL4ui64NV)
#define glVertexAttribL4ui64vNV MANGLE(VertexAttribL4ui64vNV)
#define glVertexAttribLFormatNV MANGLE(VertexAttribLFormatNV)
#define glVertexAttribLPointerEXT MANGLE(VertexAttribLPointerEXT)
#define glVertexAttribLPointer MANGLE(VertexAttribLPointer)
#define glVertexAttribP1ui MANGLE(VertexAttribP1ui)
#define glVertexAttribP1uiv MANGLE(VertexAttribP1uiv)
#define glVertexAttribP2ui MANGLE(VertexAttribP2ui)
#define glVertexAttribP2uiv MANGLE(VertexAttribP2uiv)
#define glVertexAttribP3ui MANGLE(VertexAttribP3ui)
#define glVertexAttribP3uiv MANGLE(VertexAttribP3uiv)
#define glVertexAttribP4ui MANGLE(VertexAttribP4ui)
#define glVertexAttribP4uiv MANGLE(VertexAttribP4uiv)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
@@ -1868,6 +2185,12 @@
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexFormatNV MANGLE(VertexFormatNV)
#define glVertexP2ui MANGLE(VertexP2ui)
#define glVertexP2uiv MANGLE(VertexP2uiv)
#define glVertexP3ui MANGLE(VertexP3ui)
#define glVertexP3uiv MANGLE(VertexP3uiv)
#define glVertexP4ui MANGLE(VertexP4ui)
#define glVertexP4uiv MANGLE(VertexP4uiv)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointer MANGLE(VertexPointer)
@@ -1913,6 +2236,9 @@
#define glVideoCaptureStreamParameterdvNV MANGLE(VideoCaptureStreamParameterdvNV)
#define glVideoCaptureStreamParameterfvNV MANGLE(VideoCaptureStreamParameterfvNV)
#define glVideoCaptureStreamParameterivNV MANGLE(VideoCaptureStreamParameterivNV)
#define glViewportArrayv MANGLE(ViewportArrayv)
#define glViewportIndexedf MANGLE(ViewportIndexedf)
#define glViewportIndexedfv MANGLE(ViewportIndexedfv)
#define glViewport MANGLE(Viewport)
#define glWaitSync MANGLE(WaitSync)
#define glWeightbvARB MANGLE(WeightbvARB)

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2011 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
@@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2010-11-03 18:59:30 -0700 (Wed, 03 Nov 2010) $ */
/* glext.h last updated $Date: 2011-07-06 02:49:14 -0700 (Wed, 06 Jul 2011) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 66
#define GL_GLEXT_VERSION 71
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@@ -5026,6 +5026,38 @@ extern "C" {
#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
#define GL_DECODE_EXT 0x8A49
#define GL_SKIP_DECODE_EXT 0x8A4A
#endif
#ifndef GL_NV_texture_multisample
#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_FACTOR_MIN_AMD 0x901C
#define GL_FACTOR_MAX_AMD 0x901D
#endif
#ifndef GL_AMD_sample_positions
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_SYNC_X11_FENCE_EXT 0x90E1
#endif
#ifndef GL_AMD_multi_draw_indirect
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
#endif
/*************************************************************/
@@ -11031,6 +11063,62 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
#define GL_AMD_depth_clamp_separate 1
#endif
#ifndef GL_EXT_texture_sRGB_decode
#define GL_EXT_texture_sRGB_decode 1
#endif
#ifndef GL_NV_texture_multisample
#define GL_NV_texture_multisample 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
#endif
#ifndef GL_AMD_blend_minmax_factor
#define GL_AMD_blend_minmax_factor 1
#endif
#ifndef GL_AMD_sample_positions
#define GL_AMD_sample_positions 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif
#ifndef GL_AMD_multi_draw_indirect
#define GL_AMD_multi_draw_indirect 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_EXT_framebuffer_multisample_blit_scaled 1
#endif
#ifdef __cplusplus
}

View File

@@ -284,7 +284,7 @@ typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */
typedef void (GLAPIENTRYP _GLUfuncptr)();
typedef void (GLAPIENTRYP _GLUfuncptr)(void);
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);

View File

@@ -251,6 +251,15 @@ struct __DRItexBufferExtensionRec {
GLint target,
GLint format,
__DRIdrawable *pDraw);
/**
* Method to release texture buffer in case some special platform
* need this.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
};
/**
@@ -490,6 +499,7 @@ struct __DRIuseInvalidateExtensionRec {
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
#define __DRI_ATTRIB_YINVERTED 47
#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
/* __DRI_ATTRIB_RENDER_TYPE */
#define __DRI_ATTRIB_RGBA_BIT 0x01
@@ -647,7 +657,7 @@ struct __DRIlegacyExtensionRec {
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 1
#define __DRI_SWRAST_VERSION 2
struct __DRIswrastExtensionRec {
__DRIextension base;
@@ -660,6 +670,13 @@ struct __DRIswrastExtensionRec {
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
/* Since version 2 */
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
/**
@@ -675,6 +692,7 @@ struct __DRIswrastExtensionRec {
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
#define __DRI_BUFFER_HIZ 10
struct __DRIbufferRec {
unsigned int attachment;
@@ -769,6 +787,14 @@ struct __DRIdri2ExtensionRec {
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
__DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
unsigned int attachment,
unsigned int format,
int width,
int height);
void (*releaseBuffer)(__DRIscreen *screen,
__DRIbuffer *buffer);
};
@@ -791,6 +817,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004
/**
* queryImage attributes
@@ -822,6 +849,11 @@ struct __DRIimageExtensionRec {
void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
/**
* The new __DRIimage will share the content with the old one, see dup(2).
*/
__DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
};

View File

@@ -0,0 +1,4 @@
CHIPSET(0x7121, I810, i8xx)
CHIPSET(0x7123, I810_DC100, i8xx)
CHIPSET(0x7125, I810_E, i8xx)
CHIPSET(0x1132, I815, i8xx)

View File

@@ -0,0 +1,15 @@
CHIPSET(0x3577, I830_M, i8xx)
CHIPSET(0x2562, 845_G, i8xx)
CHIPSET(0x3582, I855_GM, i8xx)
CHIPSET(0x2572, I865_G, i8xx)
CHIPSET(0x2582, I915_G, i915)
CHIPSET(0x258A, E7221_G, i915)
CHIPSET(0x2592, I915_GM, i915)
CHIPSET(0x2772, I945_G, i945)
CHIPSET(0x27A2, I945_GM, i945)
CHIPSET(0x27AE, I945_GME, i945)
CHIPSET(0x29B2, Q35_G, i945)
CHIPSET(0x29C2, G33_G, i945)
CHIPSET(0x29D2, Q33_G, i945)
CHIPSET(0xA011, IGD_GM, i945)
CHIPSET(0xA001, IGD_G, i945)

View File

@@ -0,0 +1,27 @@
CHIPSET(0x29A2, I965_G, i965)
CHIPSET(0x2992, I965_Q, i965)
CHIPSET(0x2982, I965_G_1, i965)
CHIPSET(0x2972, I946_GZ, i965)
CHIPSET(0x2A02, I965_GM, i965)
CHIPSET(0x2A12, I965_GME, i965)
CHIPSET(0x2A42, GM45_GM, g4x)
CHIPSET(0x2E02, IGD_E_G, g4x)
CHIPSET(0x2E12, Q45_G, g4x)
CHIPSET(0x2E22, G45_G, g4x)
CHIPSET(0x2E32, G41_G, g4x)
CHIPSET(0x2E42, B43_G, g4x)
CHIPSET(0x2E92, B43_G1, g4x)
CHIPSET(0x0042, ILD_G, ilk)
CHIPSET(0x0046, ILM_G, ilk)
CHIPSET(0x0102, SANDYBRIDGE_GT1, snb_gt1)
CHIPSET(0x0112, SANDYBRIDGE_GT2, snb_gt2)
CHIPSET(0x0122, SANDYBRIDGE_GT2_PLUS, snb_gt2)
CHIPSET(0x0106, SANDYBRIDGE_M_GT1, snb_gt1)
CHIPSET(0x0116, SANDYBRIDGE_M_GT2, snb_gt2)
CHIPSET(0x0126, SANDYBRIDGE_M_GT2_PLUS, snb_gt2)
CHIPSET(0x010A, SANDYBRIDGE_S, snb_gt1)
CHIPSET(0x0152, IVYBRIDGE_GT1, ivb_gt1)
CHIPSET(0x0162, IVYBRIDGE_GT2, ivb_gt2)
CHIPSET(0x0156, IVYBRIDGE_M_GT1, ivb_gt1)
CHIPSET(0x0166, IVYBRIDGE_M_GT2, ivb_gt2)
CHIPSET(0x015a, IVYBRIDGE_S_GT1, ivb_gt1)

View File

@@ -0,0 +1,77 @@
#ifndef _PCI_ID_DRIVER_MAP_H_
#define _PCI_ID_DRIVER_MAP_H_
#include <stddef.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
static const int i810_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i810_pci_ids.h"
#undef CHIPSET
};
#endif
static const int i915_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i915_pci_ids.h"
#undef CHIPSET
};
static const int i965_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i965_pci_ids.h"
#undef CHIPSET
};
#ifndef DRIVER_MAP_GALLIUM_ONLY
static const int r100_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/radeon_pci_ids.h"
#undef CHIPSET
};
static const int r200_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r200_pci_ids.h"
#undef CHIPSET
};
#endif
static const int r300_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r300_pci_ids.h"
#undef CHIPSET
};
static const int r600_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/r600_pci_ids.h"
#undef CHIPSET
};
static const struct {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
} driver_map[] = {
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
{ 0x8086, "i810", i810_chip_ids, ARRAY_SIZE(i810_chip_ids) },
#endif
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
#ifndef DRIVER_MAP_GALLIUM_ONLY
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
#endif
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
{ 0x10de, "nouveau", NULL, -1 },
{ 0x0000, NULL, NULL, 0 },
};
#endif /* _PCI_ID_DRIVER_MAP_H_ */

View File

@@ -0,0 +1,22 @@
CHIPSET(0x5148, R200_QH, R200)
CHIPSET(0x514C, R200_QL, R200)
CHIPSET(0x514D, R200_QM, R200)
CHIPSET(0x4242, R200_BB, R200)
CHIPSET(0x4966, RV250_If, RV250)
CHIPSET(0x4967, RV250_Ig, RV250)
CHIPSET(0x4C64, RV250_Ld, RV250)
CHIPSET(0x4C66, RV250_Lf, RV250)
CHIPSET(0x4C67, RV250_Lg, RV250)
CHIPSET(0x5960, RV280_5960, RV280)
CHIPSET(0x5961, RV280_5961, RV280)
CHIPSET(0x5962, RV280_5962, RV280)
CHIPSET(0x5964, RV280_5964, RV280)
CHIPSET(0x5965, RV280_5965, RV280)
CHIPSET(0x5C61, RV280_5C61, RV280)
CHIPSET(0x5C63, RV280_5C63, RV280)
CHIPSET(0x5834, RS300_5834, RS300)
CHIPSET(0x5835, RS300_5835, RS300)
CHIPSET(0x7834, RS350_7834, RS300)
CHIPSET(0x7835, RS350_7835, RS300)

View File

@@ -0,0 +1,226 @@
CHIPSET(0x4144, R300_AD, R300)
CHIPSET(0x4145, R300_AE, R300)
CHIPSET(0x4146, R300_AF, R300)
CHIPSET(0x4147, R300_AG, R300)
CHIPSET(0x4E44, R300_ND, R300)
CHIPSET(0x4E45, R300_NE, R300)
CHIPSET(0x4E46, R300_NF, R300)
CHIPSET(0x4E47, R300_NG, R300)
CHIPSET(0x4E48, R350_NH, R350)
CHIPSET(0x4E49, R350_NI, R350)
CHIPSET(0x4E4B, R350_NK, R350)
CHIPSET(0x4148, R350_AH, R350)
CHIPSET(0x4149, R350_AI, R350)
CHIPSET(0x414A, R350_AJ, R350)
CHIPSET(0x414B, R350_AK, R350)
CHIPSET(0x4E4A, R360_NJ, R350)
CHIPSET(0x4150, RV350_AP, RV350)
CHIPSET(0x4151, RV350_AQ, RV350)
CHIPSET(0x4152, RV350_AR, RV350)
CHIPSET(0x4153, RV350_AS, RV350)
CHIPSET(0x4154, RV350_AT, RV350)
CHIPSET(0x4155, RV350_AU, RV350)
CHIPSET(0x4156, RV350_AV, RV350)
CHIPSET(0x4E50, RV350_NP, RV350)
CHIPSET(0x4E51, RV350_NQ, RV350)
CHIPSET(0x4E52, RV350_NR, RV350)
CHIPSET(0x4E53, RV350_NS, RV350)
CHIPSET(0x4E54, RV350_NT, RV350)
CHIPSET(0x4E56, RV350_NV, RV350)
CHIPSET(0x5460, RV370_5460, RV370)
CHIPSET(0x5462, RV370_5462, RV370)
CHIPSET(0x5464, RV370_5464, RV370)
CHIPSET(0x5B60, RV370_5B60, RV370)
CHIPSET(0x5B62, RV370_5B62, RV370)
CHIPSET(0x5B63, RV370_5B63, RV370)
CHIPSET(0x5B64, RV370_5B64, RV370)
CHIPSET(0x5B65, RV370_5B65, RV370)
CHIPSET(0x3150, RV380_3150, RV380)
CHIPSET(0x3152, RV380_3152, RV380)
CHIPSET(0x3154, RV380_3154, RV380)
CHIPSET(0x3155, RV380_3155, RV380)
CHIPSET(0x3E50, RV380_3E50, RV380)
CHIPSET(0x3E54, RV380_3E54, RV380)
CHIPSET(0x4A48, R420_JH, R420)
CHIPSET(0x4A49, R420_JI, R420)
CHIPSET(0x4A4A, R420_JJ, R420)
CHIPSET(0x4A4B, R420_JK, R420)
CHIPSET(0x4A4C, R420_JL, R420)
CHIPSET(0x4A4D, R420_JM, R420)
CHIPSET(0x4A4E, R420_JN, R420)
CHIPSET(0x4A4F, R420_JO, R420)
CHIPSET(0x4A50, R420_JP, R420)
CHIPSET(0x4A54, R420_JT, R420)
CHIPSET(0x5548, R423_UH, R423)
CHIPSET(0x5549, R423_UI, R423)
CHIPSET(0x554A, R423_UJ, R423)
CHIPSET(0x554B, R423_UK, R423)
CHIPSET(0x5550, R423_5550, R423)
CHIPSET(0x5551, R423_UQ, R423)
CHIPSET(0x5552, R423_UR, R423)
CHIPSET(0x5554, R423_UT, R423)
CHIPSET(0x5D57, R423_5D57, R423)
CHIPSET(0x554C, R430_554C, R430)
CHIPSET(0x554D, R430_554D, R430)
CHIPSET(0x554E, R430_554E, R430)
CHIPSET(0x554F, R430_554F, R430)
CHIPSET(0x5D48, R430_5D48, R430)
CHIPSET(0x5D49, R430_5D49, R430)
CHIPSET(0x5D4A, R430_5D4A, R430)
CHIPSET(0x5D4C, R480_5D4C, R480)
CHIPSET(0x5D4D, R480_5D4D, R480)
CHIPSET(0x5D4E, R480_5D4E, R480)
CHIPSET(0x5D4F, R480_5D4F, R480)
CHIPSET(0x5D50, R480_5D50, R480)
CHIPSET(0x5D52, R480_5D52, R480)
CHIPSET(0x4B48, R481_4B48, R481)
CHIPSET(0x4B49, R481_4B49, R481)
CHIPSET(0x4B4A, R481_4B4A, R481)
CHIPSET(0x4B4B, R481_4B4B, R481)
CHIPSET(0x4B4C, R481_4B4C, R481)
CHIPSET(0x564A, RV410_564A, RV410)
CHIPSET(0x564B, RV410_564B, RV410)
CHIPSET(0x564F, RV410_564F, RV410)
CHIPSET(0x5652, RV410_5652, RV410)
CHIPSET(0x5653, RV410_5653, RV410)
CHIPSET(0x5657, RV410_5657, RV410)
CHIPSET(0x5E48, RV410_5E48, RV410)
CHIPSET(0x5E4A, RV410_5E4A, RV410)
CHIPSET(0x5E4B, RV410_5E4B, RV410)
CHIPSET(0x5E4C, RV410_5E4C, RV410)
CHIPSET(0x5E4D, RV410_5E4D, RV410)
CHIPSET(0x5E4F, RV410_5E4F, RV410)
CHIPSET(0x5A41, RS400_5A41, RS400)
CHIPSET(0x5A42, RS400_5A42, RS400)
CHIPSET(0x5A61, RC410_5A61, RC410)
CHIPSET(0x5A62, RC410_5A62, RC410)
CHIPSET(0x5954, RS480_5954, RS480)
CHIPSET(0x5955, RS480_5955, RS480)
CHIPSET(0x5974, RS482_5974, RS480)
CHIPSET(0x5975, RS482_5975, RS480)
CHIPSET(0x7100, R520_7100, R520)
CHIPSET(0x7101, R520_7101, R520)
CHIPSET(0x7102, R520_7102, R520)
CHIPSET(0x7103, R520_7103, R520)
CHIPSET(0x7104, R520_7104, R520)
CHIPSET(0x7105, R520_7105, R520)
CHIPSET(0x7106, R520_7106, R520)
CHIPSET(0x7108, R520_7108, R520)
CHIPSET(0x7109, R520_7109, R520)
CHIPSET(0x710A, R520_710A, R520)
CHIPSET(0x710B, R520_710B, R520)
CHIPSET(0x710C, R520_710C, R520)
CHIPSET(0x710E, R520_710E, R520)
CHIPSET(0x710F, R520_710F, R520)
CHIPSET(0x7140, RV515_7140, RV515)
CHIPSET(0x7141, RV515_7141, RV515)
CHIPSET(0x7142, RV515_7142, RV515)
CHIPSET(0x7143, RV515_7143, RV515)
CHIPSET(0x7144, RV515_7144, RV515)
CHIPSET(0x7145, RV515_7145, RV515)
CHIPSET(0x7146, RV515_7146, RV515)
CHIPSET(0x7147, RV515_7147, RV515)
CHIPSET(0x7149, RV515_7149, RV515)
CHIPSET(0x714A, RV515_714A, RV515)
CHIPSET(0x714B, RV515_714B, RV515)
CHIPSET(0x714C, RV515_714C, RV515)
CHIPSET(0x714D, RV515_714D, RV515)
CHIPSET(0x714E, RV515_714E, RV515)
CHIPSET(0x714F, RV515_714F, RV515)
CHIPSET(0x7151, RV515_7151, RV515)
CHIPSET(0x7152, RV515_7152, RV515)
CHIPSET(0x7153, RV515_7153, RV515)
CHIPSET(0x715E, RV515_715E, RV515)
CHIPSET(0x715F, RV515_715F, RV515)
CHIPSET(0x7180, RV515_7180, RV515)
CHIPSET(0x7181, RV515_7181, RV515)
CHIPSET(0x7183, RV515_7183, RV515)
CHIPSET(0x7186, RV515_7186, RV515)
CHIPSET(0x7187, RV515_7187, RV515)
CHIPSET(0x7188, RV515_7188, RV515)
CHIPSET(0x718A, RV515_718A, RV515)
CHIPSET(0x718B, RV515_718B, RV515)
CHIPSET(0x718C, RV515_718C, RV515)
CHIPSET(0x718D, RV515_718D, RV515)
CHIPSET(0x718F, RV515_718F, RV515)
CHIPSET(0x7193, RV515_7193, RV515)
CHIPSET(0x7196, RV515_7196, RV515)
CHIPSET(0x719B, RV515_719B, RV515)
CHIPSET(0x719F, RV515_719F, RV515)
CHIPSET(0x7200, RV515_7200, RV515)
CHIPSET(0x7210, RV515_7210, RV515)
CHIPSET(0x7211, RV515_7211, RV515)
CHIPSET(0x71C0, RV530_71C0, RV530)
CHIPSET(0x71C1, RV530_71C1, RV530)
CHIPSET(0x71C2, RV530_71C2, RV530)
CHIPSET(0x71C3, RV530_71C3, RV530)
CHIPSET(0x71C4, RV530_71C4, RV530)
CHIPSET(0x71C5, RV530_71C5, RV530)
CHIPSET(0x71C6, RV530_71C6, RV530)
CHIPSET(0x71C7, RV530_71C7, RV530)
CHIPSET(0x71CD, RV530_71CD, RV530)
CHIPSET(0x71CE, RV530_71CE, RV530)
CHIPSET(0x71D2, RV530_71D2, RV530)
CHIPSET(0x71D4, RV530_71D4, RV530)
CHIPSET(0x71D5, RV530_71D5, RV530)
CHIPSET(0x71D6, RV530_71D6, RV530)
CHIPSET(0x71DA, RV530_71DA, RV530)
CHIPSET(0x71DE, RV530_71DE, RV530)
CHIPSET(0x7281, RV560_7281, RV560)
CHIPSET(0x7283, RV560_7283, RV560)
CHIPSET(0x7287, RV560_7287, RV560)
CHIPSET(0x7290, RV560_7290, RV560)
CHIPSET(0x7291, RV560_7291, RV560)
CHIPSET(0x7293, RV560_7293, RV560)
CHIPSET(0x7297, RV560_7297, RV560)
CHIPSET(0x7280, RV570_7280, RV570)
CHIPSET(0x7288, RV570_7288, RV570)
CHIPSET(0x7289, RV570_7289, RV570)
CHIPSET(0x728B, RV570_728B, RV570)
CHIPSET(0x728C, RV570_728C, RV570)
CHIPSET(0x7240, R580_7240, R580)
CHIPSET(0x7243, R580_7243, R580)
CHIPSET(0x7244, R580_7244, R580)
CHIPSET(0x7245, R580_7245, R580)
CHIPSET(0x7246, R580_7246, R580)
CHIPSET(0x7247, R580_7247, R580)
CHIPSET(0x7248, R580_7248, R580)
CHIPSET(0x7249, R580_7249, R580)
CHIPSET(0x724A, R580_724A, R580)
CHIPSET(0x724B, R580_724B, R580)
CHIPSET(0x724C, R580_724C, R580)
CHIPSET(0x724D, R580_724D, R580)
CHIPSET(0x724E, R580_724E, R580)
CHIPSET(0x724F, R580_724F, R580)
CHIPSET(0x7284, R580_7284, R580)
CHIPSET(0x793F, RS600_793F, RS600)
CHIPSET(0x7941, RS600_7941, RS600)
CHIPSET(0x7942, RS600_7942, RS600)
CHIPSET(0x791E, RS690_791E, RS690)
CHIPSET(0x791F, RS690_791F, RS690)
CHIPSET(0x796C, RS740_796C, RS740)
CHIPSET(0x796D, RS740_796D, RS740)
CHIPSET(0x796E, RS740_796E, RS740)
CHIPSET(0x796F, RS740_796F, RS740)

View File

@@ -0,0 +1,265 @@
CHIPSET(0x9400, R600_9400, R600)
CHIPSET(0x9401, R600_9401, R600)
CHIPSET(0x9402, R600_9402, R600)
CHIPSET(0x9403, R600_9403, R600)
CHIPSET(0x9405, R600_9405, R600)
CHIPSET(0x940A, R600_940A, R600)
CHIPSET(0x940B, R600_940B, R600)
CHIPSET(0x940F, R600_940F, R600)
CHIPSET(0x94C0, RV610_94C0, RV610)
CHIPSET(0x94C1, RV610_94C1, RV610)
CHIPSET(0x94C3, RV610_94C3, RV610)
CHIPSET(0x94C4, RV610_94C4, RV610)
CHIPSET(0x94C5, RV610_94C5, RV610)
CHIPSET(0x94C6, RV610_94C6, RV610)
CHIPSET(0x94C7, RV610_94C7, RV610)
CHIPSET(0x94C8, RV610_94C8, RV610)
CHIPSET(0x94C9, RV610_94C9, RV610)
CHIPSET(0x94CB, RV610_94CB, RV610)
CHIPSET(0x94CC, RV610_94CC, RV610)
CHIPSET(0x94CD, RV610_94CD, RV610)
CHIPSET(0x9580, RV630_9580, RV630)
CHIPSET(0x9581, RV630_9581, RV630)
CHIPSET(0x9583, RV630_9583, RV630)
CHIPSET(0x9586, RV630_9586, RV630)
CHIPSET(0x9587, RV630_9587, RV630)
CHIPSET(0x9588, RV630_9588, RV630)
CHIPSET(0x9589, RV630_9589, RV630)
CHIPSET(0x958A, RV630_958A, RV630)
CHIPSET(0x958B, RV630_958B, RV630)
CHIPSET(0x958C, RV630_958C, RV630)
CHIPSET(0x958D, RV630_958D, RV630)
CHIPSET(0x958E, RV630_958E, RV630)
CHIPSET(0x958F, RV630_958F, RV630)
CHIPSET(0x9500, RV670_9500, RV670)
CHIPSET(0x9501, RV670_9501, RV670)
CHIPSET(0x9504, RV670_9504, RV670)
CHIPSET(0x9505, RV670_9505, RV670)
CHIPSET(0x9506, RV670_9506, RV670)
CHIPSET(0x9507, RV670_9507, RV670)
CHIPSET(0x9508, RV670_9508, RV670)
CHIPSET(0x9509, RV670_9509, RV670)
CHIPSET(0x950F, RV670_950F, RV670)
CHIPSET(0x9511, RV670_9511, RV670)
CHIPSET(0x9515, RV670_9515, RV670)
CHIPSET(0x9517, RV670_9517, RV670)
CHIPSET(0x9519, RV670_9519, RV670)
CHIPSET(0x95C0, RV620_95C0, RV620)
CHIPSET(0x95C2, RV620_95C2, RV620)
CHIPSET(0x95C4, RV620_95C4, RV620)
CHIPSET(0x95C5, RV620_95C5, RV620)
CHIPSET(0x95C6, RV620_95C6, RV620)
CHIPSET(0x95C7, RV620_95C7, RV620)
CHIPSET(0x95C9, RV620_95C9, RV620)
CHIPSET(0x95CC, RV620_95CC, RV620)
CHIPSET(0x95CD, RV620_95CD, RV620)
CHIPSET(0x95CE, RV620_95CE, RV620)
CHIPSET(0x95CF, RV620_95CF, RV620)
CHIPSET(0x9590, RV635_9590, RV635)
CHIPSET(0x9591, RV635_9591, RV635)
CHIPSET(0x9593, RV635_9593, RV635)
CHIPSET(0x9595, RV635_9595, RV635)
CHIPSET(0x9596, RV635_9596, RV635)
CHIPSET(0x9597, RV635_9597, RV635)
CHIPSET(0x9598, RV635_9598, RV635)
CHIPSET(0x9599, RV635_9599, RV635)
CHIPSET(0x959B, RV635_959B, RV635)
CHIPSET(0x9610, RS780_9610, RS780)
CHIPSET(0x9611, RS780_9611, RS780)
CHIPSET(0x9612, RS780_9612, RS780)
CHIPSET(0x9613, RS780_9613, RS780)
CHIPSET(0x9614, RS780_9614, RS780)
CHIPSET(0x9615, RS780_9615, RS780)
CHIPSET(0x9616, RS780_9616, RS780)
CHIPSET(0x9710, RS880_9710, RS880)
CHIPSET(0x9711, RS880_9711, RS880)
CHIPSET(0x9712, RS880_9712, RS880)
CHIPSET(0x9713, RS880_9713, RS880)
CHIPSET(0x9714, RS880_9714, RS880)
CHIPSET(0x9715, RS880_9715, RS880)
CHIPSET(0x9440, RV770_9440, RV770)
CHIPSET(0x9441, RV770_9441, RV770)
CHIPSET(0x9442, RV770_9442, RV770)
CHIPSET(0x9443, RV770_9443, RV770)
CHIPSET(0x9444, RV770_9444, RV770)
CHIPSET(0x9446, RV770_9446, RV770)
CHIPSET(0x944A, RV770_944A, RV770)
CHIPSET(0x944B, RV770_944B, RV770)
CHIPSET(0x944C, RV770_944C, RV770)
CHIPSET(0x944E, RV770_944E, RV770)
CHIPSET(0x9450, RV770_9450, RV770)
CHIPSET(0x9452, RV770_9452, RV770)
CHIPSET(0x9456, RV770_9456, RV770)
CHIPSET(0x945A, RV770_945A, RV770)
CHIPSET(0x945B, RV770_945B, RV770)
CHIPSET(0x945E, RV770_945E, RV770)
CHIPSET(0x9460, RV790_9460, RV770)
CHIPSET(0x9462, RV790_9462, RV770)
CHIPSET(0x946A, RV770_946A, RV770)
CHIPSET(0x946B, RV770_946B, RV770)
CHIPSET(0x947A, RV770_947A, RV770)
CHIPSET(0x947B, RV770_947B, RV770)
CHIPSET(0x9480, RV730_9480, RV730)
CHIPSET(0x9487, RV730_9487, RV730)
CHIPSET(0x9488, RV730_9488, RV730)
CHIPSET(0x9489, RV730_9489, RV730)
CHIPSET(0x948A, RV730_948A, RV730)
CHIPSET(0x948F, RV730_948F, RV730)
CHIPSET(0x9490, RV730_9490, RV730)
CHIPSET(0x9491, RV730_9491, RV730)
CHIPSET(0x9495, RV730_9495, RV730)
CHIPSET(0x9498, RV730_9498, RV730)
CHIPSET(0x949C, RV730_949C, RV730)
CHIPSET(0x949E, RV730_949E, RV730)
CHIPSET(0x949F, RV730_949F, RV730)
CHIPSET(0x9540, RV710_9540, RV710)
CHIPSET(0x9541, RV710_9541, RV710)
CHIPSET(0x9542, RV710_9542, RV710)
CHIPSET(0x954E, RV710_954E, RV710)
CHIPSET(0x954F, RV710_954F, RV710)
CHIPSET(0x9552, RV710_9552, RV710)
CHIPSET(0x9553, RV710_9553, RV710)
CHIPSET(0x9555, RV710_9555, RV710)
CHIPSET(0x9557, RV710_9557, RV710)
CHIPSET(0x955F, RV710_955F, RV710)
CHIPSET(0x94A0, RV740_94A0, RV740)
CHIPSET(0x94A1, RV740_94A1, RV740)
CHIPSET(0x94A3, RV740_94A3, RV740)
CHIPSET(0x94B1, RV740_94B1, RV740)
CHIPSET(0x94B3, RV740_94B3, RV740)
CHIPSET(0x94B4, RV740_94B4, RV740)
CHIPSET(0x94B5, RV740_94B5, RV740)
CHIPSET(0x94B9, RV740_94B9, RV740)
CHIPSET(0x68E0, CEDAR_68E0, CEDAR)
CHIPSET(0x68E1, CEDAR_68E1, CEDAR)
CHIPSET(0x68E4, CEDAR_68E4, CEDAR)
CHIPSET(0x68E5, CEDAR_68E5, CEDAR)
CHIPSET(0x68E8, CEDAR_68E8, CEDAR)
CHIPSET(0x68E9, CEDAR_68E9, CEDAR)
CHIPSET(0x68F1, CEDAR_68F1, CEDAR)
CHIPSET(0x68F2, CEDAR_68F2, CEDAR)
CHIPSET(0x68F8, CEDAR_68F8, CEDAR)
CHIPSET(0x68F9, CEDAR_68F9, CEDAR)
CHIPSET(0x68FE, CEDAR_68FE, CEDAR)
CHIPSET(0x68C0, REDWOOD_68C0, REDWOOD)
CHIPSET(0x68C1, REDWOOD_68C1, REDWOOD)
CHIPSET(0x68C8, REDWOOD_68C8, REDWOOD)
CHIPSET(0x68C9, REDWOOD_68C9, REDWOOD)
CHIPSET(0x68D8, REDWOOD_68D8, REDWOOD)
CHIPSET(0x68D9, REDWOOD_68D9, REDWOOD)
CHIPSET(0x68DA, REDWOOD_68DA, REDWOOD)
CHIPSET(0x68DE, REDWOOD_68DE, REDWOOD)
CHIPSET(0x68A0, JUNIPER_68A0, JUNIPER)
CHIPSET(0x68A1, JUNIPER_68A1, JUNIPER)
CHIPSET(0x68A8, JUNIPER_68A8, JUNIPER)
CHIPSET(0x68A9, JUNIPER_68A9, JUNIPER)
CHIPSET(0x68B0, JUNIPER_68B0, JUNIPER)
CHIPSET(0x68B8, JUNIPER_68B8, JUNIPER)
CHIPSET(0x68B9, JUNIPER_68B9, JUNIPER)
CHIPSET(0x68BA, JUNIPER_68BA, JUNIPER)
CHIPSET(0x68BE, JUNIPER_68BE, JUNIPER)
CHIPSET(0x68BF, JUNIPER_68BF, JUNIPER)
CHIPSET(0x6880, CYPRESS_6880, CYPRESS)
CHIPSET(0x6888, CYPRESS_6888, CYPRESS)
CHIPSET(0x6889, CYPRESS_6889, CYPRESS)
CHIPSET(0x688A, CYPRESS_688A, CYPRESS)
CHIPSET(0x6898, CYPRESS_6898, CYPRESS)
CHIPSET(0x6899, CYPRESS_6899, CYPRESS)
CHIPSET(0x689B, CYPRESS_689B, CYPRESS)
CHIPSET(0x689E, CYPRESS_689E, CYPRESS)
CHIPSET(0x689C, HEMLOCK_689C, HEMLOCK)
CHIPSET(0x689D, HEMLOCK_689D, HEMLOCK)
CHIPSET(0x9802, PALM_9802, PALM)
CHIPSET(0x9803, PALM_9803, PALM)
CHIPSET(0x9804, PALM_9804, PALM)
CHIPSET(0x9805, PALM_9805, PALM)
CHIPSET(0x9806, PALM_9806, PALM)
CHIPSET(0x9807, PALM_9807, PALM)
CHIPSET(0x9640, SUMO_9640, SUMO)
CHIPSET(0x9641, SUMO_9641, SUMO)
CHIPSET(0x9642, SUMO2_9642, SUMO2)
CHIPSET(0x9643, SUMO2_9643, SUMO2)
CHIPSET(0x9644, SUMO2_9644, SUMO2)
CHIPSET(0x9645, SUMO2_9645, SUMO2)
CHIPSET(0x9647, SUMO_9647, SUMO)
CHIPSET(0x9648, SUMO_9648, SUMO)
CHIPSET(0x964a, SUMO_964A, SUMO)
CHIPSET(0x964e, SUMO_964E, SUMO)
CHIPSET(0x964f, SUMO_964F, SUMO)
#ifndef RADEON_CLASSIC
CHIPSET(0x6700, CAYMAN_6700, CAYMAN)
CHIPSET(0x6701, CAYMAN_6701, CAYMAN)
CHIPSET(0x6702, CAYMAN_6702, CAYMAN)
CHIPSET(0x6703, CAYMAN_6703, CAYMAN)
CHIPSET(0x6704, CAYMAN_6704, CAYMAN)
CHIPSET(0x6705, CAYMAN_6705, CAYMAN)
CHIPSET(0x6706, CAYMAN_6706, CAYMAN)
CHIPSET(0x6707, CAYMAN_6707, CAYMAN)
CHIPSET(0x6708, CAYMAN_6708, CAYMAN)
CHIPSET(0x6709, CAYMAN_6709, CAYMAN)
CHIPSET(0x6718, CAYMAN_6718, CAYMAN)
CHIPSET(0x6719, CAYMAN_6719, CAYMAN)
CHIPSET(0x671C, CAYMAN_671C, CAYMAN)
CHIPSET(0x671D, CAYMAN_671D, CAYMAN)
CHIPSET(0x671F, CAYMAN_671F, CAYMAN)
#endif
CHIPSET(0x6720, BARTS_6720, BARTS)
CHIPSET(0x6721, BARTS_6721, BARTS)
CHIPSET(0x6722, BARTS_6722, BARTS)
CHIPSET(0x6723, BARTS_6723, BARTS)
CHIPSET(0x6724, BARTS_6724, BARTS)
CHIPSET(0x6725, BARTS_6725, BARTS)
CHIPSET(0x6726, BARTS_6726, BARTS)
CHIPSET(0x6727, BARTS_6727, BARTS)
CHIPSET(0x6728, BARTS_6728, BARTS)
CHIPSET(0x6729, BARTS_6729, BARTS)
CHIPSET(0x6738, BARTS_6738, BARTS)
CHIPSET(0x6739, BARTS_6739, BARTS)
CHIPSET(0x673E, BARTS_673E, BARTS)
CHIPSET(0x6740, TURKS_6740, TURKS)
CHIPSET(0x6741, TURKS_6741, TURKS)
CHIPSET(0x6742, TURKS_6742, TURKS)
CHIPSET(0x6743, TURKS_6743, TURKS)
CHIPSET(0x6744, TURKS_6744, TURKS)
CHIPSET(0x6745, TURKS_6745, TURKS)
CHIPSET(0x6746, TURKS_6746, TURKS)
CHIPSET(0x6747, TURKS_6747, TURKS)
CHIPSET(0x6748, TURKS_6748, TURKS)
CHIPSET(0x6749, TURKS_6749, TURKS)
CHIPSET(0x6750, TURKS_6750, TURKS)
CHIPSET(0x6758, TURKS_6758, TURKS)
CHIPSET(0x6759, TURKS_6759, TURKS)
CHIPSET(0x675F, TURKS_675F, TURKS)
CHIPSET(0x6760, CAICOS_6760, CAICOS)
CHIPSET(0x6761, CAICOS_6761, CAICOS)
CHIPSET(0x6762, CAICOS_6762, CAICOS)
CHIPSET(0x6763, CAICOS_6763, CAICOS)
CHIPSET(0x6764, CAICOS_6764, CAICOS)
CHIPSET(0x6765, CAICOS_6765, CAICOS)
CHIPSET(0x6766, CAICOS_6766, CAICOS)
CHIPSET(0x6767, CAICOS_6767, CAICOS)
CHIPSET(0x6768, CAICOS_6768, CAICOS)
CHIPSET(0x6770, CAICOS_6770, CAICOS)
CHIPSET(0x6778, CAICOS_6778, CAICOS)
CHIPSET(0x6779, CAICOS_6779, CAICOS)

View File

@@ -0,0 +1,23 @@
CHIPSET(0x4C57, RADEON_LW, RV200)
CHIPSET(0x4C58, RADEON_LX, RV200)
CHIPSET(0x4C59, RADEON_LY, RV100)
CHIPSET(0x4C5A, RADEON_LZ, RV100)
CHIPSET(0x5144, RADEON_QD, R100)
CHIPSET(0x5145, RADEON_QE, R100)
CHIPSET(0x5146, RADEON_QF, R100)
CHIPSET(0x5147, RADEON_QG, R100)
CHIPSET(0x5159, RADEON_QY, RV100)
CHIPSET(0x515A, RADEON_QZ, RV100)
CHIPSET(0x5157, RV200_QW, RV200)
CHIPSET(0x5158, RV200_QX, RV200)
CHIPSET(0x515E, RN50_515E, UNKNOWN)
CHIPSET(0x5969, RN50_5969, UNKNOWN)
CHIPSET(0x4136, RS100_4136, RS100)
CHIPSET(0x4336, RS100_4336, RS100)
CHIPSET(0x4137, RS200_4137, RS200)
CHIPSET(0x4337, RS200_4337, RS200)
CHIPSET(0x4237, RS250_4237, RS200)
CHIPSET(0x4437, RS250_4437, RS200)

View File

@@ -194,5 +194,8 @@ def generate(env):
env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
#env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])
# Avoid depending on gcc runtime DLLs
env.AppendUnique(LINKFLAGS = ['-static-libgcc'])
def exists(env):
return find(env)

View File

@@ -56,7 +56,10 @@ def quietCommandLines(env):
env['SHLINKCOMSTR'] = " Linking $TARGET ..."
env['LDMODULECOMSTR'] = " Linking $TARGET ..."
env['SWIGCOMSTR'] = " Generating $TARGET ..."
env['LEXCOMSTR'] = " Generating $TARGET ..."
env['YACCCOMSTR'] = " Generating $TARGET ..."
env['CODEGENCOMSTR'] = " Generating $TARGET ..."
env['INSTALLSTR'] = " Installing $TARGET ..."
def createConvenienceLibBuilder(env):
@@ -154,7 +157,8 @@ def createCodeGenerateMethod(env):
def generate(env):
"""Common environment generation code"""
if env.get('quiet', True):
verbose = env.get('verbose', False) or not env.get('quiet', True)
if not verbose:
quietCommandLines(env)
# Custom builders and methods

79
scons/gallium.py Normal file → Executable file
View File

@@ -35,6 +35,7 @@ import os
import os.path
import re
import subprocess
import platform as _platform
import SCons.Action
import SCons.Builder
@@ -73,7 +74,7 @@ def install_shared_library(env, sources, version = ()):
while len(version):
version = version[:-1]
target_name = '.'.join((str(source),) + version)
action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE")
action = SCons.Action.Action(symlink, " Symlinking $TARGET ...")
last = env.Command(os.path.join(target_dir, target_name), last, action)
targets += last
return targets
@@ -141,6 +142,10 @@ def pkg_config_modules(env, name, modules):
def generate(env):
"""Common environment generation code"""
# Tell tools which machine to compile for
env['TARGET_ARCH'] = env['machine']
env['MSVS_ARCH'] = env['machine']
# Toolchain
platform = env['platform']
if env['toolchain'] == 'default':
@@ -175,6 +180,10 @@ def generate(env):
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
# MSVC x64 support is broken in earlier versions of scons
env.EnsurePythonVersion(2, 0)
# shortcuts
machine = env['machine']
platform = env['platform']
@@ -183,6 +192,27 @@ def generate(env):
gcc = env['gcc']
msvc = env['msvc']
# Determine whether we are cross compiling; in particular, whether we need
# to compile code generators with a different compiler as the target code.
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()))
host_machine = {
'x86': 'x86',
'i386': 'x86',
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'ppc' : 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
}.get(host_machine, 'generic')
env['crosscompile'] = platform != host_platform
if machine == 'x86_64' and host_machine != 'x86_64':
env['crosscompile'] = True
env['hostonly'] = False
# Backwards compatability with the debug= profile= options
if env['build'] == 'debug':
if not env['debug']:
@@ -217,6 +247,8 @@ def generate(env):
# configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
build_topdir = 'build'
build_subdir = env['platform']
if env['embedded']:
build_subdir = 'embedded-' + build_subdir
if env['machine'] != 'generic':
build_subdir += '-' + env['machine']
if env['build'] != 'release':
@@ -247,6 +279,18 @@ def generate(env):
cppdefines += ['NDEBUG']
if env['build'] == 'profile':
cppdefines += ['PROFILE']
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
cppdefines += [
'_POSIX_SOURCE',
('_POSIX_C_SOURCE', '199309L'),
'_SVID_SOURCE',
'_BSD_SOURCE',
'_GNU_SOURCE',
'PTHREADS',
'HAVE_POSIX_MEMALIGN',
]
if env['platform'] == 'darwin':
cppdefines += ['_DARWIN_C_SOURCE']
if platform == 'windows':
cppdefines += [
'WIN32',
@@ -319,8 +363,8 @@ def generate(env):
if platform == 'wince':
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
if platform == 'embedded':
cppdefines += ['PIPE_OS_EMBEDDED']
if env['embedded']:
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
env.Append(CPPDEFINES = cppdefines)
# C compiler options
@@ -349,12 +393,15 @@ def generate(env):
'-m32',
#'-march=pentium4',
]
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
and (platform != 'windows' or env['build'] == 'debug' or True):
# NOTE: We need to ensure stack is realigned given that we
# produce shared objects, and have no control over the stack
# alignment policy of the application. Therefore we need
# -mstackrealign ore -mincoming-stack-boundary=2.
#
# XXX: -O and -mstackrealign causes stack corruption on MinGW
#
# XXX: We could have SSE without -mstackrealign if we always used
# __attribute__((force_align_arg_pointer)), but that's not
# always the case.
@@ -370,6 +417,8 @@ def generate(env):
ccflags += ['-m64']
if platform == 'darwin':
ccflags += ['-fno-common']
if env['platform'] != 'windows':
ccflags += ['-fvisibility=hidden']
# See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
ccflags += [
@@ -402,13 +451,19 @@ def generate(env):
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
'/GL-', # disable whole program optimization
]
else:
ccflags += [
'/O2', # optimize for speed
]
if env['build'] == 'release':
ccflags += [
'/GL', # enable whole program optimization
]
else:
ccflags += [
'/GL-', # disable whole program optimization
]
ccflags += [
'/fp:fast', # fast floating point
'/W3', # warning level
@@ -498,7 +553,7 @@ def generate(env):
else:
env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
if msvc:
if env['build'] != 'debug':
if env['build'] == 'release':
# enable Link-time Code Generation
linkflags += ['/LTCG']
env.Append(ARFLAGS = ['/LTCG'])
@@ -551,13 +606,21 @@ def generate(env):
env.Append(LINKFLAGS = linkflags)
env.Append(SHLINKFLAGS = shlinkflags)
# We have C++ in several libraries, so always link with the C++ compiler
if env['gcc']:
env['LINK'] = env['CXX']
# Default libs
env.Append(LIBS = [])
libs = []
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
# Load tools
env.Tool('lex')
env.Tool('yacc')
if env['llvm']:
env.Tool('llvm')
env.Tool('udis86')
pkg_config_modules(env, 'x11', ['x11', 'xext'])
pkg_config_modules(env, 'drm', ['libdrm'])

View File

@@ -142,13 +142,11 @@ def generate(env):
try:
env.ParseConfig('llvm-config --cppflags')
env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
env.ParseConfig('llvm-config --libs')
env.ParseConfig('llvm-config --ldflags')
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version
return
else:
env['LINK'] = env['CXX']
assert llvm_version is not None
env['llvm'] = True

View File

@@ -1,72 +0,0 @@
"""gallium
Frontend-tool for Gallium3D architecture.
"""
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# 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, sub license, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial portions
# of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
#
import sys
import distutils.sysconfig
import os.path
def generate(env):
# See http://www.scons.org/wiki/PythonExtensions
if sys.platform in ['win32']:
python_root = sys.prefix
python_version = '%u%u' % sys.version_info[:2]
python_include = os.path.join(python_root, 'include')
python_libs = os.path.join(python_root, 'libs')
python_lib = os.path.join(python_libs, 'python' + python_version + '.lib')
env.Append(CPPPATH = [python_include])
env.Append(LIBPATH = [python_libs])
env.Append(LIBS = ['python' + python_version + '.lib'])
env.Replace(SHLIBPREFIX = '')
env.Replace(SHLIBSUFFIX = '.pyd')
# XXX; python25_d.lib is not included in Python for windows, and
# we'll get missing symbols unless we undefine _DEBUG
cppdefines = env['CPPDEFINES']
cppdefines = [define for define in cppdefines if define != '_DEBUG']
env.Replace(CPPDEFINES = cppdefines)
env.AppendUnique(CPPFLAGS = ['/U_DEBUG'])
env.AppendUnique(LINKFLAGS = ['/nodefaultlib:python25_d.lib'])
else:
#env.ParseConfig('python-config --cflags --ldflags --libs')
env.AppendUnique(CPPPATH = [distutils.sysconfig.get_python_inc()])
env.Replace(SHLIBPREFIX = '')
env.Replace(SHLIBSUFFIX = distutils.sysconfig.get_config_vars()['SO'])
# for debugging
#print env.Dump()
def exists(env):
return 1

View File

@@ -1,44 +0,0 @@
"""udis86
Tool-specific initialization for udis86
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
def generate(env):
conf = env.Configure()
if conf.CheckHeader('udis86.h'): # and conf.CheckLib('udis86'):
env['UDIS86'] = True
env.Prepend(LIBS = ['udis86'])
else:
env['UDIS86'] = False
conf.Finish()
def exists(env):
return True
# vim:set ts=4 sw=4 et:

View File

@@ -1,17 +1,33 @@
Import('*')
SConscript('mapi/vgapi/SConscript')
if env['platform'] == 'windows':
SConscript('egl/main/SConscript')
SConscript('talloc/SConscript')
SConscript('getopt/SConscript')
SConscript('glsl/SConscript')
if env['hostonly']:
# We are just compiling the things necessary on the host for cross
# compilation
Return()
# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
# enable OpenGL ES support.
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
SConscript('mapi/vgapi/SConscript')
if env['platform'] != 'embedded':
SConscript('egl/main/SConscript')
SConscript('glu/sgi/SConscript')
SConscript('glut/glx/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')
SConscript('gallium/SConscript')

View File

@@ -3,8 +3,13 @@
TOP = ../..
include $(TOP)/configs/current
SUBDIRS = main drivers
SUBDIRS =
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
SUBDIRS += wayland
endif
SUBDIRS += drivers main
default: subdirs

View File

@@ -2,6 +2,7 @@
#
# Drivers should define
#
# EGL_BUILTIN, the driver is built-in or external
# EGL_DRIVER, the driver name
# EGL_SOURCES, the driver sources
# EGL_INCLUDES, the include pathes
@@ -12,32 +13,45 @@
#
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER)
EGL_DRIVER_PATH = $(TOP)/$(LIB_DIR)/egl/$(EGL_DRIVER).so
EGL_OBJECTS = $(EGL_SOURCES:.c=.o)
# built-in or external
ifeq ($(EGL_BUILTIN),true)
EGL_TARGET = lib$(EGL_DRIVER).a
EGL_INSTALL =
else
EGL_TARGET = $(EGL_DRIVER_PATH)
EGL_INSTALL = install-so
endif
default: depend $(EGL_DRIVER_PATH)
default: depend $(EGL_TARGET)
$(EGL_DRIVER_PATH): $(EGL_DRIVER)
$(EGL_DRIVER_PATH): $(EGL_DRIVER).so
@$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl
$(INSTALL) $< $(TOP)/$(LIB_DIR)/egl
$(EGL_DRIVER): $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -noprefix \
$(EGL_DRIVER).so: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER).so -noprefix \
-linker '$(CC)' -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
$(MKLIB_OPTIONS) \
$(EGL_OBJECTS) $(EGL_LIBS) -l$(EGL_LIB)
lib$(EGL_DRIVER).a: $(EGL_OBJECTS) Makefile $(TOP)/src/egl/drivers/Makefile.template
@$(MKLIB) -o $(EGL_DRIVER) -static $(EGL_OBJECTS)
.c.o:
$(CC) -c $(EGL_INCLUDES) $(CFLAGS) $(EGL_CFLAGS) $< -o $@
install: $(EGL_DRIVER_PATH)
install-so: $(EGL_DRIVER_PATH)
$(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
$(MINSTALL) $(EGL_DRIVER_PATH) $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
install: $(EGL_INSTALL)
clean:
rm -f $(EGL_DRIVER)
rm -f $(EGL_DRIVER).so
rm -f lib$(EGL_DRIVER).a
rm -f $(EGL_OBJECTS)
rm -f depend depend.bak

View File

@@ -3,18 +3,46 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_dri2.so
EGL_SOURCES = egl_dri2.c
EGL_DRIVER = egl_dri2
EGL_SOURCES = egl_dri2.c common.c
EGL_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/mapi \
-I$(TOP)/src/gbm/main \
-I$(TOP)/src/gbm/backends/dri \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
$(XCB_DRI2_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBDRM_CFLAGS)
EGL_LIBS = $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(LIBDRM_LIBS)
EGL_LIBS = $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
EGL_BUILTIN = true
ifeq ($(SHARED_GLAPI),1)
EGL_CFLAGS += -DHAVE_SHARED_GLAPI
endif
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_x11.c
EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
EGL_LIBS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_drm.c
EGL_INCLUDES += -DHAVE_DRM_PLATFORM
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
EGL_SOURCES += platform_wayland.c
EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
-I$(TOP)/src/egl/wayland/wayland-egl \
-I$(TOP)/src/egl/wayland/wayland-drm
EGL_LIBS += $(WAYLAND_LIBS) \
$(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
include ../Makefile.template

View File

@@ -0,0 +1,144 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "egl_dri2.h"
#ifdef HAVE_LIBUDEV
#define DRIVER_MAP_DRI2_ONLY
#include "pci_ids/pci_id_driver_map.h"
#include <libudev.h>
static struct udev_device *
dri2_udev_device_new_from_fd(struct udev *udev, int fd)
{
struct udev_device *device;
struct stat buf;
if (fstat(fd, &buf) < 0) {
_eglLog(_EGL_WARNING, "EGL-DRI2: failed to stat fd %d", fd);
return NULL;
}
device = udev_device_new_from_devnum(udev, 'c', buf.st_rdev);
if (device == NULL) {
_eglLog(_EGL_WARNING,
"EGL-DRI2: could not create udev device for fd %d", fd);
return NULL;
}
return device;
}
char *
dri2_get_device_name_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device;
const char *const_device_name;
char *device_name = NULL;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
const_device_name = udev_device_get_devnode(device);
if (!const_device_name)
goto out;
device_name = strdup(const_device_name);
out:
udev_device_unref(device);
udev_unref(udev);
return device_name;
}
char *
dri2_get_driver_for_fd(int fd)
{
struct udev *udev;
struct udev_device *device, *parent;
const char *pci_id;
char *driver = NULL;
int vendor_id, chip_id, i, j;
udev = udev_new();
device = dri2_udev_device_new_from_fd(udev, fd);
if (device == NULL)
return NULL;
parent = udev_device_get_parent(device);
if (parent == NULL) {
_eglLog(_EGL_WARNING, "DRI2: could not get parent device");
goto out;
}
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (pci_id == NULL ||
sscanf(pci_id, "%x:%x", &vendor_id, &chip_id) != 2) {
_eglLog(_EGL_WARNING, "EGL-DRI2: malformed or no PCI ID");
goto out;
}
for (i = 0; driver_map[i].driver; i++) {
if (vendor_id != driver_map[i].vendor_id)
continue;
if (driver_map[i].num_chips_ids == -1) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
for (j = 0; j < driver_map[i].num_chips_ids; j++)
if (driver_map[i].chip_ids[j] == chip_id) {
driver = strdup(driver_map[i].driver);
_eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
fd, vendor_id, chip_id, driver);
goto out;
}
}
out:
udev_device_unref(device);
udev_unref(udev);
return driver;
}
#endif /* HAVE_LIBUDEV */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,233 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#ifndef EGL_DRI2_INCLUDED
#define EGL_DRI2_INCLUDED
#ifdef HAVE_X11_PLATFORM
#include <xcb/xcb.h>
#include <xcb/dri2.h>
#include <xcb/xfixes.h>
#include <X11/Xlib-xcb.h>
#endif
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
#include "wayland-drm.h"
#include "wayland-egl-priv.h"
#endif
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#ifdef HAVE_DRM_PLATFORM
#include <gbm_driint.h>
#endif
#include "eglconfig.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglcurrent.h"
#include "egllog.h"
#include "eglsurface.h"
#include "eglimage.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
struct dri2_egl_driver
{
_EGLDriver base;
void *handle;
_EGLProc (*get_proc_address)(const char *procname);
void (*glFlush)(void);
};
struct dri2_egl_display
{
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
int own_dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
__DRIdri2Extension *dri2;
__DRIswrastExtension *swrast;
__DRI2flushExtension *flush;
__DRItexBufferExtension *tex_buffer;
__DRIimageExtension *image;
int fd;
#ifdef HAVE_DRM_PLATFORM
struct gbm_dri_device *gbm_dri;
#endif
char *device_name;
char *driver_name;
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[4];
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_display *wl_dpy;
struct wl_drm *wl_server_drm;
struct wl_drm *wl_drm;
int authenticated;
#endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id);
};
struct dri2_egl_context
{
_EGLContext base;
__DRIcontext *dri_context;
};
#ifdef HAVE_WAYLAND_PLATFORM
enum wayland_buffer_type {
WL_BUFFER_FRONT,
WL_BUFFER_BACK,
WL_BUFFER_THIRD,
WL_BUFFER_COUNT
};
#define __DRI_BUFFER_COUNT 10
#endif
enum dri2_surface_type {
DRI2_WINDOW_SURFACE,
DRI2_PIXMAP_SURFACE,
DRI2_PBUFFER_SURFACE
};
struct dri2_egl_surface
{
_EGLSurface base;
__DRIdrawable *dri_drawable;
__DRIbuffer buffers[5];
int buffer_count;
int have_fake_front;
int swap_interval;
#ifdef HAVE_X11_PLATFORM
xcb_drawable_t drawable;
xcb_xfixes_region_t region;
int depth;
int bytes_per_pixel;
xcb_gcontext_t gc;
xcb_gcontext_t swapgc;
#endif
enum dri2_surface_type type;
#ifdef HAVE_WAYLAND_PLATFORM
struct wl_egl_window *wl_win;
struct wl_egl_pixmap *wl_pix;
struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT];
int wl_buffer_lock[WL_BUFFER_COUNT];
int dx;
int dy;
__DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT];
__DRIbuffer *third_buffer;
__DRIbuffer *pending_buffer;
EGLBoolean block_swap_buffers;
#endif
};
struct dri2_egl_buffer {
__DRIbuffer *dri_buffer;
struct dri2_egl_display *dri2_dpy;
};
struct dri2_egl_config
{
_EGLConfig base;
const __DRIconfig *dri_single_config;
const __DRIconfig *dri_double_config;
};
struct dri2_egl_image
{
_EGLImage base;
__DRIimage *dri_image;
};
/* standard typecasts */
_EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl)
_EGL_DRIVER_TYPECAST(dri2_egl_image, _EGLImage, obj)
extern const __DRIimageLookupExtension image_lookup_extension;
extern const __DRIuseInvalidateExtension use_invalidate;
EGLBoolean
dri2_load_driver(_EGLDisplay *disp);
/* Helper for platforms not using dri2_create_screen */
void
dri2_setup_screen(_EGLDisplay *disp);
EGLBoolean
dri2_load_driver_swrast(_EGLDisplay *disp);
EGLBoolean
dri2_create_screen(_EGLDisplay *disp);
__DRIimage *
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
int depth, EGLint surface_type, const EGLint *attr_list);
_EGLImage *
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list);
EGLBoolean
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp);
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
char *
dri2_get_driver_for_fd(int fd);
char *
dri2_get_device_name_for_fd(int fd);
#endif /* EGL_DRI2_INCLUDED */

View File

@@ -0,0 +1,146 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <xf86drm.h>
#include <dlfcn.h>
#include "egl_dri2.h"
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 gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
struct dri2_egl_image *dri2_img;
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
if (!_eglInitImage(&dri2_img->base, disp)) {
free(dri2_img);
return NULL;
}
dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
if (dri2_img->dri_image == NULL) {
free(dri2_img);
_eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
return NULL;
}
return &dri2_img->base;
}
static _EGLImage *
dri2_drm_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_drm_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
return drmAuthMagic(dri2_dpy->fd, id);
}
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
struct gbm_device *gbm;
int i;
dri2_dpy = malloc(sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
gbm = (struct gbm_device *) disp->PlatformDisplay;
if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
free(dri2_dpy);
return EGL_FALSE;
}
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
free(dri2_dpy);
return EGL_FALSE;
}
dri2_dpy->fd = gbm_device_get_fd(gbm);
dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
dri2_dpy->image = dri2_dpy->gbm_dri->image;
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
dri2_dpy->gbm_dri->lookup_user_data = disp;
dri2_setup_screen(disp);
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i],
i + 1, 0, 0, NULL);
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif
dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
}

View File

@@ -0,0 +1,866 @@
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kristian Høgsberg <krh@bitplanet.net>
* Benjamin Franzke <benjaminfranzke@googlemail.com>
*/
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <xf86drm.h>
#include "egl_dri2.h"
#include <wayland-client.h>
#include "wayland-drm-client-protocol.h"
static void
sync_callback(void *data)
{
int *done = data;
*done = 1;
}
static void
force_roundtrip(struct wl_display *display)
{
int done = 0;
wl_display_sync_callback(display, sync_callback, &done);
wl_display_iterate(display, WL_DISPLAY_WRITABLE);
while (!done)
wl_display_iterate(display, WL_DISPLAY_READABLE);
}
static void
wl_buffer_release(void *data, struct wl_buffer *buffer)
{
struct dri2_egl_surface *dri2_surf = data;
int i;
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i] == buffer)
break;
assert(i <= WL_BUFFER_COUNT);
/* not found? */
if (i == WL_BUFFER_COUNT)
return;
dri2_surf->wl_buffer_lock[i] = 0;
}
static struct wl_buffer_listener wl_buffer_listener = {
wl_buffer_release
};
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
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;
dri2_surf = malloc(sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
dri2_surf->dri_buffers[i] = NULL;
dri2_surf->pending_buffer = NULL;
dri2_surf->third_buffer = NULL;
dri2_surf->block_swap_buffers = EGL_FALSE;
switch (type) {
case EGL_WINDOW_BIT:
dri2_surf->wl_win = (struct wl_egl_window *) window;
dri2_surf->type = DRI2_WINDOW_SURFACE;
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->type = DRI2_PIXMAP_SURFACE;
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;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
type == EGL_WINDOW_BIT ?
dri2_conf->dri_double_config :
dri2_conf->dri_single_config,
dri2_surf);
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
goto cleanup_dri_drawable;
}
return &dri2_surf->base;
cleanup_dri_drawable:
dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
cleanup_surf:
free(dri2_surf);
return NULL;
}
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
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().
*/
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int i;
(void) drv;
if (!_eglPutSurface(surf))
return EGL_TRUE;
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < WL_BUFFER_COUNT; ++i)
if (dri2_surf->wl_drm_buffer[i])
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->type == DRI2_PIXMAP_SURFACE))
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
}
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,
struct wl_visual *visual)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct wl_buffer *buf;
buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
dri2_surf->base.Width, dri2_surf->base.Height,
buffer->pitch, visual);
wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
return buf;
}
static void
dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
(void) format;
switch (dri2_surf->type) {
case DRI2_WINDOW_SURFACE:
/* allocate a front buffer for our double-buffered window*/
if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
break;
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
__DRI_BUFFER_FRONT_LEFT, format,
dri2_surf->base.Width, dri2_surf->base.Height);
break;
default:
break;
}
}
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->type) {
case DRI2_PIXMAP_SURFACE:
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 dri2_egl_surface *dri2_surf = data;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
/* FIXME: print internal error */
if (!dri2_surf->pending_buffer)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->pending_buffer);
dri2_surf->pending_buffer = NULL;
}
static void
dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
if (dri2_surf->third_buffer) {
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
}
for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
if (dri2_surf->dri_buffers[i]) {
switch (i) {
case __DRI_BUFFER_FRONT_LEFT:
if (dri2_surf->pending_buffer)
force_roundtrip(dri2_dpy->wl_dpy);
dri2_surf->pending_buffer = dri2_surf->dri_buffers[i];
wl_display_sync_callback(dri2_dpy->wl_dpy,
dri2_release_pending_buffer, dri2_surf);
break;
default:
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->dri_buffers[i]);
break;
}
dri2_surf->dri_buffers[i] = NULL;
}
}
}
static inline void
pointer_swap(const void **p1, const void **p2)
{
const void *tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
static void
destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
if (dri2_surf->third_buffer == NULL)
return;
dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
dri2_surf->third_buffer);
dri2_surf->third_buffer = NULL;
if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
}
static void
swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
enum wayland_buffer_type a, enum wayland_buffer_type b)
{
int tmp;
tmp = dri2_surf->wl_buffer_lock[a];
dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
dri2_surf->wl_buffer_lock[b] = tmp;
pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
(const void **) &dri2_surf->wl_drm_buffer[b]);
}
static void
swap_back_and_third(struct dri2_egl_surface *dri2_surf)
{
if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
destroy_third_buffer(dri2_surf);
pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
(const void **) &dri2_surf->third_buffer);
swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
}
static void
dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
unsigned int type)
{
switch (type) {
case __DRI_BUFFER_BACK_LEFT:
if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
swap_back_and_third(dri2_surf);
else if (dri2_surf->third_buffer)
destroy_third_buffer(dri2_surf);
break;
default:
break;
}
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
int i;
if (dri2_surf->type == DRI2_WINDOW_SURFACE &&
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
dri2_surf->base.Height != dri2_surf->wl_win->height)) {
dri2_release_buffers(dri2_surf);
dri2_surf->base.Width = dri2_surf->wl_win->width;
dri2_surf->base.Height = dri2_surf->wl_win->height;
dri2_surf->dx = dri2_surf->wl_win->dx;
dri2_surf->dy = dri2_surf->wl_win->dy;
for (i = 0; i < WL_BUFFER_COUNT; ++i) {
if (dri2_surf->wl_drm_buffer[i])
wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
dri2_surf->wl_drm_buffer[i] = NULL;
dri2_surf->wl_buffer_lock[i] = 0;
}
}
dri2_surf->buffer_count = 0;
for (i = 0; i < 2*count; i+=2) {
assert(attachments[i] < __DRI_BUFFER_COUNT);
assert(dri2_surf->buffer_count < 5);
dri2_prior_buffer_creation(dri2_surf, attachments[i]);
if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
dri2_surf->dri_buffers[attachments[i]] =
dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
attachments[i], attachments[i+1],
dri2_surf->base.Width, dri2_surf->base.Height);
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)
dri2_process_back_buffer(dri2_surf, attachments[i+1]);
}
memcpy(&dri2_surf->buffers[dri2_surf->buffer_count],
dri2_surf->dri_buffers[attachments[i]],
sizeof(__DRIbuffer));
dri2_surf->buffer_count++;
}
assert(dri2_surf->type == DRI2_PIXMAP_SURFACE ||
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
if (dri2_surf->type == DRI2_PIXMAP_SURFACE && !dri2_surf->wl_pix->buffer)
dri2_surf->wl_pix->buffer =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_pix->visual);
*out_count = dri2_surf->buffer_count;
if (dri2_surf->buffer_count == 0)
return NULL;
*width = dri2_surf->base.Width;
*height = dri2_surf->base.Height;
return dri2_surf->buffers;
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
const unsigned int format = 32;
int i;
attachments_with_format = calloc(count * 2, sizeof(unsigned int));
if (!attachments_with_format) {
*out_count = 0;
return NULL;
}
for (i = 0; i < count; ++i) {
attachments_with_format[2*i] = attachments[i];
attachments_with_format[2*i + 1] = format;
}
buffer =
dri2_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
free(attachments_with_format);
return buffer;
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
/* FIXME: Does EGL support front buffer rendering at all? */
#if 0
struct dri2_egl_surface *dri2_surf = loaderPrivate;
dri2WaitGL(dri2_surf);
#else
(void) loaderPrivate;
#endif
}
static void
wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
{
struct dri2_egl_surface *dri2_surf = data;
dri2_surf->block_swap_buffers = EGL_FALSE;
}
/**
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
static EGLBoolean
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);
while (dri2_surf->block_swap_buffers)
wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
dri2_surf->block_swap_buffers = EGL_TRUE;
wl_display_frame_callback(dri2_dpy->wl_dpy,
dri2_surf->wl_win->surface,
wayland_frame_callback, dri2_surf);
if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
pointer_swap(
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
(const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]);
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT]->attachment =
__DRI_BUFFER_FRONT_LEFT;
dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment =
__DRI_BUFFER_BACK_LEFT;
swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
wayland_create_buffer(dri2_surf,
dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT],
dri2_surf->wl_win->visual);
wl_buffer_damage(dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT], 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
wl_surface_attach(dri2_surf->wl_win->surface,
dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
dri2_surf->dx, dri2_surf->dy);
dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
dri2_surf->wl_win->attached_width = dri2_surf->base.Width;
dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
/* reset resize growing parameters */
dri2_surf->dx = 0;
dri2_surf->dy = 0;
wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
dri2_surf->base.Width, dri2_surf->base.Height);
}
_EGLContext *ctx;
if (dri2_drv->glFlush) {
ctx = _eglGetCurrentContext();
if (ctx && ctx->DrawSurface == &dri2_surf->base)
dri2_drv->glFlush();
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
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;
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_egl_pixmap->visual);
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)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
dri2_dpy->authenticated = 0;
wl_drm_authenticate(dri2_dpy->wl_drm, id);
force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->authenticated)
ret = -1;
/* reset authenticated */
dri2_dpy->authenticated = 1;
return ret;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
free(dri2_dpy->driver_name);
free(dri2_dpy);
disp->DriverData = NULL;
return EGL_TRUE;
}
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
struct dri2_egl_display *dri2_dpy = data;
drm_magic_t magic;
dri2_dpy->device_name = strdup(device);
if (!dri2_dpy->device_name)
return;
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
if (dri2_dpy->fd == -1) {
_eglLog(_EGL_WARNING, "wayland-egl: could not open %s (%s)",
dri2_dpy->device_name, strerror(errno));
return;
}
drmGetMagic(dri2_dpy->fd, &magic);
wl_drm_authenticate(dri2_dpy->wl_drm, magic);
}
static void
drm_handle_authenticated(void *data, struct wl_drm *drm)
{
struct dri2_egl_display *dri2_dpy = data;
dri2_dpy->authenticated = 1;
}
static const struct wl_drm_listener drm_listener = {
drm_handle_device,
drm_handle_authenticated
};
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
uint32_t id;
int i;
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);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);
if (dri2_dpy->wl_dpy == NULL)
goto cleanup_dpy;
} else {
dri2_dpy->wl_dpy = disp->PlatformDisplay;
}
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
force_roundtrip(dri2_dpy->wl_dpy);
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)
goto cleanup_dpy;
dri2_dpy->wl_drm = wl_drm_create(dri2_dpy->wl_dpy, id, 1);
if (!dri2_dpy->wl_drm)
goto cleanup_dpy;
wl_drm_add_listener(dri2_dpy->wl_drm, &drm_listener, dri2_dpy);
force_roundtrip(dri2_dpy->wl_dpy);
if (dri2_dpy->fd == -1)
goto cleanup_drm;
force_roundtrip(dri2_dpy->wl_dpy);
if (!dri2_dpy->authenticated)
goto cleanup_fd;
dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
if (dri2_dpy->driver_name == NULL) {
_eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
goto cleanup_fd;
}
if (!dri2_load_driver(disp))
goto cleanup_driver_name;
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_lookup_extension.base;
dri2_dpy->extensions[2] = &use_invalidate.base;
dri2_dpy->extensions[3] = NULL;
if (!dri2_create_screen(disp))
goto cleanup_driver;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0,
EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
dri2_dpy->authenticate = dri2_wayland_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_driver_name:
free(dri2_dpy->driver_name);
cleanup_fd:
close(dri2_dpy->fd);
cleanup_drm:
free(dri2_dpy->device_name);
wl_drm_destroy(dri2_dpy->wl_drm);
cleanup_dpy:
free(dri2_dpy);
return EGL_FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
TOP = ../../../..
include $(TOP)/configs/current
EGL_DRIVER = egl_glx.so
EGL_DRIVER = egl_glx
EGL_SOURCES = egl_glx.c
EGL_INCLUDES = \
@@ -11,6 +11,9 @@ EGL_INCLUDES = \
-I$(TOP)/src/egl/main
EGL_CFLAGS = $(X11_CFLAGS)
EGL_LIBS = $(X11_LIBS) -lGL
EGL_LIBS = $(X11_LIBS) $(DLOPEN_LIBS)
EGL_CFLAGS += -D_EGL_MAIN=_eglBuiltInDriverGLX
EGL_BUILTIN = true
include ../Makefile.template

View File

@@ -1,8 +1,10 @@
/**************************************************************************
*
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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
@@ -10,19 +12,19 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
@@ -36,8 +38,8 @@
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <EGL/egl.h>
#include <dlfcn.h>
#include "GL/glx.h"
#include "eglconfig.h"
#include "eglcontext.h"
@@ -54,10 +56,66 @@
#error "GL/glx.h must be equal to or greater than GLX 1.4"
#endif
/* GLX 1.0 */
typedef GLXContext (*GLXCREATECONTEXTPROC)( Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct );
typedef void (*GLXDESTROYCONTEXTPROC)( Display *dpy, GLXContext ctx );
typedef Bool (*GLXMAKECURRENTPROC)( Display *dpy, GLXDrawable drawable, GLXContext ctx);
typedef void (*GLXSWAPBUFFERSPROC)( Display *dpy, GLXDrawable drawable );
typedef GLXPixmap (*GLXCREATEGLXPIXMAPPROC)( Display *dpy, XVisualInfo *visual, Pixmap pixmap );
typedef void (*GLXDESTROYGLXPIXMAPPROC)( Display *dpy, GLXPixmap pixmap );
typedef Bool (*GLXQUERYVERSIONPROC)( Display *dpy, int *maj, int *min );
typedef int (*GLXGETCONFIGPROC)( Display *dpy, XVisualInfo *visual, int attrib, int *value );
typedef void (*GLXWAITGLPROC)( void );
typedef void (*GLXWAITXPROC)( void );
/* GLX 1.1 */
typedef const char *(*GLXQUERYEXTENSIONSSTRINGPROC)( Display *dpy, int screen );
typedef const char *(*GLXQUERYSERVERSTRINGPROC)( Display *dpy, int screen, int name );
typedef const char *(*GLXGETCLIENTSTRINGPROC)( Display *dpy, int name );
/** subclass of _EGLDriver */
struct GLX_egl_driver
{
_EGLDriver Base; /**< base class */
void *handle;
/* GLX 1.0 */
GLXCREATECONTEXTPROC glXCreateContext;
GLXDESTROYCONTEXTPROC glXDestroyContext;
GLXMAKECURRENTPROC glXMakeCurrent;
GLXSWAPBUFFERSPROC glXSwapBuffers;
GLXCREATEGLXPIXMAPPROC glXCreateGLXPixmap;
GLXDESTROYGLXPIXMAPPROC glXDestroyGLXPixmap;
GLXQUERYVERSIONPROC glXQueryVersion;
GLXGETCONFIGPROC glXGetConfig;
GLXWAITGLPROC glXWaitGL;
GLXWAITXPROC glXWaitX;
/* GLX 1.1 */
GLXQUERYEXTENSIONSSTRINGPROC glXQueryExtensionsString;
GLXQUERYSERVERSTRINGPROC glXQueryServerString;
GLXGETCLIENTSTRINGPROC glXGetClientString;
/* GLX 1.3 or (GLX_SGI_make_current_read and GLX_SGIX_fbconfig) */
PFNGLXGETFBCONFIGSPROC glXGetFBConfigs;
PFNGLXGETFBCONFIGATTRIBPROC glXGetFBConfigAttrib;
PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfig;
PFNGLXCREATEWINDOWPROC glXCreateWindow;
PFNGLXDESTROYWINDOWPROC glXDestroyWindow;
PFNGLXCREATEPIXMAPPROC glXCreatePixmap;
PFNGLXDESTROYPIXMAPPROC glXDestroyPixmap;
PFNGLXCREATEPBUFFERPROC glXCreatePbuffer;
PFNGLXDESTROYPBUFFERPROC glXDestroyPbuffer;
PFNGLXCREATENEWCONTEXTPROC glXCreateNewContext;
PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrent;
/* GLX 1.4 or GLX_ARB_get_proc_address */
PFNGLXGETPROCADDRESSPROC glXGetProcAddress;
/* GLX_SGIX_pbuffer */
PFNGLXCREATEGLXPBUFFERSGIXPROC glXCreateGLXPbufferSGIX;
PFNGLXDESTROYGLXPBUFFERSGIXPROC glXDestroyGLXPbufferSGIX;
};
@@ -76,14 +134,9 @@ struct GLX_egl_display
EGLBoolean have_fbconfig;
EGLBoolean have_pbuffer;
/* GLX_SGIX_pbuffer */
PFNGLXCREATEGLXPBUFFERSGIXPROC glXCreateGLXPbufferSGIX;
PFNGLXDESTROYGLXPBUFFERSGIXPROC glXDestroyGLXPbufferSGIX;
/* workaround quirks of different GLX implementations */
EGLBoolean single_buffered_quirk;
EGLBoolean glx_window_quirk;
};
@@ -168,19 +221,21 @@ static const struct {
static EGLBoolean
convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
convert_fbconfig(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, GLXFBConfig fbconfig,
struct GLX_egl_config *GLX_conf)
{
Display *dpy = GLX_dpy->dpy;
int err, attr, val;
unsigned i;
/* must have rgba bit */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, GLX_RENDER_TYPE, &val);
if (err || !(val & GLX_RGBA_BIT))
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
@@ -196,7 +251,7 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
if (!egl_attr)
continue;
err = glXGetFBConfigAttrib(dpy, fbconfig, attr, &val);
err = GLX_drv->glXGetFBConfigAttrib(dpy, fbconfig, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
err = 0;
@@ -303,21 +358,23 @@ static const struct {
};
static EGLBoolean
convert_visual(Display *dpy, XVisualInfo *vinfo,
convert_visual(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, XVisualInfo *vinfo,
struct GLX_egl_config *GLX_conf)
{
Display *dpy = GLX_dpy->dpy;
int err, attr, val;
unsigned i;
/* the visual must support OpenGL and RGBA buffer */
err = glXGetConfig(dpy, vinfo, GLX_USE_GL, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_USE_GL, &val);
if (!err && val)
err = glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_RGBA, &val);
if (err || !val)
return EGL_FALSE;
/* must know whether it is double-buffered */
err = glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, GLX_DOUBLEBUFFER, &val);
if (err)
return EGL_FALSE;
GLX_conf->double_buffered = val;
@@ -341,7 +398,7 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
if (!egl_attr)
continue;
err = glXGetConfig(dpy, vinfo, attr, &val);
err = GLX_drv->glXGetConfig(dpy, vinfo, attr, &val);
if (err) {
if (err == GLX_BAD_ATTRIBUTE) {
err = 0;
@@ -406,14 +463,16 @@ fix_config(struct GLX_egl_display *GLX_dpy, struct GLX_egl_config *GLX_conf)
static EGLBoolean
create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
EGLint screen)
create_configs(_EGLDriver *drv, _EGLDisplay *dpy, EGLint screen)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(dpy);
EGLint num_configs = 0, i;
EGLint id = 1;
if (GLX_dpy->have_fbconfig) {
GLX_dpy->fbconfigs = glXGetFBConfigs(GLX_dpy->dpy, screen, &num_configs);
GLX_dpy->fbconfigs =
GLX_drv->glXGetFBConfigs(GLX_dpy->dpy, screen, &num_configs);
}
else {
XVisualInfo vinfo_template;
@@ -434,10 +493,14 @@ create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
memset(&template, 0, sizeof(template));
_eglInitConfig(&template.Base, dpy, id);
if (GLX_dpy->have_fbconfig)
ok = convert_fbconfig(GLX_dpy->dpy, GLX_dpy->fbconfigs[i], &template);
else
ok = convert_visual(GLX_dpy->dpy, &GLX_dpy->visuals[i], &template);
if (GLX_dpy->have_fbconfig) {
ok = convert_fbconfig(GLX_drv, GLX_dpy,
GLX_dpy->fbconfigs[i], &template);
}
else {
ok = convert_visual(GLX_drv, GLX_dpy,
&GLX_dpy->visuals[i], &template);
}
if (!ok)
continue;
@@ -462,13 +525,12 @@ create_configs(_EGLDisplay *dpy, struct GLX_egl_display *GLX_dpy,
static void
check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
check_extensions(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, EGLint screen)
{
GLX_dpy->extensions =
glXQueryExtensionsString(GLX_dpy->dpy, screen);
GLX_drv->glXQueryExtensionsString(GLX_dpy->dpy, screen);
if (GLX_dpy->extensions) {
/* glXGetProcAddress is assumed */
if (strstr(GLX_dpy->extensions, "GLX_SGI_make_current_read")) {
/* GLX 1.3 entry points are used */
GLX_dpy->have_make_current_read = EGL_TRUE;
@@ -480,13 +542,8 @@ check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
}
if (strstr(GLX_dpy->extensions, "GLX_SGIX_pbuffer")) {
GLX_dpy->glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)
glXGetProcAddress((const GLubyte *) "glXCreateGLXPbufferSGIX");
GLX_dpy->glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)
glXGetProcAddress((const GLubyte *) "glXDestroyGLXPbufferSGIX");
if (GLX_dpy->glXCreateGLXPbufferSGIX &&
GLX_dpy->glXDestroyGLXPbufferSGIX &&
if (GLX_drv->glXCreateGLXPbufferSGIX &&
GLX_drv->glXDestroyGLXPbufferSGIX &&
GLX_dpy->have_fbconfig)
GLX_dpy->have_pbuffer = EGL_TRUE;
}
@@ -502,16 +559,17 @@ check_extensions(struct GLX_egl_display *GLX_dpy, EGLint screen)
static void
check_quirks(struct GLX_egl_display *GLX_dpy, EGLint screen)
check_quirks(struct GLX_egl_driver *GLX_drv,
struct GLX_egl_display *GLX_dpy, EGLint screen)
{
const char *vendor;
GLX_dpy->single_buffered_quirk = EGL_TRUE;
GLX_dpy->glx_window_quirk = EGL_TRUE;
vendor = glXGetClientString(GLX_dpy->dpy, GLX_VENDOR);
vendor = GLX_drv->glXGetClientString(GLX_dpy->dpy, GLX_VENDOR);
if (vendor && strstr(vendor, "NVIDIA")) {
vendor = glXQueryServerString(GLX_dpy->dpy, screen, GLX_VENDOR);
vendor = GLX_drv->glXQueryServerString(GLX_dpy->dpy, screen, GLX_VENDOR);
if (vendor && strstr(vendor, "NVIDIA")) {
_eglLog(_EGL_DEBUG, "disable quirks");
GLX_dpy->single_buffered_quirk = EGL_FALSE;
@@ -525,16 +583,21 @@ check_quirks(struct GLX_egl_display *GLX_dpy, EGLint screen)
* Called via eglInitialize(), GLX_drv->API.Initialize().
*/
static EGLBoolean
GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
EGLint *major, EGLint *minor)
GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy;
(void) drv;
if (disp->Platform != _EGL_PLATFORM_X11)
return EGL_FALSE;
/* this is a fallback driver */
if (!disp->Options.UseFallback)
return EGL_FALSE;
if (disp->Options.TestOnly)
return EGL_TRUE;
GLX_dpy = CALLOC_STRUCT(GLX_egl_display);
if (!GLX_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -549,7 +612,8 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
}
}
if (!glXQueryVersion(GLX_dpy->dpy, &GLX_dpy->glx_maj, &GLX_dpy->glx_min)) {
if (!GLX_drv->glXQueryVersion(GLX_dpy->dpy,
&GLX_dpy->glx_maj, &GLX_dpy->glx_min)) {
_eglLog(_EGL_WARNING, "GLX: glXQueryVersion failed");
if (!disp->PlatformDisplay)
XCloseDisplay(GLX_dpy->dpy);
@@ -557,10 +621,13 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_FALSE;
}
check_extensions(GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_quirks(GLX_dpy, DefaultScreen(GLX_dpy->dpy));
disp->DriverData = (void *) GLX_dpy;
disp->ClientAPIs = EGL_OPENGL_BIT;
create_configs(disp, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_extensions(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
check_quirks(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy));
create_configs(drv, disp, DefaultScreen(GLX_dpy->dpy));
if (!_eglGetArraySize(disp->Configs)) {
_eglLog(_EGL_WARNING, "GLX: failed to create any config");
if (!disp->PlatformDisplay)
@@ -569,16 +636,14 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_FALSE;
}
disp->DriverData = (void *) GLX_dpy;
disp->ClientAPIsMask = EGL_OPENGL_BIT;
/* we're supporting EGL 1.4 */
*major = 1;
*minor = 4;
disp->VersionMajor = 1;
disp->VersionMinor = 4;
return EGL_TRUE;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
@@ -612,12 +677,11 @@ static _EGLContext *
GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
_EGLContext *share_list, const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_context *GLX_ctx = CALLOC_STRUCT(GLX_egl_context);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_context *GLX_ctx_shared = GLX_egl_context(share_list);
(void) drv;
if (!GLX_ctx) {
_eglError(EGL_BAD_ALLOC, "eglCreateContext");
return NULL;
@@ -628,19 +692,19 @@ GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
return NULL;
}
if (GLX_dpy->have_fbconfig)
GLX_ctx->context =
glXCreateNewContext(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_RGBA_TYPE,
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
else
GLX_ctx->context =
glXCreateContext(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
if (GLX_dpy->have_fbconfig) {
GLX_ctx->context = GLX_drv->glXCreateNewContext(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_RGBA_TYPE,
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
}
else {
GLX_ctx->context = GLX_drv->glXCreateContext(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_ctx_shared ? GLX_ctx_shared->context : NULL,
GL_TRUE);
}
if (!GLX_ctx->context) {
free(GLX_ctx);
return NULL;
@@ -673,6 +737,7 @@ static EGLBoolean
GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
_EGLSurface *rsurf, _EGLContext *ctx)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_dsurf = GLX_egl_surface(dsurf);
struct GLX_egl_surface *GLX_rsurf = GLX_egl_surface(rsurf);
@@ -683,8 +748,6 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
GLXContext cctx;
EGLBoolean ret = EGL_FALSE;
(void) drv;
/* make new bindings */
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
return EGL_FALSE;
@@ -694,9 +757,9 @@ GLX_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
cctx = (GLX_ctx) ? GLX_ctx->context : NULL;
if (GLX_dpy->have_make_current_read)
ret = glXMakeContextCurrent(GLX_dpy->dpy, ddraw, rdraw, cctx);
ret = GLX_drv->glXMakeContextCurrent(GLX_dpy->dpy, ddraw, rdraw, cctx);
else if (ddraw == rdraw)
ret = glXMakeCurrent(GLX_dpy->dpy, ddraw, cctx);
ret = GLX_drv->glXMakeCurrent(GLX_dpy->dpy, ddraw, cctx);
if (ret) {
if (_eglPutSurface(old_dsurf))
@@ -747,12 +810,11 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface");
@@ -767,13 +829,14 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
GLX_surf->drawable = window;
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk)
GLX_surf->glx_drawable =
glXCreateWindow(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
else
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk) {
GLX_surf->glx_drawable = GLX_drv->glXCreateWindow(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
}
else {
GLX_surf->glx_drawable = GLX_surf->drawable;
}
if (!GLX_surf->glx_drawable) {
free(GLX_surf);
@@ -781,7 +844,7 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
if (GLX_dpy->have_1_3 && !GLX_dpy->glx_window_quirk)
GLX_surf->destroy = glXDestroyWindow;
GLX_surf->destroy = GLX_drv->glXDestroyWindow;
get_drawable_size(GLX_dpy->dpy, window, &width, &height);
GLX_surf->Base.Width = width;
@@ -795,12 +858,11 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
uint width, height;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePixmapSurface");
@@ -816,25 +878,25 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
GLX_surf->drawable = pixmap;
if (GLX_dpy->have_1_3) {
GLX_surf->glx_drawable =
glXCreatePixmap(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
GLX_surf->glx_drawable = GLX_drv->glXCreatePixmap(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->drawable, NULL);
}
else if (GLX_dpy->have_fbconfig) {
GLXFBConfig fbconfig = GLX_dpy->fbconfigs[GLX_egl_config_index(conf)];
XVisualInfo *vinfo = glXGetVisualFromFBConfig(GLX_dpy->dpy, fbconfig);
XVisualInfo *vinfo;
vinfo = GLX_drv->glXGetVisualFromFBConfig(GLX_dpy->dpy, fbconfig);
if (vinfo) {
GLX_surf->glx_drawable =
glXCreateGLXPixmap(GLX_dpy->dpy, vinfo, GLX_surf->drawable);
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
vinfo, GLX_surf->drawable);
XFree(vinfo);
}
}
else {
GLX_surf->glx_drawable =
glXCreateGLXPixmap(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_surf->drawable);
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPixmap(GLX_dpy->dpy,
&GLX_dpy->visuals[GLX_egl_config_index(conf)],
GLX_surf->drawable);
}
if (!GLX_surf->glx_drawable) {
@@ -843,7 +905,7 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
GLX_surf->destroy = (GLX_dpy->have_1_3) ?
glXDestroyPixmap : glXDestroyGLXPixmap;
GLX_drv->glXDestroyPixmap : GLX_drv->glXDestroyGLXPixmap;
get_drawable_size(GLX_dpy->dpy, pixmap, &width, &height);
GLX_surf->Base.Width = width;
@@ -856,13 +918,12 @@ static _EGLSurface *
GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf;
int attribs[5];
int i;
(void) drv;
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf) {
_eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface");
@@ -892,14 +953,11 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
attribs[i] = None;
GLX_surf->glx_drawable =
glXCreatePbuffer(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
attribs);
GLX_surf->glx_drawable = GLX_drv->glXCreatePbuffer(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)], attribs);
}
else if (GLX_dpy->have_pbuffer) {
GLX_surf->glx_drawable = GLX_dpy->glXCreateGLXPbufferSGIX(
GLX_dpy->dpy,
GLX_surf->glx_drawable = GLX_drv->glXCreateGLXPbufferSGIX(GLX_dpy->dpy,
GLX_dpy->fbconfigs[GLX_egl_config_index(conf)],
GLX_surf->Base.Width,
GLX_surf->Base.Height,
@@ -912,7 +970,7 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, _EGLDisplay *disp,
}
GLX_surf->destroy = (GLX_dpy->have_1_3) ?
glXDestroyPbuffer : GLX_dpy->glXDestroyGLXPbufferSGIX;
GLX_drv->glXDestroyPbuffer : GLX_drv->glXDestroyGLXPbufferSGIX;
return &GLX_surf->Base;
}
@@ -933,12 +991,11 @@ GLX_eglDestroySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
static EGLBoolean
GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
struct GLX_egl_display *GLX_dpy = GLX_egl_display(disp);
struct GLX_egl_surface *GLX_surf = GLX_egl_surface(draw);
(void) drv;
glXSwapBuffers(GLX_dpy->dpy, GLX_surf->glx_drawable);
GLX_drv->glXSwapBuffers(GLX_dpy->dpy, GLX_surf->glx_drawable);
return EGL_TRUE;
}
@@ -949,31 +1006,33 @@ GLX_eglSwapBuffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
static _EGLProc
GLX_eglGetProcAddress(_EGLDriver *drv, const char *procname)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
return (_EGLProc) glXGetProcAddress((const GLubyte *) procname);
return (_EGLProc) GLX_drv->glXGetProcAddress((const GLubyte *) procname);
}
static EGLBoolean
GLX_eglWaitClient(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
(void) dpy;
(void) ctx;
glXWaitGL();
GLX_drv->glXWaitGL();
return EGL_TRUE;
}
static EGLBoolean
GLX_eglWaitNative(_EGLDriver *drv, _EGLDisplay *dpy, EGLint engine)
{
(void) drv;
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
(void) dpy;
if (engine != EGL_CORE_NATIVE_ENGINE)
return _eglError(EGL_BAD_PARAMETER, "eglWaitNative");
glXWaitX();
GLX_drv->glXWaitX();
return EGL_TRUE;
}
@@ -981,16 +1040,90 @@ static void
GLX_Unload(_EGLDriver *drv)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
if (GLX_drv->handle)
dlclose(GLX_drv->handle);
free(GLX_drv);
}
static EGLBoolean
GLX_Load(_EGLDriver *drv)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
void *handle;
handle = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
if (!handle)
goto fail;
GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddress");
if (!GLX_drv->glXGetProcAddress)
GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddressARB");
if (!GLX_drv->glXGetProcAddress)
goto fail;
#define GET_PROC(proc_type, proc_name, check) \
do { \
GLX_drv->proc_name = (proc_type) \
GLX_drv->glXGetProcAddress((const GLubyte *) #proc_name); \
if (check && !GLX_drv->proc_name) goto fail; \
} while (0)
/* GLX 1.0 */
GET_PROC(GLXCREATECONTEXTPROC, glXCreateContext, EGL_TRUE);
GET_PROC(GLXDESTROYCONTEXTPROC, glXDestroyContext, EGL_TRUE);
GET_PROC(GLXMAKECURRENTPROC, glXMakeCurrent, EGL_TRUE);
GET_PROC(GLXSWAPBUFFERSPROC, glXSwapBuffers, EGL_TRUE);
GET_PROC(GLXCREATEGLXPIXMAPPROC, glXCreateGLXPixmap, EGL_TRUE);
GET_PROC(GLXDESTROYGLXPIXMAPPROC, glXDestroyGLXPixmap, EGL_TRUE);
GET_PROC(GLXQUERYVERSIONPROC, glXQueryVersion, EGL_TRUE);
GET_PROC(GLXGETCONFIGPROC, glXGetConfig, EGL_TRUE);
GET_PROC(GLXWAITGLPROC, glXWaitGL, EGL_TRUE);
GET_PROC(GLXWAITXPROC, glXWaitX, EGL_TRUE);
/* GLX 1.1 */
GET_PROC(GLXQUERYEXTENSIONSSTRINGPROC, glXQueryExtensionsString, EGL_TRUE);
GET_PROC(GLXQUERYSERVERSTRINGPROC, glXQueryServerString, EGL_TRUE);
GET_PROC(GLXGETCLIENTSTRINGPROC, glXGetClientString, EGL_TRUE);
/* GLX 1.3 */
GET_PROC(PFNGLXGETFBCONFIGSPROC, glXGetFBConfigs, EGL_FALSE);
GET_PROC(PFNGLXGETFBCONFIGATTRIBPROC, glXGetFBConfigAttrib, EGL_FALSE);
GET_PROC(PFNGLXGETVISUALFROMFBCONFIGPROC, glXGetVisualFromFBConfig, EGL_FALSE);
GET_PROC(PFNGLXCREATEWINDOWPROC, glXCreateWindow, EGL_FALSE);
GET_PROC(PFNGLXDESTROYWINDOWPROC, glXDestroyWindow, EGL_FALSE);
GET_PROC(PFNGLXCREATEPIXMAPPROC, glXCreatePixmap, EGL_FALSE);
GET_PROC(PFNGLXDESTROYPIXMAPPROC, glXDestroyPixmap, EGL_FALSE);
GET_PROC(PFNGLXCREATEPBUFFERPROC, glXCreatePbuffer, EGL_FALSE);
GET_PROC(PFNGLXDESTROYPBUFFERPROC, glXDestroyPbuffer, EGL_FALSE);
GET_PROC(PFNGLXCREATENEWCONTEXTPROC, glXCreateNewContext, EGL_FALSE);
GET_PROC(PFNGLXMAKECONTEXTCURRENTPROC, glXMakeContextCurrent, EGL_FALSE);
/* GLX_SGIX_pbuffer */
GET_PROC(PFNGLXCREATEGLXPBUFFERSGIXPROC,
glXCreateGLXPbufferSGIX, EGL_FALSE);
GET_PROC(PFNGLXDESTROYGLXPBUFFERSGIXPROC,
glXDestroyGLXPbufferSGIX, EGL_FALSE);
#undef GET_PROC
GLX_drv->handle = handle;
return EGL_TRUE;
fail:
if (handle)
dlclose(handle);
return EGL_FALSE;
}
/**
* This is the main entrypoint into the driver, called by libEGL.
* Create a new _EGLDriver object and init its dispatch table.
*/
_EGLDriver *
_eglMain(const char *args)
_EGL_MAIN(const char *args)
{
struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver);
@@ -999,6 +1132,12 @@ _eglMain(const char *args)
if (!GLX_drv)
return NULL;
if (!GLX_Load(&GLX_drv->Base)) {
_eglLog(_EGL_WARNING, "GLX: failed to load GLX");
free(GLX_drv);
return NULL;
}
_eglInitDriverFallbacks(&GLX_drv->Base);
GLX_drv->Base.API.Initialize = GLX_eglInitialize;
GLX_drv->Base.API.Terminate = GLX_eglTerminate;

View File

@@ -52,12 +52,40 @@ OBJECTS = $(SOURCES:.c=.o)
# use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
LOCAL_LIBS =
# egl_dri2 and egl_glx are built-ins
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += -lgbm
endif
EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
endif
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
endif
# translate --with-egl-platforms to _EGLPlatformType
EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
ifeq ($(firstword $(EGL_PLATFORMS)),wayland)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WAYLAND
endif
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
@@ -80,11 +108,12 @@ default: depend library
# EGL Library
library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
$(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-major $(EGL_MAJOR) -minor $(EGL_MINOR) \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(EGL_LIB_DEPS) $(OBJECTS)
-L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
$(OBJECTS) $(LOCAL_LIBS)
install-headers:
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR

View File

@@ -7,13 +7,23 @@ Import('*')
env = env.Clone()
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_BUILT_IN_DRIVER_GALLIUM',
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
if env['platform'] == 'windows':
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS',
'_EGL_OS_WINDOWS',
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
else:
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11',
'_EGL_OS_UNIX',
])
env.Append(CPPPATH = [
'#/include',
])
@@ -38,15 +48,9 @@ egl_sources = [
'eglsync.c',
]
egl = env.SharedLibrary(
target = 'libEGL',
source = egl_sources + ['egl.def'],
egl = env.ConvenienceLibrary(
target = 'egl',
source = egl_sources,
)
installed_egl = env.InstallSharedLibrary(egl, version=(1, 4, 0))
env.Alias('egl', installed_egl)
egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')]
Export('egl')

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* Public EGL API entrypoints
*
@@ -57,7 +87,6 @@
#include <stdlib.h>
#include <string.h>
#include "eglstring.h"
#include "eglcontext.h"
#include "egldisplay.h"
#include "egltypedefs.h"
@@ -294,16 +323,14 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
if (!_eglMatchDriver(disp, EGL_FALSE))
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
_eglsnprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)",
disp->APImajor, disp->APIminor, disp->Driver->Name);
/* limit to APIs supported by core */
disp->ClientAPIsMask &= _EGL_API_ALL_BITS;
disp->ClientAPIs &= _EGL_API_ALL_BITS;
}
/* Update applications version of major and minor if not NULL */
if ((major != NULL) && (minor != NULL)) {
*major = disp->APImajor;
*minor = disp->APIminor;
*major = disp->VersionMajor;
*minor = disp->VersionMinor;
}
RETURN_EGL_SUCCESS(disp, EGL_TRUE);
@@ -916,6 +943,10 @@ eglGetProcAddress(const char *procname)
#ifdef EGL_MESA_drm_image
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
#endif
#ifdef EGL_WL_bind_wayland_display
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif
{ NULL, NULL }
};
@@ -1167,7 +1198,7 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
EGLDisplay EGLAPIENTRY
eglGetDRMDisplayMESA(int fd)
{
_EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) fd);
_EGLDisplay *dpy = _eglFindDisplay(_EGL_PLATFORM_DRM, (void *) (intptr_t) fd);
return _eglGetDisplayHandle(dpy);
}
@@ -1494,3 +1525,43 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
}
#endif
#ifdef EGL_WL_bind_wayland_display
struct wl_display;
EGLBoolean EGLAPIENTRY
eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.BindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
EGLBoolean EGLAPIENTRY
eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
{
_EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLDriver *drv;
EGLBoolean ret;
_EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv);
assert(disp->Extensions.WL_bind_wayland_display);
if (!display)
RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
ret = drv->API.UnbindWaylandDisplayWL(drv, disp, display);
RETURN_EGL_EVAL(disp, ret);
}
#endif

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLAPI_INCLUDED
#define EGLAPI_INCLUDED
@@ -12,7 +42,7 @@ typedef void (*_EGLProc)(void);
*/
/* driver funcs */
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy, EGLint *major, EGLint *minor);
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, _EGLDisplay *dpy);
typedef EGLBoolean (*Terminate_t)(_EGLDriver *, _EGLDisplay *dpy);
/* config funcs */
@@ -95,6 +125,12 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c
typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride);
#endif
#ifdef EGL_WL_bind_wayland_display
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);
#endif
/**
* The API dispatcher jumps through these functions
*/
@@ -169,6 +205,11 @@ struct _egl_api
CreateDRMImageMESA_t CreateDRMImageMESA;
ExportDRMImageMESA_t ExportDRMImageMESA;
#endif
#ifdef EGL_WL_bind_wayland_display
BindWaylandDisplayWL_t BindWaylandDisplayWL;
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <stdlib.h>
#include <string.h>

View File

@@ -1,3 +1,31 @@
/**************************************************************************
*
* Copyright 2010 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLARRAY_INCLUDED
#define EGLARRAY_INCLUDED

View File

@@ -1,3 +1,32 @@
/**************************************************************************
*
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCOMPILER_INCLUDED
#define EGLCOMPILER_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* EGL Configuration (pixel format) functions.
*/
@@ -456,8 +486,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
return EGL_FALSE;
switch (attr) {
case EGL_MATCH_NATIVE_PIXMAP:
return EGL_FALSE;
case EGL_Y_INVERTED_NOK:
return conf->Display->Extensions.NOK_texture_from_pixmap;
default:
@@ -739,6 +767,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
{
if (!_eglIsConfigAttribValid(conf, attribute))
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
/* nonqueryable attributes */
switch (attribute) {
case EGL_MATCH_NATIVE_PIXMAP:
return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
break;
default:
break;
}
if (!value)
return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONFIG_INCLUDED
#define EGLCONFIG_INCLUDED

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include <assert.h>
#include <stdlib.h>
#include <string.h>

View File

@@ -1,3 +1,33 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
* Copyright 2010-2011 LunarG, 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, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef EGLCONTEXT_INCLUDED
#define EGLCONTEXT_INCLUDED

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