Skip to content
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

support Metal renderer to auto generate mipmap for render target #2784

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

junjie020
Copy link
Contributor

I need metal renderer to auto generate mipmap, other renderer have been supported about this.

And I found this issue have discuss about this:

#798

So I follow this discuss and make it work.

Here is the document I referenced:

https://developer.apple.com/documentation/metal/mtlblitcommandencoder/1400748-generatemipmapsfortexture
https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf

Something should note about which format can generate mipmap.

As the document say that, texture format should:

Mipmaps are generated with scaled images for all levels up to the maximum level. The mipmap level count for the texture must be greater than 1. Mipmap generation works only for textures with color-renderable and color-filterable pixel formats.

And the format support color-renderable and color-filterable can be found in Metal-Feature-Set-Tables.pdf

But RBGA32F/RGBA32U/RGBA32I format is not list as filterable. I try in my device(Macbook pro M1), it work.

@bkaradzic
Copy link
Owner

cc @attilaz

@bkaradzic bkaradzic merged commit f76b678 into bkaradzic:master Apr 25, 2022
dmarcinkovic pushed a commit to DeepARSDK/bgfx that referenced this pull request Nov 20, 2023
mipek pushed a commit to mipek/bgfx that referenced this pull request Mar 2, 2024
…radzic#2784)

* support render target auto generate mipmap

* move autoGenMipmap check to s_textureFormat table
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