Skip to content

Commit 275cfdb

Browse files
committed
no more ignored memory flags
1 parent 0cdf8ed commit 275cfdb

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/FNA3D_Driver_Vulkan.c

+3-20
Original file line numberDiff line numberDiff line change
@@ -2059,27 +2059,24 @@ static uint8_t VULKAN_INTERNAL_FindMemoryType(
20592059
VulkanRenderer *renderer,
20602060
uint32_t typeFilter,
20612061
VkMemoryPropertyFlags requiredProperties,
2062-
VkMemoryPropertyFlags ignoredProperties,
20632062
uint32_t *memoryTypeIndex
20642063
) {
20652064
uint32_t i;
20662065

20672066
for (i = *memoryTypeIndex; i < renderer->memoryProperties.memoryTypeCount; i += 1)
20682067
{
20692068
if ( (typeFilter & (1 << i)) &&
2070-
(renderer->memoryProperties.memoryTypes[i].propertyFlags & requiredProperties) == requiredProperties &&
2071-
(renderer->memoryProperties.memoryTypes[i].propertyFlags & ignoredProperties) == 0 )
2069+
(renderer->memoryProperties.memoryTypes[i].propertyFlags & requiredProperties) == requiredProperties)
20722070
{
20732071
*memoryTypeIndex = i;
20742072
return 1;
20752073
}
20762074
}
20772075

20782076
FNA3D_LogWarn(
2079-
"Failed to find memory type %X, required %X, ignored %X",
2077+
"Failed to find memory type %X, required %X",
20802078
typeFilter,
2081-
requiredProperties,
2082-
ignoredProperties
2079+
requiredProperties
20832080
);
20842081
return 0;
20852082
}
@@ -2711,7 +2708,6 @@ static uint8_t VULKAN_INTERNAL_FindBufferMemoryRequirements(
27112708
VulkanRenderer *renderer,
27122709
VkBuffer buffer,
27132710
VkMemoryPropertyFlags requiredMemoryProperties,
2714-
VkMemoryPropertyFlags ignoredMemoryProperties,
27152711
VkMemoryRequirements *pMemoryRequirements,
27162712
uint32_t *pMemoryTypeIndex
27172713
) {
@@ -2725,7 +2721,6 @@ static uint8_t VULKAN_INTERNAL_FindBufferMemoryRequirements(
27252721
renderer,
27262722
pMemoryRequirements->memoryTypeBits,
27272723
requiredMemoryProperties,
2728-
ignoredMemoryProperties,
27292724
pMemoryTypeIndex
27302725
);
27312726
}
@@ -2734,7 +2729,6 @@ static uint8_t VULKAN_INTERNAL_FindImageMemoryRequirements(
27342729
VulkanRenderer *renderer,
27352730
VkImage image,
27362731
VkMemoryPropertyFlags requiredMemoryPropertyFlags,
2737-
VkMemoryPropertyFlags ignoredMemoryPropertyFlags,
27382732
VkMemoryRequirements *pMemoryRequirements,
27392733
uint32_t *pMemoryTypeIndex
27402734
) {
@@ -2748,7 +2742,6 @@ static uint8_t VULKAN_INTERNAL_FindImageMemoryRequirements(
27482742
renderer,
27492743
pMemoryRequirements->memoryTypeBits,
27502744
requiredMemoryPropertyFlags,
2751-
ignoredMemoryPropertyFlags,
27522745
pMemoryTypeIndex
27532746
);
27542747
}
@@ -2763,18 +2756,15 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
27632756
uint8_t bindResult = 0;
27642757
uint32_t memoryTypeIndex = 0;
27652758
VkMemoryPropertyFlags requiredMemoryPropertyFlags;
2766-
VkMemoryPropertyFlags ignoredMemoryPropertyFlags;
27672759
VkMemoryRequirements memoryRequirements;
27682760

27692761
/* Prefer GPU allocation */
27702762
requiredMemoryPropertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
2771-
ignoredMemoryPropertyFlags = 0;
27722763

27732764
while (VULKAN_INTERNAL_FindImageMemoryRequirements(
27742765
renderer,
27752766
image,
27762767
requiredMemoryPropertyFlags,
2777-
ignoredMemoryPropertyFlags,
27782768
&memoryRequirements,
27792769
&memoryTypeIndex
27802770
)) {
@@ -2810,7 +2800,6 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
28102800
{
28112801
memoryTypeIndex = 0;
28122802
requiredMemoryPropertyFlags = 0;
2813-
ignoredMemoryPropertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
28142803

28152804
if (isRenderTarget)
28162805
{
@@ -2823,7 +2812,6 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForImage(
28232812
renderer,
28242813
image,
28252814
requiredMemoryPropertyFlags,
2826-
ignoredMemoryPropertyFlags,
28272815
&memoryRequirements,
28282816
&memoryTypeIndex
28292817
)) {
@@ -2869,21 +2857,16 @@ static uint8_t VULKAN_INTERNAL_BindMemoryForBuffer(
28692857
uint8_t bindResult = 0;
28702858
uint32_t memoryTypeIndex = 0;
28712859
VkMemoryPropertyFlags requiredMemoryPropertyFlags;
2872-
VkMemoryPropertyFlags ignoredMemoryPropertyFlags;
28732860
VkMemoryRequirements memoryRequirements;
28742861

28752862
requiredMemoryPropertyFlags =
28762863
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
28772864
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
28782865

2879-
/* since buffers are able to be memcpy'd directly, we never want them to be device-local */
2880-
ignoredMemoryPropertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
2881-
28822866
while (VULKAN_INTERNAL_FindBufferMemoryRequirements(
28832867
renderer,
28842868
buffer,
28852869
requiredMemoryPropertyFlags,
2886-
ignoredMemoryPropertyFlags,
28872870
&memoryRequirements,
28882871
&memoryTypeIndex
28892872
)) {

0 commit comments

Comments
 (0)