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
e44b2920
Commit
e44b2920
authored
Feb 17, 2021
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamically detect Direct3D 12
parent
78fc304d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
build.gradle.kts
skiko/build.gradle.kts
+0
-1
directXRedrawer.cc
skiko/src/jvmMain/cpp/windows/directXRedrawer.cc
+49
-1
No files found.
skiko/build.gradle.kts
View file @
e44b2920
...
@@ -382,7 +382,6 @@ tasks.withType(LinkSharedLibrary::class.java).configureEach {
...
@@ -382,7 +382,6 @@ tasks.withType(LinkSharedLibrary::class.java).configureEach {
"opengl32.lib"
,
"opengl32.lib"
,
"shcore.lib"
,
"shcore.lib"
,
"user32.lib"
,
"user32.lib"
,
"d3d12.lib"
,
"dxgi.lib"
,
"dxgi.lib"
,
"d3dcompiler.lib"
"d3dcompiler.lib"
)
)
...
...
skiko/src/jvmMain/cpp/windows/directXRedrawer.cc
View file @
e44b2920
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <d3d12.h>
#include <d3d12.h>
#include <dxgi1_4.h>
#include <dxgi1_4.h>
#define GR_D3D_CALL_ERRCHECK(X) \
#define GR_D3D_CALL_ERRCHECK(X) \
do \
do \
{ \
{ \
...
@@ -49,6 +48,55 @@ public:
...
@@ -49,6 +48,55 @@ public:
extern
"C"
extern
"C"
{
{
HRESULT
D3D12CreateDevice
(
IUnknown
*
pAdapter
,
D3D_FEATURE_LEVEL
MinimumFeatureLevel
,
REFIID
riid
,
void
**
ppDevice
)
{
typedef
HRESULT
(
*
D3D12CreateDevice_t
)(
IUnknown
*
pAdapter
,
D3D_FEATURE_LEVEL
MinimumFeatureLevel
,
REFIID
riid
,
void
**
ppDevice
);
static
D3D12CreateDevice_t
impl
=
nullptr
;
if
(
!
impl
)
{
auto
d3d12dll
=
LoadLibrary
(
TEXT
(
"D3D12.dll"
));
if
(
!
d3d12dll
)
return
E_NOTIMPL
;
impl
=
(
D3D12CreateDevice_t
)
GetProcAddress
(
d3d12dll
,
"D3D12CreateDevice"
);
if
(
!
impl
)
return
E_NOTIMPL
;
}
return
impl
(
pAdapter
,
MinimumFeatureLevel
,
riid
,
ppDevice
);
}
HRESULT
D3D12SerializeRootSignature
(
const
D3D12_ROOT_SIGNATURE_DESC
*
pRootSignature
,
D3D_ROOT_SIGNATURE_VERSION
Version
,
ID3DBlob
**
ppBlob
,
ID3DBlob
**
ppErrorBlob
)
{
typedef
HRESULT
(
*
D3D12SerializeRootSignature_t
)(
const
D3D12_ROOT_SIGNATURE_DESC
*
pRootSignature
,
D3D_ROOT_SIGNATURE_VERSION
Version
,
ID3DBlob
**
ppBlob
,
ID3DBlob
**
ppErrorBlob
);
static
D3D12SerializeRootSignature_t
impl
=
nullptr
;
if
(
!
impl
)
{
auto
d3d12dll
=
LoadLibrary
(
TEXT
(
"D3D12.dll"
));
if
(
!
d3d12dll
)
return
E_NOTIMPL
;
impl
=
(
D3D12SerializeRootSignature_t
)
GetProcAddress
(
d3d12dll
,
"D3D12SerializeRootSignature"
);
if
(
!
impl
)
return
E_NOTIMPL
;
}
return
impl
(
pRootSignature
,
Version
,
ppBlob
,
ppErrorBlob
);
}
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skiko_redrawer_Direct3DRedrawer_makeDirectXContext
(
JNIEXPORT
jlong
JNICALL
Java_org_jetbrains_skiko_redrawer_Direct3DRedrawer_makeDirectXContext
(
JNIEnv
*
env
,
jobject
redrawer
,
jlong
devicePtr
)
JNIEnv
*
env
,
jobject
redrawer
,
jlong
devicePtr
)
{
{
...
...
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