Skip to content

Feature/to cache pipeline#111

Open
Mee-gu wants to merge 13 commits into
minggo:metal-supportfrom
Mee-gu:feature/toCachePipeline
Open

Feature/to cache pipeline#111
Mee-gu wants to merge 13 commits into
minggo:metal-supportfrom
Mee-gu:feature/toCachePipeline

Conversation

@Mee-gu

@Mee-gu Mee-gu commented Nov 7, 2018

Copy link
Copy Markdown
Contributor

Cache ShaderModule, RenderPass and RenderPipeline for reuse

Mee-gu and others added 7 commits October 25, 2018 10:03
…etal-support

* 'metal-support' of github.com:Mee-gu/new-renderer:
  use MTLPixelFormatDepth32Float_Stencil8 instead since it has better compatibility
  use MTLPixelFormatDepth32Float_Stencil8 instead since it has better compatibility
  【Feature】add test case (minggo#109)
Comment thread cocos/math/HashAlgorithm.h Outdated
Comment thread src/backend/BlendState.cpp Outdated
Comment thread src/backend/BlendState.h
Comment thread src/backend/StringUtils.hpp
Comment thread src/backend/Texture.cpp Outdated
Comment thread src/backend/metal/DeviceMTL.h Outdated
Comment thread src/backend/Device.h Outdated
Comment thread src/backend/Texture.h Outdated
}

size_t DeviceMTL::findRenderPipelineInCache(const RenderPipelineDescriptor& descriptor)
{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return RenderPipeline*?

Comment thread src/backend/metal/RenderPipelineMTL.mm
}

return HashAlgorithm::PJWHash(info.c_str(), info.length());
return std::hash<std::string>{}(info);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use std::hash since the collision probability approaching 1.0/std::numeric_limits<size_t>::max().

Comment thread src/backend/Device.h Outdated
virtual RenderPipeline* newRenderPipeline(const RenderPipelineDescriptor& descriptor) = 0;

// Cache RenderPipeline for reuse
// virtual RenderPipeline* cacheRenderPipeline(const RenderPipelineDescriptor& descriptor) = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unneeded codes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants