You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3109545 on 2016/09/01 by Zabir.Hoque Merging DX12 RHIs stage 1. #Tests Ran InfiltratorDemo, ElementalDemo, ShooterGame Change 3109580 on 2016/09/01 by Zabir.Hoque Merging DX12 RHI. Stage 2: Moving XB and Windows APIs to a common location. This will cause a build break, but will allow us to preserve history. Change 3109632 on 2016/09/01 by Zabir.Hoque Merge DX12 RHI. Stage 3. Ported all changes and merged RHI into common and Win and XB1 specialized folder. Current with MS partners branch and Release 4.13. Change 3109690 on 2016/09/01 by Zabir.Hoque Fixing build break after large merge from partners branch and syncing to latest Dev-Rendering. Change 3109716 on 2016/09/01 by Zabir.Hoque Fix build warnings after merge. Change 3109733 on 2016/09/01 by Zabir.Hoque More build fixes for things pointing from XboxOneD3D12RHI to D3D12RHI Change 3109773 on 2016/09/01 by Zabir.Hoque Fixing code analysis warnings. Change 3109870 on 2016/09/01 by Rolando.Caloca DR - Simple clear mode Change 3110066 on 2016/09/01 by Zabir.Hoque Remove C++11 feature so VS2013 can compile for Fortnite. Change 3110335 on 2016/09/01 by Brian.Karis Fixed double lighting of clear coat, cloth, and eyes #review-3108222 @Ben.Woodhouse Change 3110411 on 2016/09/01 by Rolando.Caloca DR - vk - Fix bogus assert - Fix pipeline barrier with levelCount=0 Change 3110573 on 2016/09/01 by Zabir.Hoque Exclude D3D12 merged RHI from Mac Builds. Change 3110681 on 2016/09/01 by Rolando.Caloca DR - vk - Swapchain fix for drivers returning infinite swapchain images Change 3110936 on 2016/09/01 by Rolando.Caloca DR - vk - Fix crash when dumping unused heaps - Show file/line if enabled Change 3111034 on 2016/09/01 by Rolando.Caloca DR - vk - Fix exclude rect clear Change 3111139 on 2016/09/01 by Rolando.Caloca DR - Automatically enable capturing mode if running under RenderDoc Change 3111170 on 2016/09/01 by Rolando.Caloca DR - vk - Store max info per descriptor set pool Change 3111234 on 2016/09/01 by Zabir.Hoque XB1 compiler warnings. Change 3111763 on 2016/09/02 by Rolando.Caloca DR - Fix typo in shader PR #2759 #jira UE-35496 Change 3111846 on 2016/09/02 by Rolando.Caloca DR - vk - Update to SDK 1.0.24.0 (including glslang) Change 3111916 on 2016/09/02 by Ben.Woodhouse Fix for timestamp query results being broken in the XB1 DX11 RHI (caused by a merge issue with dev-platform) Also clarify some variable naming Change 3112048 on 2016/09/02 by Rolando.Caloca DR - vk - Compile fix for build machines Change 3112315 on 2016/09/02 by Rolando.Caloca DR - vk - Added peak usage to mem dump Change 3112791 on 2016/09/02 by Daniel.Wright FD3D12PipelineStateCache debug fix Change 3113483 on 2016/09/05 by Ben.Woodhouse Fix potential issue with timestamp and occlusion queries overlapping with new query packing optimisation. We may want to put these into separate buffers to avoid reduce the padding with timestamp queries (timestamp queries currently use 4x the memory they actually need due to additional padding) Change 3113488 on 2016/09/05 by Ben.Woodhouse GPu profiler : fix for render thread performance issues, enable GPU profiler by default Avoids RHIThread stalls in query creation by reusing queries via a pool. A FRenderQueryPool class already existed for doing this, so this was moved into the engine to make it accessible from both the engine and renderer modules Tested on XB1,PS4,PC dx11 Change 3114286 on 2016/09/06 by Chris.Bunner Copying CL 3114173 from 4.13 - Better enforce render resource limits on widget draw size.Jira UE-26375. Change 3114883 on 2016/09/06 by Rolando.Caloca DR - vk - Delete resources on the RHI thread - Set blend factor to 1 - Added num mips & num layers to RT views - Added missing destructors - Fix for crash on rhi thread Change 3116308 on 2016/09/07 by Rolando.Caloca DR - vk - New renderpass/transition/barrier rewrite for sm4 (disabled) - Fixes for 3d texture RTs Change 3117409 on 2016/09/08 by Gil.Gribb Merging //UE4/Dev-Main@3117389 to Dev-Rendering (//UE4/Dev-Rendering) Change 3117445 on 2016/09/08 by Gil.Gribb Fix merge fallout Change 3117555 on 2016/09/08 by Rolando.Caloca DR - Fix merge issue Change 3117687 on 2016/09/08 by Marc.Olano Create new Vector Noise material node, and *3DDeriv numerical derivative material functions Vector Noise node has noise functions with 3D output, including cellnoise (random color per cell), computed noise with vector output, gradient of 3D noise, curl of 3D noise, and version of Voronoi noise returning seed position in the closest Voronoi cell. 3DDeriv functions compute gradient and curl on any expression using centered differences from four samples offset in a tetrahedral pattern (two fewer than the common axis-aligned offset method) Change 3117696 on 2016/09/08 by Rolando.Caloca DR - Replicate 4.13.1 fix from3117678UE4.13 - Better error reporting when SCW fails/crashes jira UE-17227 Change 3117720 on 2016/09/08 by Rolando.Caloca DR - vk - Fix for static analysis Change 3117786 on 2016/09/08 by Rolando.Caloca DR - vk - Use new alignment Change 3118145 on 2016/09/08 by Marcus.Wassmer Fix async compute clear not waiting for the gfx pipe properly. Also appears to fix a rare PS4 gpu hang. Change 3118329 on 2016/09/08 by Brian.Karis Fix screen size calculations for LOD Change 3118351 on 2016/09/08 by Brian.Karis Quadric mesh simplifier! In and working for the first time. ScreenSize is now correctly calculated from MaxDeviation Pixel Error now a reduction setting in LOD group. Binary Heap is fixed and functional. Still needs to play better with 3rd party reduction. Change 3118457 on 2016/09/08 by Rolando.Caloca DR - vk - Fix cube & 3d texture transitions & copies Change 3118540 on 2016/09/08 by Benjamin.Hyder Re-Submitting Noise assets to get engine version Change 3119438 on 2016/09/09 by Rolando.Caloca DR - vk - Added barrier & cache flushes when reading back GPU memory - Added cubemap & 3d texture barriers - Added cubemap & 3d texture copy image Change 3119518 on 2016/09/09 by Brian.Karis Fixed compile error Change 3119580 on 2016/09/09 by Marc.Olano Documentation for Vector noise Change 3119710 on 2016/09/09 by Rolando.Caloca DR - vk - Fix read stencil mask & front/back Change 3119865 on 2016/09/09 by Rolando.Caloca DR - vk - RHIReadSurfaceFloatData - Fix redundant write transitions - Simplify copy and transition code Change 3120059 on 2016/09/09 by Rolando.Caloca DR - vk - Static analysis warnings Change 3120413 on 2016/09/09 by Mark.Satterthwaite Fix AVFMedia plugin failing when a movie has captions. #jira UE-35828 Change 3120936 on 2016/09/12 by Ben.Woodhouse Add slate rendering to the GPU stats Change 3121204 on 2016/09/12 by Rolando.Caloca DR - vk - Fix geometry shaders position - Revert translucent workaround Change3121467on 2016/09/12 by Rolando.Caloca DR - Fix integration issue (lost some shader defines) Change 3121862 on 2016/09/12 by Zabir.Hoque Fixing Code Analysis warnings. #jira: UE-35860 Change 3122139 on 2016/09/12 by Ben.Woodhouse Re-enable the checkerboard lighting by default to workaround skin lighting issue in fortnite (again) #jira UE-35886 Change 3122278 on 2016/09/12 by Zabir.Hoque 2nd Attempt at Code Analysis warnings [CL 3122339 by Marcus Wassmer in Main branch]
178 lines
4.1 KiB
C++
178 lines
4.1 KiB
C++
// Copyright (C) 2009 Nine Realms, Inc
|
|
//
|
|
|
|
#pragma once
|
|
|
|
/*
|
|
===============================================================================
|
|
Direct Mapped Cache
|
|
size must be a power of 2
|
|
===============================================================================
|
|
*/
|
|
|
|
template< typename T, uint32 Size >
|
|
class TCacheDirect
|
|
{
|
|
public:
|
|
TCacheDirect();
|
|
|
|
// find element in cache, returns NULL if not found
|
|
T* Find( uint32 Key );
|
|
// add new element not already in cache
|
|
void Add( uint32 Key, const T& Element );
|
|
// invalidates element if currently in cache
|
|
void Remove( uint32 Key );
|
|
|
|
protected:
|
|
// Use AOS instead?
|
|
T Cache[ Size ];
|
|
uint32 Keys[ Size ];
|
|
};
|
|
|
|
template< typename T, uint32 Size >
|
|
FORCEINLINE TCacheDirect<T, Size>::TCacheDirect()
|
|
{
|
|
static_assert((Size & (Size - 1)) == 0, "Size must be power of 2.");
|
|
|
|
FMemory::Memset( Keys, 0xff );
|
|
}
|
|
|
|
template< typename T, uint32 Size >
|
|
FORCEINLINE T* TCacheDirect<T, Size>::Find( uint32 Key )
|
|
{
|
|
uint32 Index = Key & ( Size - 1 );
|
|
return ( Keys[Index] == Key ) ? &Cache[Index] : NULL;
|
|
}
|
|
|
|
template< typename T, uint32 Size >
|
|
FORCEINLINE void TCacheDirect<T, Size>::Add( uint32 Key, const T& Element )
|
|
{
|
|
checkSlow( !Find( Key ) );
|
|
|
|
uint32 Index = Key & ( Size - 1 );
|
|
Keys[Index] = Key;
|
|
Cache[Index] = Element;
|
|
}
|
|
|
|
template< typename T, uint32 Size >
|
|
FORCEINLINE void TCacheDirect<T, Size>::Remove( uint32 Key )
|
|
{
|
|
uint32 Index = Key & ( Size - 1 );
|
|
if( Keys[ Index ] == Key )
|
|
{
|
|
Keys[ Index ] = ~0u;
|
|
}
|
|
}
|
|
|
|
/*
|
|
===============================================================================
|
|
4-way Set Associative Cache
|
|
LRU replacement
|
|
size must be a power of 2 and >= 4
|
|
===============================================================================
|
|
*/
|
|
|
|
template< typename T, uint32 size >
|
|
class TCache4Way
|
|
{
|
|
public:
|
|
TCache4Way();
|
|
|
|
T* Find( uint32 key ); // find element in cache, returns NULL if not found
|
|
|
|
void Add( uint32 key, const T& Element ); // add new element not already in cache
|
|
void Remove( uint32 key ); // invalidates element if currently in cache
|
|
|
|
protected:
|
|
T cache[size >> 2][4];
|
|
uint32 keys[size >> 2][4];
|
|
uint8 order[size >> 2];
|
|
};
|
|
|
|
template< typename T, uint32 size >
|
|
FORCEINLINE TCache4Way<T, size>::TCache4Way()
|
|
{
|
|
static_assert((Size & (Size - 1)) == 0, "Size must be power of 2.");
|
|
|
|
FMemory::Memset( Keys, 0xff );
|
|
|
|
uint8 StartingOrder = (3 << 6) | (2 << 4) | (1 << 2) | 0;
|
|
FMemory::Memset( order, StartingOrder );
|
|
}
|
|
|
|
template< typename T, uint32 size >
|
|
FORCEINLINE T* TCache4Way<T, size>::Find( uint32 key )
|
|
{
|
|
uint32 index = key & ( (size >> 2) - 1 );
|
|
uint32 SetBits = order[index];
|
|
|
|
uint32 SetBitsShifted = SetBits;
|
|
uint32 LowMask = 0;
|
|
uint32 HighMask = 0xfc;
|
|
for( uint32 i = 0; i < 4; i++ )
|
|
{
|
|
uint32 SetOffset = SetBitsShifted & 3;
|
|
if( key == keys[index][ SetOffset ] )
|
|
{
|
|
// Update order. SetIndex to MRU
|
|
uint32 LowerBits = SetBits & LowMask;
|
|
uint32 HigherBits = SetBits & HighMask;
|
|
order[index] = HigherBits | (LowerBits << 2) | SetOffset;
|
|
|
|
return &cache[index][ SetOffset ];
|
|
}
|
|
|
|
SetBitsShifted >>= 2;
|
|
LowMask = (LowMask << 2) | 3;
|
|
HighMask <<= 2;
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
template< typename T, uint32 size >
|
|
FORCEINLINE void TCache4Way<T, size>::Add( uint32 Key, const T& Element )
|
|
{
|
|
checkSlow( !Find( key ) );
|
|
|
|
uint32 index = key & ( (size >> 2) - 1 );
|
|
|
|
uint32 SetBits = order[index];
|
|
// Take LRU
|
|
uint32 SetOffset = (SetBits >> 6) & 3;
|
|
// Set as MRU
|
|
order[index] = (SetBits << 2) | SetOffset;
|
|
|
|
keys[index][ SetOffset ] = Key;
|
|
cache[index][ SetOffset ] = Element;
|
|
}
|
|
|
|
template< typename T, uint32 size >
|
|
FORCEINLINE void TCache4Way<T, size>::Remove( uint32 key )
|
|
{
|
|
uint32 index = key & ( (size >> 2) - 1 );
|
|
uint32 SetBits = order[index];
|
|
|
|
uint32 SetBitsShifted = SetBits;
|
|
uint32 LowMask = 0;
|
|
uint32 HighMask = 0xfc;
|
|
for( uint32 i = 0; i < 4; i++ )
|
|
{
|
|
uint32 SetOffset = SetBitsShifted & 3;
|
|
if( key == keys[index][ SetIndex ] )
|
|
{
|
|
// Update order. SetIndex to LRU.
|
|
uint32 LowerBits = SetBits & LowMask;
|
|
uint32 HigherBits = SetBits & HighMask;
|
|
order[index] = (SetOffset << 6) | (HigherBits >> 2) | LowerBits;
|
|
|
|
keys[index][ SetOffset ] = ~0u;
|
|
return;
|
|
}
|
|
|
|
SetBitsShifted >>= 2;
|
|
LowMask = (LowMask << 2) | 3;
|
|
HighMask <<= 2;
|
|
}
|
|
}
|