Commit Graph

21 Commits

Author SHA1 Message Date
Thomas Guillemard
33e7c89822 Move MaxUboSize definition (#530)
* 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-12-17 22:32:12 -02:00
gdkchan
0e1e094b7a
Improve texture tables (#457)
* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
2018-10-17 18:02:23 -03:00
ReinUsesLisp
2562ca6c3f Fix multiple rendertargets (#427)
* Simplify render target bindings

* Implement multiple viewports

* Pack glViewportIndexed calls into a single glViewportArray

* Use ARB_viewport_array when available

* Cache framebuffer attachments

* Use get accessors in OGLExtension

* Address feedback
2018-09-26 00:55:30 +02:00
ReinUsesLisp
a42ab2e40c Implement vertex instancing (#381) 2018-08-25 01:16:58 -03:00
ReinUsesLisp
1cd7aaf504 Avoid querying and setting texture bindings in hot code (#376) 2018-08-23 01:54:32 -03:00
gdkchan
c393cdf8e3
More flexible memory manager (#307)
* Keep track mapped buffers with fixed offsets

* Started rewriting the memory manager

* Initial support for MapPhysicalMemory and UnmapPhysicalMemory, other tweaks

* MapPhysicalMemory/UnmapPhysicalMemory support, other tweaks

* Rebased

* Optimize the map/unmap physical memory svcs

* Integrate shared font support

* Fix address space reserve alignment

* Some fixes related to gpu memory mapping

* Some cleanup

* Only try uploading const buffers that are really used

* Check if memory region is contiguous

* Rebased

* Add missing count increment on IsRegionModified

* Check for reads/writes outside of the address space, optimize translation with a tail call
2018-08-15 15:59:51 -03:00
ReinUsesLisp
25dd5f4238 Low level graphics API prerequisites (#319)
* 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-10 01:09:40 -03:00
ReinUsesLisp
51605fafc0 Avoid calling buffer binding when shader didn't change (#295) 2018-07-26 13:49:29 -03:00
ReinUsesLisp
5fe0bc584b Send data to OpenGL host without client-side copies (#285)
* Directly send host address to buffer data

* Cleanup OGLShader

* Directly copy vertex and index data too

* Revert shader bind "cache"

* Address feedback
2018-07-19 16:02:51 -03:00
ReinUsesLisp
cd203e98f2 Implement Geometry shaders (#280)
* 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-19 02:33:27 -03:00
ReinUsesLisp
3e13b40b35 Add config key to dump shaders in local directory (#265)
* Add config key to dump shaders in local directory

* Address feedback
2018-07-15 19:37:27 -03:00
gdkchan
2f37583ab3
Some small shader related fixes (#258)
* Some small shader related fixes

* Address PR feedback
2018-07-14 13:08:39 -03:00
gdkchan
e6eeb6f09f
Add support for Vertex Program A and other small shader improvements (#192)
* 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-27 23:55:08 -03:00
gdkchan
900a84ae0a Fix vertex buffer size on the gpu when the draw vertex count is less than the buffer size, added a few more registers (currently not implemented) 2018-06-27 01:32:28 -03:00
ReinUsesLisp
09dfefed1f Implementation of UBOs instead of uniform constant arrays (#186)
* 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-26 02:10:54 -03:00
gdkchan
e7559f128f
Small OpenGL Renderer refactoring (#177)
* 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-23 21:39:25 -03:00
gdkchan
53a6922f87 Some small gpu improvements and shader improvements, add support for ASTC 4x4 textures (slow!) 2018-06-02 00:50:56 -03:00
gdkchan
79e0070363 Improve shader sending method to GAL, use a memory interface instead of reading a fixed array size and sending every time 2018-05-22 22:43:31 -03:00
gdkchan
b19c474082 Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection 2018-05-17 15:25:42 -03:00
gdkchan
42ebfdff7f [GPU] Fix frame buffer being upside down in some cases 2018-04-14 00:39:24 -03:00
gdkchan
b9aa3966c0 Merge shader branch, adding support for GLSL decompilation, a macro
interpreter, and a rewrite of the GPU code.
2018-04-08 16:41:38 -03:00