Add GPUVertexLayout to graphics backends

This commit is contained in:
Wojtek Figat
2024-12-13 09:20:01 +01:00
parent cedf4b1eb5
commit fc4e6f4972
31 changed files with 605 additions and 93 deletions

View File

@@ -11,6 +11,7 @@
#include "GPUTimerQueryNull.h"
#include "GPUBufferNull.h"
#include "GPUSamplerNull.h"
#include "GPUVertexLayoutNull.h"
#include "GPUSwapChainNull.h"
#include "Engine/Core/Log.h"
#include "Engine/Graphics/Async/GPUTasksManager.h"
@@ -172,6 +173,11 @@ GPUSampler* GPUDeviceNull::CreateSampler()
return New<GPUSamplerNull>();
}
GPUVertexLayout* GPUDeviceNull::CreateVertexLayout(const VertexElements& elements)
{
return New<GPUVertexLayoutNull>(elements);
}
GPUSwapChain* GPUDeviceNull::CreateSwapChain(Window* window)
{
return New<GPUSwapChainNull>(window);

View File

@@ -47,6 +47,7 @@ public:
GPUTimerQuery* CreateTimerQuery() override;
GPUBuffer* CreateBuffer(const StringView& name) override;
GPUSampler* CreateSampler() override;
GPUVertexLayout* CreateVertexLayout(const VertexElements& elements) override;
GPUSwapChain* CreateSwapChain(Window* window) override;
GPUConstantBuffer* CreateConstantBuffer(uint32 size, const StringView& name) override;
};

View File

@@ -0,0 +1,22 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#pragma once
#if GRAPHICS_API_NULL
#include "Engine/Graphics/Shaders/GPUVertexLayout.h"
/// <summary>
/// Vertex layout for Null backend.
/// </summary>
class GPUVertexLayoutNull : public GPUVertexLayout
{
public:
GPUVertexLayoutNull(const Elements& elements)
: GPUVertexLayout()
{
_elements = elements;
}
};
#endif