Commit Graph

1057 Commits

Author SHA1 Message Date
steve robb
f029468598 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30729174 by steve robb in ue5-main branch]
2024-01-19 16:41:35 -05:00
daniele vettorel
66febb5cc9 Make D3D11 query timeout thresholds configurable, increase the default timeout, and clean up timeout logic.
The VerifyD3D11Result logic already takes care of logging and checking the device removal reason.
#rb mihnea.balta

[CL 30684041 by daniele vettorel in ue5-main branch]
2024-01-18 10:24:41 -05:00
benjamin rouveyrol
0cff7410b6 Let FRHIViewDesc::EDimension decide the RHI's SRV/UAV dimension to be able to create 2D array SRVs/UAVs for cubemap textures
Keep the behavior from 25147071 when we want to create a 2D SRV of something which is not a 2D texture. This ensures we do not ignore FRHIViewDesc::FTexture::ArrayRange and select the right slice of a texture

#rb Luke.Thatcher
#jira UE-201831

[CL 30629413 by benjamin rouveyrol in ue5-main branch]
2024-01-16 02:32:32 -05:00
jimmy smith
cf2e6af0dd [Resubmit] Delete deprecated usage of GetRuntimeFormat and CreateCompressedInfo
#rb Aaron.McLeran

[CL 30580918 by jimmy smith in ue5-main branch]
2024-01-11 17:33:06 -05:00
yuriy odonnell
01419a8913 Add strongly typed EShaderOptionalDataKey to access shader optional data instead of adhoc characters
#rb carl.lloyd, christopher.waters, Colton.Daniels

[CL 30572888 by yuriy odonnell in ue5-main branch]
2024-01-11 13:36:32 -05:00
jimmy smith
dc9ff7a102 [Backout] - CL30570241
[FYI] jimmy.smith
Original CL Desc
-----------------------------------------------------------------
Delete deprecated usage of GetRuntimeFormat and CreateCompressedInfo
#rb Aaron.McLeran

[CL 30570451 by jimmy smith in ue5-main branch]
2024-01-11 11:42:33 -05:00
jimmy smith
c5e18ba2bb Delete deprecated usage of GetRuntimeFormat and CreateCompressedInfo
#rb Aaron.McLeran

[CL 30570266 by jimmy smith in ue5-main branch]
2024-01-11 11:34:30 -05:00
matt peters
bd992eb4e0 LLM: Use LLM_IF_ENABLED around all calls to OnLowLevelAlloc and OnLowLevelFree that are guarded by a macro for conditional compilation. LLM_IF_ENABLED is not strictly necessary; LLM or #if ENABLE_LOW_LEVEL_MEM_TRACKER will also both behave correctly. But LLM_IF_ENABLED is a small optimization (avoids a function call) and we want to apply it for consistency.
#jira UE-200297
#rnx
#rb Devin.Doucette

[CL 30479895 by matt peters in ue5-main branch]
2024-01-08 09:02:49 -05:00
christopher waters
e9661bc768 Preparing for dependency cleanup.
[CL 30244022 by christopher waters in ue5-main branch]
2023-12-11 13:55:22 -05:00
christopher waters
b6eee9f385 Fixing IDXGISwapchainProvider.h single file compile errors by adding the necessary DXGI includes.
[CL 30094861 by christopher waters in ue5-main branch]
2023-12-04 16:19:38 -05:00
charles bloom
4ee677c4b1 un-duplicate code in D3D11 and 12 rendertarget pixel conversion routines
#jira UE-201702
#rb fabian.giesen

[CL 30093260 by charles bloom in ue5-main branch]
2023-12-04 15:48:37 -05:00
charles bloom
b066d4c0b3 TextureRenderTarget clean up Create/Update not supporting all formats
use generic routines so all-format support is automatic
#rb fabian.giesen

[CL 30070416 by charles bloom in ue5-main branch]
2023-12-03 10:39:38 -05:00
christopher waters
2d9fd8b52f Removing unnecessary includes of ShaderCompiler.h. Also removing a few other unnecessary includes.
[CL 30045008 by christopher waters in ue5-main branch]
2023-12-01 12:35:29 -05:00
christopher waters
52e8fb4092 Refactoring D3D11 binding to not go through Context methods.
- 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]
2023-11-30 15:28:22 -05:00
marc audy
a66de8e79d Ongoing C4702 warning fixes
[CL 30003628 by marc audy in ue5-main branch]
2023-11-29 19:16:19 -05:00
benjamin rouveyrol
46a8fa88f8 remove device id check for HDR on windows:
* 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]
2023-11-28 03:39:43 -05:00
marc audy
bf0ba2c08e Fix C4702
#rb ryan.mangin
#rnx

[CL 29866863 by marc audy in ue5-main branch]
2023-11-21 11:28:56 -05:00
christopher waters
e67e3156f6 D3D12 Bindless Descriptor Updates
- 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]
2023-11-03 15:53:43 -04:00
zach harris
3a5af8510c Fixing the -Prefer<IHV> functionality for DirectX when selecting which graphics adapter to use and cleaning up DX11 adapter selection code to more closely match our DX12 implementation.
#rb daniele.vettorel

[CL 29191160 by zach harris in ue5-main branch]
2023-10-27 14:40:36 -04:00
mihnea balta
c09ff36c64 Deprecate DrawIndexedIndirect, since it's just a more confusing version of DrawIndexedPrimitiveIndirect.
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]
2023-10-19 06:29:04 -04:00
jonathan bard
ddf6dd3934 Refactored render target to texture conversion so that it can be done on any UTextureRenderTarget / UTexture type :
* 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]
2023-10-05 08:12:26 -04:00
zach bethel
5be1ae901a Fix crash in D3D11 when FMaterialRenderProxy::UpdateDeferredCachedUniformExpressions is using a non-immediate command list.
#rb mihnea.balta
#rnx

[CL 28283518 by zach bethel in ue5-main branch]
2023-09-27 14:17:10 -04:00
zach bethel
e7fdf09eb9 Fixed various RHI's to only clear targets with clear actions rather than all targets when any clear action is specified.
#jira UE-195766

[CL 28206288 by zach bethel in ue5-main branch]
2023-09-25 17:20:21 -04:00
zach bethel
0f40a4d17f Fixed RHIBindDebugLabelName to take a command list.
#jira UE-195436

[CL 27966365 by zach bethel in ue5-main branch]
2023-09-18 13:51:58 -04:00
christopher waters
3cc28e6db6 Removing individual parameter binding methods from IRHI*Context now that everything uses batched shader parameters
- 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]
2023-09-05 14:29:04 -04:00