44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#if defined(XCENGINE_SUPPORT_VULKAN)
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "XCEngine/RHI/RHICommandList.h"
|
|
#include "XCEngine/RHI/RHICommandQueue.h"
|
|
#include "XCEngine/RHI/RHIDevice.h"
|
|
#include "XCEngine/RHI/RHIShader.h"
|
|
#include "XCEngine/RHI/RHITexture.h"
|
|
#include "XCEngine/RHI/Vulkan/VulkanDevice.h"
|
|
#include "XCEngine/RHI/Vulkan/VulkanTexture.h"
|
|
|
|
namespace XCEngine {
|
|
namespace RHI {
|
|
|
|
class VulkanGraphicsFixture : public ::testing::Test {
|
|
protected:
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
|
|
std::wstring ResolveShaderPath(const wchar_t* relativePath) const;
|
|
TextureDesc CreateColorTextureDesc(uint32_t width, uint32_t height) const;
|
|
TextureDesc CreateDepthTextureDesc(uint32_t width, uint32_t height) const;
|
|
RHICommandList* CreateCommandList() const;
|
|
RHIShader* CreateWriteRedComputeShader() const;
|
|
RHIShader* CreateWriteRedComputeShaderFromGlsl() const;
|
|
void SubmitAndWait(RHICommandList* commandList);
|
|
std::vector<uint8_t> ReadTextureRgba8(VulkanTexture* texture);
|
|
|
|
RHIDevice* m_device = nullptr;
|
|
RHICommandQueue* m_queue = nullptr;
|
|
};
|
|
|
|
} // namespace RHI
|
|
} // namespace XCEngine
|
|
|
|
#endif
|