Commit Graph

48669 Commits

Author SHA1 Message Date
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
Brian Paul
d9d0d4198f swrast: new fast_draw_depth_stencil() for glDrawPixels(GL_DEPTH_STENCIL)
Stop using deprecated renderbuffer PutRow() function.  Note that we
aren't using Map/UnmapRenderbuffer() yet because this call is inside
a swrast_render_start/finish() pair.

v2: use _mesa_pack_uint_24_8_depth_stencil_row(), per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
826f36b1d8 swrast: remove the copy_depth_stencil_pixels() function
Hopefully glCopyPixels(GL_DEPTH_STENCIL) will be handled by the
fast copy function.  Otherwise, just do the copy with separate
depth + stencil copies.  That's effectively what the removed code
did anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00
Brian Paul
e6c6b1c147 swrast: stop using depth/stencil wrappers in CopyPixels code
The functions that read depth/stencil values understand all (packed)
depth/stencil buffer formats now so there's no reason to use the
wrappers.

Also, improve the format checks in fast_copy_pixels() to catch mismatched
depth/stencil cases.

v2: fix the test for combined depth+stencil buffers, per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
bd31fb3463 swrast: remove needless assignment in draw_depth_stencil_pixels()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
7cf2d75d4f swast: replace renderbuffer->GetPointer() with _swrast_pixel_address()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
242fd9df3b swrast: use _swrast_pixel_address() helper function
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:50 -07:00
Brian Paul
d00d39a016 swrast: rewrite stencil test code
Stop using the deprecated renderbuffer Get/Put Row/Values functions.
Consolidate code paths, etc.  The file is nearly half the size it used
to be!

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8b913bda3a swrast: remove dead code in s_stencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
70df474941 swrast: rewrite _swrast_read_stencil_span()
Use format pack/unpack functions instead of deprecated renderbuffer
GetRow/PutRow functions.

v2: use get_stencil_address(), s/destVals/newVals/

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
4d6b0927ab swrast: rewrite _swrast_read_depth_span_float()
Stop using the deprecated renderbuffer GetRow() function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
82f28c0a12 mesa: rewrite _swrast_depth_bounds_test()
Stop using the deprecated renderbuffer functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
29a9983969 swrast: rewrite depth-testing code
Consolidate code, stop using the deprecateted renderbuffer Put/Get
Row/Values() functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8e7c388b31 swrast: stop using _swrast_get_values() in z/depth code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
e23e8cbf39 swrast: stop using _swrast_get_values() in stencil code
That function will go a way in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
89fb81d521 swrast: do fast_copy_pixels() with Map/UnmapRenderbuffer()
v2: use memmove() instead of memcpy() in case of overlap

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
95970677b9 swrast: replace GetRow() call with _mesa_unpack_ubyte_stencil_row()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
fc41473b9f mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers.  The later wasn't used
anywhere!  Remove them and all implementations of those functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
c4b5f0cadb swrast: rewrite color buffer clearing to use Map/UnmapRenderbuffer()
v2: use _mesa_pack_colormask() helper and fix incorrect masking arithmetic

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
f1a2aa5cb3 mesa: add _mesa_pack_colormask()
For generating bit-wise colormasks for arbitrary pixel formats.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
488d7fc67d mesa: add _mesa_get_format_max_bits()
Returns max bits per channel for the given format.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fd104a8459 swrast: do depth/stencil clearing with Map/UnmapRenderbuffer()
Another step toward getting rid of the renderbuffer PutRow/etc functions.

v2: fix assorted depth/stencil clear bugs found by Eric

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fb758aab27 mesa: split get_tex_rgba() into compressed/uncompressed versions
This just splits one big function into two smaller ones for better
readability.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
5e6a6e49e9 mesa: fix comments in getteximage_error_check() 2011-12-24 08:00:29 -07:00
Jian Zhao
26195c8417 mesa: move the format and type check before select_tex_image()
Move the format and type check before select_tex_image, or it will fail to
report the mismatch error if the teximage is null.

Reported-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Jian Zhao <jian.j.zhao@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-24 08:00:29 -07:00
Maarten Lankhorst
1fdecef886 vl: Fix inverted logic in vlc checks
Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-24 15:36:46 +01:00
Alexandre Demers
3258cd9e61 egl,glx,wgl: Fixes stapi->createContext usage
Fixed the build failure, fixed a warning where attributs and error arguments had
been
inverted and fixed another call that was missing an argument.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 11:11:33 +00:00