Commit Graph

55288 Commits

Author SHA1 Message Date
Tom Stellard 7cd248aa79 radeon/llvm: Fix build with LLVM 3.3 2013-02-19 15:52:55 +00:00
Tom Stellard 1f006717db r600g: Add $(DEFINES) to AM_CXXFLAGS
This way llvm_wrapper.cpp is compiled with -DHAVE_LLVM=0x....
2013-02-19 15:52:55 +00:00
Paul Berry 444246c7e3 i965: Remove unused userclip flags.
brw_vs_prog_data::userclip hasn't been used since commit f0cecd4
(i965: Move VUE map computation to once at VS compile time).

brw_gs_prog_key::userclip_active hasn't been used since commit 9f3d321
(i965: Make the userclip flag for the VUE map come from VS prog data).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-19 07:35:52 -08:00
Brian Paul dfbcb1849c llvmpipe: fix handling of 0 x 0 framebuffer size
Bump up the size to 1 x 1.  This fixes a number of potential failure
points in the code.

See also http://bugs.freedesktop.org/show_bug.cgi?id=61012
2013-02-19 07:19:19 -07:00
Brian Paul e2091f64cb st/xlib: initialize the drawable size in create_xmesa_buffer()
Otherwise, the PBuffer's size was never set.  This also initializes
the buffer size for windows, pixmaps, etc.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61012

Note: This is a candidate for the stable branches.
2013-02-19 07:19:19 -07:00
Stefan Brüns 5876a5dbc0 glx: fix glGetTexLevelParameteriv for indirect rendering
A single element in a GLX reply is contained in the header itself.
The number of elements is denoted in the "n" field of the reply.
If "n" is 1, the length of additional data is 0.
The XXX_data_length() function of xcb does not return the length of
the (optional, n>1) data but the number of elements.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=59876

Note: This is a candidate for the stable branches.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-19 07:19:19 -07:00
Brian Paul 63c30d7e4f st/mesa: implement glBitmap unpacking from a PBO, for the cache path
We weren't mapping the PBO when using the bitmap cache (but we had
the PBO code for the non-cache path.)

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026

Note: This is a candidate for the stable branches.
2013-02-19 07:19:19 -07:00
Brian Paul 5da967aff5 draw: fix non-perspective interpolation in interp()
This fixes a regression from ab74fee5e1.
When we use the clip coordinate to compute the screen-space interpolation
factor, we need to first apply the divide-by-W step to the clip
coordinate.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60938

Note: This is a candidate for the 9.1 branch.
2013-02-19 07:19:18 -07:00
Marek Olšák 07cdfdb708 st/mesa: remove what is left from u_blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák 40ee93c4e8 st/mesa: simplify and improve CopyTexSubImage
It has become a bit messy.

Changes:

- finally correct checking for transfer ops depending on the base format

- making sure the base internal format and the texture format match
  (we were ignoring it, but it's important for correctness)

- the way-too-strict rule that both src and dst base formats must be the same
  was dropped; ensuring the simpler and more permissive rule mentioned above
  is enough

- stop using util_blit_pixels; pipe->blit is flexible enough, and now that we
  have RGBX and red-alpha formats, pipe->blit can be used for more cases

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák 6520a86c67 st/mesa: don't do sRGB conversion in CopyTexSubImage
Assuming I understand EXT_texture_sRGB correctly.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák 0a1479c829 st/mesa: implement blit-based TexImage and TexSubImage
A temporary texture is created such that it matches the format and type
combination and pixels are copied to it using memcpy. Then the blit is used to
copy the temporary texture to the texture image being modified by TexImage or
TexSubImage. The blit takes care of the format and type conversion and
swizzling. The result is a very fast texture upload involving as little CPU
as possible.

This improves performance in apps which upload textures during rendering.
An example is the Wine OpenGL backend for DirectDraw, which I used to test
the game StarCraft. Profiling had shown that TexSubImage was taking 50% of
CPU time without this patch, which was the main motivation for this work, and
now TexSubImage only takes 14% of CPU time. I had to underclock my CPU to see
any difference in the game and this patch does make the game a lot faster
if the CPU is slow (or using the powersave cpufreq profile).

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák a6e0ac9571 st/mesa: fix blit-based GetTexImage for 1D array textures
This is not easy to hit, because we have 3 code paths now
(tried in this order):
- memcpy-based (skips the blit) -> _mesa_tex_getimage
- blit-based
- slow pixel packing -> _mesa_tex_getimage

The main difference later in the code is the parameters of
_mesa_image_address3d.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák 91acf6225a st/mesa: fix blit-based GetTexImage for depth/stencil formats
BTW, we have 0 tests for glGetTexImage(format=GL_DEPTH*).

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Marek Olšák 0181e18d0f st/mesa: factor out code for determining blit.mask from CopyTexSubImage
I'll need this later.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-18 17:57:41 +01:00
Michel Dänzer 9c1107b3e1 radeonsi: Fix PIPE_FORMAT_X32_S8X24_UINT sampler hardware format
4 more little piglits.

NOTE: This is a candidate for the 9.1 branch.
2013-02-18 15:59:02 +01:00
Michel Dänzer 8356962853 radeonsi: Use stencil surface level information for stencil texturing
7 more little dwarves^W piglits.

NOTE: This is a candidate for the 9.1 branch.
2013-02-18 15:58:37 +01:00
Michel Dänzer f9adf79876 radeonsi: properly implement S8Z24 depth-stencil format
Based on r600g commit 2b9659c9e6 .

Fixes crashes with 4 piglit tests which are now hitting these formats.

NOTE: This is a candidate for the 9.1 branch.
2013-02-18 15:58:05 +01:00
Vincent Lejeune 0527317e1f r600g/llvm: Support for TBO
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2013-02-18 15:08:59 +01:00
Vincent Lejeune c116598f86 r600g/llvm: Set Inputs/Outputs count to 32 (api reported value)
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2013-02-18 15:08:54 +01:00
Vincent Lejeune 90e6f47ac8 r600g/llvm: Fix alpha_to_one piglit tests
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2013-02-18 15:08:50 +01:00
Vincent Lejeune ef8fde6acb r600g/llvm: Add support for UBO
NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2013-02-18 15:08:45 +01:00
Christopher James Halse Rogers dd599188d2 i965: Fix leak in blorp CopyTexSubImage2D
_mesa_delete_renderbuffer does not call the driver-specific
renderbuffer delete function, so the blorp code was leaking the
Intel-specific bits, including some GEM objects.

Call the renderbuffer's ->Delete() method instead, which does the
right thing.

Fixes Unity rapidly sending the machine into the arms of the OOM-killer

Note: This is a candidate for the 9.1 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-16 08:11:14 -08:00
Roland Scheidegger f1ab67c13a gallivm/tgsi: fix issues with sample opcodes
We need to encode them as Texture instructions since the NumOffsets field
is encoded there. However, we don't encode the actual target in there, this
is derived from the sampler view src later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-16 02:40:59 +01:00
Roland Scheidegger cb2e678294 gallivm/tgsi: fix src modifier fetching with non-float types.
Need to take the type into account. Also, if we want to allow
mov's with modifiers we need to pick a type (assume float).

v2: don't allow all modifiers on all type, in particular don't allow
absolute on non-float types and don't allow negate on unsigned.
Also treat UADD as signed (despite the name) since it is used
for handling both signed and unsigned integer arguments and otherwise
modifiers don't work.
Also add tgsi docs clarifying this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-16 02:40:51 +01:00
Roland Scheidegger c25ae5d27b gallivm: fix issues with trunc/round/floor/ceil with no arch rounding
The emulation of these if there's no rounding instruction available
is a bit more complicated than what the code did.
In particular, doing fp-to-int/int-to-fp will not work if the exponent
is large enough (and with NaNs, Infs). Hence such values need to be filtered
out and the original value returned in this case (which fortunately should
always be exact). This comes at the expense of performance (if your cpu
doesn't support rounding instructions).
Furthermore, floor/ifloor/ceil/iceil were affected by precision issues for
values near negative (for floor) or positive (for ceil) zero, fix that as well
(fixing this issue might not actually be slower except for ceil/iceil if the
type is not signed which is probably rare - note iceil has no callers left
in any case).

Also add some new rounding test values in lp_test_arit to actually test
for that stuff (which previously would have failed without sse41).

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=59701.
2013-02-16 02:40:44 +01:00
Roland Scheidegger 70daad6a99 gallivm: DIV shouldn't be deprecated.
(Though it looks glsl won't emit it.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-16 02:40:36 +01:00
Matt Turner 00f6fe6c66 mesa: Use PROGRAM_ERROR_STRING_ARB instead of the _NV name
Since NV_fragment_program is now gone. No functional change, since the
values are identical.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-15 10:28:12 -08:00
Brian Paul 2ef530cf68 trace: add context pointer sanity checking
To help catch mixed up context pointer bugs in the future, add a
trace_context_check() function and some new assertions.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-15 11:11:34 -07:00
Brian Paul 82d62cf04f trace: fix incorrect trace_surface::base.context pointer
When a trace_surface object is created in trace_surf_create() we
weren't correctly setting the surface's context pointer.  Instead of
it being the trace context, it was the wrapped driver's context.
This caused things to blow up sometimes during surface deallocation.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-15 11:11:34 -07:00
Brian Paul 3b0de75c4d mesa: remove old version comment from gl.h 2013-02-15 09:25:15 -07:00
Brian Paul 70135e915a trace: whitespace, comment clean-ups 2013-02-15 09:25:15 -07:00
Brian Paul 7b836a7d25 trace: move struct tr_list to tr_texture.h
That's the only place it's used.
2013-02-15 09:25:15 -07:00
Brian Paul 4be5a06752 st/mesa: fix format query for GL_ARB_texture_rg
The GL_ARB_texture_rg spec says that we need to support both texturing
and rendering for the GL_RED and GL_RG formats.  So move the format
check up into the rendertarget_mapping[] list.  Also, add
PIPE_FORMAT_R8_UNORM to the list of formats required.

Note: This is a candidate for the stable branches.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-02-15 09:25:14 -07:00
Eric Anholt c37992c54d i965/fs: Do a general SEND dependency workaround for the original 965.
We'd been ad-hoc inserting instructions in some SEND messages with no
knowledge of when it was required (so extra instructions), but not all SENDs
(so not often enough).  This should do much better than that, though it's
still flow-control-ignorant.

v2: Use BRW_MAX_MRF instead of magic numbers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58960
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: Candidate for the stable branches.
2013-02-15 06:17:46 -08:00
Kristian Høgsberg 6dbe94c12c egl-wayland: Fix left-over wl_display_roundtrip() usage
We have to use the EGL wayland event queue for roundtrip, so use the
wayland_roundtrip() helper, which does just that.
2013-02-14 20:48:05 -05:00
Eric Anholt 5bb05c6e6d i965/gen7: Set up all samplers even if samplers are sparsely used.
In GLSL, sampler indices are allocated contiguously from 0.  But in the
case of ARB_fragment_program (and possibly fixed function), an app that
uses texture 0 and 2 will use sampler indices 0 and 2, so we were only
allocating space for samplers 0 and 1 and setting up sampler 0.  We
would read garbage for sampler 2, resulting in flickering textures and
an angry simulator.

Fixes bad rendering in 0 A.D. and ETQW.  This was fixed for pre-gen7 by
28f4be9eb9

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25201
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58680
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable branches.
2013-02-14 15:14:09 -08:00
Marek Olšák 34dc4d6b67 r600g: add support for red-alpha render targets 2013-02-14 14:59:36 +01:00
Marek Olšák ec5376f5d8 r300g: add support for red-alpha render targets 2013-02-14 14:59:36 +01:00
Marek Olšák 5d3b8ad24b st/mesa: try to find exact format matching user format and type for DrawPixels
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-14 14:51:46 +01:00
Marek Olšák 2b9659c9e6 r600g: properly implement S8Z24 depth-stencil format for Evergreen
I should say "fix", but it has never been used until now.
S8Z24 is the format equivalent to the GL_UNSIGNED_INT_24_8 packing,
so we'll start to see it more often with st/mesa now making smart decisions
about formats.

The DB<->CB copy can change the channel ordering for transfers, other than
that, the internal DB format doesn't really matter.

R600-R700 support is possible except shadow mapping.
FMT_24_8 is broken if the SAMPLE_C instruction is used (no idea why).

Also the sampler swizzling was broken in theory and the fact it worked was
a lucky coincidence.

radeonsi might need to port this.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2013-02-14 14:51:46 +01:00
Michel Dänzer c840270ebe radeonsi: Handle TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
8 more little piglits.

NOTE: This is a candidate for the 9.1 branch.
2013-02-14 10:51:44 +01:00
Michel Dänzer f34ad85765 radeonsi: Fix array indices for detecting integer vertex formats 2013-02-14 10:31:21 +01:00
Vinson Lee 0d5ce524ab glsl: Initialize ir_texture member variable.
Fixes uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-13 23:10:48 -08:00
Eric Anholt b8906adb66 intel: Allow blit readpixels even when the pack alignment is set.
The default alignment is 4, so this fast path was rarely hit.  Rather
than introduce logic to handle alignment, just use the Mesa core
function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46632
Cc: neil@linux.intel.com
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-13 18:10:20 -08:00
Eric Anholt 516d8be502 i965: Remove writemask support from brw_SAMPLE().
The code was rather broken for non-XYZW on 8-wide, but all of our
callers were using XYZW anyway.  For my experiments with using writemask
on texturing, I've been using manual header setup in the compiler
backends, since we want to actually know what registers are written for
optimization and register allocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-13 18:10:20 -08:00
Eric Anholt bf91f0b039 i965/fs: Use a helper function for checking for flow control instructions.
In 2 of our checks, we were missing BREAK and CONTINUE.

NOTE: Candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-13 17:47:06 -08:00
bma ce3dfa19ab shaderapi: Fix AttachShader error
Detect a duplicate Shader type as and error instead of silently allowing
it, restrict to ES2 API.

v2: Tapani Pälli <tapani.palli@intel.com>
    - make the check run time instead of compile time

v3: chadv
    - Quote spec on which error to generate.

Signed-off-by: bma <Bo.Ma@windriver.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
2013-02-13 14:09:47 -08:00
Tom Stellard 0898047e7b configure.ac: Add components to LLVM_COMPONENTS when using llvm shared libs
This is required when LLVM is built with CMake, which creates one
shared library for each component.
2013-02-13 17:01:08 -05:00
Eric Anholt cb4616d32d i965: Re-enable the -RHW workaround for original gen4 chips.
Fixes broken clipping in supertuxkart and presumably many other applications.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51471
NOTE: Candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-13 10:19:21 -08:00