1
0
Fork 0
forked from wry/wry

opengl: make mixed device use a non-fatal error

This commit is contained in:
Julian Orth 2025-08-29 13:37:53 +02:00
parent 5e9bc64757
commit 384eb80e89

View file

@ -329,7 +329,10 @@ fn fill_boxes3(ctx: &GlRenderContext, boxes: &[[f32; 2]], color: &Color) {
}
fn render_texture(ctx: &GlRenderContext, tex: &CopyTexture) {
let texture = tex.tex.as_gl();
let Some(texture) = tex.tex.as_gl() else {
log::error!("A non-OpenGL texture was passed into OpenGL");
return;
};
if !texture.gl.contents_valid.get() {
log::error!("Ignoring texture with invalid contents");
return;
@ -437,10 +440,8 @@ fn handle_explicit_sync(ctx: &GlRenderContext, img: Option<&Rc<EglImage>>, sync:
}
impl dyn GfxTexture {
fn as_gl(&self) -> &Texture {
(self as &dyn Any)
.downcast_ref()
.expect("Non-gl texture passed into gl")
fn as_gl(&self) -> Option<&Texture> {
(self as &dyn Any).downcast_ref()
}
}