Merge pull request #336 from cdavis5e/no-optimal-shared-mac
MVKImage: Don't say shared memory is allowed on Mac.
This commit is contained in:
commit
8a807b7c47
@ -217,6 +217,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline uint32_t getHostVisibleMemoryTypes() { return _hostVisibleMemoryTypes; }
|
inline uint32_t getHostVisibleMemoryTypes() { return _hostVisibleMemoryTypes; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a bit mask of all memory type indices that are coherent between host and device.
|
||||||
|
* Each bit [0..31] in the returned bit mask indicates a distinct memory type.
|
||||||
|
*/
|
||||||
|
inline uint32_t getHostCoherentMemoryTypes() { return _hostCoherentMemoryTypes; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a bit mask of all memory type indices that do NOT allow host visibility to the memory.
|
* Returns a bit mask of all memory type indices that do NOT allow host visibility to the memory.
|
||||||
* Each bit [0..31] in the returned bit mask indicates a distinct memory type.
|
* Each bit [0..31] in the returned bit mask indicates a distinct memory type.
|
||||||
@ -277,6 +283,7 @@ protected:
|
|||||||
std::vector<MVKQueueFamily*> _queueFamilies;
|
std::vector<MVKQueueFamily*> _queueFamilies;
|
||||||
uint32_t _allMemoryTypes;
|
uint32_t _allMemoryTypes;
|
||||||
uint32_t _hostVisibleMemoryTypes;
|
uint32_t _hostVisibleMemoryTypes;
|
||||||
|
uint32_t _hostCoherentMemoryTypes;
|
||||||
uint32_t _privateMemoryTypes;
|
uint32_t _privateMemoryTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1091,15 +1091,17 @@ void MVKPhysicalDevice::initMemoryProperties() {
|
|||||||
|
|
||||||
#if MVK_MACOS
|
#if MVK_MACOS
|
||||||
_memoryProperties.memoryTypeCount = 3;
|
_memoryProperties.memoryTypeCount = 3;
|
||||||
_privateMemoryTypes = 0x1; // Private only
|
_privateMemoryTypes = 0x1; // Private only
|
||||||
_hostVisibleMemoryTypes = 0x6; // Shared & managed
|
_hostCoherentMemoryTypes = 0x4; // Shared only
|
||||||
_allMemoryTypes = 0x7; // Private, shared, & managed
|
_hostVisibleMemoryTypes = 0x6; // Shared & managed
|
||||||
|
_allMemoryTypes = 0x7; // Private, shared, & managed
|
||||||
#endif
|
#endif
|
||||||
#if MVK_IOS
|
#if MVK_IOS
|
||||||
_memoryProperties.memoryTypeCount = 2; // Managed storage not available on iOS
|
_memoryProperties.memoryTypeCount = 2; // Managed storage not available on iOS
|
||||||
_privateMemoryTypes = 0x1; // Private only
|
_privateMemoryTypes = 0x1; // Private only
|
||||||
_hostVisibleMemoryTypes = 0x2; // Shared only
|
_hostCoherentMemoryTypes = 0x2; // Shared only
|
||||||
_allMemoryTypes = 0x3; // Private & shared
|
_hostVisibleMemoryTypes = 0x2; // Shared only
|
||||||
|
_allMemoryTypes = 0x3; // Private & shared
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +149,11 @@ VkResult MVKImage::getMemoryRequirements(VkMemoryRequirements* pMemoryRequiremen
|
|||||||
pMemoryRequirements->memoryTypeBits = (_isDepthStencilAttachment
|
pMemoryRequirements->memoryTypeBits = (_isDepthStencilAttachment
|
||||||
? _device->getPhysicalDevice()->getPrivateMemoryTypes()
|
? _device->getPhysicalDevice()->getPrivateMemoryTypes()
|
||||||
: _device->getPhysicalDevice()->getAllMemoryTypes());
|
: _device->getPhysicalDevice()->getAllMemoryTypes());
|
||||||
|
#if MVK_MACOS
|
||||||
|
if (!_isLinear) { // XXX Linear images must support host-coherent memory
|
||||||
|
mvkDisableFlag(pMemoryRequirements->memoryTypeBits, _device->getPhysicalDevice()->getHostCoherentMemoryTypes());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user