Emil Velikov [Sat, 7 Feb 2015 00:47:18 +0000 (00:47 +0000)]
docs: Add sha256 sums for the 10.4.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit
54da987baec25fbaf6975c93f197ddbfe65a303c)
Emil Velikov [Sat, 7 Feb 2015 00:17:09 +0000 (00:17 +0000)]
Add release notes for the 10.4.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit
62eb27ac8bbd979796f50e253f6c786d7d791242)
Eric Anholt [Fri, 30 Jan 2015 22:03:14 +0000 (14:03 -0800)]
nir: Fix broken fsat recognizer.
We've probably never seen this ridiculous pattern in the wild, so it
didn't matter.
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Eric Anholt [Wed, 28 Jan 2015 00:42:38 +0000 (16:42 -0800)]
nir: Slightly simplify algebraic code generation by reusing a struct.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Eric Anholt [Mon, 10 Nov 2014 22:26:14 +0000 (14:26 -0800)]
tgsi/ureg: Add missing some missing opcodes opcode_tmp.h
I wanted all of these for NIR-to-TGSI.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Eric Anholt [Fri, 7 Nov 2014 20:35:58 +0000 (12:35 -0800)]
tgsi/ureg: Move ureg_dst_register() to the header.
I wanted to use it for nir-to-tgsi. The equivalent ureg_src_register() is
also located here.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Marek Olšák [Sun, 1 Feb 2015 15:28:26 +0000 (16:28 +0100)]
gallium/u_tests: test a NULL buffer sampler view
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Marek Olšák [Sun, 1 Feb 2015 12:11:49 +0000 (13:11 +0100)]
gallium/u_tests: test a NULL constant buffer
This expects (0,0,0,0), though it can be changed to something else or allow
more than one set of values to be considered correct.
This is currently the radeonsi behavior.
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Marek Olšák [Sun, 1 Feb 2015 12:08:53 +0000 (13:08 +0100)]
gallium/u_tests: test a NULL texture sampler view
v2: allow one of the two values
Marek Olšák [Sun, 1 Feb 2015 12:05:14 +0000 (13:05 +0100)]
gallium/u_tests: restructure the only test, refactor out reusable code
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Marek Olšák [Sun, 1 Feb 2015 11:59:27 +0000 (12:59 +0100)]
gallium: run gallium tests if GALLIUM_TESTS=1 is set
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Marek Olšák [Thu, 5 Feb 2015 17:13:20 +0000 (18:13 +0100)]
gallium/postprocessing: fix crash at context destruction
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Xavier Bouchoux [Wed, 28 Jan 2015 01:31:58 +0000 (02:31 +0100)]
r600g/sb: fix a bug in constants folding optimisation pass
ADD R6.y.1, R5.w.1, ~1|
3f800000
ADD R6.y.2, |R6.y.1|, -0.0001|
b8d1b717
was wrongly being converted to
ADD R6.y.1, R5.w.1, ~1|
3f800000
ADD R6.y.2, R5.w.1, -1.0001|
bf800347
because abs() modifier was ignored.
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Xavier Bouchoux [Wed, 28 Jan 2015 01:20:51 +0000 (02:20 +0100)]
r600g: fix abs() support on ALU 3 source operands instructions
Since alu does not support abs() modifier on source operands, spill
and apply the modifiers to a temp register when needed.
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
David Heidelberg [Sun, 28 Dec 2014 00:11:14 +0000 (01:11 +0100)]
r300g: small code cleanup (v2)
v2: incorporated changes from Marek Olšák
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Iago Toral Quiroga [Tue, 20 Jan 2015 16:07:13 +0000 (17:07 +0100)]
glsl: GLSL ES identifiers cannot exceed 1024 characters
v2 (Ian Romanick)
- Move the check to the lexer before rallocing a copy of the large string.
Fixes the following 2 dEQP tests:
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_vertex
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_fragment
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Kenneth Graunke [Thu, 15 Jan 2015 10:05:18 +0000 (02:05 -0800)]
i965: Fix INTEL_DEBUG=shader_time for SIMD8 VS (and GS).
We were incorrectly attributing VS time to FS8 on Gen8+, which now use
fs_visitor for vertex shaders.
We don't hit this for geometry shaders yet, but we may as well add
support now - the fix is obvious, and we'll just forget later.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Kenneth Graunke [Thu, 5 Feb 2015 05:11:56 +0000 (21:11 -0800)]
i965/fs: Use inst->eot rather than opcodes in register allocation.
Previously, we special cased FB writes and URB writes in the register
allocation code. What we really wanted was to handle any message with
EOT set.
This saves us from extending the list with new opcodes in the future.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Kenneth Graunke [Thu, 5 Feb 2015 05:17:55 +0000 (21:17 -0800)]
i965/fs: Delete is_last_send(); just check inst->eot.
This helper function basically just checks inst->eot, but also asserts
that only opcodes we expect to terminate threads have EOT set. As far
as I'm aware, we've never had such a bug.
Removing it means that we don't have to extend the list for new opcodes.
Cherryview and Skylake introduce an optimization where sampler messages
can have EOT set; scalar GS/HS/DS will likely introduce new opcodes as
well.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Michel Dänzer [Thu, 5 Feb 2015 03:46:04 +0000 (12:46 +0900)]
st/mesa: Don't use PIPE_USAGE_STREAM for GL_PIXEL_UNPACK_BUFFER_ARB
The latter currently implies CPU read access, so only PIPE_USAGE_STAGING
can be expected to be fast.
Mesa demos src/tests/streaming_rect on Kaveri (radeonsi):
Unpatched: 42 frames in 1.023 seconds = 41.056 FPS
Patched: 615 frames in 1.000 seconds = 615.000 FPS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88658
Cc: "10.3 10.4" <mesa-stable@lists.freedestkop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tiziano Bacocco [Fri, 30 Jan 2015 12:51:44 +0000 (13:51 +0100)]
st/nine: Implement dummy vbo behaviour when vs is missing inputs
Use a dummy vertex buffer object when vs inputs have no corresponding
entries in the vertex declaration. This dummy buffer will give to the
shader float4(0,0,0,0).
This fixes several artifacts on some games.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
Axel Davy [Sat, 24 Jan 2015 16:58:28 +0000 (17:58 +0100)]
gallium/targets/d3dadapter9: Free card device
The drm fd wasn't released, causing a crash
for wine tests on nouveau, which seems to have
a bug when a lot of device descriptors are open.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sun, 11 Jan 2015 16:51:59 +0000 (17:51 +0100)]
gallium/targets/d3dadapter9: Release the pipe_screen at destruction.
We weren't releasing hal and ref, causing some issues (threads not released, etc)
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 10 Jan 2015 17:49:16 +0000 (18:49 +0100)]
gallium/targets/d3dadapter9: Fix device detection for render-nodes
When on a render node the unique ioctl doesn't work.
This patch drops the code to detect the device, which relied
on an ioctl, and replaces it by the mesa loader function.
The mesa loader function is more complete and won't fail for render-nodes.
Alternatively we could also have used the pipe cap to
determine the vendor and device id from the driver.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 24 Jan 2015 11:02:04 +0000 (12:02 +0100)]
st/nine: Dummy sampler should have a=1
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Fri, 23 Jan 2015 22:20:17 +0000 (23:20 +0100)]
st/nine: Fix update_framebuffer binding cbufs the pixel shader wouldn't render to
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Fri, 23 Jan 2015 22:51:32 +0000 (23:51 +0100)]
st/nine: Clear: better behave if rt_mask is different to the one of the framebuffer bound
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 21 Jan 2015 07:59:05 +0000 (08:59 +0100)]
st/nine: Fix multisampling support detection
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tiziano Bacocco [Tue, 20 Jan 2015 23:41:11 +0000 (00:41 +0100)]
st/nine: Fix enabled lights in stateblocks
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
Axel Davy [Mon, 19 Jan 2015 16:13:57 +0000 (17:13 +0100)]
st/nine: Fix depth stencil formats bindings flags.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Mon, 19 Jan 2015 15:20:35 +0000 (16:20 +0100)]
st/nine: Fix gpu memory leak in swapchain
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Mon, 19 Jan 2015 15:09:07 +0000 (16:09 +0100)]
st/nine: SetResourceResize should track nr_samples too
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tiziano Bacocco [Mon, 19 Jan 2015 14:40:22 +0000 (15:40 +0100)]
st/nine: D3DRS_FILLMODE set to 0 is D3DFILL_SOLID
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
Tiziano Bacocco [Mon, 19 Jan 2015 14:27:38 +0000 (15:27 +0100)]
st/nine: Setting D3DRS_ALPHAFUNC to 0 means D3DCMP_NEVER
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>
Axel Davy [Sun, 18 Jan 2015 10:05:34 +0000 (11:05 +0100)]
st/nine: Implement fallback behaviour when rts and ds don't match
This seems to be the behaviour on Win. Previous behaviour led
to different issues depending on the driver.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 17 Jan 2015 12:43:38 +0000 (13:43 +0100)]
st/nine: Fix present_buffers allocation
If has_present_buffers was false at first,
but after a device reset, it turns true (for
example if we begin to render to a multisampled
back buffer), there was a crash due to present_buffers
being uninitialised.
This patch fixes it.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Patrick Rudolph [Fri, 16 Jan 2015 07:17:07 +0000 (08:17 +0100)]
st/nine: Check for aligned offset in each vertex element
Fixes wine test test_vertex_declaration_alignment()
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Fri, 16 Jan 2015 06:34:36 +0000 (07:34 +0100)]
st/nine: Fix bufferoverflow in {Get|Set}PixelShaderConstantF
Previous code wasn't checking against the correct limit: 224
for sm3 hardware, but 256.
Fixes wine test test_pixel_shader_constant()
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Mon, 12 Jan 2015 16:58:14 +0000 (17:58 +0100)]
st/nine: Set [out] argument to NULL for some functions
Wine tests, and probably some apps, check for errors by checking for NULL
instead of error codes.
Fixes wine test test_surface_blocks()
Reviewed-by: Axel davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Thu, 15 Jan 2015 16:20:17 +0000 (17:20 +0100)]
st/nine: Remove duplicated debug message
Likely a rebase error
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Thu, 15 Jan 2015 08:43:33 +0000 (09:43 +0100)]
st/nine: Return E_FAIL for unused vertexdeclaration type
Add returncode E_FAIL.
Return E_FAIL for any vertexdeclaration element with type unused.
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Thu, 15 Jan 2015 08:18:25 +0000 (09:18 +0100)]
st/nine: Missing sanity check for CALLOC return E_OUTOFMEMORY if allocation of usage_map fails
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Axel Davy [Wed, 14 Jan 2015 11:41:16 +0000 (12:41 +0100)]
st/nine: Implement ATOC hack
ATOC is an hack for Alpha to coverage
that is supported by NV and Intel.
You need to check the support for it
with CheckDeviceFormat.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 14 Jan 2015 11:33:21 +0000 (12:33 +0100)]
st/nine: Implement AMD alpha to coverage
This D3D hack is supposed to be supported
by all AMD SM2+ cards. Apps use it without
checking if they are on AMD.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 14 Jan 2015 11:10:48 +0000 (12:10 +0100)]
st/nine: Add D3DFMT_DF16 support
This depth buffer format, like D3DFMT_INTZ, can be used to read
the depth buffer values when bound to a shader.
Some apps may use this format to get better performance when
they don't need the precision of INTZ (24 bits for depth, 8 for
stencil, whereas DF16 is just 16 bits for depth)
We don't add support for DF24 yet, because it implies support
for FETCH4, which we don't support for now.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 31 Dec 2014 16:26:05 +0000 (17:26 +0100)]
st/nine: Change the value of some advertised caps
These values are taken from wine.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Thu, 8 Jan 2015 14:11:19 +0000 (15:11 +0100)]
st/nine: NineDevice9_SetClipPlane: pPlane must be non-NULL
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 10 Jan 2015 14:11:30 +0000 (15:11 +0100)]
st/nine: Implement fallback for D3DFMT_D24S8, D3DFMT_D24X8 and D3DFMT_INTZ
Some drivers support PIPE_FORMAT_S8_UINT_Z24_UNORM,
some others PIPE_FORMAT_Z24_UNORM_S8_UINT, some both.
It doesn't matter which one we use, since the d3d formats
they map to aren't lockable (app can read it directly).
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 10 Jan 2015 13:58:03 +0000 (14:58 +0100)]
st/nine: Refactor format d3d9 to pipe conversion
Move the checks of whether the format is supported
into a common place.
The advantage is that allows to handle when a d3d9
format can be mapped to several formats, and that
cards don't support all of them.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 10 Jan 2015 11:38:02 +0000 (12:38 +0100)]
st/nine: Refactor nine_d3d9_to_pipe_format_map
The order of the format is changed to have
an increasing ordering of the d3d9 format values.
Some missing formats are added and matched to PIPE_FORMAT_NONE
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 10 Jan 2015 11:19:10 +0000 (12:19 +0100)]
st/nine: Improve CheckDeviceFormat debug output
Because the debug output of this function was cut in two parts,
sometimes the second part wasn't print when we would return earlier,
whereas we would like to get it.
The reason of the separation was that it's only at the end of the function
we can print what we map to the d3d9 arguments, but we can always retrieve
that info by hand.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 17:43:20 +0000 (18:43 +0100)]
st/nine: Implement RESZ hack
This D3D hack allows to resolve a multisampled
depth buffer into a single sampled one.
Note that the implementation is slightly incorrect.
When querying the content of D3DRS_POINTSIZE,
it should return the resz code if it has been set.
This behaviour will be implemented when state changes
will be reworked. For now the current behaviour is ok,
since apps use the D3DCREATE_PUREDEVICE flag when creating
the device, which means they won't read states and in exchange
get better performance.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 24 Jan 2015 22:33:07 +0000 (23:33 +0100)]
st/nine: fix early basetexture destruction
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Patrick Rudolph [Wed, 7 Jan 2015 18:26:39 +0000 (19:26 +0100)]
st/nine: Do not leak private data in volume9.
This->data was allocated by nine, but not freed.
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Patrick Rudolph [Tue, 6 Jan 2015 16:47:39 +0000 (17:47 +0100)]
st/nine: Check block alignment for compressed textures in NineSurface9_CopySurface
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Axel Davy [Wed, 7 Jan 2015 15:34:12 +0000 (16:34 +0100)]
st/nine: Commit sampler views again if srgb state changed.
This fixes a wine test and some minor visual issues on some games.
The patch is not optimal, there is probably a more efficient way to
fix this issue, but the code there already has some innefficiencies.
There is plans to rewrite that part of the code to make it more
efficient.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Thu, 8 Jan 2015 10:31:24 +0000 (11:31 +0100)]
st/nine: Fix use of D3DSP_NOSWIZZLE
D3DSP_NOSWIZZLE already contains the shift.
Detected with Clang.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 11:01:50 +0000 (12:01 +0100)]
st/nine: Check for the correct number of constants.
This removes unneeded hack for Anno 1404.
This app is not checking the number of supporting
constants, and rely on the shader compilation to fail
if it puts too many constants.
This patch also checks for the correct number of constants for ps.
Note that we don't check the official limitations for old vs and ps
versions. The restrictions were fixed, unlike for the number of vertex
shader constants for later versions. Likely apps use the correct number,
and it's not a problem for us if it wants use more.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 11:00:00 +0000 (12:00 +0100)]
st/nine: Introduce failure handling for shader parsing.
Instead of crashing on buggy shaders, we should return an error.
This patch introduces this behaviour in the case of invalid constant
access
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 10:21:00 +0000 (11:21 +0100)]
st/nine: Print warnings for r500 when shader is likely to go wrong
r500 hasn't enough float constants for vs to fill all needs.
Overlapping issues can happen with complex shaders.
The fix would be to recompile shaders to include the integer
and boolean constants, instead of reserving slots for them.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 10:12:56 +0000 (11:12 +0100)]
st/nine: Declare constants only up to the maximum needed.
Previously 276 constants were declared everytime.
This patch makes shaders declare constants up to the maximum
constant needed and moves the moment we print the TGSI
shader after the moment we declare the constants.
This is needed for r500, since when indirect addressing is used,
it cannot reduce the amount of constants needed, and that it is
restricted to 256 constant slots.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Wed, 7 Jan 2015 10:07:23 +0000 (11:07 +0100)]
st/nine: Refactor how user constbufs sizes are calculated
Count explicitly the slots for float, int and bool constants,
and deduce the constbuf size in nine_shader.
Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 3 Jan 2015 10:16:23 +0000 (11:16 +0100)]
st/nine: Explicit nine requirements
This patch raises nine requirements and disables nine for old
hw that don't match them.
Currently for these cards only games that don't have tight requirements
would work well with nine. However nine is missing several checks
regarding these limitations.
To make code and future patches less heavy, dropping support for these old
card seems a good solution.
That makes r500 the only dx9 generation cards supported by nine. It seems the one
with the less limitations for nine. Still not everything is ok, and we'll have
for example to implement shader recompilation for these cards to include
integer and boolean constants in the shader.
Eventually when this is done, we can reintroduce support for older cards.
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Axel Davy [Sat, 17 Jan 2015 13:30:17 +0000 (14:30 +0100)]
gallium: Add MULTISAMPLE_Z_RESOLVE cap
Resolving a multisampled depth texture into
a single sampled texture is supported on >= SM4.1
hw. It is possible some previous hw support it.
The ability was tested on radeonsi and nvc0.
Apparently is is also supported for radeon >= r700.
This patch adds the MULTISAMPLE_Z_RESOLVE cap and
add it to the drivers. It is advertised for drivers
for which it is sure the ability is supported.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Laura Ekstrand [Thu, 5 Feb 2015 00:36:24 +0000 (16:36 -0800)]
GL: Update glext.h to Revision 29735 (
20150202).
Khronos modified glext.h to get rid of GL_TEXTURE_BINDING, a special enum
added for ARB_direct_state_access. This enum was ruled unimplementable.
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Jose Fonseca [Thu, 5 Feb 2015 14:33:06 +0000 (14:33 +0000)]
llvmpipe: Trivially advertise PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT.
Nothing special needs to be done.
Even though llvmpipe copies constant (ie uniform) buffers internally, the
application is supposed to flush and sync, so all should work.
All bufferstorage piglit tests pass.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Matt Turner [Wed, 7 Jan 2015 20:01:43 +0000 (12:01 -0800)]
i965: Remove now unnecessary Gen8 CMP destination type override.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 7 Jan 2015 19:52:05 +0000 (11:52 -0800)]
i965: Set CMP's destination type to src0's type.
Allows CMP instructions with float sources to be compacted and coissued.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 4 Feb 2015 01:38:49 +0000 (17:38 -0800)]
i965/fs: Implement the WaCMPInstFlagDepClearedEarly work-around.
Prevents piglit regressions from the next patch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jose Fonseca [Wed, 4 Feb 2015 15:21:41 +0000 (15:21 +0000)]
gallium/util: Don't implement u_bit_scan64 on MSVC.
As ffsll doesn't exist in MSVC yet, and u_bit_scan64 is only used by
radeonsi which is never built with MSVC.
This is just a stop-gap fix to unbreak MSVC build until we refactor these
mathematical portability wrappers into src/util.
Trivial.
Jose Fonseca [Wed, 4 Feb 2015 14:58:20 +0000 (14:58 +0000)]
gallium/util: Define ffsll on MinGW.
Trivial.
(Fixing MSVC will be far less so, as _BitScanForward64 is only supported on x64.)
Marek Olšák [Sat, 31 Jan 2015 20:43:37 +0000 (21:43 +0100)]
radeonsi: implement polygon stippling
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Tue, 3 Feb 2015 11:49:19 +0000 (12:49 +0100)]
radeonsi: add polygon stipple texture slot
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 31 Jan 2015 19:09:46 +0000 (20:09 +0100)]
radeonsi: deduce rasterizer primitive type at the beginning of draw_vbo
I will need this for polygon stippling.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 31 Jan 2015 16:22:35 +0000 (17:22 +0100)]
radeonsi: allow 64 descriptors per array
We need a slot for the stipple texture and the pixel shader already uses
32 textures (16 API slots + 16 FMASK slots).
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 1 Feb 2015 13:38:48 +0000 (14:38 +0100)]
radeonsi: add support for sampler views where resource = NULL
The hardware obeys swizzles even if the resource is NULL.
This will be used by set_polygon_stipple.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 1 Feb 2015 12:16:45 +0000 (13:16 +0100)]
radeonsi: add support for NULL texture sampler views that return (0,0,0,1)
This used to hang.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 1 Feb 2015 12:16:06 +0000 (13:16 +0100)]
radeonsi: fix a crash when binding a NULL sampler view list
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 1 Feb 2015 15:58:08 +0000 (16:58 +0100)]
radeonsi: move the buffer descriptor to the end of the image descriptor
This will allow supporting NULL textures.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 31 Jan 2015 16:31:23 +0000 (17:31 +0100)]
radeonsi: don't use tgsi_parse_context to get processor type
Also remove unused "tokens".
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 31 Jan 2015 18:00:44 +0000 (19:00 +0100)]
radeonsi: fix instanced arrays with non-zero start instance
Fixes piglit ARB_base_instance/arb_base_instance-drawarrays.
Cc: 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 1 Feb 2015 12:47:01 +0000 (13:47 +0100)]
r600g,radeonsi: don't append to streamout buffers that haven't been used yet
The FILLED_SIZE counter is uninitialized at the beginning, so we can't use it.
Instead, use offset = 0, which is what we always do when not appending.
This unexpectedly fixes spec/ARB_texture_multisample/sample-position/*.
Yes, the test does use transform feedback.
Cc: 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 31 Jan 2015 17:58:19 +0000 (18:58 +0100)]
gallium: set PIPE_MAX_SAMPLERS to 18
For drivers that use higher slots not to crash in tgsi_shader_info.
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 31 Jan 2015 17:56:54 +0000 (18:56 +0100)]
gallium/u_pstipple: add ability to specify a fixed texture unit
E.g. r600g can use slot 17, which is outside of the API range.
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 31 Jan 2015 16:15:16 +0000 (17:15 +0100)]
gallium/util: add u_bit_scan64
Same as u_bit_scan, but for uint64_t.
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 31 Jan 2015 16:17:05 +0000 (17:17 +0100)]
tgsi: add tgsi_get_processor_type helper from radeon
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Tue, 3 Feb 2015 08:50:23 +0000 (00:50 -0800)]
i965/fs: Fix saturate on MAD and LRP with the NIR backend.
Fixes misrendering in "Witcher 2" with INTEL_USE_NIR=1, and probably
many other programs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Iago Toral Quiroga [Mon, 2 Feb 2015 12:59:27 +0000 (13:59 +0100)]
mesa: Fix _mesa_format_convert fallback path when src is not an array format
When a rebase swizzle is provided and we call _mesa_swizzle_and_convert
after unpacking the source format we were always passing normalized=false.
We should pass true or false depending on the formats involved in the
conversion for the byte and float paths (the integer path cannot ever be
normalized).
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Park, Jeongmin [Tue, 3 Feb 2015 02:52:03 +0000 (11:52 +0900)]
st/osmesa: Fix osbuffer->textures indexing
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88930
Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Connor Abbott [Tue, 3 Feb 2015 06:50:49 +0000 (01:50 -0500)]
i965/nir: use redundant phi optimization
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Connor Abbott [Tue, 3 Feb 2015 06:49:44 +0000 (01:49 -0500)]
nir: add an optimization to remove useless phi nodes
This removes phi nodes whose sources all point to the same thing.
Shader-db results:
total NIR instructions in shared programs:
2045293 ->
2041209 (-0.20%)
NIR instructions in affected programs: 126564 -> 122480 (-3.23%)
helped: 615
HURT: 0
total FS instructions in shared programs:
4321840 ->
4320392 (-0.03%)
FS instructions in affected programs: 24622 -> 23174 (-5.88%)
helped: 138
HURT: 0
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Jason Ekstrand [Tue, 3 Feb 2015 18:10:59 +0000 (10:10 -0800)]
nir/validate: Ensure that phi sources are SSA-only
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Jason Ekstrand [Tue, 3 Feb 2015 20:42:07 +0000 (12:42 -0800)]
nir/validate: Validate that only float ALU outputs are saturated
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Jason Ekstrand [Tue, 3 Feb 2015 20:41:36 +0000 (12:41 -0800)]
nir/lower_source_mods: Don't lower saturate for non-float outputs
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Jason Ekstrand [Thu, 22 Jan 2015 00:00:55 +0000 (16:00 -0800)]
i965/fs_nir: Get rid of get_alu_src
Originally, get_alu_src was supposed to handle resolving swizzles and
things like that. However, now that basically every instruction we have
only takes scalar sources, we don't really need it anymore. The only case
where it's still marginally useful is for the mov and vecN operations that
are left over from SSA form. We can handle those cases as a special case
easily enough. As a side-effect, we don't need the vec_to_movs pass
anymore.
v2 Jason Ekstrand <jason.ekstrand@intel.com>:
- Rework the way we detect if we need an extra copy for swizzling. The
old code involved a pile of confusing switch fall-throughs; we now use a
loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Tue, 23 Dec 2014 22:44:19 +0000 (14:44 -0800)]
i965/fs: Use NIR's scalarizing abilities and stop handling vectors
Now that we can scalarize with NIR, there's no need for all this code
anymore. Let's get rid of it and just do scalar operations.
v2: run copy prop before lowering phi nodes
v3: Get rid of the "emit(...)->saturate = foo" pattern
v4: Run alu_to_scalar as an optimization pass
total instructions in shared programs:
5998321 ->
5974070 (-0.40%)
instructions in affected programs: 732075 -> 707824 (-3.31%)
helped: 3137
HURT: 191
GAINED: 18
LOST: 0
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jason Ekstrand [Wed, 21 Jan 2015 23:23:32 +0000 (15:23 -0800)]
nir: Add a pass to lower vector phi nodes to scalar phi nodes
v2 Jason Ekstrand <jason.ekstrand@intel.com>:
- Add better comments
- Use nir_ssa_dest_init and nir_src_for_ssa more places
- Fix some void * casts
v3 Jason Ekstrand <jason.ekstrand@intel.com>:
- Rework the way we determine whether or not to sccalarize a phi node to
make the recursion non-bogus
- Treat load_const instructions as scalarizable
v4 Jason Ekstrand <jason.ekstrand@intel.com>:
- Allow uniform and input loads to be scalarizable
v5 Jason Ekstrand <jason.ekstrand@intel.com>:
- Also consider loads of inputs (varying, uniform, or ubo) to be
scalarizable. We were already doing this for load_var on uniforms and
inputs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Thu, 29 Jan 2015 02:37:32 +0000 (18:37 -0800)]
i965/fs: Add support for constant propagating into sources with modifiers.
All but 16 of the programs helped were ARB fp programs.
total instructions in shared programs:
5949286 ->
5945470 (-0.06%)
instructions in affected programs: 275162 -> 271346 (-1.39%)
helped: 1197
GAINED: 1
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 30 Jan 2015 23:13:48 +0000 (15:13 -0800)]
i965/vec4: Use abs/negate functions in const propagation.
No changes in shader-db.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Matt Turner [Fri, 30 Jan 2015 22:14:43 +0000 (14:14 -0800)]
i965: Add function to take the abs of immediates.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>