Skip to content

Commit

Permalink
add some debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Apr 9, 2024
1 parent 982782f commit a7bb801
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gfx_apis/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ fn run_ops(fb: &Framebuffer, ops: &[GfxApiOpt]) -> Option<SyncFile> {
i += 1;
}
if let Some(color) = color {
log::info!("fill with color {:?}", color);
fill_boxes3(&fb.ctx, triangles, &color);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/gfx_apis/gl/gl/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub const GL_COLOR_ATTACHMENT0: GLenum = 0x8CE0;
pub const GL_COLOR_BUFFER_BIT: GLbitfield = 0x00004000;
pub const GL_COMPILE_STATUS: GLenum = 0x8B81;
pub const GL_EXTENSIONS: GLenum = 0x1F03;
pub const GL_RENDERER: GLenum = 0x1F01;
pub const GL_FALSE: GLboolean = 0;
pub const GL_FLOAT: GLenum = 0x1406;
pub const GL_FRAGMENT_SHADER: GLenum = 0x8B30;
Expand Down
9 changes: 8 additions & 1 deletion src/gfx_apis/gl/renderer/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use {
program::GlProgram, render_buffer::GlRenderBuffer, sys::GLint, texture::GlTexture,
},
renderer::{framebuffer::Framebuffer, image::Image},
sys::GL_RENDERER,
GfxGlState, RenderError, Texture,
},
video::{
Expand All @@ -21,11 +22,12 @@ use {
},
},
ahash::AHashMap,
bstr::ByteSlice,
enum_map::{enum_map, Enum, EnumMap},
jay_config::video::GfxApi,
std::{
cell::{Cell, RefCell},
ffi::CString,
ffi::{CStr, CString},
fmt::{Debug, Formatter},
rc::Rc,
},
Expand Down Expand Up @@ -148,6 +150,11 @@ impl GlRenderContext {
} else {
None
};
{
let name = (ctx.dpy.gles.glGetString)(GL_RENDERER);
let name = CStr::from_ptr(name as _).to_bytes();
log::info!("gl renderer: {}", name.as_bstr());
}
let fill_prog = GlProgram::from_shaders(
ctx,
include_str!("../shaders/fill.vert.glsl"),
Expand Down

0 comments on commit a7bb801

Please sign in to comment.