Skip to content

Commit

Permalink
Make it run again
Browse files Browse the repository at this point in the history
  • Loading branch information
krupitskas committed Sep 30, 2024
1 parent e107448 commit aaa80ac
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 188 deletions.
1 change: 1 addition & 0 deletions Yasno/Graphics/Primitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace ysn
D3D12_INDEX_BUFFER_VIEW index_buffer_view;

uint32_t index_count = 0;
int material_id = -1;

std::unordered_map<std::string, Attribute> attributes;
};
Expand Down
8 changes: 4 additions & 4 deletions Yasno/Graphics/RenderScene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ namespace ysn

struct ModelRenderParameters
{
bool should_cast_shadow = false;

bool should_cast_shadow = false;
};

struct Model
{
std::string name = "Unnamed Model";
std::string name = "Unnamed Model";
ModelRenderParameters render_parameters;

std::vector<Mesh> meshes;
std::vector<Material> materials;

// Not sure about that
std::vector<GpuResource> buffers;
Expand All @@ -41,7 +41,7 @@ namespace ysn
std::vector<GpuResource> node_buffers; // Per node GPU data
std::vector<D3D12_SAMPLER_DESC> sampler_descs;
};

struct RenderScene
{
std::shared_ptr<Camera> camera;
Expand Down
1 change: 1 addition & 0 deletions Yasno/Graphics/Techniques/ShadowMapPass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <System/GltfLoader.hpp>
#include <Renderer/DescriptorHeap.hpp>
#include <Renderer/DxRenderer.hpp>

namespace ysn
{
Expand Down
6 changes: 5 additions & 1 deletion Yasno/Renderer/CommandQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace ysn
return commandList;
}

wil::com_ptr<ID3D12GraphicsCommandList4> CommandQueue::GetCommandList()
wil::com_ptr<ID3D12GraphicsCommandList4> CommandQueue::GetCommandList(std::string name)
{
wil::com_ptr<ID3D12CommandAllocator> commandAllocator;
wil::com_ptr<ID3D12GraphicsCommandList4> commandList;
Expand Down Expand Up @@ -103,6 +103,10 @@ namespace ysn
commandList = CreateCommandList(commandAllocator);
}

#ifndef YSN_RELEASE
commandList->SetName(std::wstring(name.begin(), name.end()).c_str());
#endif

// Associate the command allocator with the command list so that it can be
// retrieved when the command list is executed.
ThrowIfFailed(commandList->SetPrivateDataInterface(__uuidof(ID3D12CommandAllocator), commandAllocator.get()));
Expand Down
2 changes: 1 addition & 1 deletion Yasno/Renderer/CommandQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ysn
CommandQueue(wil::com_ptr<ID3D12Device5> device, D3D12_COMMAND_LIST_TYPE type);
virtual ~CommandQueue();

wil::com_ptr<ID3D12GraphicsCommandList4> GetCommandList();
wil::com_ptr<ID3D12GraphicsCommandList4> GetCommandList(std::string name = "Neyasno Command List");

// Execute a command list.
// Returns the fence value to wait for this command list.
Expand Down
2 changes: 2 additions & 0 deletions Yasno/Renderer/GpuResource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace ysn
{
struct GpuResource
{
GpuResource() = default;

GpuResource(wil::com_ptr<ID3D12Resource> res) : resource(res) {}

D3D12_GPU_VIRTUAL_ADDRESS GetGPUVirtualAddress() const
Expand Down
Loading

0 comments on commit aaa80ac

Please sign in to comment.