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

Implement GraphicsAdapter.QueryRenderTargetFormat() #6160

Closed
wants to merge 3 commits into from

Conversation

nkast
Copy link
Contributor

@nkast nkast commented Jan 22, 2018

Fallback of unsuported and profile depended SurfaceFormat. (Dxt, Single, drBlendable, ...)

Not implemeneted:
Optional/Device depended formats. (566, 4444, ...)
Depth Formats.
MultiSampleCount.

@nkast nkast force-pushed the tnc_QueryRenderTargetFormat branch from ad65123 to 4d577a9 Compare January 28, 2018 12:02
@dellis1972
Copy link
Contributor

This works on GL based systems too right?

@nkast
Copy link
Contributor Author

nkast commented Jan 30, 2018

Yes, this works on all platforms in a way compatible with XNA. So far I doesn't depend on the device.
The changes in GraphicsAdapter.Legacy.cs and GraphicsAdapter.cs are identical.

After it's merged we can use it to fix #6036 and also pass the tests of b26f927.

@nkast
Copy link
Contributor Author

nkast commented Jan 30, 2018

If we are going to use this QueryRenderTargetFormat() in the RenderTarget/Texture construction it will change the behavior depending on the Profile. For example, HdrBlendable will become Color under Reach profile. I think I should move some of this code in #5451.

The way this is going work on the Texture construction:

bool isSupported = device.adapter.QueryRenderTargetFormat(device.Profile, prefferedSurfaceFormat, out surfaceFormat);
if(!isSupported)
{
if(this is IRenderTarget)
 surfaceFormat = prefferedSurfaceFormat;
else
 throw new Exception(device.Profile + "does not support surface "+ prefferedSurfaceFormat);
}

That won't be a good error message because some formats (DXT, NormalizedByte2) are not supported as RenderTargets in any profile.
So I think I will post a fix for #6036 that does not really on QueryRenderTargetFormat() but does some checks inline and throws a better error.

@nkast
Copy link
Contributor Author

nkast commented Jan 30, 2018

Ok, I have a new PR #6170 that fixes #6036 without the Profile fallback.

@nkast
Copy link
Contributor Author

nkast commented Feb 13, 2018

#6170 is merged. I moved the rest to #5451

@nkast nkast closed this Feb 13, 2018
@nkast nkast deleted the tnc_QueryRenderTargetFormat branch February 13, 2018 07:53
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