diff --git a/OgreMain/include/OgreImage.h b/OgreMain/include/OgreImage.h index ab73b38f927..cc4818a887a 100644 --- a/OgreMain/include/OgreImage.h +++ b/OgreMain/include/OgreImage.h @@ -252,7 +252,7 @@ namespace Ogre { @see Image::load( const String& filename ) */ - Image & load(const DataStreamPtr& stream, const String& type = BLANKSTRING ); + Image & load(const DataStreamPtr& stream, String type = BLANKSTRING ); /** Utility method to combine 2 separate images into this one, with the first image source supplying the RGB channels, and the second image supplying the diff --git a/OgreMain/src/OgreImage.cpp b/OgreMain/src/OgreImage.cpp index 874edca9daf..be83f3c626e 100644 --- a/OgreMain/src/OgreImage.cpp +++ b/OgreMain/src/OgreImage.cpp @@ -277,10 +277,18 @@ namespace Ogre { return Codec::getCodec(formatextension)->encode(this); } //----------------------------------------------------------------------------- - Image & Image::load(const DataStreamPtr& stream, const String& type ) + Image & Image::load(const DataStreamPtr& stream, String type ) { freeMemory(); + if (type.empty()) + { + String base, ext; + StringUtil::splitBaseFilename(stream->getName(), base, ext); + if (!ext.empty()) + type = ext; + } + Codec * pCodec = 0; if (!type.empty()) { diff --git a/PlugIns/GLSLang/src/OgreGLSLang.cpp b/PlugIns/GLSLang/src/OgreGLSLang.cpp index 157f500963f..16d09cfc4c4 100644 --- a/PlugIns/GLSLang/src/OgreGLSLang.cpp +++ b/PlugIns/GLSLang/src/OgreGLSLang.cpp @@ -475,6 +475,9 @@ void GLSLangProgram::prepareImpl() auto uboName = String(program.getUniformBlockName(blockIdx)); if(uboName != "OgreUniforms") { + if(mType == GPT_MESH_PROGRAM || mType == GPT_TASK_PROGRAM) + continue; // SSBOs in mesh shaders are used for vertex buffers + GpuProgramManager::getSingleton().getSharedParameters(uboName); // TODO: there is no public API to set the binding point and create the correct buffer yet } diff --git a/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp b/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp index cc9aac46a50..f74e9daf5ac 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanDevice.cpp @@ -250,6 +250,7 @@ namespace Ogre extensions.push_back( VK_KHR_SWAPCHAIN_EXTENSION_NAME ); VkPhysicalDeviceFeatures2 features2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2}; + features2.features = mDeviceFeatures; #ifdef VK_EXT_mesh_shader VkPhysicalDeviceMeshShaderFeaturesEXT meshShaderFeatures = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT}; diff --git a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp index 94d913ffd80..bb510c94bf2 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanRenderSystem.cpp @@ -768,6 +768,8 @@ namespace Ogre deviceExtensions.push_back( VK_EXT_MESH_SHADER_EXTENSION_NAME ); deviceExtensions.push_back( VK_KHR_SPIRV_1_4_EXTENSION_NAME ); mRealCapabilities->setCapability(RSC_MESH_PROGRAM); + + mDescriptorSetBindings[0].stageFlags |= VK_SHADER_STAGE_MESH_BIT_NV; } #endif } @@ -1102,12 +1104,14 @@ namespace Ogre { mActiveParameters[gptype] = params; + int dstUBO = gptype % GPT_PIPELINE_COUNT; + auto sizeBytes = params->getConstantList().size(); - if(sizeBytes && gptype <= GPT_FRAGMENT_PROGRAM) + if(sizeBytes && dstUBO < 2) { auto step = alignToNextMultiple(sizeBytes, mDevice->mDeviceProperties.limits.minUniformBufferOffsetAlignment); - mUBOInfo[gptype].range = sizeBytes; + mUBOInfo[dstUBO].range = sizeBytes; if (std::accumulate(mAutoParamsBufferUsage.begin(), mAutoParamsBufferUsage.end(), 0) + step >= mAutoParamsBuffer->getSizeInBytes()) @@ -1119,7 +1123,7 @@ namespace Ogre if((mAutoParamsBufferPos + sizeBytes) >= mAutoParamsBuffer->getSizeInBytes()) mAutoParamsBufferPos = 0; - mUBODynOffsets[gptype] = mAutoParamsBufferPos; + mUBODynOffsets[dstUBO] = mAutoParamsBufferPos; mAutoParamsBuffer->writeData(mAutoParamsBufferPos, sizeBytes, params->getConstantList().data()); mAutoParamsBufferPos += step;