engine: sync editor rendering and ui changes

This commit is contained in:
2026-04-08 16:09:15 +08:00
parent 31756847ab
commit 162f1cc12e
153 changed files with 4454 additions and 2990 deletions

View File

@@ -1,6 +1,7 @@
#include "fixtures/OpenGLTestFixture.h"
#include "XCEngine/RHI/OpenGL/OpenGLCommandList.h"
#include "XCEngine/RHI/OpenGL/OpenGLBuffer.h"
#include "XCEngine/RHI/OpenGL/OpenGLPipelineState.h"
#include "XCEngine/RHI/OpenGL/OpenGLVertexArray.h"
using namespace XCEngine::RHI;
@@ -160,3 +161,30 @@ TEST_F(OpenGLTestFixture, CommandList_SetBlendFactor) {
EXPECT_FLOAT_EQ(color[2], 0.5f);
EXPECT_FLOAT_EQ(color[3], 1.0f);
}
TEST_F(OpenGLTestFixture, CommandList_SetStencilRef_UpdatesActivePipelineStencilReference) {
OpenGLCommandList cmdList;
OpenGLPipelineState pipeline;
DepthStencilStateDesc state = {};
state.stencilEnable = true;
state.front.func = static_cast<uint32_t>(ComparisonFunc::Equal);
state.back.func = static_cast<uint32_t>(ComparisonFunc::NotEqual);
pipeline.SetDepthStencilState(state);
cmdList.SetPipelineState(&pipeline);
cmdList.SetStencilRef(5);
GLint frontRef = 0;
GLint backRef = 0;
GLint frontFunc = 0;
GLint backFunc = 0;
glGetIntegerv(GL_STENCIL_REF, &frontRef);
glGetIntegerv(GL_STENCIL_BACK_REF, &backRef);
glGetIntegerv(GL_STENCIL_FUNC, &frontFunc);
glGetIntegerv(GL_STENCIL_BACK_FUNC, &backFunc);
EXPECT_EQ(frontRef, 5);
EXPECT_EQ(backRef, 5);
EXPECT_EQ(frontFunc, GL_EQUAL);
EXPECT_EQ(backFunc, GL_NOTEQUAL);
}