aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/Shader
AgeCommit message (Collapse)Author
2019-04-18New shader translator implementation (#654)gdkchan
* Start implementing a new shader translator * Fix shift instructions and a typo * Small refactoring on StructuredProgram, move RemovePhis method to a separate class * Initial geometry shader support * Implement TLD4 * Fix -- There's no negation on FMUL32I * Add constant folding and algebraic simplification optimizations, nits * Some leftovers from constant folding * Avoid cast for constant assignments * Add a branch elimination pass, and misc small fixes * Remove redundant branches, add expression propagation and other improvements on the code * Small leftovers -- add missing break and continue, remove unused properties, other improvements * Add null check to handle empty block cases on block visitor * Add HADD2 and HMUL2 half float shader instructions * Optimize pack/unpack sequences, some fixes related to half float instructions * Add TXQ, TLD, TLDS and TLD4S shader texture instructions, and some support for bindless textures, some refactoring on codegen * Fix copy paste mistake that caused RZ to be ignored on the AST instruction * Add workaround for conditional exit, and fix half float instruction with constant buffer * Add missing 0.0 source for TLDS.LZ variants * Simplify the switch for TLDS.LZ * Texture instructions related fixes * Implement the HFMA instruction, and some misc. fixes * Enable constant folding on UnpackHalf2x16 instructions * Refactor HFMA to use OpCode* for opcode decoding rather than on the helper methods * Remove the old shader translator * Remove ShaderDeclInfo and other unused things * Add dual vertex shader support * Add ShaderConfig, used to pass shader type and maximum cbuffer size * Move and rename some instruction enums * Move texture instructions into a separate file * Move operand GetExpression and locals management to OperandManager * Optimize opcode decoding using a simple list and binary search * Add missing condition for do-while on goto elimination * Misc. fixes on texture instructions * Simplify TLDS switch * Address PR feedback, and a nit
2019-03-04Do naming refactoring on Ryujinx.Graphics (#611)Alex Barney
* Renaming part 1 * Renaming part 2 * Renaming part 3 * Renaming part 4 * Renaming part 5 * Renaming part 6 * Renaming part 7 * Renaming part 8 * Renaming part 9 * Renaming part 10 * General cleanup * Thought I got all of these * Apply #595 * Additional renaming * Tweaks from feedback * Rename files
2019-02-28 Initial non 2D textures support (#525)Thomas Guillemard
* Initial non 2D textures support - Shaders still need to be changed - Some types aren't yet implemented * Start implementing texture instructions suffixes Fix wrong texture type with cube and TEXS Also support array textures in TEX and TEX.B Clean up TEX and TEXS coords managment Fix TEXS.LL with non-2d textures Implement TEX.AOFFI Get the right arguments for TEX, TEXS and TLDS Also, store suffix operands in appropriate values to support multiple suffix combinaisons * Support depth in read/writeTexture Also support WrapR and detect mipmap * Proper cube map textures support + fix TEXS.LZ * Implement depth compare * some code clean up * Implement CubeMap textures in OGLTexture.Create * Implement TLD4 and TLD4S * Add Texture 1D support * updates comments * fix some code style issues * Fix some nits + rename some things to be less confusing * Remove GetSuffix local functions * AOFFI => AOffI * TextureType => GalTextureTarget * finish renaming TextureType to TextureTarget * Disable LL, LZ and LB support in the decompiler This needs more work at the GL level (GLSL implementation should be right) * Revert "Disable LL, LZ and LB support in the decompiler" This reverts commit 64536c3d9f673645faff3152838d1413c3203395. * Fix TEXS ARRAY_2D index * ImageFormat depth should be 1 for all image format * Fix shader build issues with sampler1DShadow and texture * Fix DC & AOFFI combinaison with TEX/TEXS * Support AOFFI with TLD4 and TLD4S * Fix shader compilation error for TLD4.AOFFI with no DC * Fix binding isuses on the 2d copy engine TODO: support 2d array copy * Support 2D array copy operation in the 2D engine This make every copy right in the GPU side. Thie CPU copy probably needs to be updated * Implement GetGpuSize + fix somes issues with 2d engine copies TODO: mipmap level in it * Don't throw an exception in the layer handling * Fix because of rebase * Reject 2d layers of non textures in 2d copy engine * Add 3D textures and mipmap support on BlockLinearSwizzle * Fix naming on new BitUtils methods * gpu cache: Make sure to invalidate textures that doesn't have the same target * Add the concept of layer count for array instead of using depth Also cleanup GetGpuSize as Swizzle can compute the size with mipmap * Support multi layer with mip map in ReadTexture * Add more check for cache invalidation & remove cubemap and cubemap array code for now Also fix compressed 2d array * Fix texelFetchOffset shader build error * Start looking into cube map again Also add some way to log write in register in engines * fix write register log levles * Remove debug logs in WriteRegister * Disable AOFFI support on non NVIDIA drivers * Fix code align
2019-02-15Fix XMAD shader instruction, gl_FrontFacing and enable face culling (#583)gdkchan
* Fix XMAD shader instruction implementation * Fix gl_FrontFacing constant value * Enable face culling again * Fix typo
2019-01-31Initial support for shader half float instructions (#507)gdkchan
2018-12-26Do not attempt to read unused attribute, fix attributes count (#520)gdkchan
2018-12-17Move MaxUboSize definition (#530)Thomas Guillemard
* Move MaxUboSize definition This fix a crash on Ryujinx.ShaderTools caused by the absence of an OpenGL context. * Use a constant for the value in ShaderTools * Address comments
2018-11-28Add support for bigger UBOs, fix sRGB regression, small improvement t… (#503)gdkchan
* Add support for bigger UBOs, fix sRGB regression, small improvement to the 2D copy engine * Break into multiple lines * Read fractions for source/step values on the 2d copy engine aswell * Use fixed point math for more speed * Fix reinterpret when texture sizes are different
2018-10-23Fix for render target and a shader compilation issue (#471)gdkchan
* Fix render target using possibly deleted or wrong handles * Fix basic blocks with only a KIL instruction on the shader translator * Formatting fix
2018-10-17Improve texture tables (#457)gdkchan
* Improve texture tables * More renaming and other tweaks * Minor tweaks
2018-10-13Add support for saturation on some shader instructions, fix ReadTexture ↵gdkchan
alignment and add ColorMask support (#451) * Add support for saturation on some shader instructions, fix ReadTexture alignment * Add ColorMask support, other tweaks
2018-09-19Fixup SSY (#424)ReinUsesLisp
2018-09-18Allow "reinterpretation" of framebuffer/zeta formats (#418)gdkchan
* (Re)Implement format reinterpretation, other changes * Implement writeback to guest memory, some refactoring * More refactoring, implement reinterpretation the old way again * Clean up * Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes * nit: Formatting * Address PR feedback
2018-09-08Move GPU emulation from Ryujinx.HLE to Ryujinx.Graphics and misc changes (#402)ReinUsesLisp
* Move GPU LLE emulation from HLE to Graphics * Graphics: Move Gal/Texture to Texture * Remove Engines/ directory and namespace * Use tables for image formats * Abstract OpCode decoding * Simplify image table * Do not leak Read* symbols in TextureReader * Fixups * Rename IGalFrameBuffer -> IGalRenderTarget * Remove MaxBpp hardcoded value * Change yet again texture data and add G8R8 flipping * Rename GalFrameBufferFormat to GalSurfaceFormat * Unident EnsureSetup in ImageHandler * Add IsCompressed * Address some feedback
2018-09-01Shaders: Handle Ipa PASS argument as needed in Fragment Shaders (#392)ReinUsesLisp
2018-08-31Implement SSY/SYNC shader instructions (#382)ReinUsesLisp
* Use a program counter to control shaders' flow * Cleanup * Implement SSY/SYNC * Address feedback * Fixup commentary * Fixup Ssy instruction
2018-08-25Implement vertex instancing (#381)ReinUsesLisp
2018-08-23Implement multiple rendertarget attachments and depth writting (#375)ReinUsesLisp
* Add depth writting * Implement multiple attachments * Address feedback
2018-08-20Avoid gpr overwritting on Ld_C instruction (#371)ReinUsesLisp
* Avoid gpr overwritting on LD_C instruction * Address feedback * Ignore invalid registers
2018-08-19Rendertarget attachments, texture and image changes (#358)ReinUsesLisp
* Add multiple color outputs for fragment shaders * Add registers and gal enums * Use textures for framebuffers and split color and zeta framebuffers * Abstract texture and framebuffer targets as an image * Share images between framebuffers and textures * Unstub formats * Add some formats * Disable multiple attachments * Cache framebuffer attachments * Handle format types * Add some rendertarget formats * Code cleanup * Fixup half float types * Address feedback * Disable multiple attachments in shaders * Add A4B4G4R4 image format * Add reversed section for image enums
2018-08-16Code style fixes and nits on the HLE project (#355)gdkchan
* Some style fixes and nits on ITimeZoneService * Remove some unneeded usings * Remove the Ryujinx.HLE.OsHle.Handles namespace * Remove hbmenu automatic load on process exit * Rename Ns to Device, rename Os to System, rename SystemState to State * Move Exceptions and Utilities out of OsHle * Rename OsHle to HOS * Rename OsHle folder to HOS * IManagerDisplayService and ISystemDisplayService style fixes * BsdError shouldn't be public * Add a empty new line before using static * Remove unused file * Some style fixes on NPDM * Exit gracefully when the application is closed * Code style fixes on IGeneralService * Add 0x prefix on values printed as hex * Small improvements on finalization code * Move ProcessId and ThreadId out of AThreadState * Rename VFs to FileSystem * FsAccessHeader shouldn't be public. Also fix file names casing * More case changes on NPDM * Remove unused files * Move using to the correct place on NPDM * Use properties on KernelAccessControlMmio * Address PR feedback
2018-08-16Implement PointCoord and PointSize shader attributes (#353)ReinUsesLisp
* Implement PointCoord and PointSize shader attributes * Address feedback
2018-08-13Fix FMUL and TEXS shader instructions (#347)gdkchan
2018-08-13Add partial support to the TEX.B shader instruction (#342)gdkchan
* Add partial support to the TEX.B shader instruction, fix for mixed indexed and non-indexed drawing * Better exception
2018-08-10Low level graphics API prerequisites (#319)ReinUsesLisp
* Add GalPipelineState and IGalPipeline * Separate UploadVertex call * Add ConstBuffer cache * Move Vertex Assembly into GalPipelineState * Move Uniform binds to GalPipelineState * Move framebuffer flip into a buffer * Rebase * Fix regression * Move clear values from VertexEndGl to ClearBuffers * Rename obscure names O->Old S->New
2018-08-06Changing shader decompiler to avoid vec2 and vec3 types, which were causing ↵Darabat
specific crashes. (#332) * Changing shader decompiler to avoid vec2 and vec3 types, which were causing specific crashes. * aligning code * step back * Redoing changes * Redoing changes * Redoing changes and avoiding concatenations * redoing changes
2018-08-03Fix for integer vertex attributes and iset bf flag (#323)gdkchan
2018-07-19Implement Geometry shaders (#280)ReinUsesLisp
* Implement Geometry shaders * Add EmitVertex() and EndPrimitive() * Read output geometry data from header * Stub Vmad * Add Iadd_I32 * Stub Mov_S (S2R) * Stub Isberd * Change vertex index to gpr39 in Abuf * Add stub messages for consistency * Do not print input block when there is no attributes * Use GL_ARB_enhanced_layouts * Skip geometry shaders when there's no GL_ARB_enhanced_layouts * Address feedback * Address feedback
2018-07-17Implement some shader instructions (#252)ReinUsesLisp
* Add IADDI32, IADD and SEL shader instructions * Add LOP shader instruction and fix LOP32I pass_b * Add ISET shader instruction * Add IADD3 shader instruction * Address feedback * Fixup OperA in Iadd_I32
2018-07-14Some small shader related fixes (#258)gdkchan
* Some small shader related fixes * Address PR feedback
2018-07-03Add FaceAttr in GLSL, unmanaged case in EmitTex and ConstantColorG80 blend ↵ReinUsesLisp
factor (#207) * Add FaceAttr (0x3fc) input attribute in GLSL * Implement unmanaged case in EmitTex * Add ConstantColor for 0xC001 (G80) from PR #145
2018-06-28Explicit GLSL "position" attribute location (#199)ReinUsesLisp
2018-06-27Add support for Vertex Program A and other small shader improvements (#192)gdkchan
* Add WIP support for Vertex Program A, add the FADD_I32 shader instruction, small fix on FFMA_I encoding, nits * Add separate subroutines for program A/B, and copy attributes to a temp * Move finalization code to main * Add new line after flip uniform on the shader * Handle possible case where VPB uses an output attribute written by VPA but not available on the vbo * Address PR feedback
2018-06-26Implementation of UBOs instead of uniform constant arrays (#186)ReinUsesLisp
* Sort uniform binding to avoid possible failures in drivers fewer bindings * Throw exception for Cbuf overflow * Search for free bindings instead of using locked ones * EnsureAllocated when binding buffers * Fix uniform bindings * Remove spaces * Use 64 KiB UBOs when available * Remove double colon * Use IdentationStr and avoid division in Cbuf offset * Add spaces
2018-06-23Small OpenGL Renderer refactoring (#177)gdkchan
* Call OpenGL functions directly, remove the pfifo thread, some refactoring * Fix PerformanceStatistics calculating the wrong host fps, remove wait event on PFIFO as this wasn't exactly was causing the freezes (may replace with an exception later) * Organized the Gpu folder a bit more, renamed a few things, address PR feedback * Make PerformanceStatistics thread safe * Remove unused constant * Use unlimited update rate for better pref
2018-06-23Fix 3 graphics related issues (#180)gdkchan
* Fix 3 graphics related bugs * OGLShader shouldn't be public (yet)
2018-06-12Minor shader fixesgdkchan
2018-06-02Fix mistake on astc conversion, make some static methods that shouldn't be ↵gdkchan
public private, remove old commmented out code
2018-06-02Some small gpu improvements and shader improvements, add support for ASTC ↵gdkchan
4x4 textures (slow!)
2018-05-29Added support for more shader instructions and texture formats, fix swapped ↵gdkchan
channels in RGB565 and RGBA5551? texture formats, allow zero values on blending registers, initial work to build CFG on the shader decoder, update the BRA instruction to work with it (WIP)
2018-05-22Improve shader sending method to GAL, use a memory interface instead of ↵gdkchan
reading a fixed array size and sending every time
2018-05-17Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, ↵gdkchan
SHL, LD_C, some shader related fixes, added support for texture component selection
2018-04-30Ignore ZR target texture color registers on shadergdkchan
2018-04-29Properly support multiple vertex buffers, stub 2 ioctls, fix a shader issue, ↵gdkchan
change the way how the vertex buffer size is calculated for the buffers with limit = 0
2018-04-25Some small sync primitive fixes, logging fixes, started to implement the 2D ↵gdkchan
engine on the GPU, fixed DrawArrays, implemented a few more shader instructions, made a start on nvdrv refactor, etc...
2018-04-19Add SvcSetThreadActivity, tweak SignalProcessWideKey, add fmul32i shader ↵gdkchan
instructions and other small fixes
2018-04-14[GPU] Fix frame buffer being upside down in some casesgdkchan
2018-04-13[GPU] Remove 1f in RCP instruction emitter on glsl decompilergdkchan
2018-04-13[GPU] Do not use the f suffix on float contants on the shader glsl codegdkchan
2018-04-13Bump glsl version to support layout qualifiergdkchan