Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
Native_SDK
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
Native_SDK
Commits
0a5b48fd
Unverified
Commit
0a5b48fd
authored
Mar 10, 2020
by
Omar Zohdi
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #50 from c0d1f1ed/single-queue
Avoid creating more queues than supported
parents
f42d5525
fd1d0510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
24 deletions
+11
-24
HelperVk.cpp
framework/PVRUtils/Vulkan/HelperVk.cpp
+11
-24
No files found.
framework/PVRUtils/Vulkan/HelperVk.cpp
View file @
0a5b48fd
...
...
@@ -1186,8 +1186,6 @@ pvrvk::Device createDeviceAndQueues(pvrvk::PhysicalDevice physicalDevice, const
{
std
::
vector
<
pvrvk
::
DeviceQueueCreateInfo
>
queueCreateInfo
;
const
std
::
vector
<
pvrvk
::
QueueFamilyProperties
>&
queueFamilyProperties
=
physicalDevice
->
getQueueFamilyProperties
();
std
::
vector
<
uint32_t
>
queuesRemaining
;
queuesRemaining
.
resize
(
queueFamilyProperties
.
size
());
const
char
*
graphics
=
"GRAPHICS "
;
const
char
*
compute
=
"COMPUTE "
;
...
...
@@ -1207,38 +1205,27 @@ pvrvk::Device createDeviceAndQueues(pvrvk::PhysicalDevice physicalDevice, const
((
queueFamilyProperties
[
i
].
getQueueFlags
()
&
pvrvk
::
QueueFlags
::
e_SPARSE_BINDING_BIT
)
!=
0
)
?
sparse
:
nothing
,
nothing
,
nothing
);
}
for
(
uint32_t
i
=
0
;
i
<
queueFamilyProperties
.
size
();
++
i
)
{
queuesRemaining
[
i
]
=
queueFamilyProperties
[
i
].
getQueueCount
();
}
std
::
vector
<
int32_t
>
queueIndices
(
queueFamilyProperties
.
size
(),
-
1
);
std
::
vector
<
float
>
queuePrioties
;
std
::
vector
<
pvrvk
::
QueueFlags
>
queueFlags
(
queueFamilyProperties
.
size
(),
pvrvk
::
QueueFlags
(
0
));
for
(
uint32_t
i
=
0
;
i
<
numQueueCreateInfos
;
++
i
)
{
for
(
uint32_t
j
=
0
;
j
<
queueFamilyProperties
.
size
();
++
j
)
{
// look for the flags
if
(((
static_cast
<
uint32_t
>
(
queueFamilyProperties
[
j
].
getQueueFlags
())
&
static_cast
<
uint32_t
>
(
queueCreateInfos
[
i
].
queueFlags
))
==
static_cast
<
uint32_t
>
(
queueCreateInfos
[
i
].
queueFlags
))
&&
queuesRemaining
[
j
])
// if requested, look for presentation support
if
(
!
queueCreateInfos
[
i
].
surface
||
physicalDevice
->
getSurfaceSupport
(
j
,
queueCreateInfos
[
i
].
surface
))
{
if
(
queueCreateInfos
[
i
].
surface
)
// look for presentation
{
if
(
physicalDevice
->
getSurfaceSupport
(
j
,
queueCreateInfos
[
i
].
surface
))
{
outAccessInfo
[
i
].
familyId
=
j
;
outAccessInfo
[
i
].
queueId
=
static_cast
<
uint32_t
>
(
++
queueIndices
[
j
]);
queuePrioties
.
emplace_back
(
queueCreateInfos
[
i
].
priority
);
queueFlags
[
j
]
|=
queueCreateInfos
[
i
].
queueFlags
;
--
queuesRemaining
[
j
];
break
;
}
}
else
uint32_t
supportedFlags
=
static_cast
<
uint32_t
>
(
queueFamilyProperties
[
j
].
getQueueFlags
());
uint32_t
requestedFlags
=
static_cast
<
uint32_t
>
(
queueCreateInfos
[
i
].
queueFlags
);
// look for the supported flags
if
((
supportedFlags
&
requestedFlags
)
==
requestedFlags
)
{
if
(
static_cast
<
uint32_t
>
(
queueIndices
[
j
]
+
1
)
<
queueFamilyProperties
[
j
].
getQueueCount
())
{
++
queueIndices
[
j
];
}
outAccessInfo
[
i
].
familyId
=
j
;
outAccessInfo
[
i
].
queueId
=
++
queueIndices
[
j
]
;
outAccessInfo
[
i
].
queueId
=
static_cast
<
uint32_t
>
(
queueIndices
[
j
])
;
queuePrioties
.
emplace_back
(
queueCreateInfos
[
i
].
priority
);
--
queuesRemaining
[
j
];
break
;
}
}
...
...
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