Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
de680f76
Commit
de680f76
authored
Mar 05, 2021
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a check if the current video card is blacklisted (DX12). Added blacklist of video cards.
parent
74c1d2a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
directXRedrawer.cc
skiko/src/jvmMain/cpp/windows/directXRedrawer.cc
+27
-3
Direct3DContextHandler.kt
...lin/org/jetbrains/skiko/context/Direct3DContextHandler.kt
+1
-0
No files found.
skiko/src/jvmMain/cpp/windows/directXRedrawer.cc
View file @
de680f76
...
@@ -27,6 +27,11 @@
...
@@ -27,6 +27,11 @@
} while (false)
} while (false)
const
int
BuffersCount
=
2
;
const
int
BuffersCount
=
2
;
const
std
::
vector
<
std
::
wstring
>
adapterBlacklist
{
L"Intel(R) HD Graphics 520"
,
L"Intel(R) HD Graphics 530"
,
L"NVIDIA GeForce GTX 750 Ti"
,
L"NVIDIA Quadro M2000M"
};
class
DirectXDevice
class
DirectXDevice
{
{
...
@@ -38,7 +43,7 @@ public:
...
@@ -38,7 +43,7 @@ public:
gr_cp
<
ID3D12Fence
>
fence
;
gr_cp
<
ID3D12Fence
>
fence
;
HANDLE
fenceEvent
=
NULL
;
HANDLE
fenceEvent
=
NULL
;
uint64_t
fenceValue
;
uint64_t
fenceValue
;
unsigned
int
bufferIndex
=
1
;
unsigned
int
bufferIndex
=
0
;
unsigned
int
bufferWidth
=
0
;
unsigned
int
bufferWidth
=
0
;
unsigned
int
bufferHeight
=
0
;
unsigned
int
bufferHeight
=
0
;
...
@@ -241,6 +246,21 @@ HRESULT D3DCompile(
...
@@ -241,6 +246,21 @@ HRESULT D3DCompile(
return
false
;
return
false
;
}
}
bool
isBlacklisted
(
IDXGIAdapter1
*
hardwareAdapter
)
{
DXGI_ADAPTER_DESC1
desc
;
hardwareAdapter
->
GetDesc1
(
&
desc
);
std
::
wstring
currentAdapterName
(
desc
.
Description
);
for
(
std
::
wstring
name
:
adapterBlacklist
)
{
if
(
currentAdapterName
==
name
)
{
fwprintf
(
stderr
,
L"Graphics card: %s is blacklisted.
\n
"
,
name
.
c_str
());
return
true
;
}
}
return
false
;
}
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skiko_redrawer_Direct3DRedrawer_createDirectXDevice
(
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skiko_redrawer_Direct3DRedrawer_createDirectXDevice
(
JNIEnv
*
env
,
jobject
redrawer
,
jlong
windowHandle
)
JNIEnv
*
env
,
jobject
redrawer
,
jlong
windowHandle
)
{
{
...
@@ -254,6 +274,10 @@ HRESULT D3DCompile(
...
@@ -254,6 +274,10 @@ HRESULT D3DCompile(
{
{
return
0
;
return
0
;
}
}
if
(
isBlacklisted
(
hardwareAdapter
.
get
()))
{
return
0
;
}
gr_cp
<
ID3D12Device
>
device
;
gr_cp
<
ID3D12Device
>
device
;
if
(
!
SUCCEEDED
(
D3D12CreateDevice
(
hardwareAdapter
.
get
(),
D3D_FEATURE_LEVEL_11_0
,
IID_PPV_ARGS
(
&
device
))))
if
(
!
SUCCEEDED
(
D3D12CreateDevice
(
hardwareAdapter
.
get
(),
D3D_FEATURE_LEVEL_11_0
,
IID_PPV_ARGS
(
&
device
))))
{
{
...
@@ -325,10 +349,10 @@ HRESULT D3DCompile(
...
@@ -325,10 +349,10 @@ HRESULT D3DCompile(
JNIEnv
*
env
,
jobject
redrawer
,
jlong
devicePtr
,
jlong
contextPtr
,
jlong
surfacePtr
,
jboolean
isVsyncEnabled
)
JNIEnv
*
env
,
jobject
redrawer
,
jlong
devicePtr
,
jlong
contextPtr
,
jlong
surfacePtr
,
jboolean
isVsyncEnabled
)
{
{
DirectXDevice
*
d3dDevice
=
fromJavaPointer
<
DirectXDevice
*>
(
devicePtr
);
DirectXDevice
*
d3dDevice
=
fromJavaPointer
<
DirectXDevice
*>
(
devicePtr
);
SkSurface
*
surface
=
fromJavaPointer
<
SkSurface
*>
(
surfacePtr
);
SkSurface
*
surface
=
fromJavaPointer
<
SkSurface
*>
(
surfacePtr
);
surface
->
flushAndSubmit
();
GrDirectContext
*
fContext
=
fromJavaPointer
<
GrDirectContext
*>
(
contextPtr
);
GrDirectContext
*
fContext
=
fromJavaPointer
<
GrDirectContext
*>
(
contextPtr
);
surface
->
flushAndSubmit
();
surface
->
flush
(
SkSurface
::
BackendSurfaceAccess
::
kPresent
,
GrFlushInfo
());
surface
->
flush
(
SkSurface
::
BackendSurfaceAccess
::
kPresent
,
GrFlushInfo
());
fContext
->
flush
({});
fContext
->
flush
({});
fContext
->
submit
(
true
);
fContext
->
submit
(
true
);
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/context/Direct3DContextHandler.kt
View file @
de680f76
...
@@ -54,6 +54,7 @@ internal class Direct3DContextHandler(layer: SkiaLayer) : ContextHandler(layer)
...
@@ -54,6 +54,7 @@ internal class Direct3DContextHandler(layer: SkiaLayer) : ContextHandler(layer)
}
}
override
fun
flush
()
{
override
fun
flush
()
{
super
.
flush
()
try
{
try
{
directXRedrawer
.
finishFrame
(
directXRedrawer
.
finishFrame
(
device
,
device
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment