CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.03k stars 3.51k forks source link

Failing: Scene/GlobeSurfaceTileProvider can render more imagery layers than the available texture units #7362

Open mramato opened 5 years ago

mramato commented 5 years ago

Scene/GlobeSurfaceTileProvider can render more imagery layers than the available texture units is failing in Firefox: http://localhost:8080/Specs/SpecRunner.html?spec=Scene%2FGlobeSurfaceTileProvider%20can%20render%20more%20imagery%20layers%20than%20the%20available%20texture%20units

Failed: promise rejected: RuntimeError: Program failed to link. Link log: Programs with more than 16 samplers are disallowed on Mesa drivers to avoid crashing.

mramato commented 5 years ago

WebGL Report ✓ This browser supports WebGL 1

Platform: Linux x86_64 Browser User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36 Context Name: webgl GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium) Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit Renderer: WebKit WebGL Unmasked Vendor: Intel Open Source Technology Center Unmasked Renderer: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2) Antialiasing: Available ANGLE: No Major Performance Caveat: No Vertex Shader Max Vertex Attributes: 16 Max Vertex Uniform Vectors: 4096 Max Vertex Texture Image Units: 32 Max Varying Vectors: 32 Best float precision: [-2127, 2127] (23) Transform Feedback Coming in WebGL 2 Rasterizer Aliased Line Width Range: [1, 7.375] Aliased Point Size Range: [1, 255] Fragment Shader Max Fragment Uniform Vectors: 4096 Max Texture Image Units: 32 float/int precision: highp/highp Best float precision: [-2127, 2127] (23) Framebuffer Max Color Buffers: 8 RGBA Bits: [8, 8, 8, 8] Depth / Stencil Bits: [24, 8] Max Render Buffer Size: 16384 Max Viewport Dimensions: [16384, 16384] Textures Max Texture Size: 16384 Max Cube Map Texture Size: 16384 Max Combined Texture Image Units: 192 Max Anisotropy: 16 Uniform Buffers Coming in WebGL 2 Supported Extensions: ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_half_float EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_texture_filter_anisotropic WEBKIT_EXT_texture_filter_anisotropic EXT_sRGB OES_element_index_uint OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_astc WEBGL_compressed_texture_s3tc WEBKIT_WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBKIT_WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context WEBKIT_WEBGL_lose_context

To see draft extensions in Chrome, browse to about:flags, enable the "Enable WebGL Draft Extensions" option, and relaunch.

mramato commented 5 years ago

Looked at this briefly with @bagnell and he thinks it's a Firefox bug. Basically Max Combined Texture Image Units is incorrectly reported by the context as 192, but if you try and use more than 16, the shader will fail to compile (because of an internal Mesa limit). Firefox should be reporting 16 and everything would work.

hpinkos commented 5 years ago

@mramato should this be marked test-failure instead of priority-high?

mramato commented 5 years ago

Maybe. The problem is that if someone has a lot of imagery layers, Cesium will crash, but I'm not completely sure that once the Firefox bug is fixed that still wouldn't happen. Either way I need to report this to Mozilla first, I'll post a link to the issue once that happens.

xtassin commented 5 years ago

Could this be related? I got many users reporting the following error message in Google Chrome:

Program failed to link. Link log: FRAGMENT shader texture image units count exceeds MAX_TEXTURE_IMAGE_UNITS(16)

My code does a heavy use of imagery layers.

gberaudo commented 5 years ago

The problem still exists with Firefox 67.

@mramato, have you been able to report the issue to Mozilla? I could not find it in https://bugzilla.mozilla.org/buglist.cgi?product=Core&component=Canvas%3A%20WebGL&bug_status=__open__.

Modestgentleman commented 4 years ago

Could this be related? I got many users reporting the following error message in Google Chrome:

Program failed to link. Link log: FRAGMENT shader texture image units count exceeds MAX_TEXTURE_IMAGE_UNITS(16)

My code does a heavy use of imagery layers.

Have you solved this problem?

bn-dignitas commented 4 years ago

@Modestgentleman @xtassin Not sure if it helps, but we ran across this with Cesium version 1.58 running in Chrome with 6+ imagery layers and shadowmap. I saw that a fix was put in Cesium 1.60 that might have fixed the issue. If you're running with an older Cesium you might want to check it out. https://github.com/CesiumGS/cesium/issues/7990