Commit graph

49245 commits

Author SHA1 Message Date
Stéphane Marchesin
11cdf24d15 i915g: Add missing draw_flush call.
Fixes a bunch of corruption bugs, especially some missing clipped triangles.
2011-12-28 12:36:26 -08:00
José Fonseca
62e968d6da mesa: Re-add main/bitset.h to fix classic nouveau build failure.
bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d798.
2011-12-28 11:14:52 +00:00
Mathias Fröhlich
196800d798 mesa: Remove now unused main/bitset.h.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
1ef3a94536 mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Since commit 82b9661894 and
34eae1c72a vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
ccbf192f59 mesa: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
45cd15bfae radeon: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
19c46d3d7b nouveau: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
b49b1e4642 i915: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
50e0091a9d mesa: Convert RENDERINPUTS* macros to GLbitfield64.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Stéphane Marchesin
b50d250e02 i915g: Only apply the optimization to output vars.
This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.
2011-12-27 17:08:26 -08:00
Kenneth Graunke
07ee9f374f i965/vs: Properly clear cur_value when propagating direct copies.
Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:38 -08:00
Kenneth Graunke
443c8d1ab7 i965/vs: Fix incorrect subscript when resetting copy propagation records.
In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3.  Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:37 -08:00
Chad Versace
7420c9dab4 i965: Create mock implementation of GL_OES_EGL_image_external
In Android IceCreamSandwich, SurfaceFlinger requires GL_OES_image_external
for basic compositing tasks. Without the extension, SurfaceFlinger fails
to start.

Despite the incompleteness of the extension's implementation introduced by
this patch, it is good enough to enable SurfaceFlinger and to unblock the
people who need to begin testing Mesa on IceCreamSandwich.

To enable the extension, set the environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external". Ideally, Android
should set this in init.rc.

WARNING: This implementation of GL_OES_EGL_image_external is not complete.
Some of it is even incorrect. When we begin to really implement
GL_OES_EGL_image_external, much of the patch will need reverting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Chad Versace
7e5ffd9be2 meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()
If the meta flag MESA_META_TEXTURE is present, then disable the texture
target GL_TEXTURE_EXTERNAL_OES.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Alexander von Gluck
ac8a933aa8 mklib: tab cleanup, no functional change
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:18:25 -07:00
Alexander von Gluck
a3752fa63b mesa: fpclassify is available on Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:56 -07:00
Alexander von Gluck
2e60c955c2 glu: remove BeOS define as BeOS is not longer a target platform
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:51 -07:00
Alexander von Gluck
9e4c8ce3bc gallium: use Mesa pthread_barrier_t on Haiku, as it is incomplete under Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:30 -07:00
Dave Airlie
157566860d gallium/u_pack: fix l8/i8 pack color ub
just noticed this in passing, not sure it actually fixes any issus.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 10:35:09 +00:00
Mathias Fröhlich
91d950bad1 vbo: Clean up recalculate_input_bindings.
Now the gl_array_object's layout matches the one used in
recalculate_input_bindings. Make use of this and remove the
bind_array_obj function.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 08:57:41 +01:00
Alexander von Gluck
a5608a5098 mklib: Add Haiku build support
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:23:03 -07:00
Johannes Obermayr
aa284042a3 Fix build with LLVM >= r145623.
This is a workaround for https://bugs.freedesktop.org/show_bug.cgi?id=43861.

Actually the issue which makes -pedantic failing should be solved.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:12:10 -07:00
Brian Paul
98dffd9764 swrast: assert _swrast_map_teximage() x, y is multiple of block size 2011-12-26 15:22:26 -07:00
Brian Paul
08a81c8697 swrast: replace assertion with conditional in _swrast_map_teximage()
Just in case we ran out of memory when trying to allocate the texture
memory.
2011-12-26 15:22:26 -07:00
Brian Paul
62f2d6ef03 mesa: fix signed/unsigned comparison warnings 2011-12-26 15:22:26 -07:00
Brian Paul
0a7602b938 vbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays
This fixes a regression seen with the isosurf demo when switching between
glBegin/End and glDrawArrays (do it several times).  The problem was the
driver wasn't getting _NEW_ARRAY when the arrays were subtly changed:
(vertex3f, normal3f) vs. (normal3f, vertex3f).

This patch fixes that by signaling _NEW_ARRAY whenever we transition
between glBegin/End and glDrawArrays mode and display lists.

The patch also fixes up the initialization of the map_vp_none[] array
to stop putting strange values in the last five elements of the array.

v2: remove DRAW_ELEMENTS, don't distinguish between glDrawArrays and
glDrawElements

v3: add DRAW_DISPLAY_LIST for the display list case, just to be safe.

Reviewed-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 15:21:32 -07:00
Mathias Fröhlich
31bf243a92 mesa: remove leftovers from color indexed rendering.
Remove gl_light::_dli and gl_light::_sli.
Both are only used for a value previously used in
color indexed rendering. Also both variables are only used
and never written.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:47:06 +01:00
Mathias Fröhlich
5584a8eb19 mesa: remove unused _mesa_copy_materials.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:46:56 +01:00
Christian König
7ac114f94a vl: call decode_bitstream only once
Submit all bitstreams at once to decode_bitstream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-26 16:37:47 +01:00
Yuanhan Liu
3aa3c3f758 i965: increase the brw eu instruction store size dynamically
Here is the final patch to enable dynamic eu instruction store size:
increase the brw eu instruction store size dynamically instead of just
allocating it statically with a constant limit. This would fix something
that 'GL_MAX_PROGRAM_INSTRUCTIONS_ARB was 16384 while the driver would
limit it to 10000'.

v2: comments from ken, do not hardcode the eu limit to (1024 * 1024)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:24:42 +08:00
Yuanhan Liu
8d1b378939 i965: call next_insn() before referencing a instruction by index
A single next_insn may change the base address of instruction store
memory(p->store), so call it first before referencing the instruction
store pointer from an index.

This the final prepare work to enable the dynamic store size.

v2: comments from Ken, define emit_endif as bool type

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:23:12 +08:00
Yuanhan Liu
328e6a5497 i965: get the jmp distance by instruction index
If dynamic instruction store size is enabled, while after the brw_JMPI()
and before the brw_land_fwd_jump() function, the eu instruction store
base address(p->store) may change. Thus, the safe way to reference the
jmp instruction is by index instead of by the instruction address.

v2: comments from Eric, don't change the prototype of brw_JMPI

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:21:56 +08:00
Yuanhan Liu
0a17093eaf i965: let the if_stack just store the instruction index
If dynamic instruction store size is enabled, while after
the brw_IF/ELSE() and before the brw_ENDIF() function, the
eu instruction store base address(p->store) may change.

Thus let if_stack just store the instruction index. This is
somehow more flexible and safe than store the instruction
memory address.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-26 11:19:17 +08:00
Marek Olšák
2175634e73 r600g: fix a warning that a variable may be uninitialized 2011-12-25 10:18:48 +01:00
Marek Olšák
1b9577b833 gallium: remove PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS
It's the same as PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-25 10:18:47 +01:00
Marek Olšák
ec9b154b8c st/mesa: use a cast wrapper function to get st_transform_feedback_object 2011-12-25 10:18:43 +01:00
Marek Olšák
7191298829 st/mesa: DrawTFB should use the vertex count from the last call of EndTFB
From ARB_transform_feedback2:
    ... the vertex count used for the rendering operation is
    set by the previous EndTransformFeedback command.
2011-12-25 09:24:51 +01:00
Marek Olšák
ec4851253b r300g: mapping buffers for read should be unsynchronized
The GPU never uses them for write.
2011-12-24 21:28:43 +01:00
Marek Olšák
93f4e3cb6c winsys/radeon: move managing GEM domains back to drivers
This partially reverts commit 363ff84475.

It caused severe performance drops in Nexuiz. Reported by Phoronix.

Tested by me on r300g and by IRC people on r600g.
2011-12-24 21:28:43 +01:00
Paul Berry
e6e9becd50 i965 gen6: Fix incorrect order of dwords in gen6_update_sol_indices()
When updating SOL indices, we were accidentally putting the starting
index in dword 1 and the SVBI number to increment in dword 2--these
should be reversed.  Usually both of these values are zero, so we
didn't see any problem.  However, if a transform feedback operation
spans multiple batch buffers, the starting index will be nonzero.

Fixes piglit test "EXT_transform_feedback/intervening-read output".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Paul Berry
b31f62c907 i965 gen6: Fix transform feedback of triangle strips.
When rendering triangle strips, vertices come down the pipeline in the
order specified, even though this causes alternate triangles to have
reversed winding order.  For example, if the vertices are ABCDE, then
the GS is invoked on triangles ABC, BCD, and CDE, even though this
means that triangle BCD is in the reverse of the normal winding order.
The hardware automatically flags the triangles with reversed winding
order as _3DPRIM_TRISTRIP_REVERSE, so that face culling and two-sided
coloring can be adjusted to account for the reversed order.

In order to ensure that winding order is correct when streaming
vertices out to a transform feedback buffer, we need to alter the
ordering of BCD to BDC when the first provoking vertex convention is
in use, and to CBD when the last provoking vertex convention is in
use.

To do this, we precompute an array of indices indicating where each
vertex will be placed in the transform feedback buffer; normally this
is SVBI[0] + (0, 1, 2), indicating that vertex order should be
preserved.  When the primitive type is _3DPRIM_TRISTRIP_REVERSE, we
change this order to either SVBI[0] + (0, 2, 1) or SVBI[0] + (1, 0,
2), depending on the provoking vertex convention.

Fixes piglit tests "EXT_transform_feedback/tessellation
triangle_strip" on Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Brian Paul
5c818c6277 mesa: consolidate texstore functions
The code for storing 1D, 2D and 3D tex images (whole or sub-images) was
all pretty similar.  This consolidates those six paths.

v2: rework switch statement to catch unexpected targets

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
afebe13986 mesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAY
For 1D arrays, map each slice separately.  Note that this was handled
correctly in _mesa_store_teximage2d() but not here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
9b26aa4c7a mesa: update comment for MapTextureImage() 2011-12-24 09:25:41 -07:00
Brian Paul
c60ac7b179 swrast: rewrite glDrawPixels(GL_DEPTH) with zoom
This gets rid of another renderbuffer->PutRow() call and _DepthBuffer
usage.  We always work with 32-bit uint Z values now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:41 -07:00
Brian Paul
bf0c0ccbc9 swrast: stop using _DepthBuffer in triangle code
The only consequence is we can only use the occlusion_zless_16_triangle()
function with MESA_FORMAT_Z16.
2011-12-24 09:25:40 -07:00
Brian Paul
7a7b521ff2 mesa: remove gl_renderbuffer::PutRowRGB()
No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
6e7bc79578 swrast: stop using PutRowRGB() in triangle code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
743c664c8c swrast: refactor/rewrite fast_draw_rgba_pixels()
Use Map/UnmapRenderbuffer() for the special, optimized cases we care about.

Note that we're dropping some seldom-used cases in the new fast-path
code: as CI->RGB conversion and zooming.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:36 -07:00
Brian Paul
e66858fb67 swrast: move swrast_render_start/finish() call in drawpixels code
We don't want to call these functions where we'll be using
Map/UnmapRenderbuffer().  So push them further down in the drawpixels
cases so that we can switch over to Map/UnmapRenderbuffer() step by step.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00