Skip to content

Commit 35f6060

Browse files
authored
Updated RT samples and MiniEngine (#874)
* Updated RT samples to latest WinSDK, v143, and HLSL 2021 * Reverted experimental change for NullFile
1 parent a619dc0 commit 35f6060

29 files changed

+169
-146
lines changed

MiniEngine/Core/Core.vcxproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,19 +436,17 @@
436436
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
437437
<ItemDefinitionGroup>
438438
<ClCompile>
439-
<AdditionalIncludeDirectories>..\..\Packages\zlib-msvc-x64.1.2.11.8900\build\native\include;..\..\Packages\WinPixEventRuntime.1.0.210209001\Include\WinPixEventRuntime;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
439+
<AdditionalIncludeDirectories>..\..\Packages\WinPixEventRuntime.1.0.210209001\Include\WinPixEventRuntime;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
440440
<PreprocessorDefinitions>_GAMING_DESKTOP;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
441441
</ClCompile>
442442
</ItemDefinitionGroup>
443443
<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')" />
444+
<Import Project="..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" />
446445
</ImportGroup>
447446
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
448447
<PropertyGroup>
449448
<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>
450449
</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'))" />
450+
<Error Condition="!Exists('..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets'))" />
453451
</Target>
454452
</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/Shaders/ColorSpaceUtility.hlsli

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,37 @@
3737
float3 ApplySRGBCurve( float3 x )
3838
{
3939
// Approximately pow(x, 1.0 / 2.2)
40-
return x < 0.0031308 ? 12.92 * x : 1.055 * pow(x, 1.0 / 2.4) - 0.055;
40+
return select(x < 0.0031308, 12.92 * x, 1.055 * pow(x, 1.0 / 2.4) - 0.055);
4141
}
4242

4343
float3 RemoveSRGBCurve( float3 x )
4444
{
4545
// Approximately pow(x, 2.2)
46-
return x < 0.04045 ? x / 12.92 : pow( (x + 0.055) / 1.055, 2.4 );
46+
return select(x < 0.04045, x / 12.92, pow( (x + 0.055) / 1.055, 2.4 ));
4747
}
4848

4949
// These functions avoid pow() to efficiently approximate sRGB with an error < 0.4%.
5050
float3 ApplySRGBCurve_Fast( float3 x )
5151
{
52-
return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719;
52+
return select(x < 0.0031308, 12.92 * x, 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719);
5353
}
5454

5555
float3 RemoveSRGBCurve_Fast( float3 x )
5656
{
57-
return x < 0.04045 ? x / 12.92 : -7.43605 * x - 31.24297 * sqrt(-0.53792 * x + 1.279924) + 35.34864;
57+
return select(x < 0.04045, x / 12.92, -7.43605 * x - 31.24297 * sqrt(-0.53792 * x + 1.279924) + 35.34864);
5858
}
5959

6060
// The OETF recommended for content shown on HDTVs. This "gamma ramp" may increase contrast as
6161
// appropriate for viewing in a dark environment. Always use this curve with Limited RGB as it is
6262
// used in conjunction with HDTVs.
6363
float3 ApplyREC709Curve( float3 x )
6464
{
65-
return x < 0.0181 ? 4.5 * x : 1.0993 * pow(x, 0.45) - 0.0993;
65+
return select(x < 0.0181, 4.5 * x, 1.0993 * pow(x, 0.45) - 0.0993);
6666
}
6767

6868
float3 RemoveREC709Curve( float3 x )
6969
{
70-
return x < 0.08145 ? x / 4.5 : pow((x + 0.0993) / 1.0993, 1.0 / 0.45);
70+
return select(x < 0.08145, x / 4.5, pow((x + 0.0993) / 1.0993, 1.0 / 0.45));
7171
}
7272

7373
// This is the new HDR transfer function, also called "PQ" for perceptual quantizer. Note that REC2084

MiniEngine/Core/Shaders/GenerateMipsCS.hlsli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ float4 LoadColor( uint Index )
5555
float3 ApplySRGBCurve(float3 x)
5656
{
5757
// This is exactly the sRGB curve
58-
//return x < 0.0031308 ? 12.92 * x : 1.055 * pow(abs(x), 1.0 / 2.4) - 0.055;
58+
//return select(x < 0.0031308, 12.92 * x, 1.055 * pow(abs(x), 1.0 / 2.4) - 0.055);
5959

6060
// This is cheaper but nearly equivalent
61-
return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(abs(x - 0.00228)) - 0.13448 * x + 0.005719;
61+
return select(x < 0.0031308, 12.92 * x, 1.13005 * sqrt(abs(x - 0.00228)) - 0.13448 * x + 0.005719);
6262
}
6363

6464
float4 PackColor(float4 Linear)

MiniEngine/Core/packages.config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="WinPixEventRuntime" version="1.0.231030001" targetFramework="native" />
4-
<package id="zlib-msvc-x64" version="1.2.11.8900" targetFramework="native" />
3+
<package id="WinPixEventRuntime" version="1.0.240308001" targetFramework="native" />
54
</packages>

MiniEngine/Model/Model.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@
174174
</ItemGroup>
175175
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
176176
<ImportGroup Label="ExtensionTargets">
177-
<Import Project="..\..\Packages\directxtex_desktop_win10.2024.2.22.1\build\native\directxtex_desktop_win10.targets" Condition="Exists('..\..\Packages\directxtex_desktop_win10.2024.2.22.1\build\native\directxtex_desktop_win10.targets')" />
178-
<Import Project="..\..\Packages\directxmesh_desktop_win10.2024.2.22.1\build\native\directxmesh_desktop_win10.targets" Condition="Exists('..\..\Packages\directxmesh_desktop_win10.2024.2.22.1\build\native\directxmesh_desktop_win10.targets')" />
177+
<Import Project="..\..\Packages\directxmesh_desktop_win10.2024.6.5.1\build\native\directxmesh_desktop_win10.targets" Condition="Exists('..\..\Packages\directxmesh_desktop_win10.2024.6.5.1\build\native\directxmesh_desktop_win10.targets')" />
178+
<Import Project="..\..\Packages\directxtex_desktop_win10.2024.6.5.1\build\native\directxtex_desktop_win10.targets" Condition="Exists('..\..\Packages\directxtex_desktop_win10.2024.6.5.1\build\native\directxtex_desktop_win10.targets')" />
179179
</ImportGroup>
180180
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
181181
<PropertyGroup>
182182
<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>
183183
</PropertyGroup>
184-
<Error Condition="!Exists('..\..\Packages\directxtex_desktop_win10.2024.2.22.1\build\native\directxtex_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\directxtex_desktop_win10.2024.2.22.1\build\native\directxtex_desktop_win10.targets'))" />
185-
<Error Condition="!Exists('..\..\Packages\directxmesh_desktop_win10.2024.2.22.1\build\native\directxmesh_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\directxmesh_desktop_win10.2024.2.22.1\build\native\directxmesh_desktop_win10.targets'))" />
184+
<Error Condition="!Exists('..\..\Packages\directxmesh_desktop_win10.2024.6.5.1\build\native\directxmesh_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\directxmesh_desktop_win10.2024.6.5.1\build\native\directxmesh_desktop_win10.targets'))" />
185+
<Error Condition="!Exists('..\..\Packages\directxtex_desktop_win10.2024.6.5.1\build\native\directxtex_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\Packages\directxtex_desktop_win10.2024.6.5.1\build\native\directxtex_desktop_win10.targets'))" />
186186
</Target>
187187
</Project>

MiniEngine/Model/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="directxmesh_desktop_win10" version="2024.2.22.1" targetFramework="native" />
4-
<package id="directxtex_desktop_win10" version="2024.2.22.1" targetFramework="native" />
3+
<package id="directxmesh_desktop_win10" version="2024.6.5.1" targetFramework="native" />
4+
<package id="directxtex_desktop_win10" version="2024.6.5.1" targetFramework="native" />
55
</packages>

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingHelloWorld/D3D12RaytracingHelloWorld.vcxproj

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
<Keyword>Win32Proj</Keyword>
1616
<RootNamespace>D3D12Raytracing</RootNamespace>
1717
<ProjectName>D3D12RaytracingHelloWorld</ProjectName>
18-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
18+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1919
</PropertyGroup>
2020
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
2222
<ConfigurationType>Application</ConfigurationType>
2323
<UseDebugLibraries>true</UseDebugLibraries>
24-
<PlatformToolset>v142</PlatformToolset>
24+
<PlatformToolset>v143</PlatformToolset>
2525
<CharacterSet>Unicode</CharacterSet>
2626
</PropertyGroup>
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
2828
<ConfigurationType>Application</ConfigurationType>
2929
<UseDebugLibraries>false</UseDebugLibraries>
30-
<PlatformToolset>v142</PlatformToolset>
30+
<PlatformToolset>v143</PlatformToolset>
3131
<WholeProgramOptimization>true</WholeProgramOptimization>
3232
<CharacterSet>Unicode</CharacterSet>
3333
</PropertyGroup>
@@ -178,24 +178,22 @@
178178
</ItemGroup>
179179
<ItemGroup>
180180
<FxCompile Include="Raytracing.hlsl">
181-
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Library</ShaderType>
182-
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">6.3</ShaderModel>
183-
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">g_p%(Filename)</VariableName>
184-
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)CompiledShaders\%(Filename).hlsl.h</HeaderFileOutput>
185-
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Library</ShaderType>
186-
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">6.3</ShaderModel>
187-
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">g_p%(Filename)</VariableName>
188-
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)CompiledShaders\%(Filename).hlsl.h</HeaderFileOutput>
181+
<EnableDebuggingInformation Condition="'$(Configuration)'=='Debug'">true</EnableDebuggingInformation>
182+
<AdditionalOptions Condition="'$(Configuration)'=='Debug'">-Qembed_debug %(AdditionalOptions)</AdditionalOptions>
183+
<ShaderType>Library</ShaderType>
184+
<ShaderModel>6.3</ShaderModel>
185+
<VariableName>g_p%(Filename)</VariableName>
186+
<HeaderFileOutput>$(IntDir)CompiledShaders\%(Filename).hlsl.h</HeaderFileOutput>
189187
</FxCompile>
190188
</ItemGroup>
191189
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
192190
<ImportGroup Label="ExtensionTargets">
193-
<Import Project="..\..\..\..\..\Packages\WinPixEventRuntime.1.0.180612001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\..\..\..\Packages\WinPixEventRuntime.1.0.180612001\build\WinPixEventRuntime.targets')" />
191+
<Import Project="..\..\..\..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\..\..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" />
194192
</ImportGroup>
195193
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
196194
<PropertyGroup>
197195
<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>
198196
</PropertyGroup>
199-
<Error Condition="!Exists('..\..\..\..\..\Packages\WinPixEventRuntime.1.0.180612001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\Packages\WinPixEventRuntime.1.0.180612001\build\WinPixEventRuntime.targets'))" />
197+
<Error Condition="!Exists('..\..\..\..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\Packages\WinPixEventRuntime.1.0.240308001\build\WinPixEventRuntime.targets'))" />
200198
</Target>
201199
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="WinPixEventRuntime" version="1.0.180612001" targetFramework="native" />
3+
<package id="WinPixEventRuntime" version="1.0.240308001" targetFramework="native" />
44
</packages>

0 commit comments

Comments
 (0)