vulkan failed to render gltf with primitive.mode=line
- Dominant language
- C++
- Stars
- 20.5k
- Forks
- 2.3k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 74
Description
**Describe the bug**
I have a GLB file that contains a mesh with a primitive.mode of 1 ({"name":"Object_54","primitives":[{"attributes":{"POSITION":266},"indices":267,"material":0,"mode":1}]}). When trying to render this GLB using Vulkan, it encounters errors. I've tried different versions of NVIDIA drivers and Mesa LLVMPIPE - while the error messages differ, the rendering still fails (though not 100% of the time, but very likely). When I remove this mesh from the scene, the rendering works successfully. I'm not sure if this is an issue with my implementation, with Filament, or with the Vulkan driver?
I also tried model in https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/PrimitiveModeNormalsTest , it also crashed
using filament 1.56.3
**To Reproduce**
Steps to reproduce the behavior:
1. test glb: [004bef020bb34445b2b31e97552cd421.glb.zip](https://github.com/user-attachments/files/18107588/004bef020bb34445b2b31e97552cd421.glb.zip)
2. compile code in Additional context
3. run ./a.out 004bef020bb34445b2b31e97552cd421.glb 0 -> not remove Object_54, crash
4. run ./a.out 004bef020bb34445b2b31e97552cd421.glb 1 -> remove Object_54, success
**Expected behavior**
program run always success
**Screenshots**
N/A
**Logs**
on L40s:
```
./a.out 004bef020bb34445b2b31e97552cd421.glb 0
remove_line: 0
FEngine (64 bits) created at 0x562399481160 (threading is enabled)
FEngine resolved backend: Vulkan
Vulkan device driver: NVIDIA 535.129.03
Selected physical device 'NVIDIA L40S' from 1 physical devices. (vendor 0x10de, device 0x26b9, driver 0x85e040c0, api 1.3)
Backend feature level: 3
FEngine feature level: 1
**Failed to wait for readPixels fence**
callback called
write_png_file: test3.png
```
on P100
```
$./a.out 004bef020bb34445b2b31e97552cd421.glb 0
remove_line: 0
FEngine (64 bits) created at 0x55d035f401a0 (threading is enabled)
FEngine resolved backend: Vulkan
Vulkan device driver: NVIDIA 525.105.17
Selected physical device 'Tesla P100-PCIE-16GB' from 3 physical devices. (vendor 0x10de, device 0x15f8, driver 0x835a4440, api 1.3)
Backend feature level: 3
FEngine feature level: 1
Segmentation fault (core dumped)
```
use llvmpipe:
```
$VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json ./a.out 004bef020bb34445b2b31e97552cd421.glb 0
remove_line: 0
FEngine (64 bits) created at 0x55c69e2391a0 (threading is enabled)
FEngine resolved backend: Vulkan
Vulkan device driver: llvmpipe Mesa 24.3.0 (LLVM 15.0.6)
Selected physical device 'llvmpipe (LLVM 15.0.6, 256 bits)' from 1 physical devices. (vendor 0x10005, device 0x0, driver 0x1, api 1.3)
Backend feature level: 3
FEngine feature level: 1
Segmentation fault (core dumped)
```
**Desktop (please complete the following information):**
- OS: Linux (centos7)
- GPU: P100, L40s
- Backend: Vulkan
**Smartphone (please complete the following information):**
N/A
**Additional context**
my test code:
```
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
Contributor guide
Assessment
This issue has not been assessed yet.