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

Fallback SurfaceFormat for RenderTargets #6170

Merged
merged 6 commits into from
Feb 12, 2018

Conversation

nkast
Copy link
Contributor

@nkast nkast commented Jan 30, 2018

fixes #6036

This PR partially implements Adapter.QueryRenderTargetFormat().

The use of QuerySelectedFormat() is not perfect. We need to rethink how RenderTargets call the base Texture constructor.

@dellis1972
Copy link
Contributor

@nkast should we be using the data from the OpenGL extensions to decide if we support certain formats on the GL platforms?

@nkast
Copy link
Contributor Author

nkast commented Feb 8, 2018

For now this PR deals only with compressed formats (DXT,Alpha8,NormalizedByte) that are not supported as renderTargets. There is no need to query the adapter because GPUs don't compress textures on the fly. The resulting format should always be Color.

After that I will look into implementing the rest.

  • Newer formats depend on the Profile. For example a combination of Reach + Single will return Color (XNA). I will add this in my Reach PR once we have this PR merged.
  • Optional formats like the 16bit bgr565 and bgr4444 will require to query the adapter via OpenGL extensions or by creating a temp Device under DirectX. Or we can phase those formats out and return Color by default.
  • preferredMultiSampleCount is the second case where we need to query the adapter.

@tomspilman
Copy link
Member

Thanks @nkast !

@tomspilman tomspilman added this to the 3.7 Release milestone Feb 12, 2018
@tomspilman tomspilman merged commit 93c247d into MonoGame:develop Feb 12, 2018
@nkast nkast deleted the PreferredSurfaceFormat branch February 16, 2018 05:51
@nkast nkast mentioned this pull request Jul 2, 2018
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.

[SharpDX] Problems with DXT render targets
3 participants