Commit Graph

3708 Commits

Author SHA1 Message Date
Isaac Marovitz
78a19a854e
Least allocations in the west 2024-09-19 19:51:37 +02:00
Isaac Marovitz
ab333ec7fc
Don’t use Enum.HasFlag 2024-09-19 19:51:36 +02:00
Isaac Marovitz
ffa4cc3ae1
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-19 19:51:36 +02:00
Isaac Marovitz
488d1b69dd
Update comment for Metal 2024-09-19 19:51:36 +02:00
Isaac Marovitz
8dd97cda6e
Don’t do inline vertex buffer updates
Somehow broke zero buff MTLVertexDescriptor, but fixes broken geoemtry so I’m pushing anyway
2024-09-19 19:51:36 +02:00
riperiperi
3e65773de5
Create command buffers when rented rather than in advance (#31)
* Make it less likely to freeze, but the creation of the command buffer should probably be moved

* Create command buffers as they're rented rather than in advance
2024-09-19 19:51:36 +02:00
riperiperi
b626cc8f06
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-19 19:51:36 +02:00
Isaac Marovitz
fd39c27934
Dont bind images in texture slots 2024-09-19 19:51:35 +02:00
Isaac Marovitz
fd296be06c
Stop depth/stencil blits from crashing everything 2024-09-19 19:51:35 +02:00
riperiperi
34d523b9e5
Fix Geometry/TFB on compute, Buffer Textures, add Window Resizing (#28) 2024-09-19 19:51:35 +02:00
riperiperi
fdae6b6916
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-19 19:51:35 +02:00
Isaac Marovitz
cdc7a64c90
Fragment input interpolation qualifiers
Fixes Mario’s shadow in SMO
2024-09-19 19:51:35 +02:00
Isaac Marovitz
f89c057e76
CommandBufferBarrier 2024-09-19 19:51:34 +02:00
riperiperi
996ec7cd8c
Add constrained border colours to samplers (#26) 2024-09-19 19:51:34 +02:00
Isaac Marovitz
ab936b708b
Don’t bind byte format converted index buffers at requested index 2024-09-19 19:51:34 +02:00
Isaac Marovitz
fbd1afef6b
Render target deduplication
not sure if this is working
2024-09-19 19:51:34 +02:00
Isaac Marovitz
b324897d77
Fix CBP not doing its job
Thanks peri (again)
2024-09-19 19:51:34 +02:00
Isaac Marovitz
beabf6146b
Fix blend descriptors not dirting render pipeline
Thanks peri
2024-09-19 19:51:34 +02:00
Isaac Marovitz
b33965d31a
Support non-index quad draws
Fixes Deltarune
2024-09-19 19:51:33 +02:00
Isaac Marovitz
769b865a2d
Be better about memory 2024-09-19 19:51:33 +02:00
Isaac Marovitz
c166b31ea7
Fix stencil clears 2024-09-19 19:51:33 +02:00
Isaac Marovitz
6f97b451bb
Enable Alpha Test workaround on Metal 2024-09-19 19:51:33 +02:00
Isaac Marovitz
f877d3e369
Fix Cull FrontAndBack 2024-09-19 19:51:33 +02:00
Isaac Marovitz
61f31688fa
Warning about host map buffer creation 2024-09-19 19:51:32 +02:00
Isaac Marovitz
9b0b6a70fd
Fix fragment point_coord in 2024-09-19 19:51:32 +02:00
Isaac Marovitz
91293ff53e
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-19 19:51:32 +02:00
Isaac Marovitz
cd3d7d3bbf
VoteAllEqual, FindLSB/MSB 2024-09-19 19:51:32 +02:00
Isaac Marovitz
065eadab36
Fix vertex “built-ins”
Only declare main func out in main

Fix simd_ballot

Fix thread_index_in_simdgroup outside of compute

Fix atomic operations

instance_index
2024-09-19 19:51:32 +02:00
Isaac Marovitz
75cb4a53a1
Actually clear the right render target 2024-09-19 19:51:32 +02:00
Isaac Marovitz
3ede2fd7ae
Big GetData()
Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-09-19 19:51:31 +02:00
Isaac Marovitz
a5c7443a7f
Fix Animal Crossing Crash 2024-09-19 19:51:31 +02:00
Isaac Marovitz
51997daccf
Instruction.Barrier
Whoops

Fix inline functions in compute stage

Fix regression

Declare SharedMemories + Only Declare Memories on Main Func

Lowecase struct

Avoid magic strings

Make function signatures readable

Change how unsized arrays are indexed

Use string builder

Fix shuffle instructions

Cleanup NumberFormater

Bunch of Subgroup I/O Vars

Will probably need further refinement

Fix point_coord type

Fix support buffer declaration

Fix point_coord
2024-09-19 19:51:31 +02:00
Isaac Marovitz
36db9a9cbe
PreloadCbs + FlushCommandsIfWeightExceeding 2024-09-19 19:51:31 +02:00
Isaac Marovitz
7a57b395b4
Cleanup Pipeline
Housekeeping

More housekeeping
2024-09-19 19:51:31 +02:00
Isaac Marovitz
5b3bff608e
PersistentFlushBuffer + BackgroundResources 2024-09-19 19:51:30 +02:00
Isaac Marovitz
99d90cc55e
Match S8UintD24Unorm to Depth24UnormStencil8
Kind of works for es2gears
2024-09-19 19:51:30 +02:00
Isaac Marovitz
3b87316277
Fix FEZ not showing anything
Does not fix the underlying shortcomings of the cache system
2024-09-19 19:51:30 +02:00
Isaac Marovitz
6ab1d1ac59
Clear cached converted buffers on signaled write 2024-09-19 19:51:30 +02:00
Isaac Marovitz
64f612454f
FIx regression 2024-09-19 19:51:30 +02:00
Isaac Marovitz
e9aec3c0e2
Helper shader cleanup 2024-09-19 19:51:30 +02:00
Isaac Marovitz
f79a86b0fa
Use buffer manager for color blit 2024-09-19 19:51:29 +02:00
Isaac Marovitz
f54a777451
Buffer Conversions (#23)
* Why is this not working

* Revert helper shader changes for now

* Byte Index Buffer Restride
2024-09-19 19:51:29 +02:00
riperiperi
4ccc49481a
don't recreate render pipeline unless we're about to draw, pass view depth properly (#22) 2024-09-19 19:51:29 +02:00
Isaac Marovitz
828dd7132c
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-19 19:51:29 +02:00
Isaac Marovitz
c4faad0240
Log failed format conversions 2024-09-19 19:51:29 +02:00
Isaac Marovitz
880044ebeb
Print shader code involved in failed linking 2024-09-19 19:51:28 +02:00
Isaac Marovitz
6443a11876
Don’t use DidModifyRange 2024-09-19 19:51:28 +02:00
Isaac Marovitz
e8be0ef3b9
Fix sample compare 2024-09-19 19:51:28 +02:00
Isaac Marovitz
dd6b0b1b68
Depth Bias 2024-09-19 19:51:28 +02:00
Isaac Marovitz
da8744db1e
Map R5G5B5A1Unorm 2024-09-19 19:51:28 +02:00