update pixel format of UTextureRenderTarget2D instances#4321
Merged
Conversation
switch pixel format for various image types from EPixelFormat::PF_B8G8R8A8 to EPixelFormat::PF_FloatRGBA to enable compatibility with FD3D11DynamicRHI::RHIReadSurfaceFloatData
Contributor
|
Are we sure this is correct, seems strange that this only results in crashes sometimes. |
Collaborator
|
Thanks @zimmy87! |
Contributor
Author
|
Thanks for taking a look at this PR @rajat2004, I think you might be confusing #4120 with a related issue #3291. When I tried the repro of #4120, I was getting a 100% repro, so this isn't an intermittent or timing issue. The relevant UE4 source code is here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #4120
About
This PR switches the pixel format inside the UTextureRenderTarget2D for various image types from EPixelFormat::PF_B8G8R8A8 to EPixelFormat::PF_FloatRGBA to enable compatibility with FD3D11DynamicRHI::RHIReadSurfaceFloatData. There is a check inside FD3D11DynamicRHI::RHIReadSurfaceFloatData that ensures the pixel format of the inputted FRHITexture is EPixelFormat::PF_FloatRGBA.
How Has This Been Tested?
The scenario described in the repro steps of #4120 was confirmed to be working with this fix. Basic movement of a drone with a controller was tested with subwindows for each ImageType enabled to confirm each ImageType renders correctly. hello_drone.py was also run to confirm scene captures can still be taken and look correct.
Screenshots (if appropriate):