- Writing custom version of UE::RHICore::ApplyStaticUniformBuffers, UE::RHICore::RHISetShaderParametersShared, and UE::RHICore::RHISetShaderUnbindsShared for D3D11RHI to avoid redundant overhead.
- This removed the last uses of RHISetShaderTexture, RHISetShaderSampler, RHISetUAVParameter, RHISetShaderResourceViewParameter, and RHISetShaderParameter from D3D11RHI. Those functions are now gone.
[CL 30022429 by christopher waters in ue5-main branch]
* d3d12 / d3d11-editor are already using DXGI to check whether HDR is supported on the display.
* d3d11-cooked still relies on vendor extensions, but we propagate the information from FD3D11DynamicRHI::SetupDisplayHDRMetaData to GRHISupportsHDROutput. Because of that, we don't even call ChooseHDRDeviceAndColorGamut on vendors we do not support
Remove unnecessary check in EnsureColorSpace: it's valid to call CheckColorSpaceSupport with SDR
fix d3d11-cooked backbuffer format: both vendor extensions expect FP16 ScRGB, not HDR10 format
#rb eric.renaudhoude, mihnea.balta
#jira UE-200383 UE-168203
[CL 29955969 by benjamin rouveyrol in ue5-main branch]
- Descriptor updates are queued on the D3D12 context
- Split descriptor management type into a deferred, per-pipeline manager for Resources and a simple one for Samplers.
- Initial descriptor update flushing implementations are still WIP, CPU side heap copying/switching is up next.
- Added ability for platforms to provide custom descriptor update functions.
- Moved common code from Dispatch/Draw commands into common functions: SetupDispatch, SetupIndirectArgument, SetupDraw, SetupDispatchDraw and PostGpuEvent.
#jira UE-162017
#rb zach.bethel, jeannoe.morissette
[CL 29418682 by christopher waters in ue5-main branch]
Also, while we still have it, make sure it behaves consistently across all RHIs. D3D11 used to assert that NumInstances is above 1, even though it's not using it, and a few other RHIs inherited that behavior. Vulkan was actually using NumInstances as the number of indirect draws to perform, which would have crashed if the data was set up as D3D11 wanted it.
#rb christopher.waters
[CL 28912567 by mihnea balta in ue5-main branch]
* Added BP functions to create all types of UTexture from their UTextureRenderTarget counterpart (except UTextureRenderTargetCubeArray, since we don't have much of anything available to produce these ATM, but there's no reason it shouldn't work)
* Fixed crash when trying to create a UTexture out of a UTextureRenderTarget with a non-supported format. The error is also appropriately reported to the user via blueprint message log, instead of a message box in the past
Misc:
* UTextureRenderTarget have to implement CanConvertToTexture to indicate if they are currently able to be converted to a texture (e.g. valid size, supported format, etc.)
* There's now a generic UpdateTexture and ConstructTexture function on UTextureRenderTarget that can be used to update an existing texture or create a new one
* D3D11 and D3D12's RHIReadSurfaceData now support reading from (cube) texture arrays
* Added R8G8 to FColor conversion (the missing .BA channels are filled with 0 and 255, respectively)
* Deprecated all redundant ReadPixels / ReadFloat16Pixels from child classes of FRenderTarget (FTextureResource, FTextureRenderTargetVolumeResource, FTextureRenderTarget2DArrayResource). Note that ReadPixels / ReadFloat16Pixels / ReadLinearColorPixels are now virtual to avoid this situation and yet allow FTextureRenderTargetVolumeResource to implement them in its own way (unlike all other implementations, it uses Read3DSurfaceFloatData internally)
* Fixed typo in FTextureRenderTargetVolumeResource::GetDisplayGamma(), which didn't take PF_R32_FORMAT into account
* Added FTextureSourceFormatInfo and GTextureSourceFormats, which provides information about the various supported formats in ETextureSourceFormat (similar to EPixelFormat and GPixelFormats)
#jira UE-194364
#rb jon.cain
#tests editor
[CL 28494190 by jonathan bard in ue5-main branch]
- RHISetShaderTexture, RHISetShaderSampler, RHISetUAVParameter, RHISetShaderResourceViewParameter, RHISetShaderUniformBuffer, RHISetShaderParameter
- Only removing from the interface, each RHI still uses them in conjunction with UE::RHICore::RHISetShaderParametersShared, which uses the RHI type and not the interface.
- These methods are not part of the "public" interface so no deprecation is needed.
#rb luke.thatcher
[CL 27605633 by christopher waters in ue5-main branch]
- Discovered that a number of RHISetShaderResourceViewParameter and RHISetUAVParameter implementations do nothing with null resources, meaning that RHISetShaderUnbinds calls end up doing zero work with all the overhead.
- Adding GRHIGlobals::NeedsShaderUnbinds for RHIs to signal they need/handle unbind commands.
- RHIs that actually do work with RHISetShaderUnbinds now set NeedsShaderUnbinds on startup.
- Removed RHISetShaderUnbinds implementations that did zero work.
#rb luke.thatcher
[CL 27554898 by christopher waters in ue5-main branch]
- Fixing implementations to handle source offsets.
- Fixing implementations to handle source data smaller than the image's pitch (very small regions).
- Fixing implementations to handle RHI bypass correctly.
#rb Dmitriy.Dyomin, Florin.Pascu, Jeannoe.Morissette, Luke.Thatcher, Mihnea.Balta
[CL 26920943 by christopher waters in ue5-main branch]
- Renaming GRHIGlobals.CurrentTextureMemorySize to GRHIGlobals.StreamingTextureMemorySizeInKB
- Renaming GRHIGlobals.CurrentRendertargetMemorySize to GRHIGlobals.NonStreamingTextureMemorySizeInKB
- Adding GRHIGlobals.BufferMemorySize and GRHIGlobals.UniformBufferMemorySize
- Deduplicating RHI stat accounting code and changing it to use RHI Descs.
- UE::RHICore::UpdateGlobalTextureStats is for StreamingTextureMemorySizeInKB and NonStreamingTextureMemorySizeInKB. This still allows platforms to control where the memory is counted.
- Adding more Buffer RHI stat accounting code to RHIs that were missing it.
- UE::RHICore::UpdateGlobalBufferStats is for BufferMemorySize and UniformBufferMemorySize.
- FillBaselineTextureMemoryStats initializes and fills the common members of FTextureMemoryStats.
- Adding ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking which will force the texture to be counted in NonStreamingTextureMemorySizeInKB.
- Changing all RenderTargetPool textures to be flagged with ETextureCreateFlags::ForceIntoNonStreamingMemoryTracking so they aren't counted against streaming budgets.
- Adding UAV Texture stats instead of lumping them with regular textures
- Adding Buffer stats for ByteAddressBuffer, DrawIndirect and Misc
#jira UE-188415
#rb mihnea.balta, zach.bethel
[CL 26158360 by christopher waters in ue5-main branch]
* Moved dllexport from type to methods/staticvar in all Engine runtime code. This improves compile times, memory and performance in dll builds
[CL 26082269 by henrik karlsson in ue5-main branch]