티스토리 뷰

카테고리 없음

GPU select

newpolaris 2019. 6. 30. 16:57

이건 놔두고있는 버그인가; 아니면 그냥 쓰면 될까;

2013.Late 10.14.5 버전으로는 아래 예제에서 클릭해도 바뀌지 않는다.

https://developer.apple.com/documentation/metal/gpu_selection_in_macos/device_selection_and_fallback_for_graphics_rendering?language=objc

-[MTLDebugRenderCommandEncoder setVertexBuffer:offset:atIndex:]:1413: failed assertion `buffer is associated with a different device'

멀해도, discrete GPU가 활성화가 안된다;

다른곳을 보니 (BGFX, Filament 아예 MTLCreateSystemDefaultDevice 를 호출한다)

https://github.com/KhronosGroup/MoltenVK/blob/master/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm

void MVKDevice::initPhysicalDevice(MVKPhysicalDevice* physicalDevice) {

    _physicalDevice = physicalDevice;
    _pMVKConfig = _physicalDevice->_mvkInstance->getMoltenVKConfiguration();
    _pMetalFeatures = _physicalDevice->getMetalFeatures();
    _pProperties = &_physicalDevice->_properties;
    _pMemoryProperties = &_physicalDevice->_memoryProperties;

#if MVK_MACOS
    // If we have selected a high-power GPU and want to force the window system
    // to use it, force the window system to use a high-power GPU by calling the
    // MTLCreateSystemDefaultDevice function, and if that GPU is the same as the
    // selected GPU, update the MTLDevice instance used by the MVKPhysicalDevice.
    id<MTLDevice> mtlDevice = _physicalDevice->getMTLDevice();
    if (_pMVKConfig->switchSystemGPU && !(mtlDevice.isLowPower || mtlDevice.isHeadless) ) {
        id<MTLDevice> sysMTLDevice = MTLCreateSystemDefaultDevice();
        if (mvkGetRegistryID(sysMTLDevice) == mvkGetRegistryID(mtlDevice)) {
            _physicalDevice->replaceMTLDevice(sysMTLDevice);
        }
    }
#endif
}
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크