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

update pixel format of UTextureRenderTarget2D instances #4321

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

zimmy87
Copy link
Contributor

@zimmy87 zimmy87 commented Jan 26, 2022

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

switch pixel format for various image types from EPixelFormat::PF_B8G8R8A8 to EPixelFormat::PF_FloatRGBA to enable compatibility with FD3D11DynamicRHI::RHIReadSurfaceFloatData
@rajat2004
Copy link
Contributor

Are we sure this is correct, seems strange that this only results in crashes sometimes.
Could you also put a link (or filename) to the relevant UE4 source code if possible, thanks!

@jonyMarino jonyMarino merged commit 1b68050 into microsoft:master Jan 31, 2022
@jonyMarino
Copy link
Collaborator

Thanks @zimmy87!

@zimmy87
Copy link
Contributor Author

zimmy87 commented Jan 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breakpoint in RenderRequest.cpp while taking Scene Images
3 participants