Skip to content

Commit 5f6fe72

Browse files
committed
Merge remote-tracking branch 'origin/master' into user/amarp/sdk
2 parents 582700f + bf02bf0 commit 5f6fe72

1,207 files changed

Lines changed: 138433 additions & 300244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@
2121
*.opendb
2222
Samples/Desktop/D3D12HelloWorld/src/HelloVAResourceInterop/*.h264
2323
Samples/Desktop/D3D12HelloWorld/src/HelloVAEncode/*.h264
24+
/Samples/Desktop/D3D12Raytracing/src/D3D12OMMOfflineBaker/x64
25+
/Samples/Desktop/D3D12Raytracing/src/x64
26+
/Samples/Desktop/D3D12Raytracing/src/D3D12OMMOfflineBaker/leavesOMM.bin
27+
/Samples/Desktop/D3D12Raytracing/src/D3D12OMMOfflineBaker/treeModel.bin
28+
/Samples/Desktop/D3D12Raytracing/src/D3D12OMMOfflineBaker/treeOMM.bin
29+
/Samples/Desktop/D3D12Raytracing/src/D3D12OMMOfflineBaker/jacaranda_tree_4k.obj
30+
31+
/Samples/Desktop/**/x64

Libraries/D3DX12Residency/d3dx12Residency.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,16 @@ namespace D3DX12Residency
406406

407407
HRESULT GPUWait(ID3D12CommandQueue* pQueue)
408408
{
409-
HRESULT hr = pQueue->Wait(pFence, FenceValue);
410-
RESIDENCY_CHECK_RESULT(hr);
411-
return hr;
409+
if (FenceValue > 0)
410+
{
411+
HRESULT hr = pQueue->Wait(pFence, FenceValue);
412+
RESIDENCY_CHECK_RESULT(hr);
413+
return hr;
414+
}
415+
else
416+
{
417+
return S_OK;
418+
}
412419
}
413420

414421
HRESULT GPUSignal(ID3D12CommandQueue* pQueue)
@@ -1332,6 +1339,7 @@ namespace D3DX12Residency
13321339
LRU.TrimToSyncPointInclusive(TotalUsage + INT64(SizeToMakeResident), TotalBudget, pEvictionList, NumObjectsToEvict, GenerationToWaitFor);
13331340

13341341
RESIDENCY_CHECK_RESULT(Device->Evict(NumObjectsToEvict, pEvictionList));
1342+
NumObjectsToEvict = 0;
13351343
}
13361344
else
13371345
{

MiniEngine/Core/Core.vcxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.props" Condition="Exists('..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.props')" />
34
<ItemGroup Label="ProjectConfigurations">
45
<ProjectConfiguration Include="Debug|x64">
56
<Configuration>Debug</Configuration>
@@ -436,19 +437,20 @@
436437
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
437438
<ItemDefinitionGroup>
438439
<ClCompile>
439-
<AdditionalIncludeDirectories>..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\include;..\..\Packages\WinPixEventRuntime.1.0.210209001\Include\WinPixEventRuntime;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
440+
<AdditionalIncludeDirectories>..\..\Packages\WinPixEventRuntime.1.0.210209001\Include\WinPixEventRuntime;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
440441
<PreprocessorDefinitions>_GAMING_DESKTOP;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
441442
</ClCompile>
442443
</ItemDefinitionGroup>
443444
<ImportGroup Label="ExtensionTargets">
444-
<Import Project="..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets" Condition="Exists('..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets')" />
445-
<Import Project="..\..\Packages\WinPixEventRuntime.1.0.231030001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\Packages\WinPixEventRuntime.1.0.231030001\build\WinPixEventRuntime.targets')" />
445+
<Import Project="..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" />
446+
<Import Project="..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.targets" Condition="Exists('..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.targets')" />
446447
</ImportGroup>
447448
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
448449
<PropertyGroup>
449450
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
450451
</PropertyGroup>
451-
<Error Condition="!Exists('..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\zlib-msvc-x64.targets'))" />
452-
<Error Condition="!Exists('..\..\Packages\WinPixEventRuntime.1.0.231030001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\WinPixEventRuntime.1.0.231030001\build\WinPixEventRuntime.targets'))" />
452+
<Error Condition="!Exists('..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets'))" />
453+
<Error Condition="!Exists('..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.props'))" />
454+
<Error Condition="!Exists('..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\Microsoft.Direct3D.D3D12.1.618.3\build\native\Microsoft.Direct3D.D3D12.targets'))" />
453455
</Target>
454456
</Project>

MiniEngine/Core/FileUtility.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#include "pch.h"
1515
#include "FileUtility.h"
1616
#include <fstream>
17-
#include <mutex>
18-
#include <zlib.h> // From NuGet package
17+
//#include <zlib.h> // From NuGet package
1918

2019
using namespace std;
2120
using namespace Utility;
@@ -25,7 +24,7 @@ namespace Utility
2524
ByteArray NullFile = make_shared<vector<byte> > (vector<byte>() );
2625
}
2726

28-
ByteArray DecompressZippedFile( wstring& fileName );
27+
//ByteArray DecompressZippedFile( wstring& fileName );
2928

3029
ByteArray ReadFileHelper(const wstring& fileName)
3130
{
@@ -47,14 +46,15 @@ ByteArray ReadFileHelper(const wstring& fileName)
4746

4847
ByteArray ReadFileHelperEx( shared_ptr<wstring> fileName)
4948
{
50-
std::wstring zippedFileName = *fileName + L".gz";
51-
ByteArray firstTry = DecompressZippedFile(zippedFileName);
52-
if (firstTry != NullFile)
53-
return firstTry;
49+
//std::wstring zippedFileName = *fileName + L".gz";
50+
//ByteArray firstTry = DecompressZippedFile(zippedFileName);
51+
//if (firstTry != NullFile)
52+
// return firstTry;
5453

5554
return ReadFileHelper(*fileName);
5655
}
5756

57+
/*
5858
ByteArray Inflate(ByteArray CompressedSource, int& err, uint32_t ChunkSize = 0x100000 )
5959
{
6060
// Create a dynamic buffer to hold compressed blocks
@@ -123,6 +123,7 @@ ByteArray DecompressZippedFile( wstring& fileName )
123123
124124
return DecompressedFile;
125125
}
126+
*/
126127

127128
ByteArray Utility::ReadFileSync( const wstring& fileName)
128129
{

MiniEngine/Core/GraphicsCore.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ void Graphics::Initialize(bool RequireDXRSupport)
354354

355355
// Suppress errors from calling ResolveQueryData with timestamps that weren't requested on a given frame.
356356
D3D12_MESSAGE_ID_RESOLVE_QUERY_INVALID_QUERY_STATE,
357+
358+
// Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST. Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.
359+
D3D12_MESSAGE_ID_CREATERESOURCE_STATE_IGNORED,
357360
};
358361

359362
D3D12_INFO_QUEUE_FILTER NewFilter = {};

MiniEngine/Core/Math/Frustum.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ void Frustum::ConstructOrthographicFrustum( float Left, float Right, float Top,
6161
m_FrustumCorners[ kFarUpperRight ] = Vector3(Right, Top, -Back); // Far upper right
6262

6363
// Define the bounding planes
64-
m_FrustumPlanes[kNearPlane] = BoundingPlane( 0.0f, 0.0f, -1.0f, -Front );
65-
m_FrustumPlanes[kFarPlane] = BoundingPlane( 0.0f, 0.0f, 1.0f, Back );
66-
m_FrustumPlanes[kLeftPlane] = BoundingPlane( 1.0f, 0.0f, 0.0f, -Left );
67-
m_FrustumPlanes[kRightPlane] = BoundingPlane( -1.0f, 0.0f, 0.0f, Right );
68-
m_FrustumPlanes[kTopPlane] = BoundingPlane( 0.0f, -1.0f, 0.0f, Bottom );
69-
m_FrustumPlanes[kBottomPlane] = BoundingPlane( 0.0f, 1.0f, 0.0f, -Top );
64+
m_FrustumPlanes[kNearPlane] = BoundingPlane( 0.0f, 0.0f, 1.0f, -Front );
65+
m_FrustumPlanes[kFarPlane] = BoundingPlane( 0.0f, 0.0f, -1.0f, Back );
66+
m_FrustumPlanes[kLeftPlane] = BoundingPlane( 1.0f, 0.0f, 0.0f, -Left );
67+
m_FrustumPlanes[kRightPlane] = BoundingPlane( -1.0f, 0.0f, 0.0f, Right );
68+
m_FrustumPlanes[kBottomPlane] = BoundingPlane( 0.0f, 1.0f, 0.0f, -Bottom );
69+
m_FrustumPlanes[kTopPlane] = BoundingPlane( 0.0f, -1.0f, 0.0f, Top );
7070
}
7171

7272

@@ -82,11 +82,11 @@ Frustum::Frustum( const Matrix4& ProjMat )
8282
if (ProjMatF[3] == 0.0f && ProjMatF[7] == 0.0f && ProjMatF[11] == 0.0f && ProjMatF[15] == 1.0f)
8383
{
8484
// Orthographic
85-
float Left = (-1.0f - ProjMatF[12]) * RcpXX;
86-
float Right = ( 1.0f - ProjMatF[12]) * RcpXX;
87-
float Top = ( 1.0f - ProjMatF[13]) * RcpYY;
85+
float Left = (-1.0f - ProjMatF[12]) * RcpXX;
86+
float Right = ( 1.0f - ProjMatF[12]) * RcpXX;
87+
float Top = ( 1.0f - ProjMatF[13]) * RcpYY;
8888
float Bottom = (-1.0f - ProjMatF[13]) * RcpYY;
89-
float Front = ( 0.0f - ProjMatF[14]) * RcpZZ;
89+
float Front = ( 0.0f - ProjMatF[14]) * RcpZZ;
9090
float Back = ( 1.0f - ProjMatF[14]) * RcpZZ;
9191

9292
// Check for reverse Z here. The bounding planes need to point into the frustum.

MiniEngine/Core/ParticleEffectManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ namespace
388388
void ParticleEffectManager::Initialize( uint32_t MaxDisplayWidth, uint32_t MaxDisplayHeight )
389389
{
390390
D3D12_SAMPLER_DESC SamplerBilinearBorderDesc = SamplerPointBorderDesc;
391-
SamplerBilinearBorderDesc.Filter = D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT;
391+
SamplerBilinearBorderDesc.Filter = D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT;
392392

393393
RootSig.Reset(5, 3);
394394
RootSig.InitStaticSampler(0, SamplerBilinearBorderDesc);

MiniEngine/Core/SamplerManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SamplerDesc : public D3D12_SAMPLER_DESC
3030
AddressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP;
3131
MipLODBias = 0.0f;
3232
MaxAnisotropy = 16;
33-
ComparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL;
33+
ComparisonFunc = D3D12_COMPARISON_FUNC_NONE;
3434
BorderColor[0] = 1.0f;
3535
BorderColor[1] = 1.0f;
3636
BorderColor[2] = 1.0f;

MiniEngine/Core/Shaders/BicubicFilterFunctions.hlsli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ float4 GetBicubicFilterWeights(float offset, float A)
3131
//return ComputeWeights(offset, A);
3232

3333
// Precompute weights for 16 discrete offsets
34-
static const float4 FilterWeights[16] =
34+
const float4 FilterWeights[16] =
3535
{
3636
ComputeWeights( 0.5 / 16.0, -0.5),
3737
ComputeWeights( 1.5 / 16.0, -0.5),

MiniEngine/Core/Shaders/BlurCS.hlsl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ float3 BlurPixels( float3 a, float3 b, float3 c, float3 d, float3 e, float3 f, f
3434
return Weights[0]*e + Weights[1]*(d+f) + Weights[2]*(c+g) + Weights[3]*(b+h) + Weights[4]*(a+i);
3535
}
3636

37-
// 16x16 pixels with an 8x8 center that we will be blurring writing out. Each uint is two color channels packed together
37+
// 16x16 pixels with an 8x8 center that we will be blurring writing out. Each uint is two color channels packed together
3838
groupshared uint CacheR[128];
3939
groupshared uint CacheG[128];
4040
groupshared uint CacheB[128];
@@ -67,7 +67,7 @@ void Load1Pixel( uint index, out float3 pixel )
6767
pixel = asfloat( uint3(CacheR[index], CacheG[index], CacheB[index]) );
6868
}
6969

70-
// Blur two pixels horizontally. This reduces LDS reads and pixel unpacking.
70+
// Blur two pixels horizontally. This reduces LDS reads and pixel unpacking.
7171
void BlurHorizontally( uint outIndex, uint leftMostIndex )
7272
{
7373
float3 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
@@ -77,6 +77,9 @@ void BlurHorizontally( uint outIndex, uint leftMostIndex )
7777
Load2Pixels( leftMostIndex + 3, s6, s7 );
7878
Load2Pixels( leftMostIndex + 4, s8, s9 );
7979

80+
// Be sure to finish loading values before we rewrite them.
81+
GroupMemoryBarrierWithGroupSync();
82+
8083
Store1Pixel(outIndex , BlurPixels(s0, s1, s2, s3, s4, s5, s6, s7, s8));
8184
Store1Pixel(outIndex+1, BlurPixels(s1, s2, s3, s4, s5, s6, s7, s8, s9));
8285
}
@@ -104,8 +107,8 @@ void main( uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID, uint3 DTid : S
104107
//
105108
// Load 4 pixels per thread into LDS
106109
//
107-
int2 GroupUL = (Gid.xy << 3) - 4; // Upper-left pixel coordinate of group read location
108-
int2 ThreadUL = (GTid.xy << 1) + GroupUL; // Upper-left pixel coordinate of quad that this thread will read
110+
int2 GroupUL = (Gid.xy << 3) - 4; // Upper-left pixel coordinate of group read location
111+
int2 ThreadUL = (GTid.xy << 1) + GroupUL; // Upper-left pixel coordinate of quad that this thread will read
109112

110113
//
111114
// Store 4 unblurred pixels in LDS

0 commit comments

Comments
 (0)