Skip to content

Commit

Permalink
Move all "binding" files to separate directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flone-dnb committed Oct 20, 2024
1 parent 1dc862f commit 8d652f5
Show file tree
Hide file tree
Showing 36 changed files with 245 additions and 236 deletions.
48 changes: 24 additions & 24 deletions src/engine_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ set(PROJECT_WIN32_SOURCES
private/shader/hlsl/HlslShader.cpp
private/shader/hlsl/RootSignatureGenerator.h
private/shader/hlsl/RootSignatureGenerator.cpp
private/shader/hlsl/resources/HlslShaderTextureResourceBinding.h
private/shader/hlsl/resources/HlslShaderTextureResourceBinding.cpp
private/shader/hlsl/resources/HlslGlobalShaderResourceBinding.cpp
private/shader/hlsl/resources/HlslGlobalShaderResourceBinding.h
private/shader/hlsl/resources/binding/texture/HlslShaderTextureResourceBinding.h
private/shader/hlsl/resources/binding/texture/HlslShaderTextureResourceBinding.cpp
private/shader/hlsl/resources/binding/global/HlslGlobalShaderResourceBinding.cpp
private/shader/hlsl/resources/binding/global/HlslGlobalShaderResourceBinding.h
private/shader/hlsl/HlslComputeShaderInterface.cpp
private/shader/hlsl/HlslComputeShaderInterface.h
private/shader/hlsl/formats/HlslVertexFormatDescription.h
Expand Down Expand Up @@ -160,12 +160,12 @@ set(PROJECT_SOURCES
private/shader/general/resources/cpuwrite/DynamicCpuWriteShaderResourceArray.h
private/shader/general/resources/cpuwrite/DynamicCpuWriteShaderResourceArrayManager.cpp
private/shader/general/resources/cpuwrite/DynamicCpuWriteShaderResourceArrayManager.h
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBinding.cpp
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBinding.h
private/shader/general/resources/GlobalShaderResourceBinding.cpp
private/shader/general/resources/GlobalShaderResourceBinding.h
private/shader/general/resources/GlobalShaderResourceBindingManager.cpp
private/shader/general/resources/GlobalShaderResourceBindingManager.h
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBinding.cpp
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBinding.h
private/shader/general/resources/binding/global/GlobalShaderResourceBinding.cpp
private/shader/general/resources/binding/global/GlobalShaderResourceBinding.h
private/shader/general/resources/binding/global/GlobalShaderResourceBindingManager.cpp
private/shader/general/resources/binding/global/GlobalShaderResourceBindingManager.h
private/shader/glsl/formats/GlslVertexFormatDescription.h
private/shader/glsl/formats/GlslVertexFormatDescription.cpp
private/shader/glsl/formats/MeshNodeGlslVertexFormatDescription.cpp
Expand All @@ -184,17 +184,17 @@ set(PROJECT_SOURCES
private/shader/general/EngineShaderNames.hpp
private/shader/general/EngineShaders.hpp
private/shader/general/EngineShaderConstantMacros.hpp
private/shader/general/resources/ShaderResourceBinding.h
private/shader/general/resources/ShaderResourceBinding.cpp
private/shader/general/resources/binding/ShaderResourceBinding.h
private/shader/general/resources/binding/ShaderResourceBinding.cpp
private/shader/general/resources/ShaderArrayIndexManager.h
private/shader/general/resources/ShaderArrayIndexManager.cpp
private/shader/general/resources/ShaderLightsInFrustumSingleType.hpp
private/shader/glsl/GlslShader.h
private/shader/glsl/GlslShader.cpp
private/shader/glsl/resources/GlslShaderTextureResourceBinding.h
private/shader/glsl/resources/GlslShaderTextureResourceBinding.cpp
private/shader/glsl/resources/GlslGlobalShaderResourceBinding.cpp
private/shader/glsl/resources/GlslGlobalShaderResourceBinding.h
private/shader/glsl/resources/binding/texture/GlslShaderTextureResourceBinding.h
private/shader/glsl/resources/binding/texture/GlslShaderTextureResourceBinding.cpp
private/shader/glsl/resources/binding/global/GlslGlobalShaderResourceBinding.cpp
private/shader/glsl/resources/binding/global/GlslGlobalShaderResourceBinding.h
private/shader/glsl/DescriptorSetLayoutGenerator.h
private/shader/glsl/DescriptorSetLayoutGenerator.cpp
private/shader/glsl/GlslComputeShaderInterface.cpp
Expand Down Expand Up @@ -237,14 +237,14 @@ set(PROJECT_SOURCES
private/shader/general/ShaderMacro.h
private/shader/general/ShaderMacro.cpp
private/shader/general/ShaderFilesystemPaths.hpp
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.cpp
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.h
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingUniquePtr.cpp
private/shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingUniquePtr.h
private/shader/general/resources/texture/ShaderTextureResourceBindingManager.cpp
private/shader/general/resources/texture/ShaderTextureResourceBindingManager.h
private/shader/general/resources/texture/ShaderTextureResourceBindingUniquePtr.cpp
private/shader/general/resources/texture/ShaderTextureResourceBindingUniquePtr.h
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.cpp
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingUniquePtr.cpp
private/shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingUniquePtr.h
private/shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.cpp
private/shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.h
private/shader/general/resources/binding/texture/ShaderTextureResourceBindingUniquePtr.cpp
private/shader/general/resources/binding/texture/ShaderTextureResourceBindingUniquePtr.h
public/shader/VulkanAlignmentConstants.hpp
public/misc/ProjectPaths.h
private/misc/ProjectPaths.cpp
Expand Down
15 changes: 9 additions & 6 deletions src/engine_lib/private/game/nodes/MeshNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "game/Window.h"
#include "render/Renderer.h"
#include "render/general/resources/GpuResourceManager.h"
#include "shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/EngineShaderNames.hpp"
#include "misc/PrimitiveMeshGenerator.h"

Expand Down Expand Up @@ -580,7 +580,8 @@ namespace ne {
// keep spawn locked

// Make sure there is no resource with this name.
auto it = mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(sShaderResourceName);
auto it =
mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(sShaderResourceName);
if (it != mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.end()) [[unlikely]] {
Error error(std::format(
"mesh node \"{}\" already has a shader CPU write resource with the name \"{}\"",
Expand Down Expand Up @@ -735,7 +736,8 @@ namespace ne {
// keep spawn locked

// Make sure there is a resource with this name.
auto it = mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(sShaderResourceName);
auto it =
mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(sShaderResourceName);
if (it == mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.end()) {
return; // silently exit, this is not an error
}
Expand Down Expand Up @@ -859,8 +861,9 @@ namespace ne {
}

// Find mesh data shader resource.
const auto meshDataIt = mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(
sMeshShaderConstantBufferName);
const auto meshDataIt =
mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.find(
sMeshShaderConstantBufferName);
if (meshDataIt == mtxGpuResources.second.shaderResources.shaderCpuWriteResourceBindings.end())
[[unlikely]] {
Error error(
Expand Down
4 changes: 2 additions & 2 deletions src/engine_lib/private/material/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "io/Logger.h"
#include "game/nodes/MeshNode.h"
#include "render/general/resources/GpuResourceManager.h"
#include "shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.h"
#include "shader/ShaderManager.h"
#include "render/general/pipeline/PipelineManager.h"
#include "material/TextureManager.h"
Expand Down
13 changes: 6 additions & 7 deletions src/engine_lib/private/render/directx/DirectXRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include "material/Material.h"
#include "game/nodes/MeshNode.h"
#include "shader/hlsl/RootSignatureGenerator.h"
#include "shader/general/resources/cpuwrite/ShaderCpuWriteResourceBinding.h"
#include "shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBinding.h"
#include "render/general/resources/frame/FrameResourceManager.h"
#include "game/camera/CameraProperties.h"
#include "game/camera/CameraManager.h"
#include "shader/hlsl/resources/HlslShaderTextureResourceBinding.h"
#include "shader/hlsl/resources/binding/texture/HlslShaderTextureResourceBinding.h"
#include "render/directx/resources/DirectXFrameResource.h"
#include "render/directx/resources/shadow/DirectXShadowMapArrayIndexManager.h"
#include "shader/hlsl/HlslComputeShaderInterface.h"
Expand Down Expand Up @@ -1001,12 +1001,11 @@ namespace ne {

// Find and bind mesh data resource since only it is used in vertex shader.
const auto& meshDataIt =
pMtxMeshGpuResources->second.shaderResources.shaderCpuWriteResourceBindings.find(
MeshNode::getMeshShaderConstantBufferName());
pMtxMeshGpuResources->second.shaderResources.shaderCpuWriteResourceBindings
.find(MeshNode::getMeshShaderConstantBufferName());
#if defined(DEBUG)
if (meshDataIt ==
pMtxMeshGpuResources->second.shaderResources.shaderCpuWriteResourceBindings.end())
[[unlikely]] {
if (meshDataIt == pMtxMeshGpuResources->second.shaderResources
.shaderCpuWriteResourceBindings.end()) [[unlikely]] {
Error error(std::format(
"expected to find \"{}\" shader resource",
MeshNode::getMeshShaderConstantBufferName()));
Expand Down
10 changes: 5 additions & 5 deletions src/engine_lib/private/render/general/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "render/general/resources/GpuResourceManager.h"
#include "shader/general/resources/LightingShaderResourceManager.h"
#include "shader/general/resources/ShaderLightsInFrustumSingleType.hpp"
#include "shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/GlobalShaderResourceBindingManager.h"
#include "shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/binding/global/GlobalShaderResourceBindingManager.h"
#include "shader/general/ShaderMacro.h"
#include "shader/ShaderManager.h"
#include "game/nodes/MeshNode.h"
Expand Down Expand Up @@ -880,8 +880,8 @@ namespace ne {
new ShaderCpuWriteResourceBindingManager(this));

// Create shader texture resource manager.
pShaderTextureResourceManager =
std::unique_ptr<ShaderTextureResourceBindingManager>(new ShaderTextureResourceBindingManager(this));
pShaderTextureResourceManager = std::unique_ptr<ShaderTextureResourceBindingManager>(
new ShaderTextureResourceBindingManager(this));

// Create lighting shader resource manager.
pLightingShaderResourceManager = LightingShaderResourceManager::create(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include "render/general/resources/GpuResourceManager.h"
#include "shader/ComputeShaderInterface.h"
#include "shader/general/resources/LightingShaderResourceManager.h"
#include "shader/general/resources/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/GlobalShaderResourceBindingManager.h"
#include "shader/general/resources/binding/cpuwrite/ShaderCpuWriteResourceBindingManager.h"
#include "shader/general/resources/binding/texture/ShaderTextureResourceBindingManager.h"
#include "shader/general/resources/binding/global/GlobalShaderResourceBindingManager.h"
#include "render/vulkan/pipeline/VulkanPipeline.h"

namespace ne {
Expand Down
Loading

0 comments on commit 8d652f5

Please sign in to comment.