From 6945a9062b9f78fa49c1df1d8928d582534b9bf6 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 11 Feb 2020 15:36:47 +0100 Subject: [PATCH] gpu/gl: add detail to the float FBO error message Updates gio#49 Signed-off-by: Elias Naur --- gpu/gl/backend.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gpu/gl/backend.go b/gpu/gl/backend.go index c0fcb6f2..475db765 100644 --- a/gpu/gl/backend.go +++ b/gpu/gl/backend.go @@ -473,15 +473,18 @@ func floatTripleFor(f Functions, ver [2]int, exts []string) (textureTriple, erro defFBO := Framebuffer(f.GetBinding(FRAMEBUFFER_BINDING)) f.BindFramebuffer(FRAMEBUFFER, fbo) defer f.BindFramebuffer(FRAMEBUFFER, defFBO) + var attempts []string for _, tt := range triples { const size = 256 f.TexImage2D(TEXTURE_2D, 0, tt.internalFormat, size, size, tt.format, tt.typ, nil) f.FramebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, tex, 0) - if st := f.CheckFramebufferStatus(FRAMEBUFFER); st == FRAMEBUFFER_COMPLETE { + st := f.CheckFramebufferStatus(FRAMEBUFFER) + if st == FRAMEBUFFER_COMPLETE { return tt, nil } + attempts = append(attempts, fmt.Sprintf("(0x%x, 0x%x, 0x%x): 0x%x", tt.internalFormat, tt.format, tt.typ, st)) } - return textureTriple{}, errors.New("floating point fbos not supported") + return textureTriple{}, fmt.Errorf("floating point fbos not supported (attempted %s)", attempts) } func srgbaTripleFor(ver [2]int, exts []string) (textureTriple, error) {