| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Enable the required capabilities to use Vulkan 1.0 without validation
errors and disable those that are not compatible with it.
|
|\
| |
| | |
video_core: Remove unused variables
|
| |
| |
| |
| | |
Silences several compiler warnings about unused variables.
|
|/
|
|
|
| |
This stops shaders from failing to build when the exceed host's shared
memory size limit. An error is logged.
|
|
|
|
|
| |
Implement atomic operations on images.
On GLSL these are atomicImage* functions (e.g. atomicImageAdd).
|
|
|
|
|
|
| |
This is the equivalent of an image buffer on OpenGL.
- Used by Octopath Traveler
|
|\
| |
| | |
vk_rasterizer: Implement constant attributes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Constant attributes (in OpenGL known disabled attributes) are not
supported on Vulkan, even with extensions. To emulate this behavior we
return zero on reads from disabled vertex attributes in shader code.
This has no caching cost because attribute formats are not dynamic state
on Vulkan and we have to store it in the pipeline cache anyway.
- Fixes Animal Crossing: New Horizons terrain borders
|
| |
| |
| |
| |
| | |
This silences an assertion we were hitting and uses workgroup memory
barriers when the game requests it.
|
|\ \
| | |
| | | |
shader/other: Implement BAR.SYNC 0x0
|
| | |
| | |
| | |
| | |
| | | |
Trivially implement this particular case of BAR. Unless games use OpenCL
or CUDA barriers, we shouldn't hit any other case here.
|
|\ \ \
| | | |
| | | | |
shader_decompiler: Visit source nodes even when they assign to RZ
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Some operations like atomicMin were ignored because they returned were
being stored to RZ. This operations have a side effect and it was being
ignored.
|
| |/ /
| | |
| | |
| | |
| | | |
Atomic instructions can be used without returning anything and this is
valid code. Remove the assert.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Hardware S2R special registers match gl_Thread*MaskNV. We can trivially
implement these using Nvidia's extension on OpenGL or naively stubbing
them with the ARB instructions to match. This might cause issues if the
host device warp size doesn't match Nvidia's. That said, this is
unlikely on proper shaders.
Refer to the attached url for more documentation about these flags.
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_thread_group.txt
|
|/
|
|
|
| |
This allows us to use native SPIR-V instructions without having to
manually check for NAN.
|
|\
| |
| | |
shader/texture: Support multiple unknown sampler properties
|
| | |
|
|/ |
|
|\
| |
| | |
shader/memory: Implement RED.E.ADD and minor changes to ATOM
|
| |
| |
| |
| |
| |
| |
| |
| | |
Implements a reduction operation. It's an atomic operation that doesn't
return a value.
This commit introduces another primitive because some shading languages
might have a primitive for reduction operations.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Credits go to gdkchan and Ryujinx. The pull request used for this can
be found here: https://github.com/Ryujinx/Ryujinx/pull/1082
yuzu was already using the header for interpolation, but it was missing
the FragCoord.w multiplication described in the linked pull request.
This commit finally removes the FragCoord.w == 1.0f hack from the shader
decompiler.
While we are at it, this commit renames some enumerations to match
Nvidia's documentation (linked below) and fixes component declaration
order in the shader program header (z and w were swapped).
https://github.com/NVIDIA/open-gpu-doc/blob/master/Shader-Program-Header/Shader-Program-Header.html
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Co-Authored-By: Mat M. <mathew1800@gmail.com>
|
| |
|
| |
|
| |
|
|\
| |
| | |
vk_shader_decompiler: Implement indexed textures
|
| |
| |
| |
| |
| |
| |
| | |
Implement accessing textures through an index. It uses the same
interface as OpenGL, the main difference is that Vulkan bindings are
forced to be arrayed (the binding index doesn't change for stacked
textures in SPIR-V).
|
|/
|
|
|
| |
While changing this, fix assert in vk_shader_decompiler. We now know
scaled formats are expected to be float in shaders attributes.
|
|\
| |
| | |
vk_shader_decompiler: Implement Layer output attribute
|
| |
| |
| |
| |
| |
| | |
SPIR-V's Layer is GLSL's gl_Layer. It lets the application choose from a
shader stage (vertex, tessellation or geometry) which framebuffer layer
write the output fragments to.
|
|\ \
| | |
| | | |
vk_shader: Implement ImageLoad
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| | |
Please enter the commit message for your changes. Lines starting
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Vulkan's VertexIndex and InstanceIndex don't match with hardware. This
is because Nvidia implements gl_VertexID and gl_InstanceID. The math
that relates these is:
gl_VertexIndex = gl_BaseVertex + gl_VertexID
gl_InstanceIndex = gl_InstanceIndex + gl_InstanceID
To emulate it using what Vulkan's SPIR-V offers (the *Index variants)
this commit substracts gl_Base* from gl_*Index to obtain the OpenGL and
hardware's equivalent.
|
|\
| |
| | |
Partially implement Indexed samplers in general and specific code in GLSL
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ATOM operates atomically on global memory. For now only add ATOM.ADD
since that's what was found in commercial games.
This asserts for ATOM.ADD.S32 (handling the others as unimplemented),
although ATOM.ADD.U32 shouldn't be any different.
This change forces us to change the default type on SPIR-V storage
buffers from float to uint. We could also alias the buffers, but it's
simpler for now to just use uint. While we are at it, abstract the code
to avoid repetition.
|
|/
|
|
|
|
|
|
|
| |
Some games like The Legend of Zelda: Breath of the Wild assign
render targets without writing them from the fragment shader. This
generates Vulkan validation errors, so silence these I previously
introduced a commit to set "vec4(0, 0, 0, 1)" for these attachments. The
problem is that this is not what games expect. This commit reverts that
change.
|
|
|
|
| |
Also updates sirit to include atomic instructions.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This commit introduces a mechanism by which shader IR code can be
amended and extended. This useful for track algorithms where certain
information can derived from before the track such as indexes to array
samplers.
|
|\
| |
| | |
vk_shader_decompiler: Misc changes
|
| |
| |
| |
| |
| | |
When full decompilation was enabled, labels were not being inserted and
instructions were misused. Fix these bugs.
|
| |
| |
| |
| |
| | |
Avoid changing gl_Position when the NDC used by the game is [0, 1]
(Vulkan's native).
|
| |
| |
| |
| |
| |
| | |
Some games write from fragment shaders to an unexistant framebuffer
attachment or they don't write to one when it exists in the framebuffer.
Fix this by skipping writes or adding zeroes.
|
| | |
|
|/
|
|
|
|
|
|
| |
ExprCondCode visit implements the generic Visit. Use this instead of
that one.
As an intended side effect this fixes unwritten memory usages in cases
when a negation of a condition code is used.
|
|
|
|
| |
Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Update Sirit and its usage in vk_shader_decompiler. Highlights:
- Implement tessellation shaders
- Implement geometry shaders
- Implement some missing features
- Use native half float instructions when available.
|
|\
| |
| | |
Implement FLO & TXD Instructions on GPU Shaders
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|\
| |
| | |
gl_shader_decompiler/vk_shader_decompiler: Resolve implicit fallthrough cases
|
| |
| |
| |
| |
| | |
This would previously result in NeverExecute and UnusedIndex being
treated as regular predicates.
|
|/
|
|
|
| |
These parameters aren't actually modified in any way, so they can be
made const references.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
In the process remove implementation of SUATOM.MIN and SUATOM.MAX as
these require a distinction between U32 and S32. These have to be
implemented with imageCompSwap loop.
|
|
|
|
|
| |
* Implement SULD as float.
* Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
|
| |
|
|\
| |
| | |
vk_device: Add miscellaneous features and minor style changes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Increase minimum Vulkan requirements
* Require VK_EXT_vertex_attribute_divisor
* Require depthClamp, samplerAnisotropy and largePoints features
* Search and expose VK_KHR_uniform_buffer_standard_layout
* Search and expose VK_EXT_index_type_uint8
* Search and expose native float16 arithmetics
* Track current driver with VK_KHR_driver_properties
* Query and expose SSBO alignment
* Query more image formats
* Improve logging overall
* Minor style changes
* Minor rephrasing of commentaries
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement VOTE using Nvidia's intrinsics. Documentation about these can
be found here
https://developer.nvidia.com/reading-between-threads-shader-intrinsics
Instead of using portable ARB instructions I opted to use Nvidia
intrinsics because these are the closest we have to how Tegra X1
hardware renders.
To stub VOTE on non-Nvidia drivers (including nouveau) this commit
simulates a GPU with a warp size of one, returning what is meaningful
for the instruction being emulated:
* anyThreadNV(value) -> value
* allThreadsNV(value) -> value
* allThreadsEqualNV(value) -> true
ballotARB, also known as "uint64_t(activeThreadsNV())", emits
VOTE.ANY Rd, PT, PT;
on nouveau's compiler. This doesn't match exactly to Nvidia's code
VOTE.ALL Rd, PT, PT;
Which is emulated with activeThreadsNV() by this commit. In theory this
shouldn't really matter since .ANY, .ALL and .EQ affect the predicates
(set to PT on those cases) and not the registers.
|
|
|
|
|
| |
This commit takes care of implementing the F16 Variants of the
conversion instructions and makes sure conversions are done.
|
| |
|
|\
| |
| | |
gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shaders
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit implements gl_ViewportIndex and gl_Layer in vertex and
geometry shaders. In the case it's used in a vertex shader, it requires
ARB_shader_viewport_layer_array. This extension is available on AMD and
Nvidia devices (mesa and proprietary drivers), but not available on
Intel on any platform. At the moment of writing this description I don't
know if this is a hardware limitation or a driver limitation.
In the case that ARB_shader_viewport_layer_array is not available,
writes to these registers on a vertex shader are ignored, with the
appropriate logging.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Hardware testing revealed that SSY and PBK push to a different stack,
allowing code like this:
SSY label1;
PBK label2;
SYNC;
label1: PBK;
label2: EXIT;
|
|
|
|
|
|
|
|
|
| |
Instead of having a vector of unique_ptr stored in a vector and
returning star pointers to this, use shared_ptr. While changing
initialization code, move it to a separate file when possible.
This is a first step to allow code analysis and node generation beyond
the ShaderIR class.
|
|\
| |
| | |
vk_device,vk_shader_decompiler: Miscellaneous changes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix missing OpSelectionMerge instruction. This caused devices loses on
most hardware, Intel didn't care.
Fix [-1;1] -> [0;1] depth conversions.
Conditionally use VK_EXT_scalar_block_layout. This allows us to use
non-std140 layouts on UBOs.
Update external Vulkan headers.
|
|/ |
|
|\
| |
| | |
shader: Implement AL2P and ALD.PHYS
|
| | |
|
|/ |
|
|\
| |
| | |
shader_ir/decode: Miscellaneous fixes to half-float decompilation
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Operations done before the main half float operation (like HAdd) were
managing a packed value instead of the unpacked one. Adding an unpacked
operation allows us to drop the per-operand MetaHalfArithmetic entry,
simplifying the code overall.
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|