The hash should only depend on the raw byte stream, not the entire DXBC
blob. Useful now since we can declare root signatures either through
DXBC blob or as RDAT object (which is raw).
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
offset_component_count was set to 0 for cubes, but GRAD path also
uses the variable to check how many components to use for GRAD.
OFFSET is not supported for cubes, so that's likely why it was bugged.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Gets better codegen, since compiler no longer has to assume
that negative indices can be generated, which means full 64-bit sign
extension and addressing math (slow).
Based on experiments, no native driver lets -1 indices work,
so it's safe to make the u32 assumption.
See test_root_descriptor_offset_sign as a justification for this change.
Also, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6562
for discussion on InBounds.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
For now, just keep the NV path as well. It's the exact same extension
basically as the KHR one.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes a number of issues observed in tessellation shaders,
and potentially geometry shaders, when inputs and/or outputs
are array variables.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Width + offset must not overflow in SPIR-V. SM 5+ is well-defined here.
It's enough to just clamp the width against 32 - offset in all cases.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Since we added validation here for FH4, this crashes now as vkd3d-compiler passes a NULL shader_interface_info.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Consider we have declarations of CB0 of size 36 and CB1 of size 153.
Previously we'd just return the struct of CB0 when accessing CB1 because it came first as we didn't consider the size.
Psychonauts 2 indexes into CB1 by constant values above 36.
There is no reason a compiler could not eliminate these reads as it is technically out of bounds for the underlying array type.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Lets calling code know if it should use ALLOW_VARYING_SUBGROUP_SIZE.
To avoid too much churn on pipeline caches, only add the flag when
needed.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
In control flow, we can force LOD 0.0 to avoid undefined result when
games sample with implicit LOD in non-quad uniform control flow.
Behavior on different implementations is:
- Helper lanes come to life and interpolate shader input.
- LOD is clamped to 0.0 in divergent control flow.
This hack is not safe in general, since we force 0.0 even when the
control flow is quad uniform.
This is the most practical solution for the problem for now.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Since we introduce side effects, avoid full late-Z for everything, which
is slow, and not necessarily correct either.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Otherwise we pass in a pointer which is bad, or a local value which is also illegal for some reason.
It has to be a "memory object declaration".
Found via. spirv-val
Signed-off-by: Joshua Ashton <joshua@froggi.es>
There are no output built-ins here, just per-vertex stuff passed directly to DS to deal with there.
Closes: #227
Signed-off-by: Joshua Ashton <joshua@froggi.es>