Commit Graph

95 Commits (f58920b944e745879b6ca0e7a69a0316258a31dc)

Author SHA1 Message Date
Isaac Marovitz f58920b944 Check for null resources before declaring them resident 2024-09-28 19:03:01 -04:00
Isaac Marovitz ca30248d97 Fix null sampler crash 2024-09-28 19:03:01 -04:00
Isaac Marovitz 7245193f08 Auto-backed samplers 2024-09-28 19:03:01 -04:00
Isaac Marovitz 2f0235fc37 Refactor binding logic + Bind image arrays 2024-09-28 19:03:01 -04:00
Isaac Marovitz ce23bff285 Fix invalid depth stencil state when no depth stencil is present
Partially fixes Sonic Frontiers and Castlevania Dominus Collection
2024-09-28 19:03:01 -04:00
Isaac Marovitz 6a46943af9 Fix null resources breaking arg buffer alignment 2024-09-28 19:03:01 -04:00
Isaac Marovitz f06c869df1 Upstream changes 2024-09-28 19:03:01 -04:00
Isaac Marovitz 8a579b64be Logic Operations 2024-09-28 19:03:01 -04:00
Isaac Marovitz bdb00f3981 Rasterizer Discard + Multisample State 2024-09-28 19:03:01 -04:00
Isaac Marovitz 6e3aaa6360 Metal: Argument Buffer Pre-Pass (#38)
* Init

* Fix missing flags

* Cleanup
2024-09-28 19:03:01 -04:00
riperiperi fff3a4f8f8 Patch some leaks and only perform copies on valid textures (#37) 2024-09-28 19:03:01 -04:00
Isaac Marovitz 080af8db24 Format 2024-09-28 19:03:01 -04:00
Isaac Marovitz d5e19a70bd Image Constant Fixes
Allows Mario Party Superstars to boot
2024-09-28 19:03:01 -04:00
Isaac Marovitz 4cd15cb1a6 Shader Extra Set Support + Cleanup (#36)
Separate samplers are now supported and arrays in constant sets are bound
2024-09-28 19:03:01 -04:00
Isaac Marovitz 47b99e6bc3 TextureArray & ImageArray Creation + State 2024-09-28 19:03:01 -04:00
Isaac Marovitz e8dda2d5ef Properly register TextureBuffer usage + Store Auto ref 2024-09-28 19:03:01 -04:00
Isaac Marovitz 3214a4cf8e Bind TextureBuffers 2024-09-28 19:03:01 -04:00
Isaac Marovitz b434cae2c2 Fix image bindings 2024-09-28 19:03:01 -04:00
Isaac Marovitz 650f309b58 Image binding support
Kirby still has a problem with NaN 3D Texture
2024-09-28 19:03:01 -04:00
Isaac Marovitz 9f2c99fcfa Better vertex buffer management 2024-09-28 19:03:01 -04:00
Isaac Marovitz 655823ecc7 Better index buffer management 2024-09-28 19:03:01 -04:00
Isaac Marovitz 18a1741348 Formatting cleanup 2024-09-28 19:03:01 -04:00
Isaac Marovitz b734c81683 Formatting 2024-09-28 19:03:01 -04:00
Isaac Marovitz 9d866ff282 Fix blend state optimisation breaking attachments
Fixes SM3DW
2024-09-28 19:03:01 -04:00
riperiperi 468ab8242f Maintain identity swizzle view of textures for rendering 2024-09-28 19:03:01 -04:00
Isaac Marovitz 0c1acb5107 Cleanup + Format 2024-09-28 19:03:01 -04:00
Isaac Marovitz 8e8dcf0d7f Fix trying to reserve size 0 in staging buffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz 9f0a468f55 Fix zero buff not being reset 2024-09-28 19:03:01 -04:00
Isaac Marovitz ab79959975 Dirty Arg Buffers on Program Change 2024-09-28 19:03:01 -04:00
Isaac Marovitz de5bf3a141 Least allocations in the west 2024-09-28 19:03:01 -04:00
Isaac Marovitz 5e8606c89a Don’t use Enum.HasFlag 2024-09-28 19:03:01 -04:00
Isaac Marovitz daee63c451 Metal: Better Bindings (#29)
* Tell GAL to use Vk model (and break everything)

* ResourceBindingSegments

* Set information on backend caps

* Get ready to break everything

* Refactor EncoderStateManager

* Remove padding from helper shaders

* Fix ref array sizes

* Seperate vert & frag buffers

* Shader-side changes

* Fixes

* Fix some helper shader resource layouts

* Sort by binding id

* Fix helper shader layouts

* Don’t do inline vertex buffer updates

* Check for null storage
2024-09-28 19:03:01 -04:00
Isaac Marovitz 6aff6401fb Don’t do inline vertex buffer updates
Somehow broke zero buff MTLVertexDescriptor, but fixes broken geoemtry so I’m pushing anyway
2024-09-28 19:03:01 -04:00
riperiperi 2511bf1e4c Preload command speedup, Texture/buffer data flush, blit shader fix (#30)
* Move encoder state to be tied to command buffer, so preload and background cbs have their own encoder state

* Texture buffer/data flush, blit shader fix
2024-09-28 19:03:01 -04:00
riperiperi edceb1607f Fix Geometry/TFB on compute, Buffer Textures, add Window Resizing (#28) 2024-09-28 19:03:01 -04:00
riperiperi e02df72323 State and cache optimization (#27)
* WIP pipeline/depth state cache rework

* Fix some issues

* Fix some more default values

* Reduce allocations for state changes

* fix helpershader stuff

* explanation comment

* fix depth bias
2024-09-28 19:03:01 -04:00
Isaac Marovitz b33c1ae22f Don’t bind byte format converted index buffers at requested index 2024-09-28 19:03:01 -04:00
Isaac Marovitz 242fcc2481 Render target deduplication
not sure if this is working
2024-09-28 19:03:01 -04:00
Isaac Marovitz c4731c0555 Fix blend descriptors not dirting render pipeline
Thanks peri
2024-09-28 19:03:01 -04:00
Isaac Marovitz ab1e02c56a Be better about memory 2024-09-28 19:03:01 -04:00
Isaac Marovitz b7ddb693bc Fix Cull FrontAndBack 2024-09-28 19:03:01 -04:00
Isaac Marovitz c8308d27f1 Argument Buffers (#24)
* Stuff

* More arg buffer stuff

* Fixes

* Rebase

* Pass storage buffers to inline functions

* Fix binding

* Fix typo + Fix a couple shaders

* Enforce ids

* Dispose

* Mark used buffers as resident

* Update depth clear shader

* Fix non-contiguous struct defs

* Update ChangeBufferStride

* Fix StorageBuffer assignments

* Fix odyssey crash

* Retain buffer bindings

* Pad Std140

* Set texture data with safe buffers

* Clone buffers

* Always declare vert in

* Stop clears from breaking OpenGL games

* Fix depth clear

* Use invariant position

* Horribly inefficient texture & sampler arg buffers

* Fix missing struct access

* Minimise rebinds as much as possible

* Build arg buffers on staging buffer
2024-09-28 19:03:01 -04:00
Isaac Marovitz 4578ee53d3 Actually clear the right render target 2024-09-28 19:03:01 -04:00
Isaac Marovitz b1928461bb Cleanup Pipeline
Housekeeping

More housekeeping
2024-09-28 19:03:01 -04:00
Isaac Marovitz 49781fde65 Fix FEZ not showing anything
Does not fix the underlying shortcomings of the cache system
2024-09-28 19:03:01 -04:00
Isaac Marovitz 6ebe5bb406 Buffer Conversions (#23)
* Why is this not working

* Revert helper shader changes for now

* Byte Index Buffer Restride
2024-09-28 19:03:01 -04:00
Isaac Marovitz 58b3e2e82b Metal: Buffers Take 2 (#21)
* Basic BufferManager

* Start Scoped Command Buffers

* Fences stuff

* Remember to cleanup sync manager

* Auto, Command Buffer Dependants

* Cleanup

* Cleanup + Fix Texture->Buffer Copies

* Slow buffer upload

* Cleanup + Rework TextureBuffer

* Don’t get unsafe

* Cleanup

* Goddamn it

* Staging Buffer + Interrupt Action + Flush
2024-09-28 19:03:01 -04:00
Isaac Marovitz 9a6759d1e5 Depth Bias 2024-09-28 19:03:01 -04:00
Isaac Marovitz 3c188718c4 Fix Clear Viewport 2024-09-28 19:03:01 -04:00
Isaac Marovitz ba07a8c603 More cleanup 2024-09-28 19:03:01 -04:00