Commit Graph

110721 Commits

Author SHA1 Message Date
Axel Davy 737df40a63 st/nine: Track constant slots used
This tracking will be useful for constant compaction

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy d2cab4562c st/nine: Refactor ct_ctor
The refactoring will make it easier to parse the shader
twice for the constant compaction path.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 6f3da226e6 st/nine: Make swvp_on imply IS_VS
swvp cannot happen with ps, thus it makes
sense to force it to false with ps.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy d57d1436d3 st/nine: Refactor shader constants ureg_src computation
Put the shader constant code in one place to better change
that code in future commits.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 6d86292f8a st/nine: Manually upload vs and ps constants
In future commits we will introduce more fine-grained
uploads

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 1ddeb43537 st/nine: use helper ureg_DECL_sampler everywhere
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 3717ec4157 st/nine: Compact pixel shader key
Compact the shader key to make room for new
elements.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 2acbd977d7 st/nine: Compact nine_ff_get_projected_key
Only the first four sampler slots can be used
by ff ps < 0x14, thus the size of the key
can be reduced.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy a92a43d41d st/nine: Refactor param->rel
Refactor param->rel to enable different paths
for constants and inputs relative addressing.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 5974401a4a st/nine: Regroup param->rel tests
Regroup all the param->rel assertions into one assertion for better clarity
and better covering.
param->rel on an input can only happen with float constants for vs,
or with inputs on vs/ps 3.0.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 12654a2fda st/nine: Control shader constant inlining with drirc
Until we use async shader compilation for constant inlining,
don't enable it unless user asks for it.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 95f25bef54 st/nine: Recompile optimized shaders based on b/i consts
Boolean and Integer constants are used in d3d9 for flow control.

Boolean are used for if/then/else and Integer constants
for loops.
The compilers can generate better code if these values are known
at compilation.
I haven't met so far a game that would change the values of these
constants frequently (and when they do, they set to the values used
for the previous draw call, and thus the changes get filtered out).

Thus it makes sense to inline these constants and recompile the shaders.
The commit sets a bound to the number of variants for a given shader
to avoid too many shaders to be generated.

One drawback is it means more shader compilations. It would probably
make sense to compile these shaders asynchronously or let the user
control the behaviour with an env var, but this is not done here.

The games I tested hit very few shader variants, and the performance
impact was negligible, but it could help for games with uber shaders.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy e57267a09e drirc: Add Gallium nine workaround for Rayman Legends
The game requires it to display many textures properly.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy c097ff3617 st/nine: Add drirc option to use data_internal for dynamic textures
dynamic textures seem to have predictable stride. This stride
should be the same as for a ram buffer.

It seems some game don't check the actual stride value, assuming
it to be the expected one.
Thus this workaround (protected by drirc option) is to use an intermediate
ram buffer.

Fixes Rayman Legends texture issues when enabled.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 7dcc85b46e st/nine: Support internal compressed format for volumes
Reuse the generic path to support compressed formats.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 1b0a7d0557 st/nine: Support internal compressed format for surfaces
Reuse the generic path to support compressed formats.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 22c41d2d81 st/nine: Refactor volume GetSystemMemPointer
It will make it easier to reuse in another place.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:51 +02:00
Axel Davy 85c9d92067 st/nine: Refactor surface GetSystemMemPointer
It will make it easier to reuse in another place.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 8ba4f73911 st/nine: rename *_conversion to *_internal
Rename these variables to a new name which will
fit new usages introduced in later commits.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 4a51a7c1da st/nine: Optimize volume upload with conversion
Use nine_context_box_upload instead of locking the pipe
for volume upload with format conversion.
nine_context_box_upload already handles format
conversion.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy fac3f99377 st/nine: Optimize surface upload with conversion
Use nine_context_box_upload instead of locking the pipe
for surface upload with format conversion.
nine_context_box_upload already handles format
conversion.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 4ca6b1dfd1 st/nine: Fix SINCOS input
SINCOS takes an input with replicated swizzle.
the swizzle can be on any component, not just x.
Enable it to read from any component, but also
use a temporary register to avoid dst/src aliasing.

No known game is fixed by this change as it seems
the input swizzle is commonly on x for this instruction,
and src and dst don't alias.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy f4ae483c44 st/nine: Ignore nooverwrite for systemmem
Systemmem has a specific behaviour we don't
mimick exactly.
That makes Halo feel free to use nooverwrite
with it all the time, even when reading again
at the same location.
Ignore nooverwrite to have proper synchronization.

Fixes: https://github.com/iXit/Mesa-3D/issues/348

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy fd3a870401 st/nine: Enable modifiers on ps 1.X texcoords
For many ps 1.X instructions, we were reading the
texcoords directly, instead of through tx_src_param,
resulting in modifiers getting ignored.
Use tx_src_param for all these instructions.

Fixes: https://github.com/iXit/Mesa-3D/issues/337

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 1fc0714039 st/nine: Always return OK on SetSoftwareVertexProcessing
This would need more tests to know exactly
if INVALIDCALL can be returned in some
situations.
It seems some games expect D3D_OK,
even when noop and illegal.

Fixes:
https://github.com/iXit/Mesa-3D/issues/302
https://github.com/iXit/Mesa-3D/issues/338

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy d9a4025fa3 st/nine: Finish if nooverwrite after normal mapping
d3d's nooverwrite and gallium's unsynchronized
have different semantics.
Indeed nooverwrite says the applications won't
write to locations needed by previous draws,
which is less strong than unsynchronized which
won't synchronize previous writes.

Thus in case app is locking without discard/nooverwrite,
then using nooverwrite, we need to add a
synchronization.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/29

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy e502c4d892 st/nine: Fix buffer/texture unbinding in nine_state_clear
Previously nine_state_clear was not using
NineBindBufferToDevice and NineBindTextureToDevice
to unbind buffers and textures (but used nine_bind)

This was resulting in an uncorrect bind count for these
resources.

Combined with
0ec4e5f630
Some buffers were scheduled to be uploaded directly
after they were locked (because the bind count incorrectly
assumed they were needed for the next draw call),
which resulted in uploads before the data was written.

To simplify a bit the code (and because I needed to
add a pointer to device),
remove the stateblock usage from nine_state_clear and
rename to nine_device_state_clear.

Fixes:
https://github.com/iXit/Mesa-3D/issues/345

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy bb3b8f8e01 st/nine: Upload managed buffers only at draw using them
When a draw call is emited, buffers in the
device->update_buffers list are uploaded.

This patch removes buffers from the list if they
are not bound anymore.

Behaviour found studying:
https://github.com/iXit/Mesa-3D/issues/345

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 5df96995ef st/nine: Upload managed textures only at draw using them
When a draw call is emited, textures in the
device->update_textures list are uploaded.

This patch removes textures from the list if they
are not bound anymore.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:50 +02:00
Axel Davy 394420ebb3 st/nine: Use FLT_MAX/2 for RCP clamping
This seems to fix Rayman (which adds things
to the RCP result, and thus gets an Inf),
while not having regressions.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:49 +02:00
Axel Davy 64a45ba7f8 st/nine: Fix D3DWindowBuffer_release for old wine nine support
No-one reported bugs for that, but is seems
c442dd7890
and previous commits used APIs not defined until
nine minor version 3.
This patch should prevent crash in this case.

Also turn off the resize feature in this case,
as we won't prevent a buffer leak anymore.

Cc: "19.0" mesa-stable@lists.freedesktop.org
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-04-30 19:18:49 +02:00
Eric Engestrom 0cff98c8a0 turnip: update to use the new features struct names
These were updated in version 1.1.106 of vulkan.h to make more sense
with the extension names.  We may as well keep with the times.

See also: 90108deb27 "anv: Update to use the new features struct names"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2019-04-30 16:55:38 +01:00
Eric Engestrom 941b2f4dcd radv: update to use the new features struct names
These were updated in version 1.1.106 of vulkan.h to make more sense
with the extension names.  We may as well keep with the times.

See also: 90108deb27 "anv: Update to use the new features struct names"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2019-04-30 16:55:18 +01:00
Eric Engestrom b80930a6fe anv: add support for VK_EXT_memory_budget
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-04-30 15:40:33 +00:00
Eric Engestrom 316964709e util: add os_read_file() helper
readN() taken from igt.
os_read_file() inspired by igt_sysfs_get()

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2019-04-30 15:40:33 +00:00
Rafael Antognolli 2fae99bcbd iris: Enable fast clear colors on gen11.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-30 08:31:44 -07:00
Rafael Antognolli cf3cadacdf iris: Update the surface state clear color address when available.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-30 08:31:44 -07:00
Rafael Antognolli 91bcbfc351 iris: Use the linear version of the surface format during fast clears.
Newer gens (> 9) will start doing the linear -> sRGB conversion of the
clear color for us, if we use a sRGB surface format. So let's make sure
that doesn't happen and keep the same semantics as before.

Even though the hardware could convert the clear color for us during
fast clear, that converted color is only used for sampling. For resolve,
the original color would be used (without the conversion). So we convert
it ourselves and the same converted color gets used for both sampling
and resolving, simplifying the whole logic.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-30 08:31:44 -07:00
Rafael Antognolli 56927a8cf5 iris: Support sRGB fast clears even if the colorspaces differ.
We were disabling fast clears if the view format had a different
colorspace than the resource format (sRGB vs linear or vice-versa). But
we actually support them if we use the view format to decide if we
should encode the clear color into sRGB colorspace.

Also add a missing linear -> sRGB surface format conversion (we don't
want the clear color to be encoded to sRGB again during resolve).

v2: Do not track sRGB colorspace during fast clears (Nanley).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-30 08:31:44 -07:00
Eric Engestrom abb2c7c9d3 egl: fixup autotools-specific wording
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Eric Engestrom fe73c74691 docs: haiku can be built using meson
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Eric Engestrom 88ed5f611d docs: use past tense when talking about autotools
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Eric Engestrom 46d6883a13 docs: replace autotools intructions with meson equivalent
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Eric Engestrom 1936bad9ec docs: drop autotools python information
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Eric Engestrom 8c7b8fcd0c docs: remove unsupported GL function name mangling
This was only supported in autotools, which has since been deleted.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 15:25:40 +00:00
Ian Romanick bfc6486819 mesa: Add missing display list support for GL_FOG_COORDINATE_SOURCE
Fixes: fe5d67d95f ("Implement EXT_fog_coord and EXT_secondary_color.")
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Cc: Brian Paul <brianp@vmware.com>
2019-04-30 07:52:59 -07:00
Alejandro Piñeiro 9b6a00e66e docs: document MESA_GLSL=errors keyword
Added with commit 0161691f35, still checked on shaderapi.c
_mesa_get_shader_flag method.

Fixes: 0161691f35 "mesa: add GLSL_REPORT_ERRORS debug flag"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-04-30 15:45:33 +01:00
Khem Raj da84d071a6 winsys/svga/drm: Include sys/types.h
vmw_screen.h uses dev_t which is defines in sys/types.h
this header is required to be included for getting dev_t
definition. This issue happens on musl C library, it is hidden
on glibc since sys/types.h is included through another
system headers

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2019-04-30 13:50:25 +01:00
Ross Burton 1c1efa4ca9 Revert "meson: drop GLESv1 .so version back to 1.0.0"
This patch claimed that the autotools build generates libGLESv1_CM.so.1.0.0, but
it doesn't:

es1api_libGLESv1_CM_la_LDFLAGS = \
        -no-undefined \
        -version-number 1:1 \
        $(GC_SECTIONS) \
        $(LD_NO_UNDEFINED)

Revert commit cc15460e18 to ensure that the
autotools and meson builds produce the same libraries.

Fixes: cc15460e18 "meson: drop GLESv1 .so version back to 1.0.0"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2019-04-30 13:49:20 +01:00
Juan A. Suarez Romero 8d621e8ff7 anv: enable descriptor indexing capabilities
This enables the remaining capabilities in SPV_EXT_descriptor_indexing.

Fixes: 6e230d7607 "anv: Implement VK_EXT_descriptor_indexing"

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2019-04-30 09:23:46 +02:00