2026-03-17 17:54:44 +08:00
|
|
|
#include "XCEngine/RHI/OpenGL/OpenGLCommandQueue.h"
|
2026-03-23 21:09:15 +08:00
|
|
|
#include "XCEngine/RHI/RHIFence.h"
|
|
|
|
|
#include <glad/glad.h>
|
2026-03-17 17:54:44 +08:00
|
|
|
|
|
|
|
|
namespace XCEngine {
|
|
|
|
|
namespace RHI {
|
|
|
|
|
|
|
|
|
|
OpenGLCommandQueue::OpenGLCommandQueue() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OpenGLCommandQueue::~OpenGLCommandQueue() {
|
|
|
|
|
Shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenGLCommandQueue::Shutdown() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenGLCommandQueue::ExecuteCommandLists(uint32_t count, void** lists) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenGLCommandQueue::Signal(RHIFence* fence, uint64_t value) {
|
2026-03-23 21:09:15 +08:00
|
|
|
if (fence) {
|
|
|
|
|
fence->Signal(value);
|
|
|
|
|
}
|
|
|
|
|
glFlush();
|
2026-03-17 17:54:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenGLCommandQueue::Wait(RHIFence* fence, uint64_t value) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint64_t OpenGLCommandQueue::GetCompletedValue() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OpenGLCommandQueue::WaitForIdle() {
|
2026-03-23 21:09:15 +08:00
|
|
|
glFinish();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint64_t OpenGLCommandQueue::GetTimestampFrequency() const {
|
|
|
|
|
GLint64 frequency = 0;
|
|
|
|
|
glGetInteger64v(GL_TIMESTAMP, &frequency);
|
|
|
|
|
return frequency > 0 ? static_cast<uint64_t>(frequency) : 1000000000;
|
2026-03-17 17:54:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace RHI
|
|
|
|
|
} // namespace XCEngine
|