Skip to content

Commit

Permalink
#2467 try to continue without shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 26, 2023
1 parent 345a1cc commit 49b4c00
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xpra/client/gl/backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
from OpenGL.GL.ARB.fragment_program import GL_FRAGMENT_PROGRAM_ARB
from OpenGL.GL.ARB.framebuffer_object import (
GL_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, \
GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,
glGenFramebuffers, glBindFramebuffer, glFramebufferTexture2D, glBlitFramebuffer,
)

Expand Down Expand Up @@ -494,9 +494,11 @@ def gl_init_debug(self) -> None:
log.info("Enabling GL frame terminator debugging.")

def gl_init_textures(self) -> None:
log("gl_init_textures()")
assert self.offscreen_fbo is None
assert self.shaders is None
assert glGenFramebuffers, "no framebuffer support"
if not bool(glGenFramebuffers):
raise RuntimeError("current context lacks framebuffer support: no glGenFramebuffers")
self.textures = glGenTextures(N_TEXTURES)
self.offscreen_fbo = glGenFramebuffers(1)
self.tmp_fbo = glGenFramebuffers(1)
Expand All @@ -505,6 +507,10 @@ def gl_init_textures(self) -> None:

def gl_init_shaders(self) -> None:
assert self.shaders is None
if not bool(glGenProgramsARB):
log.warn("Warning: running without shaders")
self.shaders = ()
return
# Create and assign fragment programs
self.shaders = [ 1, 2, 3, 4 ]
glGenProgramsARB(4, self.shaders)
Expand Down Expand Up @@ -577,8 +583,6 @@ def gl_init(self, context, skip_fbo=False) -> None:
if not self.shaders:
self.gl_init_shaders()

# Bind program 0 for YUV painting by default
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, self.shaders[YUV_to_RGB_SHADER])
self.gl_setup = True
log("gl_init(%s, %s) done", context, skip_fbo)

Expand Down

0 comments on commit 49b4c00

Please sign in to comment.