From a0adb3cd68f19898a26792fd3e51a243a13c7629 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Tue, 5 Mar 2019 20:22:46 +0100 Subject: [PATCH] Moved model to asset pack, fixed image usage (validation) Fixes #553 --- examples/multisampling/multisampling.cpp | 31 ++---------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index 673cd6a7..476a3680 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -120,16 +120,6 @@ public: if (deviceFeatures.sampleRateShading) { enabledFeatures.sampleRateShading = VK_TRUE; } - // Enable texture compression - if (deviceFeatures.textureCompressionBC) { - enabledFeatures.textureCompressionBC = VK_TRUE; - } - else if (deviceFeatures.textureCompressionASTC_LDR) { - enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; - } - else if (deviceFeatures.textureCompressionETC2) { - enabledFeatures.textureCompressionETC2 = VK_TRUE; - } } // Creates a multi sample render target (image and view) that is used to resolve @@ -419,18 +409,7 @@ public: void loadAssets() { models.example.loadFromFile(getAssetPath() + "models/voyager/voyager.dae", vertexLayout, 1.0f, vulkanDevice, queue); - if (deviceFeatures.textureCompressionBC) { - textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_bc3_unorm.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue); - } - else if (deviceFeatures.textureCompressionASTC_LDR) { - textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_astc_8x8_unorm.ktx", VK_FORMAT_ASTC_8x8_UNORM_BLOCK, vulkanDevice, queue); - } - else if (deviceFeatures.textureCompressionETC2) { - textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, vulkanDevice, queue); - } - else { - vks::tools::exitFatal("Device does not support any compressed texture format!", VK_ERROR_FEATURE_NOT_PRESENT); - } + textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/voyager_rgba_unorm.ktx", VK_FORMAT_R8G8B8A8_UNORM, vulkanDevice, queue); } void setupDescriptorPool() @@ -492,12 +471,6 @@ public: VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet)); - VkDescriptorImageInfo texDescriptor = - vks::initializers::descriptorImageInfo( - textures.colorMap.sampler, - textures.colorMap.view, - VK_IMAGE_LAYOUT_GENERAL); - std::vector writeDescriptorSets = { // Binding 0 : Vertex shader uniform buffer @@ -511,7 +484,7 @@ public: descriptorSet, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, - &texDescriptor) + &textures.colorMap.descriptor) }; vkUpdateDescriptorSets(device, writeDescriptorSets.size(), writeDescriptorSets.data(), 0, NULL);