Commit Graph

17630 Commits

Author SHA1 Message Date
Roland Scheidegger 67906f91c9 llvmpipe: first steps of adding dual source blend support
This adds support of the additional blending factors to the blend function
itself, and also enables testing of it in lp_test_blend (which passes).
Still need to add the glue code of linking fs shader outputs to blend inputs
in llvmpipe, and probably need to add special handling if destination doesn't
include alpha (which lp_test_blend doesn't test).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-08 16:32:30 -08:00
Roland Scheidegger 8e44f4117a llvmpipe: refactoring of visibility counter handling
There can be other per-thread data than just vis_counter, so pass a struct
around instead (some of our non-public code uses this already and this
difference is a major cause of merge pain).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-08 16:32:30 -08:00
Jerome Glisse 3310acdf47 xorg: fix exa finish access
The exa core will already set the pointer to NULL prior calling
the callback function. So don't bail out in the callback if it's
already NULL.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-02-08 19:01:19 -05:00
Vinson Lee 7c544e55da nv30: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-07 21:45:01 -08:00
Michel Dänzer c093f12406 radeonsi: Handle scaled and integer formats for samplers and vertex elements.
Also, add assertions to stress that render targets don't support scaled
formats.

20 more little piglits.
2013-02-07 19:07:43 +01:00
Michel Dänzer 23405ef467 radeonsi: Don't advertise PIPE_FORMAT_L8A8_SRGB support.
The hardware can't do it.
2013-02-07 19:07:43 +01:00
Michel Dänzer a9816cc784 radeonsi: Remove incorrect (and dead) assignment in tex_fetch_args().
The proper return type is assigned at the end of the function.
2013-02-07 19:07:43 +01:00
Michel Dänzer 07eddc444c radeonsi: Use unique names for referring to texture sampling intrinsics.
Append the overloaded vector type used for passing in the addressing
parameters.

Without this, LLVM uses the same function signature for all those types,
which cannot work.

Fixes problems e.g. with FlightGear and Red Eclipse.
2013-02-07 19:07:43 +01:00
Marek Olšák 74a17a764d r300g: put textures with usage=staging in GTT and make them linear 2013-02-07 17:43:19 +01:00
Jerome Glisse 681707abf2 r600g: fix slice tile max for compressed texture and async dma
Was using the pixel size instead of the number of block for the slice
tile max computation which resulted in dma writing at wrong address.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-02-07 10:42:22 -05:00
Marek Olšák 9ba1e23647 radeonsi: use new RGBX formats 2013-02-07 00:20:24 +01:00
Marek Olšák 4dc142d521 r300g: fix blending and alpha-test with RGBX16F and enable MSAA for it 2013-02-07 00:20:24 +01:00
Marek Olšák 27e216a075 r300g: use new RGBX formats 2013-02-07 00:20:24 +01:00
Marek Olšák 3c351b7c33 r600g: use new RGBX formats 2013-02-07 00:20:24 +01:00
Marek Olšák 70bf7bae1d gallium: add RGBX formats for existing GL RGB texture formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-07 00:20:23 +01:00
Brian Paul 48b01e6a10 llvmpipe: remove extraneous const qualifier 2013-02-06 09:16:58 -07:00
Marek Olšák bc2ceb97f1 gallium/util: remove duplicated function util_format_is_rgb_no_alpha
It only checks if alpha is present, so it's the same as util_format_has_alpha.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:32 +01:00
Marek Olšák cf37aef414 r600g: report correct control flow depth 2013-02-06 14:51:31 +01:00
Marek Olšák 85efb2fff0 r300g: try to use color varyings for texcoords if max texcoord limit is exceeded
+35 piglits
2013-02-06 14:45:22 +01:00
Marek Olšák 1d3561d877 r300/compiler: copy-propagate saturate mode when possible
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-02-06 14:45:20 +01:00
Marek Olšák ae8696c7ee r300/compiler: add support for saturate output modifier in r500 vertex shaders
The GLSL compiler can simplify clamp(v,0,1) to saturate. The state tracker
doesn't use it yet, but it will.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-02-06 14:45:16 +01:00
Marek Olšák 499f7de12e r300g: fix blending with RGBX formats
Change DST_ALPHA to ONE.
2013-02-06 14:31:23 +01:00
Marek Olšák f40a7fc34a r300g: fix blending with blend color and RGBA formats
NOTE: This is a candidate for the stable branches.
2013-02-06 14:31:23 +01:00
Brian Paul ff60509157 svga: fix sRGB rendering
We weren't emitting the SVGA_RS_OUTPUTGAMMA state so sRGB rendering
didn't work properly.

Fixes piglit's framebuffer-srgb test.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-05 12:34:55 -07:00
Tom Stellard 8aaee4d64e r600g/compute: Fix segfault caused by new shader disassembler 2013-02-05 15:41:33 +00:00
Alex Deucher af0af75881 radeonsi: default PA_SC_RASTER_CONFIG to 0
That should work in all cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
2013-02-04 15:44:07 -05:00
Alex Deucher 83e4407f44 radeonsi: add support for Oland chips
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch
2013-02-04 15:43:21 -05:00
Quentin Glidic 11bd1b0f58 gallium/egl: Fix include dirs for VPATH build
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-04 10:36:50 -08:00
Brian Paul 13f3ae5b83 gallium/drivers: handle PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED query
Initially, only softpipe/llvmpipe support SQRT.
2013-02-04 09:33:44 -07:00
Brian Paul 2d367e40d9 gallivm: implement support for SQRT opcode 2013-02-04 09:33:44 -07:00
Brian Paul ad30e4545b tgsi: add support for new SQRT opcode 2013-02-04 09:33:44 -07:00
Brian Paul d276a40e15 gallium: add SQRT shader opcode
The glsl-to-tgsi translater will emit SQRT to implement GLSL's sqrt()
and distance() functions if the PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED
query says it's supported by the driver.

Otherwise, sqrt(x) is implemented with x*rsq(x).  The problem with
this is sqrt(0) must be handled specially because rsq(0) might be
Inf/NaN/undefined (and then 0*rsq(0) is Inf/Nan/undefined).  In the
glsl-to-tgsi code we use an extra CMP to check if x is zero and then
replace the result of x*rsq(x) with zero.

In the end, this makes sqrt() generate much more reasonable code for
drivers that can do square roots.

Note that many of piglit's generated shader tests use the GLSL
distance() function.
2013-02-04 09:33:44 -07:00
Michel Dänzer 6455d40b7e radeonsi: Remove spurious traces of R16G16B16 support.
The hardware can't do it, and these were causing warnings in some piglit tests.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:26 +01:00
Michel Dänzer 6bcb823844 radeonsi: Enable texture arrays.
28/30 piglit tests pass.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Michel Dänzer 120efeef8b radeonsi: Improve packing of texture address parameters.
In particular, the LOD bias and depth comparison values are packed before the
'normal' texture coordinates, and the array slice and LOD values are appended.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Michel Dänzer e5fb7347a7 radeonsi: Adapt to sample intrinsics changes.
Fix up intrinsic names, and bitcast texture address parameters to integers.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Andreas Boll 38d65a9769 gallium: handle unhandled PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60098

Signed-off-by: Brian Paul <brianp@vmware.com>
2013-02-04 08:28:17 -07:00
Vinson Lee 8a4d952d10 r600g: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-01 22:52:22 -08:00
Vinson Lee cea341fce8 nv30: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-01 22:50:26 -08:00
Vinson Lee 4cd4deab48 nv50: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-01 22:50:16 -08:00
Vinson Lee 0580f165ed nvc0: Fix memory leak.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-01 22:50:01 -08:00
Tom Stellard 257006e2a4 r600g/llvm: Select the correct GPU type for RV670
RV670 belongs in the R600 chip class

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

NOTE: This is a candidate for the 9.1 branch
2013-02-01 22:53:30 +00:00
Michel Dänzer a8a5055f2d radeonsi: Fix draws using user index buffer.
Was broken since commit bf469f4edc
('gallium: add void *user_buffer in pipe_index_buffer').

Fixes 11 piglit tests and lots of missing geometry e.g. in TORCS.

NOTE: This is a candidate for the 9.1 branch.
2013-02-01 18:53:03 +01:00
Brian Paul 3cb4915344 svga: check for NaN shader immediates
The svga device doesn't handle them.  Replace with zeros.
Fixes several piglit tests, such as "glsl-const-builtin-inversesqrt".

Reviewed-by: Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-02-01 08:00:28 -07:00
Brian Paul 9eff5e905f svga: add, use SVGA3D_SURFACE_HINT_VOLUME flag
Reviewed-by: Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-02-01 08:00:28 -07:00
Brian Paul 9a91ce9448 trace: measure time for each gallium call
To get a rough idea of how much time is spent in each gallium driver
function.  The time is measured in microseconds.
2013-02-01 08:00:28 -07:00
Brian Paul b516bf46ef trace: add void to function definition 2013-02-01 08:00:28 -07:00
Brian Paul fe20e3ebb5 trace: allow GALLIUM_TRACE=stdout/stderr 2013-02-01 08:00:28 -07:00
Marek Olšák 225228a7f5 radeonsi: port some of get_shader_param changes from r600g
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-01 15:16:35 +01:00
Marek Olšák a06f03d795 r300g: always put MSAA resources in VRAM
This along with the latest drm-fixes branch should help with bad performance
of MSAA. Remember: Nx MSAA can't be more than N times slower (where N=2,4,6).

Anyway, I recommend at least 512 MB of VRAM for Full HD 6x MSAA.

NOTE: This is a candidate for the 9.1 branch.
2013-02-01 15:16:35 +01:00