Skip to content

Commit

Permalink
Merge pull request #137 from billhollings/master
Browse files Browse the repository at this point in the history
Update to latest LunarG/VulkanSamples and update MoltenVK version to …
  • Loading branch information
billhollings authored Apr 19, 2018
2 parents e837edd + bb2188c commit 58481a7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ExternalRevisions/VulkanSamples_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2c05813aff7161f04250673e690e6c130cfae2d7
4d56b6cb5ce0682bd3ade4bb20791c7bc16c3ce8
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
*/
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MINOR 0
#define MVK_VERSION_PATCH 2
#define MVK_VERSION_PATCH 3

#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH)
Expand Down
22 changes: 13 additions & 9 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,16 @@
CAMetalLayer* mtlLayer = surface->getCAMetalLayer();
if ( !mtlLayer ) { return surface->getConfigurationResult(); }

// TODO: check which mode(s) are applicable to Metal
const VkPresentModeKHR presentModes[] = {
// VK_PRESENT_MODE_MAILBOX_KHR,
VK_PRESENT_MODE_FIFO_KHR,
};
const uint presentModesCnt = sizeof(presentModes) / sizeof(VkPresentModeKHR);
vector<VkPresentModeKHR> presentModes;
presentModes.push_back(VK_PRESENT_MODE_FIFO_KHR);

#if MVK_MACOS
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) {
presentModes.push_back(VK_PRESENT_MODE_IMMEDIATE_KHR);
}
#endif

uint32_t presentModesCnt = uint32_t(presentModes.size());

// If properties aren't actually being requested yet, simply update the returned count
if ( !pPresentModes ) {
Expand Down Expand Up @@ -947,9 +951,9 @@
#endif

#if MVK_MACOS
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) { fsMsg += "\n\t\tOSX GPU Family 1 v3"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v2] ) { fsMsg += "\n\t\tOSX GPU Family 1 v2"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v1] ) { fsMsg += "\n\t\tOSX GPU Family 1 v1"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v3] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v3"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v2] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v2"; }
if ( [_mtlDevice supportsFeatureSet: MTLFeatureSet_macOS_GPUFamily1_v1] ) { fsMsg += "\n\t\tmacOS GPU Family 1 v1"; }
#endif

MVKLogInfo(fsMsg.c_str(), _properties.deviceName, devTypeStr.c_str(), _properties.vendorID, _properties.deviceID,
Expand Down
6 changes: 6 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,15 @@
VK_IMAGE_USAGE_TRANSFER_DST_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT |
VK_IMAGE_USAGE_STORAGE_BIT));
#if MVK_MACOS
if ( pCreateInfo->presentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) {
_mtlLayer.displaySyncEnabled = NO;
}
#endif

// TODO: set additional CAMetalLayer properties before extracting drawables:
// - presentsWithTransaction
// - maximumDrawableCount (maybe for MAILBOX?)
// - drawsAsynchronously
// - colorspace (macOS only) Vulkan only supports sRGB colorspace for now.
// - wantsExtendedDynamicRangeContent (macOS only)
Expand Down
2 changes: 1 addition & 1 deletion fetchDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
# ----------------- VulkanSamples -------------------

REPO_NAME=VulkanSamples
REPO_URL="https://github.com/brenwill/${REPO_NAME}.git"
REPO_URL="https://github.com/LunarG/${REPO_NAME}.git"
REPO_REV=$(cat "../${EXT_REV_DIR}/${REPO_NAME}_repo_revision")

update_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
Expand Down

0 comments on commit 58481a7

Please sign in to comment.