Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
eaf425bd
There was an error fetching the commit references. Please try again later.
Commit
eaf425bd
authored
2 years ago
by
TellowKrinkle
Committed by
Liam
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
MoltenVK: restrict number of vertex attributes/bindings to 16
parent
fda0e7e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/video_core/vulkan_common/vulkan_device.cpp
+25
-10
25 additions, 10 deletions
src/video_core/vulkan_common/vulkan_device.cpp
with
25 additions
and
10 deletions
src/video_core/vulkan_common/vulkan_device.cpp
+
25
−
10
View file @
eaf425bd
...
...
@@ -298,9 +298,25 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
const
vk
::
InstanceDispatch
&
dld_
)
:
instance
{
instance_
},
dld
{
dld_
},
physical
{
physical_
},
format_properties
(
GetFormatProperties
(
physical
))
{
if
(
!
GetSuitability
(
surface
!=
nullptr
))
{
// Get suitability and device properties.
const
bool
is_suitable
=
GetSuitability
(
surface
!=
nullptr
);
const
VkDriverId
driver_id
=
properties
.
driver
.
driverID
;
const
bool
is_radv
=
driver_id
==
VK_DRIVER_ID_MESA_RADV
;
const
bool
is_amd_driver
=
driver_id
==
VK_DRIVER_ID_AMD_PROPRIETARY
||
driver_id
==
VK_DRIVER_ID_AMD_OPEN_SOURCE
;
const
bool
is_amd
=
is_amd_driver
||
is_radv
;
const
bool
is_intel_windows
=
driver_id
==
VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS
;
const
bool
is_intel_anv
=
driver_id
==
VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA
;
const
bool
is_nvidia
=
driver_id
==
VK_DRIVER_ID_NVIDIA_PROPRIETARY
;
const
bool
is_mvk
=
driver_id
==
VK_DRIVER_ID_MOLTENVK
;
if
(
is_mvk
&&
!
is_suitable
)
{
LOG_WARNING
(
Render_Vulkan
,
"Unsuitable driver is MoltenVK, continuing anyway"
);
}
else
if
(
!
is_suitable
)
{
throw
vk
::
Exception
(
VK_ERROR_INCOMPATIBLE_DRIVER
);
}
SetupFamilies
(
surface
);
const
auto
queue_cis
=
GetDeviceQueueCreateInfos
();
...
...
@@ -339,15 +355,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
CollectPhysicalMemoryInfo
();
CollectToolingInfo
();
const
VkDriverId
driver_id
=
properties
.
driver
.
driverID
;
const
bool
is_radv
=
driver_id
==
VK_DRIVER_ID_MESA_RADV
;
const
bool
is_amd_driver
=
driver_id
==
VK_DRIVER_ID_AMD_PROPRIETARY
||
driver_id
==
VK_DRIVER_ID_AMD_OPEN_SOURCE
;
const
bool
is_amd
=
is_amd_driver
||
is_radv
;
const
bool
is_intel_windows
=
driver_id
==
VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS
;
const
bool
is_intel_anv
=
driver_id
==
VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA
;
const
bool
is_nvidia
=
driver_id
==
VK_DRIVER_ID_NVIDIA_PROPRIETARY
;
if
(
is_nvidia
)
{
const
u32
nv_major_version
=
(
properties
.
properties
.
driverVersion
>>
22
)
&
0x3ff
;
const
auto
arch
=
GetNvidiaArchitecture
(
physical
,
supported_extensions
);
...
...
@@ -449,6 +456,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_WARNING
(
Render_Vulkan
,
"ANV driver does not support native BGR format"
);
must_emulate_bgr565
=
true
;
}
if
(
is_mvk
)
{
LOG_WARNING
(
Render_Vulkan
,
"MVK driver breaks when using more than 16 vertex attributes/bindings"
);
properties
.
properties
.
limits
.
maxVertexInputAttributes
=
std
::
min
(
properties
.
properties
.
limits
.
maxVertexInputAttributes
,
16U
);
properties
.
properties
.
limits
.
maxVertexInputBindings
=
std
::
min
(
properties
.
properties
.
limits
.
maxVertexInputBindings
,
16U
);
}
logical
=
vk
::
Device
::
Create
(
physical
,
queue_cis
,
ExtensionListForVulkan
(
loaded_extensions
),
first_next
,
dld
);
...
...
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