Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vlc-unity
Manage
Activity
Members
Labels
Plan
Issues
45
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
vlc-unity
Commits
36ea0948
Commit
36ea0948
authored
1 week ago
by
Martin Finkel
Browse files
Options
Downloads
Patches
Plain Diff
editor: error on d3d12
parent
6c6fdbcc
No related branches found
Branches containing commit
Tags
2.0.0
Tags containing commit
1 merge request
!120
editor: error on d3d12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/VLCUnity/Editor/PreBuild.cs
+13
-0
13 additions, 0 deletions
Assets/VLCUnity/Editor/PreBuild.cs
with
13 additions
and
0 deletions
Assets/VLCUnity/Editor/PreBuild.cs
+
13
−
0
View file @
36ea0948
...
...
@@ -26,6 +26,10 @@ public class PreProcessBuild :
"\n\nPlease go to Player Settings > Android > Auto Graphics API and remove Vulkan from the list."
+
"\nOnly OpenGL ES 2.0 and 3.0 are currently supported on Android."
;
const
string
WindowsD3D12ErrorMessage
=
"The Direct3D12 graphics API is not supported by the VLC Unity plugin."
+
"\n\nPlease go to Player Settings > Windows or UWP > Auto Graphics API and remove Direct3D12 from the list."
+
"\nOnly Direct3D11 is currently supported on Windows and UWP targets."
;
#if UNITY_SUPPORTS_BUILD_REPORT
public
void
OnPreprocessBuild
(
BuildReport
report
)
{
...
...
@@ -42,10 +46,19 @@ public void OnPreprocessBuild(BuildTarget target, string path)
throw
new
BuildFailedException
(
AndroidVulkanErrorMessage
);
}
}
else
if
(
target
==
BuildTarget
.
StandaloneWindows64
||
target
==
BuildTarget
.
WSAPlayer
)
{
if
(
IsD3D12Configured
(
target
))
{
throw
new
BuildFailedException
(
WindowsD3D12ErrorMessage
);
}
}
}
static
bool
IsVulkanConfigured
=>
GetGraphicsApiIndex
(
BuildTarget
.
Android
,
GraphicsDeviceType
.
Vulkan
)
>=
0
;
static
bool
IsD3D12Configured
(
BuildTarget
target
)
=>
GetGraphicsApiIndex
(
target
,
GraphicsDeviceType
.
Direct3D12
)
>=
0
;
static
int
GetGraphicsApiIndex
(
BuildTarget
target
,
GraphicsDeviceType
api
)
{
int
result
=
-
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment