-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Vulkan: Descriptor Set Layouts #3679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
534db15
d424c65
5e088e2
67936d1
ea1144b
5cbaea9
934a138
b1bd629
0660819
5a3ec03
bbb8097
290d738
0349ee3
baf2b78
8940b82
23349c9
7a7b086
75f9644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert - do DescriptorProfileHint on the GpuProgram, not here in pass. |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert all |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Catch this case in Vulkan |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,13 +327,31 @@ static EShLanguage getShLanguage(GpuProgramType type) | |
| return EShLangFragment; | ||
| } | ||
|
|
||
| class CmdDescriptorSetProfile : public ParamCommand | ||
| { | ||
| public: | ||
| String doGet(const void* target) const override | ||
| { | ||
| return static_cast<const GLSLangProgram*>(target)->getDescriptorSetProfile(); | ||
| } | ||
| void doSet(void* target, const String& val) override | ||
| { | ||
| static_cast<GLSLangProgram*>(target)->setDescriptorSetProfile(val); | ||
| } | ||
| }; | ||
| static CmdDescriptorSetProfile msCmdDescriptorSetProfile; | ||
|
|
||
| GLSLangProgram::GLSLangProgram(ResourceManager* creator, const String& name, ResourceHandle handle, | ||
| const String& group, bool isManual, ManualResourceLoader* loader) | ||
| : HighLevelGpuProgram(creator, name, handle, group, isManual, loader) | ||
| { | ||
| if (createParamDictionary("glslangProgram")) | ||
| { | ||
| setupBaseParamDictionary(); | ||
| ParamDictionary* dict = getParamDictionary(); | ||
| dict->addParameter(ParameterDef("descriptor_set_profile", "Descriptor set profile override. Values: Auto, " | ||
| "Graphics, Compute, AllUnits", PT_STRING), &msCmdDescriptorSetProfile); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unused, delete comment. |
||
|
|
||
| memset(&DefaultTBuiltInResource.limits, 1, sizeof(TLimits)); | ||
|
|
||
| if(sizeof(TBuiltInResource) == 420) // replace with build_info.h, when it is universally available | ||
|
|
@@ -369,6 +387,8 @@ void GLSLangProgram::createLowLevelImpl() | |
|
|
||
| mAssemblerProgram = | ||
| GpuProgramManager::getSingleton().createProgram(mName + "/Delegate", mGroup, mSyntaxCode, mType); | ||
| if (!mDescriptorSetProfile.empty()) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove empty check |
||
| mAssemblerProgram->setParameter("descriptor_set_profile", mDescriptorSetProfile); | ||
| String assemblyStr((char*)mAssembly.data(), mAssembly.size() * sizeof(uint32)); | ||
| mAssemblerProgram->setSource(assemblyStr); | ||
| mAssembly.clear(); // delegate stores the data now | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ namespace Ogre | |
|
|
||
| static VkInstance createInstance( FastArray<const char *> &extensions, | ||
| FastArray<const char *> &layers, | ||
| PFN_vkDebugReportCallbackEXT debugCallback ); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert here, include in another branch. |
||
| void* pNext = nullptr); | ||
|
|
||
| void createPhysicalDevice( uint32 deviceIdx ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,14 @@ namespace Ogre | |
| class VulkanProgram : public GpuProgram | ||
| { | ||
| public: | ||
| enum DescriptorSetProfileHint | ||
| { | ||
| DescriptorSetProfileAuto, | ||
| DescriptorSetProfileGraphics, | ||
| DescriptorSetProfileCompute, | ||
| DescriptorSetProfileAllUnits | ||
| }; | ||
|
|
||
| VulkanProgram( ResourceManager *creator, const String &name, ResourceHandle handle, | ||
| const String &group, bool isManual, ManualResourceLoader *loader, | ||
| VulkanDevice *device ); | ||
|
|
@@ -53,6 +61,11 @@ namespace Ogre | |
| VkPipelineShaderStageCreateInfo getPipelineShaderStageCi() const; | ||
|
|
||
| uint32 getDrawIdLocation() const { return mDrawIdLocation; } | ||
| DescriptorSetProfileHint getDescriptorSetProfileHint() const { return mDescriptorSetProfileHint; } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same naming as GLSLANG |
||
| void setDescriptorSetProfileHint( DescriptorSetProfileHint hint ) | ||
| { | ||
| mDescriptorSetProfileHint = hint; | ||
| } | ||
|
|
||
| private: | ||
| void loadFromSource() override; | ||
|
|
@@ -61,6 +74,7 @@ namespace Ogre | |
| VulkanDevice *mDevice; | ||
| VkShaderModule mShaderModule; | ||
| uint32 mDrawIdLocation; | ||
| DescriptorSetProfileHint mDescriptorSetProfileHint; | ||
| }; | ||
|
|
||
| /** Factory class for Vulkan programs. */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ namespace Ogre | |
| /// | ||
| /// Thus we generate VkRenderPass and FBOs together | ||
| VkRenderPass mRenderPass; | ||
| VkRenderPass mRenderPassLoad; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert in this branch |
||
|
|
||
| VulkanFrameBufferDescValue(); | ||
| }; | ||
|
|
@@ -80,6 +81,7 @@ namespace Ogre | |
| VulkanTextureGpu* mDepth; | ||
| uint8 mNumColourEntries = 0; | ||
| uint8 mSlice = 0; | ||
| bool mResuming = false; | ||
| private: | ||
| // 1 per MRT | ||
| // 1 per MRT MSAA resolve | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply set the profile, more is not necessary.