- Various clang reformat

- Added shader compiler app (doing nothing)
- Various Project files changes
This commit is contained in:
2025-03-01 11:01:42 -05:00
parent 7c8f8a3bb1
commit 67528aaee1
19 changed files with 218 additions and 173 deletions

View File

@@ -71,6 +71,7 @@
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(SolutionDir)\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
</Link>
<Lib>
<AdditionalDependencies>
@@ -99,6 +100,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;d3d12.lib;dxgi.lib;dxguid.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(SolutionDir)\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -113,94 +115,96 @@
<ClInclude Include="include\Core\Common\NonNullPtr.h"/>
<ClInclude Include="include\Core\Common\Singleton.h"/>
<ClInclude Include="include\Core\Container\Vector.h"/>
<ClInclude Include="include\Core\HAL\Display\Display.h" />
<ClInclude Include="include\Core\HAL\Event\SystemEvent.h" />
<ClInclude Include="include\Core\HAL\Keyboard\Keyboard.h" />
<ClInclude Include="include\Core\HAL\Keyboard\KeyCode.h" />
<ClInclude Include="include\Core\HAL\Keyboard\ScanCode.h" />
<ClInclude Include="include\Core\HAL\Mouse\Mouse.h" />
<ClInclude Include="include\Core\HotReload\HotReload.h" />
<ClInclude Include="include\Core\JulietInit.h" />
<ClInclude Include="include\Core\Logging\LogManager.h" />
<ClInclude Include="include\Core\Logging\LogTypes.h" />
<ClInclude Include="include\Core\Math\Shape.h" />
<ClInclude Include="include\Core\Memory\Allocator.h" />
<ClInclude Include="include\Core\Memory\Utils.h" />
<ClInclude Include="include\Core\Networking\IPAddress.h" />
<ClInclude Include="include\Core\Networking\NetworkPacket.h" />
<ClInclude Include="include\Core\Networking\Socket.h" />
<ClInclude Include="include\Core\Networking\SocketHandle.h" />
<ClInclude Include="include\Core\Networking\TcpListener.h" />
<ClInclude Include="include\Core\Networking\TcpSocket.h" />
<ClInclude Include="include\Core\Thread\Thread.h" />
<ClInclude Include="include\Engine\Class.h" />
<ClInclude Include="include\Engine\Engine.h" />
<ClInclude Include="include\Graphics\Colors.h" />
<ClInclude Include="include\Graphics\Graphics.h" />
<ClInclude Include="include\Graphics\GraphicsConfig.h" />
<ClInclude Include="include\Graphics\RenderPass.h" />
<ClInclude Include="include\Graphics\Texture.h" />
<ClInclude Include="include\Juliet.h" />
<ClInclude Include="include\pch.h" />
<ClInclude Include="src\Core\HAL\Display\DisplayDevice.h" />
<ClInclude Include="src\Core\HAL\Display\Display_Private.h" />
<ClInclude Include="src\Core\HAL\Display\Win32\Win32DisplayEvent.h" />
<ClInclude Include="src\Core\HAL\Display\Win32\Win32Window.h" />
<ClInclude Include="src\Core\HAL\Display\Window.h" />
<ClInclude Include="src\Core\HAL\Event\KeyboardMapping.h" />
<ClInclude Include="src\Core\HAL\Event\Keyboard_Private.h" />
<ClInclude Include="src\Core\HAL\Event\Mouse_Private.h" />
<ClInclude Include="src\Core\HAL\Event\Win32ScanCode.h" />
<ClInclude Include="src\Core\HAL\Event\WindowEvent.h" />
<ClInclude Include="src\Core\HAL\Filesystem\Filesystem_Platform.h" />
<ClInclude Include="src\Core\HAL\Filesystem\Filesystem_Private.h" />
<ClInclude Include="src\Core\Networking\SocketPlatformImpl.h" />
<ClInclude Include="src\Core\HAL\Win32.h" />
<ClInclude Include="src\Graphics\D3D12\D3D12Common.h" />
<ClInclude Include="src\Graphics\D3D12\D3D12RenderPass.h" />
<ClInclude Include="src\Graphics\D3D12\D3D12Synchronization.h" />
<ClInclude Include="src\Graphics\D3D12\D3D12Texture.h" />
<ClInclude Include="src\Graphics\D3D12\DX12CommandList.h" />
<ClInclude Include="src\Graphics\D3D12\DX12GraphicsDevice.h" />
<ClInclude Include="src\Graphics\D3D12\DX12Includes.h" />
<ClInclude Include="src\Graphics\D3D12\DX12SwapChain.h" />
<ClInclude Include="src\Graphics\D3D12\DX12Utils.h" />
<ClInclude Include="src\Graphics\GraphicsDevice.h" />
<ClInclude Include="include\Core\HAL\Display\Display.h"/>
<ClInclude Include="include\Core\HAL\Event\SystemEvent.h"/>
<ClInclude Include="include\Core\HAL\Keyboard\Keyboard.h"/>
<ClInclude Include="include\Core\HAL\Keyboard\KeyCode.h"/>
<ClInclude Include="include\Core\HAL\Keyboard\ScanCode.h"/>
<ClInclude Include="include\Core\HAL\Mouse\Mouse.h"/>
<ClInclude Include="include\Core\HotReload\HotReload.h"/>
<ClInclude Include="include\Core\JulietInit.h"/>
<ClInclude Include="include\Core\Logging\LogManager.h"/>
<ClInclude Include="include\Core\Logging\LogTypes.h"/>
<ClInclude Include="include\Core\Math\Shape.h"/>
<ClInclude Include="include\Core\Memory\Allocator.h"/>
<ClInclude Include="include\Core\Memory\Utils.h"/>
<ClInclude Include="include\Core\Networking\IPAddress.h"/>
<ClInclude Include="include\Core\Networking\NetworkPacket.h"/>
<ClInclude Include="include\Core\Networking\Socket.h"/>
<ClInclude Include="include\Core\Networking\SocketHandle.h"/>
<ClInclude Include="include\Core\Networking\TcpListener.h"/>
<ClInclude Include="include\Core\Networking\TcpSocket.h"/>
<ClInclude Include="include\Core\Thread\Thread.h"/>
<ClInclude Include="include\Engine\Class.h"/>
<ClInclude Include="include\Engine\Engine.h"/>
<ClInclude Include="include\Graphics\Colors.h"/>
<ClInclude Include="include\Graphics\Graphics.h"/>
<ClInclude Include="include\Graphics\GraphicsConfig.h"/>
<ClInclude Include="include\Graphics\RenderPass.h"/>
<ClInclude Include="include\Graphics\Texture.h"/>
<ClInclude Include="include\Juliet.h"/>
<ClInclude Include="include\pch.h"/>
<ClInclude Include="src\Core\HAL\Display\DisplayDevice.h"/>
<ClInclude Include="src\Core\HAL\Display\Display_Private.h"/>
<ClInclude Include="src\Core\HAL\Display\Win32\Win32DisplayEvent.h"/>
<ClInclude Include="src\Core\HAL\Display\Win32\Win32Window.h"/>
<ClInclude Include="src\Core\HAL\Display\Window.h"/>
<ClInclude Include="src\Core\HAL\Event\KeyboardMapping.h"/>
<ClInclude Include="src\Core\HAL\Event\Keyboard_Private.h"/>
<ClInclude Include="src\Core\HAL\Event\Mouse_Private.h"/>
<ClInclude Include="src\Core\HAL\Event\Win32ScanCode.h"/>
<ClInclude Include="src\Core\HAL\Event\WindowEvent.h"/>
<ClInclude Include="src\Core\HAL\Filesystem\Filesystem_Platform.h"/>
<ClInclude Include="src\Core\HAL\Filesystem\Filesystem_Private.h"/>
<ClInclude Include="src\Core\Networking\SocketPlatformImpl.h"/>
<ClInclude Include="src\Core\HAL\Win32.h"/>
<ClInclude Include="src\Graphics\D3D12\D3D12Common.h"/>
<ClInclude Include="src\Graphics\D3D12\D3D12RenderPass.h"/>
<ClInclude Include="src\Graphics\D3D12\D3D12Shader.h"/>
<ClInclude Include="src\Graphics\D3D12\D3D12Synchronization.h"/>
<ClInclude Include="src\Graphics\D3D12\D3D12Texture.h"/>
<ClInclude Include="src\Graphics\D3D12\DX12CommandList.h"/>
<ClInclude Include="src\Graphics\D3D12\DX12GraphicsDevice.h"/>
<ClInclude Include="src\Graphics\D3D12\DX12Includes.h"/>
<ClInclude Include="src\Graphics\D3D12\DX12SwapChain.h"/>
<ClInclude Include="src\Graphics\D3D12\DX12Utils.h"/>
<ClInclude Include="src\Graphics\GraphicsDevice.h"/>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Core\Application\ApplicationManager.cpp" />
<ClCompile Include="src\Core\Common\CoreUtils.cpp" />
<ClCompile Include="src\Core\HAL\Display\Display.cpp" />
<ClCompile Include="src\Core\HAL\Display\Win32\Win32DisplayDevice.cpp" />
<ClCompile Include="src\Core\HAL\Display\Win32\Win32DisplayEvent.cpp" />
<ClCompile Include="src\Core\HAL\Display\Win32\Win32Window.cpp" />
<ClCompile Include="src\Core\HAL\DynLib\Win32\DynamicLibrary.cpp" />
<ClCompile Include="src\Core\HAL\Event\Keyboard.cpp" />
<ClCompile Include="src\Core\HAL\Event\KeyboardMapping.cpp" />
<ClCompile Include="src\Core\HAL\Event\Mouse.cpp" />
<ClCompile Include="src\Core\HAL\Event\SystemEvent.cpp" />
<ClCompile Include="src\Core\HAL\Event\WindowEvent.cpp" />
<ClCompile Include="src\Core\HAL\Filesystem\Filesystem.cpp" />
<ClCompile Include="src\Core\HAL\Filesystem\Win32\Win32Filesystem.cpp" />
<ClCompile Include="src\Core\HotReload\HotReload.cpp" />
<ClCompile Include="src\Core\HotReload\Win32\Win32HotReload.cpp" />
<ClCompile Include="src\Core\Juliet.cpp" />
<ClCompile Include="src\Core\Logging\LogManager.cpp" />
<ClCompile Include="src\Core\Memory\Allocator.cpp" />
<ClCompile Include="src\Core\Networking\NetworkPacket.cpp" />
<ClCompile Include="src\Core\Networking\Socket.cpp" />
<ClCompile Include="src\Core\Networking\TcpListener.cpp" />
<ClCompile Include="src\Core\Networking\TcpSocket.cpp" />
<ClCompile Include="src\Core\Networking\Win32\Win32SocketPlatformImpl.cpp" />
<ClCompile Include="src\Engine\Engine.cpp" />
<ClCompile Include="src\Graphics\D3D12\D3D12Common.cpp" />
<ClCompile Include="src\Graphics\D3D12\D3D12RenderPass.cpp" />
<ClCompile Include="src\Graphics\D3D12\D3D12Synchronization.cpp" />
<ClCompile Include="src\Graphics\D3D12\D3D12Texture.cpp" />
<ClCompile Include="src\Graphics\D3D12\DX12CommandList.cpp" />
<ClCompile Include="src\Graphics\D3D12\DX12GraphicsDevice.cpp" />
<ClCompile Include="src\Graphics\D3D12\DX12SwapChain.cpp" />
<ClCompile Include="src\Graphics\D3D12\DX12Utils.cpp" />
<ClCompile Include="src\Core\Application\ApplicationManager.cpp"/>
<ClCompile Include="src\Core\Common\CoreUtils.cpp"/>
<ClCompile Include="src\Core\HAL\Display\Display.cpp"/>
<ClCompile Include="src\Core\HAL\Display\Win32\Win32DisplayDevice.cpp"/>
<ClCompile Include="src\Core\HAL\Display\Win32\Win32DisplayEvent.cpp"/>
<ClCompile Include="src\Core\HAL\Display\Win32\Win32Window.cpp"/>
<ClCompile Include="src\Core\HAL\DynLib\Win32\DynamicLibrary.cpp"/>
<ClCompile Include="src\Core\HAL\Event\Keyboard.cpp"/>
<ClCompile Include="src\Core\HAL\Event\KeyboardMapping.cpp"/>
<ClCompile Include="src\Core\HAL\Event\Mouse.cpp"/>
<ClCompile Include="src\Core\HAL\Event\SystemEvent.cpp"/>
<ClCompile Include="src\Core\HAL\Event\WindowEvent.cpp"/>
<ClCompile Include="src\Core\HAL\Filesystem\Filesystem.cpp"/>
<ClCompile Include="src\Core\HAL\Filesystem\Win32\Win32Filesystem.cpp"/>
<ClCompile Include="src\Core\HotReload\HotReload.cpp"/>
<ClCompile Include="src\Core\HotReload\Win32\Win32HotReload.cpp"/>
<ClCompile Include="src\Core\Juliet.cpp"/>
<ClCompile Include="src\Core\Logging\LogManager.cpp"/>
<ClCompile Include="src\Core\Memory\Allocator.cpp"/>
<ClCompile Include="src\Core\Networking\NetworkPacket.cpp"/>
<ClCompile Include="src\Core\Networking\Socket.cpp"/>
<ClCompile Include="src\Core\Networking\TcpListener.cpp"/>
<ClCompile Include="src\Core\Networking\TcpSocket.cpp"/>
<ClCompile Include="src\Core\Networking\Win32\Win32SocketPlatformImpl.cpp"/>
<ClCompile Include="src\Engine\Engine.cpp"/>
<ClCompile Include="src\Graphics\D3D12\D3D12Common.cpp"/>
<ClCompile Include="src\Graphics\D3D12\D3D12RenderPass.cpp"/>
<ClCompile Include="src\Graphics\D3D12\D3D12Shader.cpp"/>
<ClCompile Include="src\Graphics\D3D12\D3D12Synchronization.cpp"/>
<ClCompile Include="src\Graphics\D3D12\D3D12Texture.cpp"/>
<ClCompile Include="src\Graphics\D3D12\DX12CommandList.cpp"/>
<ClCompile Include="src\Graphics\D3D12\DX12GraphicsDevice.cpp"/>
<ClCompile Include="src\Graphics\D3D12\DX12SwapChain.cpp"/>
<ClCompile Include="src\Graphics\D3D12\DX12Utils.cpp"/>
<ClCompile Include="src\Graphics\Graphics.cpp">
<RuntimeLibrary>MultiThreadedDebugDll</RuntimeLibrary>
<Optimization>Disabled</Optimization>
@@ -261,8 +265,8 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<Content Include="include\Core\Thread\Mutex.h" />
<Content Include="src\TODO.txt" />
<Content Include="include\Core\Thread\Mutex.h"/>
<Content Include="src\TODO.txt"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets">

View File

@@ -1,7 +1,7 @@
#pragma once
#include <Juliet.h>
#include <Core/Common/CoreTypes.h>
#include <Juliet.h>
// TODO : Juliet strings
#include <string>

View File

@@ -9,4 +9,4 @@ namespace Juliet
int32 Width;
int32 Height;
};
}
} // namespace Juliet

View File

@@ -14,4 +14,4 @@ namespace Juliet
{
}
}
}
} // namespace Juliet

View File

@@ -23,18 +23,18 @@ namespace Juliet
struct ColorTargetInfo
{
Texture* TargetTexture;
uint32 MipLevel;
uint32 MipLevel;
union
{
uint32 DepthPlane;
uint32 LayerIndex;
};
bool CycleTexture; // Whether the texture should be cycled if already bound (and load operation != LOAD)
bool CycleTexture; // Whether the texture should be cycled if already bound (and load operation != LOAD)
Texture* ResolveTexture;
uint32 ResolveMipLevel;
uint32 ResolveLayerIndex;
bool CycleResolveTexture;
uint32 ResolveMipLevel;
uint32 ResolveLayerIndex;
bool CycleResolveTexture;
FColor ClearColor;
LoadOperation LoadOperation;

View File

@@ -9,7 +9,7 @@ namespace Juliet::Win32
{
namespace
{
constexpr auto WindowClassName = L"JulietWindowClass";
constexpr auto WindowClassName = L"JulietWindowClass";
constexpr LPCWSTR WindowClassPtr = WindowClassName;
bool SetupWindowState(NonNullPtr<DisplayDevice> self, NonNullPtr<Window> window, HWND handle)
@@ -46,7 +46,7 @@ namespace Juliet::Win32
HINSTANCE instance = GetModuleHandle(nullptr);
// TODO : Put outside, we should not create a new class for each new window
WNDCLASSEX WindowClass = {};
WNDCLASSEX WindowClass = {};
WindowClass.cbSize = sizeof(WNDCLASSEX);
WindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
WindowClass.lpfnWndProc = Win32MainWindowCallback;
@@ -65,7 +65,7 @@ namespace Juliet::Win32
int x = CW_USEDEFAULT, y = CW_USEDEFAULT;
const int w = window->Width, h = window->Height;
HWND handle = CreateWindowEx(styleEx, WindowClassPtr, L"JULIET TODO PASS TITLE", style, x, y, w, h, nullptr,
nullptr, instance, nullptr);
nullptr, instance, nullptr);
PumpEvents(self);

View File

@@ -1,8 +1,8 @@
#include <pch.h>
#include <Core/HAL/Filesystem/Filesystem.h>
#include <Core/HAL/Filesystem/Filesystem_Private.h>
#include <Core/HAL/Filesystem/Filesystem_Platform.h>
#include <Core/HAL/Filesystem/Filesystem_Private.h>
#include <Core/Memory/Allocator.h>
namespace Juliet

View File

@@ -3,4 +3,4 @@
namespace Juliet::Platform
{
extern char* GetBasePath();
}
}

View File

@@ -4,4 +4,4 @@ namespace Juliet
{
extern void InitFilesystem();
extern void ShutdownFilesystem();
}
} // namespace Juliet

View File

@@ -23,8 +23,8 @@ namespace Juliet
return lastWriteTime;
}
constexpr size_t kMaxAttempts = 256;
constexpr size_t kMaxDLLID = 256;
constexpr size_t kMaxAttempts = 256;
constexpr size_t kMaxDLLID = 256;
constexpr size_t kTempDLLBufferSizeForID = 6; // ID numbers + \0
} // namespace
@@ -52,7 +52,7 @@ namespace Juliet
size_t basePathLength = strlen(basePath);
const size_t tempDllMaxBufferSize = basePathLength + code.TransientDLLName.Size + kTempDLLBufferSizeForID;
auto tempDllPath = static_cast<char*>(Calloc(tempDllMaxBufferSize, sizeof(char)));
auto tempDllPath = static_cast<char*>(Calloc(tempDllMaxBufferSize, sizeof(char)));
for (uint32 attempt = 0; attempt < kMaxAttempts; ++attempt)
{
// int to char

View File

@@ -0,0 +1,16 @@
#include <pch.h>
#include <Graphics/D3D12/D3D12Shader.h>
namespace Juliet::D3D12
{
namespace
{
void CompileShader(const char* shaderFile) {}
} // namespace
void LoadShader(const char* shaderFile)
{
CompileShader(shaderFile);
}
} // namespace Juliet::D3D12

View File

@@ -0,0 +1,6 @@
#pragma once
namespace Juliet::D3D12
{
extern void LoadShader(const char* shaderFile);
}

View File

@@ -70,9 +70,9 @@ namespace Juliet::D3D12
D3D12_RESOURCE_STATES newTextureUsage);
extern D3D12TextureSubresource* FetchTextureSubresource(NonNullPtr<D3D12TextureContainer> container,
uint32 layer, uint32 level);
extern void TextureSubresourceBarrier(NonNullPtr<D3D12CommandList> commandList,
D3D12_RESOURCE_STATES sourceState, D3D12_RESOURCE_STATES destinationState,
NonNullPtr<D3D12TextureSubresource> textureSubresource);
extern void TextureSubresourceBarrier(NonNullPtr<D3D12CommandList> commandList,
D3D12_RESOURCE_STATES sourceState, D3D12_RESOURCE_STATES destinationState,
NonNullPtr<D3D12TextureSubresource> textureSubresource);
// Texture usage transition
extern void TextureSubresourceTransitionFromDefaultUsage(NonNullPtr<D3D12CommandList> commandList,

View File

@@ -46,7 +46,7 @@ namespace Juliet::D3D12
uint32 PresentDataCount;
D3D12Fence* InFlightFence;
bool AutoReleaseFence;
bool AutoReleaseFence;
D3D12GraphicsCommandListData GraphicsCommandList;
D3D12GraphicsCommandListData ComputeCommandList;

View File

@@ -17,6 +17,12 @@
#include <dxgi1_6.h>
#include "d3d12.h"
#include <d3d12shader.h>
// TODO: Should not use this when shipping
// Prebake the shaders and embed .dxil files
// When not shipping, thats ok to compile them
// #include <dxcapi.h>
#ifdef _DEBUG
#include <dxgidebug.h>
#endif