summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Review 1Kelebek12021-02-151-2/+2
|
* Implement texture offset support for TexelFetch and TextureGather and add offsets for TldsKelebek12021-02-151-7/+24
| | | | Formatting
* video_core: Fix clang build issuesReinUsesLisp2021-02-131-1/+5
|
* video_core: Reimplement the buffer cacheReinUsesLisp2021-02-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
* vk_shader_decompiler: Show comments as OpUndef with a typeReinUsesLisp2021-01-161-1/+4
| | | | | | | | | Silence the new validation layer error about SPIR-V not allowing OpUndef on a OpTypeVoid, even when the SPIR-V spec doesn't say anything against it. They will be inserted as an undefined int to avoid SPIRV-Cross and validation errors, but only when a debugging tool is attached.
* renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp2021-01-041-1/+1
|
* renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp2021-01-031-3/+3
| | | | | | | The "VK" prefix predates the "Vulkan" namespace. It was carried around the codebase for consistency. "VKDevice" currently is a bad alias with "VkDevice" (only an upcase character of difference) that can cause confusion. Rename all instances of it.
* vulkan_instance: Allow different Vulkan versions and enforce 1.1ReinUsesLisp2020-12-311-9/+2
| | | | | | | For listing the available physical devices we can use Vulkan 1.0. Now that MoltenVK supports 1.1 we can require it for running games. Add missing documentation.
* video_core: Rewrite the texture cacheReinUsesLisp2020-12-301-3/+3
| | | | | | | | | | | | | | The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
* vk_shader_decompiler: Silence warning when compiling without assertsReinUsesLisp2020-12-251-0/+1
|
* video_core: Make use of ordered container contains() where applicableLioncash2020-12-071-2/+1
| | | | | | With C++20, we can use the more concise contains() member function instead of comparing the result of the find() call with the end iterator.
* video_core: Remove unnecessary enum class casting in logging messagesLioncash2020-12-071-4/+4
| | | | | | | fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
* video_core: Resolve more variable shadowing scenarios pt.2Lioncash2020-12-051-14/+14
| | | | | | | Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
* vk_shader_decompiler: Implement force early fragment testsReinUsesLisp2020-11-261-3/+3
| | | | | | | | Force early fragment tests when the 3D method is enabled. The established pipeline cache takes care of recompiling if needed. This is implemented only on Vulkan to avoid invalidating the shader cache on OpenGL.
* cleanup unneeded comments and newlinesameerj2020-11-251-6/+0
|
* Refactor MaxwellToSpirvComparison. Use Common::BitCastameerj2020-11-251-27/+29
| | | | Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
* Address PR feedback from Reinameerj2020-11-251-28/+22
|
* vulkan_renderer: Alpha Test Culling Implementationameerj2020-11-251-2/+52
| | | | Used by various textures in many titles, e.g. SSBU menu.
* vk_device: Use Vulkan 1.0 properlyReinUsesLisp2020-08-201-2/+10
| | | | | Enable the required capabilities to use Vulkan 1.0 without validation errors and disable those that are not compatible with it.
* Merge pull request #4394 from lioncash/unused6bunnei2020-07-241-3/+2
|\ | | | | video_core: Remove unused variables
| * video_core: Remove unused variablesLioncash2020-07-211-3/+2
| | | | | | | | Silences several compiler warnings about unused variables.
* | renderer_{opengl,vulkan}: Clamp shared memory to host's limitReinUsesLisp2020-07-161-3/+9
|/ | | | | This stops shaders from failing to build when the exceed host's shared memory size limit. An error is logged.
* vk_shader_decompiler: Implement atomic image operationsReinUsesLisp2020-06-021-40/+24
| | | | | Implement atomic operations on images. On GLSL these are atomicImage* functions (e.g. atomicImageAdd).
* vk_rasterizer: Implement storage texelsReinUsesLisp2020-06-021-26/+49
| | | | | | This is the equivalent of an image buffer on OpenGL. - Used by Octopath Traveler
* Merge pull request #3930 from ReinUsesLisp/animal-bordersbunnei2020-06-011-10/+20
|\ | | | | vk_rasterizer: Implement constant attributes
| * vk_rasterizer: Implement constant attributesReinUsesLisp2020-05-131-10/+20
| | | | | | | | | | | | | | | | | | | | 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
* | shader/other: Implement MEMBAR.CTSReinUsesLisp2020-05-271-3/+4
| | | | | | | | | | This silences an assertion we were hitting and uses workgroup memory barriers when the game requests it.
* | Merge pull request #3981 from ReinUsesLisp/barbunnei2020-05-261-0/+17
|\ \ | | | | | | shader/other: Implement BAR.SYNC 0x0
| * | shader/other: Implement BAR.SYNC 0x0ReinUsesLisp2020-05-221-0/+17
| | | | | | | | | | | | | | | Trivially implement this particular case of BAR. Unless games use OpenCL or CUDA barriers, we shouldn't hit any other case here.
* | | Merge pull request #3978 from ReinUsesLisp/write-rzbunnei2020-05-261-3/+4
|\ \ \ | | | | | | | | shader_decompiler: Visit source nodes even when they assign to RZ
| * | | shader_decompiler: Visit source nodes even when they assign to RZReinUsesLisp2020-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | vk_shader_decompiler: Don't assert for void returnsReinUsesLisp2020-05-221-2/+1
| |/ / | | | | | | | | | | | | Atomic instructions can be used without returning anything and this is valid code. Remove the assert.
* / / shader/other: Implement thread comparisons (NV_shader_thread_group)ReinUsesLisp2020-05-221-0/+23
|/ / | | | | | | | | | | | | | | | | | | | | 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
* / shader_ir: Separate float-point comparisons in ordered and unorderedReinUsesLisp2020-05-091-1/+26
|/ | | | | This allows us to use native SPIR-V instructions without having to manually check for NAN.
* Merge pull request #3693 from ReinUsesLisp/clean-samplersbunnei2020-05-021-36/+36
|\ | | | | shader/texture: Support multiple unknown sampler properties
| * shader_ir: Turn classes into data structuresReinUsesLisp2020-04-231-36/+36
| |
* | shader/arithmetic_integer: Implement CC for IADDReinUsesLisp2020-04-261-0/+11
|/
* Merge pull request #3612 from ReinUsesLisp/redFernando Sahmkow2020-04-151-25/+40
|\ | | | | shader/memory: Implement RED.E.ADD and minor changes to ATOM
| * shader/memory: Implement RED.E.ADDReinUsesLisp2020-04-061-25/+40
| | | | | | | | | | | | | | | | 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.
* | renderer_vulkan: Drop Vulkan-HppReinUsesLisp2020-04-111-1/+1
| |
* | shader_decompiler: Remove FragCoord.w hack and change IPA implementationReinUsesLisp2020-04-021-10/+7
|/ | | | | | | | | | | | | | | | 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
* vk_decompiler: add atomic op and handler function.Nguyen Dac Nam2020-03-301-6/+25
|
* vk_shader_decompiler: fix linux buildmakigumo2020-03-151-1/+1
|
* vk/gl_shader_decompiler: Silence assertion on computeReinUsesLisp2020-03-131-3/+6
|
* vk_shader_decompiler: Fix default varying regressionReinUsesLisp2020-03-131-2/+6
|
* vk_shader_decompiler: Fix implicit type conversionRodrigo Locatti2020-03-131-1/+1
| | | Co-Authored-By: Mat M. <mathew1800@gmail.com>
* vk_shader_decompiler: Add XFB decorations to generic varyingsReinUsesLisp2020-03-131-16/+89
|
* vk_device: Shrink formatless capability name sizeReinUsesLisp2020-03-131-2/+2
|
* vk_shader_decompiler: Use registry for specializationReinUsesLisp2020-03-131-12/+22
|
* Merge pull request #3451 from ReinUsesLisp/indexed-texturesbunnei2020-03-051-8/+18
|\ | | | | vk_shader_decompiler: Implement indexed textures
| * vk_shader_decompiler: Implement indexed texturesReinUsesLisp2020-02-241-8/+18
| | | | | | | | | | | | | | 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).
* | video_core: Implement more scaler attribute formatsReinUsesLisp2020-02-241-4/+2
|/ | | | | While changing this, fix assert in vk_shader_decompiler. We now know scaled formats are expected to be float in shaders attributes.
* Merge pull request #3424 from ReinUsesLisp/spirv-layerbunnei2020-02-231-6/+30
|\ | | | | vk_shader_decompiler: Implement Layer output attribute
| * vk_shader_decompiler: Implement Layer output attributeReinUsesLisp2020-02-161-6/+30
| | | | | | | | | | | | 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.
* | Merge pull request #3434 from namkazt/patch-2Rodrigo Locatti2020-02-211-2/+14
|\ \ | | | | | | vk_shader: Implement ImageLoad
| * | clang-formatNguyen Dac Nam2020-02-201-1/+1
| | |
| * | shader_decompiler: only add StorageImageReadWithoutFormat when availableNguyen Dac Nam2020-02-201-1/+4
| | |
| * | shader_decompiler: add check in case of device not support ShaderStorageImageReadWithoutFormatNguyen Dac Nam2020-02-191-0/+4
| | |
| * | vk_shader: add Capability StorageImageReadWithoutFormatNguyen Dac Nam2020-02-191-0/+1
| | |
| * | vk_shader: Implement function ImageLoad (Used by Kirby Start Allies)Nguyen Dac Nam2020-02-191-2/+6
| |/ | | | | | | Please enter the commit message for your changes. Lines starting
* / vk_shader_decompiler: Fix vertex id and instance idReinUsesLisp2020-02-141-4/+13
|/ | | | | | | | | | | | | 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.
* Merge pull request #3282 from FernandoS27/indexed-samplersbunnei2020-02-021-0/+19
|\ | | | | Partially implement Indexed samplers in general and specific code in GLSL
| * Shader_IR: Address feedback.Fernando Sahmkow2020-01-251-2/+3
| |
| * Shader_IR: Correct Custom Variable assignment.Fernando Sahmkow2020-01-241-0/+2
| |
| * Shader_IR: Implement Injectable Custom Variables to the IR.Fernando Sahmkow2020-01-241-0/+16
| |
* | shader/memory: Implement ATOM.ADDReinUsesLisp2020-01-261-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp2020-01-241-13/+16
|/ | | | | | | | | 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.
* vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-VReinUsesLisp2020-01-191-3/+11
| | | | Also updates sirit to include atomic instructions.
* shader/memory: Implement ATOMS.ADD.U32ReinUsesLisp2020-01-161-0/+7
|
* Shader_IR: Address FeedbackFernando Sahmkow2020-01-041-14/+4
|
* Shader_IR: add the ability to amend code in the shader ir.Fernando Sahmkow2019-12-301-0/+18
| | | | | | | 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.
* Merge pull request #3237 from ReinUsesLisp/vk-shader-decompilerFernando Sahmkow2019-12-221-38/+45
|\ | | | | vk_shader_decompiler: Misc changes
| * vk_shader_decompiler: Fix full decompilationReinUsesLisp2019-12-191-3/+5
| | | | | | | | | | When full decompilation was enabled, labels were not being inserted and instructions were misused. Fix these bugs.
| * vk_shader_decompiler: Skip NDC correction when it is nativeReinUsesLisp2019-12-191-1/+1
| | | | | | | | | | Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
| * vk_shader_decompiler: Normalize output fragment attachmentsReinUsesLisp2019-12-191-12/+9
| | | | | | | | | | | | 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.
| * vk_shader_decompiler: Update sirit and implement Texture AOFFIReinUsesLisp2019-12-191-22/+30
| |
* | vk_shader_decompiler: Use Visit instead of reimplementing itReinUsesLisp2019-12-211-23/+1
|/ | | | | | | | 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.
* shader: Implement MEMBAR.GLReinUsesLisp2019-12-101-0/+14
| | | | Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
* vk_shader_decompiler: Fix build issues on old gcc versionsReinUsesLisp2019-12-101-2/+3
|
* vk_shader_decompiler: Reduce YNegate's severityReinUsesLisp2019-12-101-1/+1
|
* shader_ir/other: Implement S2R InvocationIdReinUsesLisp2019-12-101-0/+1
|
* vk_shader_decompiler: Misc changesReinUsesLisp2019-12-101-677/+1594
| | | | | | | | 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.
* Merge pull request #3109 from FernandoS27/new-instrbunnei2019-12-071-0/+8
|\ | | | | Implement FLO & TXD Instructions on GPU Shaders
| * Shader_IR: Implement TXD instruction.Fernando Sahmkow2019-11-141-0/+6
| |
| * Shader_IR: Implement FLO instruction.Fernando Sahmkow2019-11-141-0/+2
| |
* | video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp2019-11-231-14/+15
|/
* shader_ir/warp: Implement FSWZADDReinUsesLisp2019-11-081-0/+6
|
* gl_shader_decompiler: Reimplement shuffles with platform agnostic intrinsicsReinUsesLisp2019-11-081-40/+3
|
* Shader_IR: Implement Fast BRX and allow multi-branches in the CFG.Fernando Sahmkow2019-10-251-0/+7
|
* Merge pull request #2983 from lioncash/fallthroughFernando Sahmkow2019-10-221-0/+3
|\ | | | | gl_shader_decompiler/vk_shader_decompiler: Resolve implicit fallthrough cases
| * vk_shader_decompiler: Resolve fallthrough within ExprDecompiler's ExprCondCode operator()Lioncash2019-10-161-0/+3
| | | | | | | | | | This would previously result in NeverExecute and UnusedIndex being treated as regular predicates.
* | vk_shader_decompiler: Mark operator() function parameters as const referencesLioncash2019-10-181-21/+23
|/ | | | | These parameters aren't actually modified in any way, so they can be made const references.
* Shader_Ir: Address Feedback and clang format.Fernando Sahmkow2019-10-051-25/+18
|
* vk_shader_decompiler: Correct Branches inside conditionals.Fernando Sahmkow2019-10-051-1/+11
|
* vk_shader_decompiler: Clean code and be const correct.Fernando Sahmkow2019-10-051-7/+5
|
* vk_shader_compiler: Don't enclose branches with if(true) to avoid crashing AMDFernando Sahmkow2019-10-051-16/+33
|
* vk_shader_compiler: Correct SPIR-V AST DecompilingFernando Sahmkow2019-10-051-4/+11
|
* Shader_IR: allow else derivation to be optional.Fernando Sahmkow2019-10-051-2/+4
|
* vk_shader_compiler: Implement the decompiler in SPIR-VFernando Sahmkow2019-10-051-22/+276
|
* gl_shader_decompiler: Use uint for images and fix SUATOMReinUsesLisp2019-09-211-12/+0
| | | | | | 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.
* shader/image: Implement SULD and remove irrelevant codeReinUsesLisp2019-09-211-0/+7
| | | | | * Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
* shader_ir/warp: Implement SHFLReinUsesLisp2019-09-171-0/+50
|
* Merge pull request #2858 from ReinUsesLisp/vk-deviceFernando Sahmkow2019-09-141-3/+3
|\ | | | | vk_device: Add miscellaneous features and minor style changes
| * vk_device: Add miscellaneous features and minor style changesReinUsesLisp2019-09-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | shader/image: Implement SUATOM and fix SUSTReinUsesLisp2019-09-111-0/+42
|/
* shader_ir: Implement VOTEReinUsesLisp2019-08-211-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Shader_Ir: Implement F16 Variants of F2F, F2I, I2F.Fernando Sahmkow2019-07-201-0/+18
| | | | | This commit takes care of implementing the F16 Variants of the conversion instructions and makes sure conversions are done.
* shader/half_set_predicate: Fix HSETP2 implementationReinUsesLisp2019-07-201-13/+4
|
* Merge pull request #2695 from ReinUsesLisp/layer-viewportFernando Sahmkow2019-07-151-8/+6
|\ | | | | gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shaders
| * gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shadersReinUsesLisp2019-07-081-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | shader_ir: Implement BRX & BRA.CCFernando Sahmkow2019-07-091-0/+9
|/
* shader: Decode SUST and implement backing image functionalityReinUsesLisp2019-06-211-0/+7
|
* shader: Split SSY and PBK stackReinUsesLisp2019-06-071-12/+37
| | | | | | | | | | | 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;
* shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp2019-06-061-25/+25
| | | | | | | | | 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.
* Merge pull request #2520 from ReinUsesLisp/vulkan-refreshbunnei2019-06-061-43/+61
|\ | | | | vk_device,vk_shader_decompiler: Miscellaneous changes
| * vk_shader_decompiler: Misc fixesReinUsesLisp2019-05-261-43/+61
| | | | | | | | | | | | | | | | | | | | | | | | 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 S2R Tid{XYZ} and CtaId{XYZ}ReinUsesLisp2019-05-201-0/+18
|/
* Merge pull request #2441 from ReinUsesLisp/al2pbunnei2019-05-191-4/+3
|\ | | | | shader: Implement AL2P and ALD.PHYS
| * shader: Remove unused AbufNode Ipa modeReinUsesLisp2019-05-031-4/+3
| |
* | renderer_vulkan/vk_shader_decompiler: Remove unused variable from DeclareInternalFlags()Lioncash2019-05-101-1/+0
|/
* Merge pull request #2409 from ReinUsesLisp/half-floatsbunnei2019-04-201-5/+20
|\ | | | | shader_ir/decode: Miscellaneous fixes to half-float decompilation
| * vk_shader_decompiler: Add missing operationsReinUsesLisp2019-04-161-0/+7
| |
| * shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmeticReinUsesLisp2019-04-161-5/+7
| | | | | | | | | | | | | | 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.
| * shader_ir/decode: Implement half float saturationReinUsesLisp2019-04-161-0/+6
| |
* | shader_ir: Implement STG, keep track of global memory usage and flushReinUsesLisp2019-04-141-6/+8
|/
* vk_shader_decompiler: Implement flow primitivesReinUsesLisp2019-04-101-5/+82
|
* vk_shader_decompiler: Implement most common texture primitivesReinUsesLisp2019-04-101-8/+65
|
* vk_shader_decompiler: Implement texture decompilation helper functionsReinUsesLisp2019-04-101-0/+32
|
* vk_shader_decompiler: Implement Assign and LogicalAssignReinUsesLisp2019-04-101-2/+64
|
* vk_shader_decompiler: Implement non-OperationCode visitsReinUsesLisp2019-04-101-7/+129
|
* vk_shader_decompiler: Implement OperationCode decompilation interfaceReinUsesLisp2019-04-101-1/+411
|
* vk_shader_decompiler: Implement VisitReinUsesLisp2019-04-101-1/+50
|
* vk_shader_decompiler: Implement labels tree and flowReinUsesLisp2019-04-101-0/+71
|
* vk_shader_decompiler: Implement declarationsReinUsesLisp2019-04-101-3/+457
|
* vk_shader_decompiler: Declare and stub interface for a SPIR-V decompilerReinUsesLisp2019-04-101-0/+45