Needs to update max_half_reg, or be remapped to full reg and update
max_reg accordingly, depending on generation..
Signed-off-by: Rob Clark <robdclark@chromium.org>
When discard_delayed_release is set (default), we allocate more buffers
and use a different buffer wait path.
Check if it is set, and use the old paths if not
(the alternative buffer wait path could still be used, but there is no
advantage to using it in this case).
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
thread_submit's throttling depending on the number of internal
back buffers, and wasn't affected by the driver requested
throttling value.
Now it is.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Optimize writeonly by passing PIPE_TRANSFER_WRITE
for these buffers instead of the safer
PIPE_TRANSFER_READ_WRITE.
This seems to improve the performance of d3d8 games
using d3d8to9.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
We used TGSI_SEMANTIC_FOG for fog,
however on vs/ps 3, fog is allowed to have
4 components (even on the ff pipeline according
to a wine test).
Since gallium's TGSI_SEMANTIC_FOG has only one
component, use TGSI_SEMANTIC_GENERIC instead.
Fixes:
https://github.com/iXit/Mesa-3D/issues/346
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
The shader constant buffer size with the
constant compaction code can vary depending
on the shader variant compiled (for example if
fog constants are required, etc).
Thus instead of using fixed size for the shader,
add in the variant cache the size required, pass it
to the context, and use this value.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
As with the constant compaction we map the constant
slots to new slots, we need to pass that information
to the context which is in charge of uploading
the constants.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
When indirect addressing is not used, we know exactly
which constants are accessed, and thus can
have them located in consecutive slots.
We thus parse again the shader with a slot map
for compaction.
The path contains the work inside nine_shader.c for this
path, but it needs some other commits to work, and thus
is not enabled yet by this commit.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>