/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/ThirdParty/Jolt/Compute/DX12/ComputeSystemDX12.h
45 строк
2 KB
Jan Krassnigg
Updated Jolt (#1921)
28 апр 2026, 12:24
Не верифицирован
28 апр 2026, 12:24
600d1da
Код
Авторство
О чём код?
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics) // SPDX-FileCopyrightText: 2025 Jorrit Rouwe // SPDX-License-Identifier: MIT #pragma once #include <Jolt/Core/UnorderedMap.h> #include <Jolt/Compute/ComputeSystem.h> #ifdef JPH_USE_DX12 #include <Jolt/Compute/DX12/IncludeDX12.h> JPH_NAMESPACE_BEGIN /// Interface to run a workload on the GPU using DirectX 12. /// Minimal implementation that can integrate with your own DirectX 12 setup. class JPH_EXPORT ComputeSystemDX12 : public ComputeSystem { public: JPH_DECLARE_RTTI_VIRTUAL(JPH_EXPORT, ComputeSystemDX12) /// Initialize / shutdown bool Initialize(ID3D12Device *inDevice, ComputeSystemResult &outResult); void Shutdown(); // See: ComputeSystem virtual ComputeShaderResult CreateComputeShader(const char *inName, uint32 inGroupSizeX, uint32 inGroupSizeY, uint32 inGroupSizeZ) override; virtual ComputeBufferResult CreateComputeBuffer(ComputeBuffer::EType inType, uint64 inSize, uint inStride, const void *inData = nullptr) override; virtual ComputeQueueResult CreateComputeQueue() override; /// Access to the DX12 device ID3D12Device * GetDevice() const { return mDevice.Get(); } // Function to create a ID3D12Resource on specified heap with specified state ComPtr<ID3D12Resource> CreateD3DResource(D3D12_HEAP_TYPE inHeapType, D3D12_RESOURCE_STATES inResourceState, D3D12_RESOURCE_FLAGS inFlags, uint64 inSize); private: ComPtr<ID3D12Device> mDevice; FARPROC mDxcCreateInstanceFn = nullptr; }; JPH_NAMESPACE_END #endif // JPH_USE_DX12