// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #if GRAPHICS_API_DIRECTX12 #include "Engine/Graphics/Shaders/GPUShader.h" #include "Engine/Graphics/Shaders/GPUConstantBuffer.h" #include "GPUDeviceDX12.h" /// /// Constant Buffer for DirectX 12 backend. /// class GPUConstantBufferDX12 : public GPUResourceDX12 { public: GPUConstantBufferDX12(GPUDeviceDX12* device, uint32 size, const StringView& name) noexcept : GPUResourceDX12(device, name) , GPUAddress(0) { _size = size; } public: /// /// Last uploaded data address. /// D3D12_GPU_VIRTUAL_ADDRESS GPUAddress; }; /// /// Shader for DirectX 12 backend. /// class GPUShaderDX12 : public GPUResourceDX12 { public: /// /// Initializes a new instance of the class. /// /// The device. /// The resource name. GPUShaderDX12(GPUDeviceDX12* device, const StringView& name) : GPUResourceDX12(device, name) { } protected: // [GPUShader] GPUShaderProgram* CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, byte* cacheBytes, uint32 cacheSize, MemoryReadStream& stream) override; }; #endif