Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
731f06d9
Commit
731f06d9
authored
Jun 28, 2023
by
Evan Tang
Committed by
Alexandre Julliard
Jun 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Give Apple GPUs device IDs.
parent
aec014fe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
cocoa_display.m
dlls/winemac.drv/cocoa_display.m
+33
-2
No files found.
dlls/winemac.drv/cocoa_display.m
View file @
731f06d9
...
...
@@ -257,6 +257,37 @@ static int macdrv_get_gpu_info_from_registry_id(struct macdrv_gpu* gpu, uint64_t
}
/***********************************************************************
* macdrv_get_gpu_info_from_mtldevice
*
* Get GPU information from a Metal device that responds to the registryID selector.
*
* Returns non-zero value on failure.
*/
static
int
macdrv_get_gpu_info_from_mtldevice
(
struct
macdrv_gpu
*
gpu
,
id
<
MTLDevice
>
device
)
{
int
ret
;
if
((
ret
=
macdrv_get_gpu_info_from_registry_id
(
gpu
,
[
device
registryID
])))
return
ret
;
/* Apple GPUs aren't PCI devices and therefore have no device ID
* Use the Metal GPUFamily as the device ID */
if
(
!
gpu
->
device_id
&&
[
device
respondsToSelector
:
@selector
(
supportsFamily
:)]
&&
[
device
supportsFamily
:
MTLGPUFamilyApple1
])
{
MTLGPUFamily
highest
=
MTLGPUFamilyApple1
;
while
(
1
)
{
/* Apple2, etc are all in order */
MTLGPUFamily
next
=
highest
+
1
;
if
([
device
supportsFamily
:
next
])
highest
=
next
;
else
break
;
}
gpu
->
device_id
=
highest
;
}
return
0
;
}
/***********************************************************************
* macdrv_get_gpus_from_metal
*
* Get a list of GPUs from Metal.
...
...
@@ -289,7 +320,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
* the primary GPU because we need to hide the integrated GPU for an automatic graphic switching pair to avoid apps
* using the integrated GPU. This is the behavior of Windows on a Mac. */
primary_device
=
[
MTLCreateSystemDefaultDevice
()
autorelease
];
if
(
macdrv_get_gpu_info_from_
registry_id
(
&
primary_gpu
,
primary_device
.
registryID
))
if
(
macdrv_get_gpu_info_from_
mtldevice
(
&
primary_gpu
,
primary_device
))
goto
done
;
/* Hide the integrated GPU if the system default device is a dedicated GPU */
...
...
@@ -301,7 +332,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
for
(
i
=
0
;
i
<
devices
.
count
;
i
++
)
{
if
(
macdrv_get_gpu_info_from_
registry_id
(
&
gpus
[
gpu_count
],
devices
[
i
].
registryID
))
if
(
macdrv_get_gpu_info_from_
mtldevice
(
&
gpus
[
gpu_count
],
devices
[
i
]
))
goto
done
;
if
(
hide_integrated
&&
devices
[
i
].
isLowPower
)
...
...
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