fix(RHI): 修复 OpenGL 测试接口不匹配问题
- 修复 RHIDeviceInfo 缺少 majorVersion/minorVersion - 修复 OpenGLTexture 使用 GetTextureType 替代 GetType - 修复 OpenGLSampler 使用 OpenGLSamplerDesc - 修复 BlendFactor::OneMinusSrcAlpha -> InvSrcAlpha - 修复 OpenGLRenderTargetViewDesc/OpenGLDepthStencilViewDesc 重定义问题 - 恢复 OpenGL 测试文件到 CMakeLists
This commit is contained in:
@@ -19,7 +19,7 @@ enum class DepthStencilType {
|
||||
TextureCube
|
||||
};
|
||||
|
||||
struct DepthStencilViewDesc {
|
||||
struct OpenGLDepthStencilViewDesc {
|
||||
DepthStencilType type = DepthStencilType::Texture2D;
|
||||
int mipLevel = 0;
|
||||
int baseArraySlice = 0;
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
OpenGLDepthStencilView();
|
||||
~OpenGLDepthStencilView();
|
||||
|
||||
bool Initialize(unsigned int texture, const DepthStencilViewDesc& desc);
|
||||
bool Initialize(unsigned int texture, const OpenGLDepthStencilViewDesc& desc);
|
||||
bool Initialize(unsigned int texture, int mipLevel = 0);
|
||||
bool InitializeCubemap(unsigned int cubemap, int face, int mipLevel = 0);
|
||||
void Shutdown();
|
||||
|
||||
@@ -15,7 +15,7 @@ enum class RenderTargetType {
|
||||
TextureCubeArray
|
||||
};
|
||||
|
||||
struct RenderTargetViewDesc {
|
||||
struct OpenGLRenderTargetViewDesc {
|
||||
RenderTargetType type = RenderTargetType::Texture2D;
|
||||
int mipLevel = 0;
|
||||
int baseArraySlice = 0;
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
OpenGLRenderTargetView();
|
||||
~OpenGLRenderTargetView();
|
||||
|
||||
bool Initialize(unsigned int texture, const RenderTargetViewDesc& desc);
|
||||
bool Initialize(unsigned int texture, const OpenGLRenderTargetViewDesc& desc);
|
||||
bool Initialize(unsigned int texture, int mipLevel = 0);
|
||||
bool InitializeCubemap(unsigned int cubemap, int face, int mipLevel = 0);
|
||||
void Shutdown();
|
||||
|
||||
@@ -253,6 +253,8 @@ struct RHIDeviceInfo {
|
||||
std::wstring vendor;
|
||||
std::wstring renderer;
|
||||
std::wstring version;
|
||||
uint32_t majorVersion = 0;
|
||||
uint32_t minorVersion = 0;
|
||||
uint64_t dedicatedVideoMemory = 0;
|
||||
uint64_t dedicatedSystemMemory = 0;
|
||||
uint64_t sharedSystemMemory = 0;
|
||||
|
||||
@@ -20,7 +20,7 @@ OpenGLDepthStencilView::~OpenGLDepthStencilView() {
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
bool OpenGLDepthStencilView::Initialize(unsigned int texture, const DepthStencilViewDesc& desc) {
|
||||
bool OpenGLDepthStencilView::Initialize(unsigned int texture, const OpenGLDepthStencilViewDesc& desc) {
|
||||
m_texture = texture;
|
||||
m_mipLevel = desc.mipLevel;
|
||||
m_type = desc.type;
|
||||
@@ -53,7 +53,7 @@ bool OpenGLDepthStencilView::Initialize(unsigned int texture, const DepthStencil
|
||||
}
|
||||
|
||||
bool OpenGLDepthStencilView::Initialize(unsigned int texture, int mipLevel) {
|
||||
DepthStencilViewDesc desc;
|
||||
OpenGLDepthStencilViewDesc desc;
|
||||
desc.mipLevel = mipLevel;
|
||||
return Initialize(texture, desc);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ OpenGLRenderTargetView::~OpenGLRenderTargetView() {
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
bool OpenGLRenderTargetView::Initialize(unsigned int texture, const RenderTargetViewDesc& desc) {
|
||||
bool OpenGLRenderTargetView::Initialize(unsigned int texture, const OpenGLRenderTargetViewDesc& desc) {
|
||||
m_texture = texture;
|
||||
m_mipLevel = desc.mipLevel;
|
||||
m_type = desc.type;
|
||||
@@ -69,7 +69,7 @@ bool OpenGLRenderTargetView::Initialize(unsigned int texture, const RenderTarget
|
||||
}
|
||||
|
||||
bool OpenGLRenderTargetView::Initialize(unsigned int texture, int mipLevel) {
|
||||
RenderTargetViewDesc desc;
|
||||
OpenGLRenderTargetViewDesc desc;
|
||||
desc.type = RenderTargetType::Texture2D;
|
||||
desc.mipLevel = mipLevel;
|
||||
return Initialize(texture, desc);
|
||||
|
||||
Reference in New Issue
Block a user