Skip to content

Conversation

@crowell
Copy link
Collaborator

@crowell crowell commented Jul 25, 2022

i believe this shouldn't break anything on macOS 13, but please let me
know!

i believe this shouldn't break anything on macOS 13, but please let me
know!
@crowell
Copy link
Collaborator Author

crowell commented Jul 25, 2022

if i just set the pixelformat to BGRA, then colors are inverted, this changes the pixel format, and also swaps the float4 in the fragment shader.

was getting this error before

[2022-07-24 23:46:43.435] [/Users/jeff/dev/oot/XCShipwright/libultraship/libultraship/ResourceMgr.cpp:107] [info] Resource Manager LoadResourceThread started
2022-07-24 23:46:43.563182-0400 soh[11482:82945] Metal GPU Frame Capture Enabled
2022-07-24 23:46:43.604313-0400 soh[11482:82945] [General] An uncaught exception was raised
2022-07-24 23:46:43.604454-0400 soh[11482:82945] [General] invalid pixel format 70
2022-07-24 23:46:43.604559-0400 soh[11482:82945] [General] (
	0   CoreFoundation                      0x00000001c44b9198 __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x00000001c4203e04 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001c44b8fe4 +[NSException exceptionWithName:reason:userInfo:] + 0
	3   QuartzCore                          0x00000001cb2bce8c -[CAMetalLayer setPixelFormat:] + 292
	4   soh                                 0x00000001013928c0 _Z10Metal_Initv + 64
	5   soh                                 0x000000010125107c _ZN8SohImGui16ImGuiBackendInitEv + 84
	6   soh                                 0x00000001012525a0 _ZN8SohImGui4InitENS_10WindowImplE + 496
	7   soh                                 0x00000001012c6404 _ZL12gfx_sdl_initPKcS0_bjj + 828
	8   soh                                 0x00000001012ac448 _Z8gfx_initP19GfxWindowManagerAPIP15GfxRenderingAPIPKcbjj + 160
	9   soh                                 0x0000000101502838 _ZN4Ship6Window4InitEv + 808
	10  soh                                 0x000000010053e484 _ZN10OTRGlobalsC2Ev + 240
	11  soh                                 0x000000010053e814 _ZN10OTRGlobalsC1Ev + 28
	12  soh                                 0x000000010053f274 InitOTR + 40
	13  soh                                 0x000000010070a100 main + 28
	14  dyld                                0x000000010428508c start + 520
)
2022-07-24 23:46:43.604857-0400 soh[11482:82945] *** Terminating app due to uncaught exception 'CAMetalLayerInvalid', reason: 'invalid pixel format 70'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001c44b9198 __exceptionPreprocess + 240
	1   libobjc.A.dylib                     0x00000001c4203e04 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001c44b8fe4 +[NSException exceptionWithName:reason:userInfo:] + 0
	3   QuartzCore                          0x00000001cb2bce8c -[CAMetalLayer setPixelFormat:] + 292
	4   soh                                 0x00000001013928c0 _Z10Metal_Initv + 64
	5   soh                                 0x000000010125107c _ZN8SohImGui16ImGuiBackendInitEv + 84
	6   soh                                 0x00000001012525a0 _ZN8SohImGui4InitENS_10WindowImplE + 496
	7   soh                                 0x00000001012c6404 _ZL12gfx_sdl_initPKcS0_bjj + 828
	8   soh                                 0x00000001012ac448 _Z8gfx_initP19GfxWindowManagerAPIP15GfxRenderingAPIPKcbjj + 160
	9   soh                                 0x0000000101502838 _ZN4Ship6Window4InitEv + 808
	10  soh                                 0x000000010053e484 _ZN10OTRGlobalsC2Ev + 240
	11  soh                                 0x000000010053e814 _ZN10OTRGlobalsC1Ev + 28
	12  soh                                 0x000000010053f274 InitOTR + 40
	13  soh                                 0x000000010070a100 main + 28
	14  dyld                                0x000000010428508c start + 520
)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'CAMetalLayerInvalid', reason: 'invalid pixel format 70'
terminating with uncaught exception of type NSException

@crowell
Copy link
Collaborator Author

crowell commented Jul 25, 2022

image
with this change, some things that are rendered by ImGui are still off. unsure why still though.

@dcvz
Copy link
Owner

dcvz commented Jul 25, 2022

image with this change, some things that are rendered by ImGui are still off. unsure why still though.

You want to make the same change in imgui_impl_metal.mm that's where they also set their shader code.

@dcvz
Copy link
Owner

dcvz commented Jul 25, 2022

@crowell the interesting this is that if you look at their example ImGui/examples/example_sdl_metal/main.mm they also use MTLPixelFormatBGRA8Unorm without having to modify their shader code.. maybe there's something simpler.

Either way what you have here works too

@dcvz
Copy link
Owner

dcvz commented Jul 25, 2022

Fixes #16

@crowell crowell requested a review from dcvz July 26, 2022 01:41
@crowell
Copy link
Collaborator Author

crowell commented Jul 26, 2022

this is ready to go!

@dcvz dcvz merged commit 9ba6642 into feature/metal Jul 26, 2022
@dcvz dcvz deleted the metal_BGRA branch July 26, 2022 06:02
dcvz pushed a commit that referenced this pull request Dec 14, 2022
* Initial Auto-Location Tracking

* Updates styling for checked items in Check Tracker

* Fixes crashing issues with Check Tracker rendering

* Auto scroll Check Tracker windows to current area

* Checks Tracker only shows checked locations once in game

* Fixes issue where Check Tracker would auto-scroll to wrong location when entering a grotto

* Fixes gerudo fortress checks showing in tracker when settings have them removed

* InfTable Check Location Fixes: Lost Dog Richard, Rolling Gorons, HBA 1000, Thawed Zora

* Fixes most Event Chk Inf Checks on Check Tracker, and Frogs

* Check Tracker - Song from Malon now works

* Check Tracker
- Fixes Claim Check check not tracking
- Fixes spoiler for Claim Check check when getting Biggoron's Sword
- Fixes LACS being spoiled and not tracking

* Check Tracker - Fixes #2 for Skull Mask and Mask of Truth checks

* Check Tracker
- Adds support for merchants
- Fixes #7 for Bomchu Salesman
- Fixes #12 for Medigoron

* Check Tracker - Fixes #8 for Song from Saria

* Check Tracker - Fixes #9 for Adult Shooting Gallery

* Check Tracker - Fixes #10 for Composer Grave

* Check Tracker - Fixes #14 for Song from Ocarina of Time

* Check Tracker - Fixes #16 for Shooting the Sun

* Check Tracker - Fixes #19 for Darunia's Joy

* Save Editor - Adds missing label for Treasure Chest Game

* Check Tracker - Fixes Great Faries checks

* Check Tracker - Fixes Sheik at Temple

* Check Tracker - Fixes Great Fairy auto-scroll to wrong location

* Check Tracker - Updates blue warp checks
- Fixes Bongo Bongo and Twinrova checks

* Check Tracker - Fixes Dampe's Gravedigging Tour

* Check Tracker - Fixes Prescription to King Zora

* Check Tracker - Fixes Bazaar showing under wrong area on tracker between adult/child

* Check Tracker - Fixes scroll for Hyrule Market and Bazaar

* Check Tracker - Fixes giving Adult Trade Items shown on tracker: Broken Sword, Saw, Cojiro, Eyeball Froge, and Eyedrops

* Cleans up item_location

* Check Tracker - Item List
- Fixes item list not updating when changing seeds/options
- Separates item exclusion list from item check list
- Clean up comments

* Check Tracker - Adds Skip functionality to buttons

* Check Tracker - Refactors adult trade items to RandomizerInf

* Check Tracker - Fixes an issue where any time an item is removed the tracker would cause an application crash

* Check Tracker - Item names are now dependent on file language

* Check Tracker - Fixes Gerudo Card check not showing in Fast setting

* Reorders headers to (hopefully) avoid CI build conflicts on linux/consoles

* Explicitly defines vector header in randomizer.h to fix compile errors

* Complete Refactor of Check Tracker ImGui

* Adds missing check tracker files to CMakeLists

* Reverts the Item_location whitespace cleanup from ad10807

* Check Tracker - Loading Fixes
- Fixes a bug where loading a save file a second time would add all the checks again
- Fixes a bug where the check tracker would not render at all until in a save file

* Check Tracker - Fixes a bug where checks would sometimes fail to load

* Check Tracker - Fixes duplicated checks when using Only on Pause or Only on Combo

* Check Tracker - Works around issue where single characters don't show in EnhancementCombobox, and fixes a label for combo buttons held option

* Check Tracker - Applies all Check Tracker changes to Item Location

* Check Tracker - Updated Check List
- Adds Link's pocket, either in KF or HM depending on starting age
- Supports Scrubs and Merchants
- Uses enums instead of magic numbers
- Updates DC Scrub Short Names for MQ

* Check Tracker - Adds a performance mode option

* Check Tracker - List Fixes (requires new rando generation)
- Fixes Frogs Rupees always visible
- Fixes Kokiri Sword Chest not showing
- Fixes Weird Egg not showing

* Check Tracker - MQ List basic support

* Check Tracker - MQ/Vanilla anti-spoilers

* Check Tracker - Collecting a compass now spoils the area

* Check Tracker - Basic Vanilla Support and fixes
- Vanilla items show in check tracker, even if many won't auto check
- Fixes an issue with Gerudo Fortress Keys
- Refactors IsVisibleInCheckTracker to randomizer_check_tracjer

* Check Tracker - Fixes merge conflict from 08a487f

* Check Tracker - Fixes tracker loading as Floating when default value is set to Windowed

* Randomizer Location Exclusion List
- Adds Scrubs, Merchants, Shops. Adult Trade items, MQ Dungeons, and Bean Salesman
- Fixes Kokiri Sword Chest, Weird Egg, and Frog Song Rupees from misbehaving
- Updates Gerudo Fortress logic to be dependent on Open/Fast/Normal Fortress
- Removes Invalid Check
- Adds RO Enum for MQ settings
- Updates magic values to RO enum

* Location Exclusion List - Scrubs that are always randomized now always show on the list

* For now, removes some extra code only needed for a Check Tracker.

* Randomizer Location Exclusion List - Fixes Eyeball Frog from showing up when Adult Trade Items was off

* Location Tracker - Updates Eyedrops to use RandomizerInf instead of Chest

* Check Tracker - Fixes a bug where Link's Pocket item wasn't acting as checked for area item count

* Check Tracker - Fixes a bug where Locations would incorrectly say Vanilla due to the first check in the area being a non-MQ check

* Check Tracker - Fixes a crash when Check Tracker is docked but not visible

* Check Tracker - Fixes areas being spoiled when loading different save files

* Check Tracker - Only reset variables if they are initialized

* Check Tracker - Cleans up old comments, unused variables, methods, and macros, adds language TODOs,

* Check Tracker - Readds rainbow UI elements after Cosmetics Editor refactor

* Check Tracker - Removal of flag lookup that was refactored, no longer needed header, and some trivial whitespace fixes.

* Check Tracker - Refactors Index to Bitmask code to a macro

* Check Tracker - Changes ordering from alphabetical to RandomizerCheck ordering

* Check Tracker - Wraps everything in a namespace to avoid global variable usage

* Check Tracker - Explicitly defines for-loop scope

* Check Tracker - refactors dungeon lookup from static array to function

* Fixes a bug when using EnhancementColor with alpha

* Check Tracker - Refactors all colour to use direct conversions

* Check Tracker - refactors settings loading and check visibility for readability

* Check Tracker - Fixes a bug where the wrong label showed on the Check Tracker BG Color

* UIWidgets - Adds Alpha bar to EnhancementColor when using alpha parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants