Commit graph

152 commits

Author SHA1 Message Date
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
d9025904a7 InstGenMemory Refactor + Bindless Support 2024-09-28 19:03:01 -04:00
Isaac Marovitz
d07f6ed38e Fix hex number type ambiguity
Fixes cutscenes in Super Mario Sunshine
2024-09-28 19:03:01 -04:00
Isaac Marovitz
62b8d25315 Dual Source Blend Support in Shader
Fixes Super Mario Galaxy and The Legend of Zelda: Skyward Sword HD
2024-09-28 19:03:01 -04:00
Gabriel A
1b9377023a Fixes 2024-09-28 19:03:01 -04:00
Gabriel A
29cca80d9f Start building more accurate vertex as compute usage info 2024-09-28 19:03:01 -04:00
Isaac Marovitz
997e8d11f7 Fix compute generation failure in NieR 2024-09-28 19:03:01 -04:00
Isaac Marovitz
42c6611563 Some debug improvements 2024-09-28 19:03:01 -04:00
Isaac Marovitz
e42e4931a8 Shader Gen Fixes
Fixes Luigi’s Mansion 2 HD
2024-09-28 19:03:01 -04:00
Isaac Marovitz
2b919493e3 FSI (with raster order groups) 2024-09-28 19:03:01 -04:00
Isaac Marovitz
fdf7578928 SwizzleAdd (NOT TESTED) 2024-09-28 19:03:01 -04:00
Isaac Marovitz
558752594c Consolodate barriers 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a31e461db8 Shader Memory Barriers
Fixes some of the shader generation failures in Sonic Frontiers
2024-09-28 19:03:01 -04:00
Isaac Marovitz
4e5cf38009 Image shader gen support 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a6f5f2f82b Fix LOD 2024-09-28 19:03:01 -04:00
Isaac Marovitz
6e80cc6caa Update binding model description comment 2024-09-28 19:03:01 -04:00
riperiperi
d22feff1d2 implement compressed/uncompressed copy, fix other copies, fix int/uint output shaders (#33) 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
riperiperi
edceb1607f Fix Geometry/TFB on compute, Buffer Textures, add Window Resizing (#28) 2024-09-28 19:03:01 -04:00
Isaac Marovitz
9d26aa8d06 Fragment input interpolation qualifiers
Fixes Mario’s shadow in SMO
2024-09-28 19:03:01 -04:00
Isaac Marovitz
113e721cce Fix fragment point_coord in 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
a71b5f1a3a VoteAllEqual, FindLSB/MSB 2024-09-28 19:03:01 -04:00
Isaac Marovitz
b094d34575 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-28 19:03:01 -04:00
Isaac Marovitz
97a36298fa 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-28 19:03:01 -04:00
Isaac Marovitz
122f0f45c8 Fix sample compare 2024-09-28 19:03:01 -04:00
Isaac Marovitz
efb7baf15c Fix modulo operator
Support sample offsets

Include FragmentIn as additional arg

Always declare frag output struct

SubgroupLaneId
2024-09-28 19:03:01 -04:00
Isaac Marovitz
362672ae12 Fix sample-less reads with lod 2024-09-28 19:03:01 -04:00
Isaac Marovitz
970914e2b4 Fix Pack and UnpackHalf2x16 2024-09-28 19:03:01 -04:00
Isaac Marovitz
b0ba5d5da1 Implement IoVariable.FrontFacing 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a6de2c9274 Fix LOD sample typo 2024-09-28 19:03:01 -04:00
Isaac Marovitz
d323a8d44a Rebase Changes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ba07a8c603 More cleanup 2024-09-28 19:03:01 -04:00
Isaac Marovitz
362746887e Cleanup + Format 2024-09-28 19:03:01 -04:00
Isaac Marovitz
b064d76a4f Metal: Compute Shaders (#19)
* check for too bix texture bindings

* implement lod query

* print shader stage name

* always have fragment input

* resolve merge conflicts

* fix: lod query

* fix: casting texture coords

* support non-array memories

* use structure types for buffers

* implement compute pipeline cache

* compute dispatch

* improve error message

* rebind compute state

* bind compute textures

* pass local size as an argument to dispatch

* implement texture buffers

* hack: change vertex index to vertex id

* pass support buffer as an argument to every function

* return at the end of function

* fix: certain missing compute bindings

* implement texture base

* improve texture binding system

* remove useless exception

* move texture handle to texture base

* fix: segfault when using disposed textures

---------

Co-authored-by: Samuliak <samuliak77@gmail.com>
Co-authored-by: SamoZ256 <96914946+SamoZ256@users.noreply.github.com>
2024-09-28 19:03:01 -04:00
Isaac Marovitz
a435d94fae Sample LOD Level 2024-09-28 19:03:01 -04:00
Isaac Marovitz
88dd2984be Fix FragmentOutputColor Type 2024-09-28 19:03:01 -04:00
SamoZ256
1f91c74a95 Clone the state & flip viewport vertically (#16)
* implement texture get data

* reset all state before blit & clone state

* format

* support blit regions

* implement source region for blit

* replace bottom with top

* account for 0 size

* support image flipping

* revert presentation fixes & y flip

* revert

* flip viewport vertically

* switch face winding

* comment

* use SetBytes for texture clear

* implement missing compute builtins

* change storage and texture buffer alignment

* correct compute builtins

* don't use nullable for textures and samplers

* remove incorrect texture get data implementation

* Cleanup IntPtrs

---------

Co-authored-by: Isaac Marovitz <isaacryu@icloud.com>
2024-09-28 19:03:01 -04:00
Isaac Marovitz
997393bc65 Cleanup + Format 2024-09-28 19:03:01 -04:00
Isaac Marovitz
20beb2e250 Fix typo in SamplerType.TextureBuffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz
087bf71a13 FragmentOutputDepth Fixes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
3e1f624308 Depth Sampler Fixes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
8b2cc4ccf1 Revert position changes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
1aa2b793eb Nvm it should be in.position 2024-09-28 19:03:01 -04:00
Isaac Marovitz
6f44dcc416 More shader fixes 2024-09-28 19:03:01 -04:00
Samuliak
f5cffa0b46 don't use mask on size query 2024-09-28 19:03:01 -04:00
Samuliak
979da4c1ab declare local memory 2024-09-28 19:03:01 -04:00
Samuliak
f08d3a7517 support multiple render targets & fix: incorrect texture name 2024-09-28 19:03:01 -04:00
Samuliak
e99f9e2af0 format 2024-09-28 19:03:01 -04:00
Samuliak
bc3fd22f05 use 0 instead of undef 2024-09-28 19:03:01 -04:00