-
Notifications
You must be signed in to change notification settings - Fork 707
Metal backend #1287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SamoZ256
wants to merge
420
commits into
cemu-project:main
Choose a base branch
from
SamoZ256:metal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14,980
−463
Open
Metal backend #1287
Changes from 250 commits
Commits
Show all changes
420 commits
Select commit
Hold shift + click to select a range
e7f8f0e
simplify uniform names
SamoZ256 a328c5e
use uchar for index type
SamoZ256 4cce369
put query object into a separate file
SamoZ256 eb7c10e
implement occlusion queries
SamoZ256 fd16488
improve command buffer sync
SamoZ256 934b1f8
handle occlusion queries with no draws
SamoZ256 e89efed
request soon commit instead of committing directly
SamoZ256 e5dcd93
Merge pull request #4 from SamoZ256/metal-occlusion-queries
SamoZ256 b5954d8
release command buffers properly
SamoZ256 25a1d7e
Merge branch 'cemu-project:main' into metal
SamoZ256 02254d4
set pixel format view usage for textures
SamoZ256 008c11c
allocate special buffers only when needed
SamoZ256 2961151
correct comment
SamoZ256 358567a
make a workaround for streamout with no fbo
SamoZ256 8ac90ce
use correct stages for buffer sync
SamoZ256 535107e
fix: invalid surface copy depth
SamoZ256 aa81070
refactor pixel formats
SamoZ256 f03c0a2
only set buffer offset if needed
SamoZ256 a460a5d
do vertex restride on the CPU
SamoZ256 7ad57f5
add the option to disable accurate barriers
SamoZ256 4b548f9
never disable accurate barriers for certain shaders
SamoZ256 8b68df0
use correct texture decoders
SamoZ256 3cf831d
do vertex restride on the GPU & don't over-sync
SamoZ256 3de2b03
only enable metal on apple platforms by default
SamoZ256 ed5f72a
include texture decoder in pixel format info
SamoZ256 f9e71e9
implement ABGR4 texture decoders
SamoZ256 810168b
use alternative texture decoders for unsupported formats
SamoZ256 8c30bc8
use RG8Unorm format if ABGR4Unorm is not available
SamoZ256 6c8cd5c
use private storage mode when possible
SamoZ256 b088ddc
implement output shaders
SamoZ256 28e553e
cache output shaders
SamoZ256 07cb8b8
set output shader uniforms
SamoZ256 778037f
remove useless print statement
SamoZ256 c65123b
use logging instead of printing
SamoZ256 5d01c77
rename hybrid pipeline to void vertex pipeline
SamoZ256 a3bfde8
remove old present pipelines
SamoZ256 94e8ed5
fetch vertices manually if needed
SamoZ256 f2096de
remove vertex restriding code
SamoZ256 50175fc
report manual vertex fetch draws per frame
SamoZ256 6dc8f9a
Merge pull request #5 from SamoZ256/metal-no-vertex-restride
SamoZ256 2fb4d83
don't set verticesPerInstance twice
SamoZ256 6ba6157
properly implement ABGR4 decoder
SamoZ256 ebcb62a
add: an option to turn fast math off
SamoZ256 6b784ad
log relevant settings
SamoZ256 756470f
remove CMake hacks
SamoZ256 bfd9059
remove the -g flag on debug builds
SamoZ256 bdfac96
implement async shader compilation
SamoZ256 03bc647
prepone compilation for rect geometry shaders
SamoZ256 641ef71
count compiled shaders properly
SamoZ256 fabaf16
Merge pull request #6 from SamoZ256/metal-async
SamoZ256 8b783e6
refactor pipeline cache
SamoZ256 e9e510d
add: base for pipeline caching
SamoZ256 6b47d4f
implement pipeline cache serializing
SamoZ256 cd21d95
refactor fbos
SamoZ256 944cc8b
store loaded pipelines
SamoZ256 79f5586
report pipeline compilation count
SamoZ256 d1c69e9
set shader just before compiling
SamoZ256 cbde7f9
force compile shaders if needed
SamoZ256 4dcb858
check if pipeline is eligible for serializing
SamoZ256 7d9194a
don't overshadow error
SamoZ256 8f2385a
use lcr instead of contextNew
SamoZ256 15eb6bb
fix: pipeline cache with mesh shaders
SamoZ256 295a6ed
only add pipeline to cache if compilation was attempted
SamoZ256 1750715
retrieve ps input table without using global variable
SamoZ256 b8021b6
fix: incorrect texture usages
SamoZ256 665eb23
fix: incorrect pipeline compilation time report
SamoZ256 bca32c4
refactor the way pipelines are stored
SamoZ256 4e3f94e
compile pipelines async
SamoZ256 7906733
don't compile certain pipelines async
SamoZ256 228fd34
Merge pull request #9 from SamoZ256/metal-async-pipelines
SamoZ256 85db0dc
cache all pipelines
SamoZ256 a61d0f0
Merge pull request #7 from SamoZ256/metal-pipeline-cache
SamoZ256 00256e5
only set blend color when changed
SamoZ256 e7ac199
make occlusion queries accumulate with draws
SamoZ256 7eb8508
fix: CI when metal is disabled
SamoZ256 927c52e
implement calculate texture lod
SamoZ256 6eb46ed
remove 'Vulkan' from cache loading message
SamoZ256 61de5a3
only log todo for vulkan output shader
SamoZ256 ed48fbf
Merge branch 'main' into metal
SamoZ256 ab41de4
use host memory instead of buffer cache when possible
SamoZ256 03d4e86
add an option to use the host memory instead of buffer cache
SamoZ256 b38ca6a
add an option to choose buffer cache type
SamoZ256 b008ace
Merge pull request #10 from SamoZ256/metal-host-buffer
SamoZ256 31c10bd
move fast math option to game profile
SamoZ256 e00d244
remove unused code
SamoZ256 fbea328
correctly report memory usage for host buffer cache
SamoZ256 a00d409
improve host and device shared buffer cache modes
SamoZ256 2e93b08
rename buffer cache type to buffer cache mode
SamoZ256 2790200
separate metal shader cache
SamoZ256 07c62d5
release texture upload buffer
SamoZ256 ea0a30b
handle special state 8 and 5
SamoZ256 552c490
implement occlusion query flush
SamoZ256 c46c821
refactor command buffers
SamoZ256 fc1580f
remove outdated todo notices
SamoZ256 798da38
Merge branch 'main' into metal
SamoZ256 763e50c
Merge branch 'main' into metal
SamoZ256 2c9f627
remove MetalLogging log type
SamoZ256 f264957
implement screenshots
SamoZ256 6897abd
fix: a typo in the attribute decoder
SamoZ256 f1db7d5
don't log texture allocation warnings
SamoZ256 02c36d9
add: blit todo notice
SamoZ256 97be576
cast texture slice to uint
SamoZ256 ed32feb
rint texture slice & explicitly specify texture lod
SamoZ256 a52095b
sync between command buffers
SamoZ256 326d344
cleanup the buffer allocator
SamoZ256 4b58ac1
check if verticesPerInstance uniform is used
SamoZ256 a1b9164
don't mask ps inputs with 0x7F
SamoZ256 6ea6ad3
use verticesPerInstance for rect vertex shaders
SamoZ256 5b7a0fa
warn about invalid primitive mode
SamoZ256 c9b18ef
don't transform depth to 0...1
SamoZ256 d732416
invalidate index buffers when a command buffer finishes
SamoZ256 38cbd3e
handle halfZ in the shader decompiler
SamoZ256 a721364
log instead of printf
SamoZ256 a81ee79
maximize concurrent shader compilation when loading shader cache
SamoZ256 2890819
fix: triangle fan index count
SamoZ256 8a80373
rework the command buffer system
SamoZ256 b486568
limit height to 1 for 1D textures
SamoZ256 b140984
fix: texture sample gradient errors
SamoZ256 c5bef60
save pipeline even if compilation failed
SamoZ256 7f5040a
don't release autoreleased objects
SamoZ256 cabf568
Merge branch 'main' into metal
SamoZ256 fda2f40
fix: output shader issues
SamoZ256 9095035
only set array length for texture arrays
SamoZ256 d9f857b
only set array length for texture view arrays
SamoZ256 732e3be
explicitly make integer constants int
SamoZ256 66ad59d
implement state 5 through a draw call
SamoZ256 00857b2
support arbitrary pixel formats for state 5
SamoZ256 14258cd
Revert "only set array length for texture view arrays"
SamoZ256 06f43b4
Merge branch 'metal' into metal-state5
SamoZ256 009dab8
remove useless includes
SamoZ256 4c54f4b
Merge pull request #12 from SamoZ256/metal-state5
SamoZ256 05b603d
fix: incorrect texture read coord type
SamoZ256 18bd24b
only set concurrent compilation if Metal 3 is available
SamoZ256 f710463
Merge pull request #13 from SamoZ256/test
SamoZ256 1752126
flush file streamer after each write
SamoZ256 ac96a1d
output all fragment inputs in the vertex shader
SamoZ256 434ffc9
clamp texture mip count
SamoZ256 74a1162
only set array length for texture view arrays
SamoZ256 137becb
do safety checks before clearing
SamoZ256 ba9a937
make clear message more descriptive
SamoZ256 d64e0c9
rework gpu selection
SamoZ256 c6e8b5c
fix: depth stencil state issues
SamoZ256 e8c7e9d
Merge branch 'main' into metal
SamoZ256 4281f6e
implement shader uint min max instructions
SamoZ256 fa004a3
add an option to preserve position invariance
SamoZ256 770d6cf
Revert "rework gpu selection"
SamoZ256 79290ea
display gpu name
SamoZ256 08ea28f
add an option to select gpu for metal
SamoZ256 967a740
implement point coord properly
SamoZ256 55d9436
fix typo in texture decoder
SamoZ256 40dab1e
fallback to transparent black for custom sampler border color
SamoZ256 1d8806c
add an option to capture GPU frame
SamoZ256 9a61e81
support saving GPU captures to a file
SamoZ256 813c52c
add gpu capture environment notice
SamoZ256 337ec6b
fix: GPU capture button not working
SamoZ256 6247b65
Merge pull request #14 from SamoZ256/metal-gpu-capture
SamoZ256 68aa405
Merge branch 'main' into metal
SamoZ256 e406885
implement framebuffer fetch
SamoZ256 68d328b
mask out color attachments
SamoZ256 27a31fe
clean up accurate barriers
SamoZ256 6d1d739
limit framebuffer fetch to 2D textures
SamoZ256 03ec231
don't bind textures when framebuffer fetched
SamoZ256 3fae686
remove the accurate barriers option
SamoZ256 a0239cb
check for framebuffer fetch support
SamoZ256 d9bf99c
fix: a typo in texture index
SamoZ256 4479584
support texture lod query for framebuffer fetch
SamoZ256 ca3fe96
fix: component indexing for framebuffer fetch
SamoZ256 217e2ed
check if pixel formats match for framebuffer fetch
SamoZ256 f4985c4
add an option to disable framebuffer fetch
SamoZ256 f686a7b
use as_type instead of bitCast in shaders
SamoZ256 159a10e
Merge pull request #16 from SamoZ256/metal-accurate-barriers
SamoZ256 0b15ad4
Merge branch 'metal' into metal-shader-compilation
SamoZ256 82c2d14
fix: device preference not getting loaded
SamoZ256 a28f9d6
fix: incorrect texture view pointers
SamoZ256 adf0b5c
Merge pull request #17 from SamoZ256/metal-shader-compilation
SamoZ256 388bbe2
release command buffers
SamoZ256 aec7a18
remove useless texture member variables
SamoZ256 21bc5f2
add texture copy block size workaround
SamoZ256 1e3a3ef
prepare for AIR cache
SamoZ256 3d84b78
support multiple components in type conversion
SamoZ256 5f339e4
Merge branch 'metal' into metal-air-cache
SamoZ256 a8da524
use precompiled shaders
SamoZ256 371c089
fix: AIR shaders not getting loaded properly
SamoZ256 f5eb184
check if shaders compiled successfully
SamoZ256 5af904b
delete unused metallibs
SamoZ256 0b1932c
compile shaders to AIR at runtime
SamoZ256 4026430
use the ENABLE_METAL macro
SamoZ256 ec24102
support metal shaders in graphics packs
SamoZ256 0bf245b
remove printf
SamoZ256 4160034
Merge branch 'metal' into metal-air-cache
SamoZ256 7700635
add AIR cache to cache paths
SamoZ256 21e7466
Merge pull request #18 from SamoZ256/metal-air-cache
SamoZ256 2a218d4
use depth mask when writing to depth
SamoZ256 6cf7f43
set AIR cache thread priority
SamoZ256 9934213
disable AIR cache
SamoZ256 800aae4
Merge branch 'main' into metal
SamoZ256 24ff85b
implement new index cache
SamoZ256 97b806f
rework buffer allocators
SamoZ256 d086eb3
fix: index buffer crashes
SamoZ256 6d6c04a
update debug overlay
SamoZ256 bf93f90
flush uploaded buffers
SamoZ256 f0cf614
Merge pull request #19 from SamoZ256/metal-allocator-rework
SamoZ256 86f3648
fix: sample compare component count
SamoZ256 225d11c
fix dfdx and dfdy component count
SamoZ256 9e94451
check for texture and color tile mode
SamoZ256 db8c7de
speed up framebuffer fetch lookup
SamoZ256 29cd698
skip bindings for framebuffer fetched textures
SamoZ256 709f24b
fix typo in framebuffer fetch
SamoZ256 29a4835
fix incorrect ABGR4 texture decoder
SamoZ256 7ad4d48
filter framebuffer fetch more
SamoZ256 bc6fb81
add auto option for position invariance
SamoZ256 d912837
add auto option for buffer cache mode
SamoZ256 3c3f254
fix auto buffer cache mode not showing
SamoZ256 9db0e92
change descriptions for some expert options
SamoZ256 2523c80
Merge pull request #20 from SamoZ256/metal-auto-options
SamoZ256 3d76e7c
Merge branch 'main' into metal
SamoZ256 a74c6ee
apply position invariance in Wonderful 101
SamoZ256 28bcaf0
fix some memory leaks
SamoZ256 4f0bc72
fix memory leaks
SamoZ256 b50b913
turn position invariance on in Mario Kart 8
SamoZ256 14f42fc
create stack scoped helper macro
SamoZ256 af08521
cleanup auto position invariance
SamoZ256 0c216e4
speed up render pass change check
SamoZ256 24e1bba
choose the closest matching sampler border color
SamoZ256 2e6eafd
make sampler hash more accurate
SamoZ256 5d17b1e
improve sampler border color message
SamoZ256 8df0152
fix auto position invariance not working
SamoZ256 15e5e44
determine GPU vendor
SamoZ256 58a8b70
turn position invariance on for Star Fox Zero
SamoZ256 2f9ef59
Merge branch 'main' into metal
SamoZ256 05518c0
support max anisotropy overwrite
SamoZ256 1fb9cfd
create helper function for rasterization kill
SamoZ256 3fececc
support line strip as vertex output with geometry shaders
SamoZ256 06491ba
check for mesh shaders support
SamoZ256 d4e2135
add an option to force mesh shaders
SamoZ256 1367e11
Merge pull request #21 from SamoZ256/metal-mesh-shaders-check
SamoZ256 c01e6bf
Merge branch 'main' into metal
SamoZ256 4ec2638
latte: check if Vulkan or Metal
SamoZ256 feba1aa
latte: isolate Metal-specific hashes
SamoZ256 4311a41
latte: rename metal specific options
SamoZ256 bddf315
latte: check for mip levels in framebuffer fetch
SamoZ256 b59d134
shader-decompiler: fix disabled rasterization errors
SamoZ256 390da4f
latte: remove unused include
SamoZ256 c7aef3a
cmake: sort files alphabetically
SamoZ256 43316cf
uncomment assert
SamoZ256 144e11b
address neebyA's review
SamoZ256 4281959
Merge branch 'main' into metal
SamoZ256 4b0e26a
msl: fix shader output when rasterization is disabled
SamoZ256 f754595
Merge branch 'main' into metal
SamoZ256 0ed2fca
Merge branch 'main' into metal
SamoZ256 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.