Commit Graph

43230 Commits

Author SHA1 Message Date
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