Unverified Commit b966862f authored by Igor Demin's avatar Igor Demin Committed by GitHub

Fix crash on Windows when there is no compatible DirectX adapter (#587)

* Fix crash on Windows when there is no compatible DirectX adapter

Fixes https://github.com/JetBrains/skiko/issues/582

* Fix mistake
parent 045b8ad3
......@@ -23,9 +23,12 @@ internal class Direct3DRedrawer(
init {
val adapter = chooseAdapter(properties.adapterPriority.ordinal)
if (adapter == 0L) {
throw RenderException("Failed to choose DirectX12 adapter.")
}
adapterName = getAdapterName(adapter)
adapterMemorySize = getAdapterMemorySize(adapter)
onDeviceChosen(getAdapterName(adapter))
onDeviceChosen(adapterName)
device = createDirectXDevice(adapter, layer.contentHandle, layer.transparency)
if (device == 0L) {
throw RenderException("Failed to create DirectX12 device.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment