Skip to content

Feature/to cache pipeline#111

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

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

Conversation

@Mee-gu
Copy link
Copy Markdown
Contributor

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

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)
}

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*?

}

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().

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