Fix OpenGL ES 3.0 shader and renderer compatibility to resolve invalid operation errors#42
Conversation
Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/e8ff6608-c554-48a8-a930-fad2b4093097 Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
…t.frag Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/e8ff6608-c554-48a8-a930-fad2b4093097 Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
damacaa
left a comment
There was a problem hiding this comment.
[deck@steamdeck build]$ /home/deck/Documents/GitHub/weird-engine/examples/sample-scenes/build/WeirdSamples
Framebuffer is not complete!
terminate called without an active exception
Aborted (core dumped) /home/deck/Documents/GitHub/weird-engine/examples/sample-scenes/build/WeirdSamples
[deck@steamdeck build]$
istill get this error
- Depth texture: GL_FLOAT → GL_UNSIGNED_INT for GL_DEPTH_COMPONENT24 (GLES 3.0 spec Table 3.2: GL_DEPTH_COMPONENT24 requires GL_UNSIGNED_INT) - Color textures: GL_RGB/GL_RGBA (unsized) → GL_RGB8/GL_RGBA8 (sized) (sized formats are required to be color-renderable in GLES 3.0) - RenderTarget: bare throw; → throw std::runtime_error(...) (throw; with no active exception calls std::terminate)" Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/1627aaa0-7640-46b2-84b4-71f4bbc2ef23 Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
Fixed in c64d1b3. Three issues were causing this:
|
…mpatibility GL_OES_texture_buffer is unsupported on the Steam Deck GLES driver. Replace all samplerBuffer usage with highp sampler2D: - DataBuffer.h: remove GL_TEXTURE_BUFFER_OES/glTexBufferOES entirely; upload data via glTexImage2D (RGBA32F, width=count, height=1) - geometry_instanced.vert: remove extension + precision samplerBuffer, samplerBuffer -> sampler2D, texelFetch(buf,i) -> texelFetch(buf,ivec2(i,0),0) - sdf_distance.frag: same changes - sdf_raymarching.frag: same changes (2 texelFetch sites) - 2DSDFShaderGenerationSystem.h: update generated texelFetch calls to 2D form Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/ac95e021-5bc9-4833-8d4b-335e5fa8a0aa Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
…marching.frag GLSL ES does not allow implicit int-to-float conversion in arithmetic. Line 171: `float delta = 1 - (...)` fails because `1` is an int literal. Change to `1.0 - (...)` to satisfy the type system. Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/91d8b0d9-4c71-495b-a130-c7deda75cc2f Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
- sdf_raymarching.frag: vec3(0,1,0) -> vec3(0.0,1.0,0.0) (lines 138, 176) and vec4(...,0) -> vec4(...,0.0) (line 268) - sdf_distance.frag: max(int,0) in vec3 -> float(max(int,0)) (line 155) and vec4(...,0) -> vec4(...,0.0) (line 283) - jump_flood_step.frag: all vec2(int,int) -> vec2(float,float) (line 45) GLSL ES 3.0 forbids implicit int-to-float conversion in constructors and arithmetic, causing shader compile errors on strict drivers (Steam Deck). Agent-Logs-Url: https://github.com/damacaa/weird-engine/sessions/7a32c872-cb79-4f74-9697-af1cab89f5b9 Co-authored-by: damacaa <49535803+damacaa@users.noreply.github.com>
1 - float_expr→1.0 - float_exprinsdf_raymarching.fragline 171vec3(0, 1, 0)→vec3(0.0, 1.0, 0.0)insdf_raymarching.fraglines 138, 176vec4(..., 0)→vec4(..., 0.0)insdf_raymarching.fragline 268max(finalMaterialId, 0)int result invec3(...)→float(max(finalMaterialId, 0))insdf_distance.fragline 155vec4(..., 0)→vec4(..., 0.0)insdf_distance.fragline 283vec2(...)constructors injump_flood_step.fragline 45