1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Improve OpenGL error detection and reporting in egui_glow

May help to diagnose https://github.com/emilk/egui/issues/1087
This commit is contained in:
Emil Ernerfeldt
2022-01-09 23:04:00 +01:00
parent 611eaa52e8
commit 650057dd4a
5 changed files with 43 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
#![allow(unsafe_code)]
use crate::misc_util::{compile_shader, link_program};
use crate::misc_util::{check_for_gl_error, compile_shader, link_program};
use crate::vao_emulate::BufferInfo;
use glow::HasContext;
@@ -76,13 +76,7 @@ impl PostProcess {
glow::UNSIGNED_BYTE,
None,
);
let error_code = gl.get_error();
assert_eq!(
error_code,
glow::NO_ERROR,
"Error occurred in post process texture initialization. code : 0x{:x}",
error_code
);
check_for_gl_error(gl, "post process texture initialization");
gl.framebuffer_texture_2d(
glow::FRAMEBUFFER,
@@ -151,13 +145,7 @@ impl PostProcess {
gl.buffer_data_u8_slice(glow::ELEMENT_ARRAY_BUFFER, &indices, glow::STATIC_DRAW);
gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, None);
let error_code = gl.get_error();
assert_eq!(
error_code,
glow::NO_ERROR,
"Error occurred in post process initialization. code : 0x{:x}",
error_code
);
check_for_gl_error(gl, "post process initialization");
Ok(PostProcess {
pos_buffer,