mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-08 23:22:04 +08:00
UI: remove unused lock and fence (#24355)
old-commit-hash: 7ac92938d246030095c2928d24d55d74b57565db
This commit is contained in:
@@ -214,16 +214,9 @@ void CameraViewWidget::paintGL() {
|
||||
glClearColor(bg.redF(), bg.greenF(), bg.blueF(), bg.alphaF());
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
std::lock_guard lk(lock);
|
||||
|
||||
if (latest_frame == nullptr) return;
|
||||
|
||||
glViewport(0, 0, width(), height());
|
||||
// sync with the PBO
|
||||
if (wait_fence) {
|
||||
wait_fence->wait();
|
||||
}
|
||||
|
||||
glBindVertexArray(frame_vao);
|
||||
|
||||
glUseProgram(program->programId());
|
||||
|
||||
@@ -35,19 +35,10 @@ protected:
|
||||
virtual void updateFrameMat(int w, int h);
|
||||
void vipcThread();
|
||||
|
||||
struct WaitFence {
|
||||
WaitFence() { sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); }
|
||||
~WaitFence() { glDeleteSync(sync); }
|
||||
void wait() { glWaitSync(sync, 0, GL_TIMEOUT_IGNORED); }
|
||||
GLsync sync = 0;
|
||||
};
|
||||
|
||||
bool zoomed_view;
|
||||
std::mutex lock;
|
||||
VisionBuf *latest_frame = nullptr;
|
||||
GLuint frame_vao, frame_vbo, frame_ibo;
|
||||
mat4 frame_mat;
|
||||
std::unique_ptr<WaitFence> wait_fence;
|
||||
std::unique_ptr<QOpenGLShaderProgram> program;
|
||||
QColor bg = QColor("#000000");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user