File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
FeatureLib/pfMetalPipeline Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2038,7 +2038,7 @@ void plClient::IDetectAudioVideoSettings()
20382038 devSel.Enumerate (fWindowHndl );
20392039 devSel.RemoveUnusableDevModes (true );
20402040
2041- if (!devSel.GetDefault (&dmr))
2041+ if (!devSel.GetRequested (&dmr, devmode ))
20422042 devmode = false ;
20432043 hsG3DDeviceRecord *rec = (hsG3DDeviceRecord *)dmr.GetDevice ();
20442044 const hsG3DDeviceMode *mode = dmr.GetMode ();
Original file line number Diff line number Diff line change 4343#include < Foundation/Foundation.h>
4444#include < Metal/Metal.h>
4545#include " plMetalDevice.h"
46+ #include " plPipeline/hsG3DDeviceSelector.h"
4647
4748void plMetalDevice::LoadLibrary ()
4849{
5354 */
5455
5556 NS::Error* error;
57+ // If we're Metal 3 compatible - load the Metal 3 shader library
5658#ifdef METAL_3_SDK
5759 if (@available (macOS 12 , iOS 15 , *)) {
58- if (fMetalDevice -> supportsFamily (MTL::GPUFamilyMetal3) ) {
60+ if (fDeviceType == hsG3DDeviceSelector:: kDevTypeMetal3 ) {
5961 NSURL * shaderURL = [NSBundle .mainBundle URLForResource: @" pfMetalPipelineShadersMSL30" withExtension: @" metallib" ];
6062 fShaderLibrary = fMetalDevice ->newLibrary (static_cast <NS::URL*>(shaderURL), &error);
6163 return ;
6264 }
6365 }
6466#endif
67+ // Otherwise load the right Metal 2 shader library.
68+ // The MSL23 library is optimized for Apple Silicon. It will
69+ // still load on Intel Macs, but we need to be running at least
70+ // macOS 11. Intel Macs running older versions of macOS need to
71+ // run an MSL 2.1 version of the library.
6572#ifdef TARGET_OS_OSX
6673 if (@available (macOS 11 , iOS 14 , *)) {
6774 NSURL * shaderURL = [NSBundle .mainBundle URLForResource: @" pfMetalPipelineShadersMSL23" withExtension: @" metallib" ];
You can’t perform that action at this time.
0 commit comments