Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading ANY glb with morph targets will crash on iOS platform with backend::Metal #1525

Closed
fishelegs opened this issue Aug 15, 2019 · 4 comments · Fixed by #1663
Closed

Reading ANY glb with morph targets will crash on iOS platform with backend::Metal #1525

fishelegs opened this issue Aug 15, 2019 · 4 comments · Fixed by #1663
Assignees
Labels
bug Something isn't working metal Issue/request specific to Metal

Comments

@fishelegs
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. use master branch or v1.3.1 release branch
    2.open hello-gltf iOS demo with Metal
    3.change DamagedHelmet.glb to ANY glb with morph targets.
    4.It'll crash after running.

Expected behavior
No crash.

Screenshots
crash in id PipelineStateCreator::operator()(id device,
const PipelineState& state) noexcept ;
error:
Error Domain=AGXMetalA10 Code=3 "Cannot convert attribute from MTLAttributeFormatChar4 to an unsigned integer type" UserInfo={NSLocalizedDescription=Cannot convert attribute from MTLAttributeFormatChar4 to an unsigned integer type}

Callstack:
2019-08-15 20:51:34.426728+0800 hello-gltf[12459:583455] Compiler failed to build request
Cannot convert attribute from MTLAttributeFormatChar4 to an unsigned integer type
utils::PostconditionPanic
in id filament::backend::metal::PipelineStateCreator::operator()(id, const filament::backend::metal::PipelineState &):85
in file filament/backend/src/metal/MetalState.mm
reason: Could not create Metal pipeline state.
#0 0 hello-gltf 0x0000000104adb710 _ZN5utils9CallStack6updateEm + 32
#1 0 hello-gltf 0x0000000104af59bc _ZN5utils6TPanicINS_18PostconditionPanicEEC2EPKcS4_iNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE + 192
#2 0 hello-gltf 0x0000000104af695c _ZN5utils18PostconditionPanicCI2NS_6TPanicIS0_EEEPKcS3_iNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 68
#3 0 hello-gltf 0x0000000104af5590 _ZN5utils18PostconditionPanicCI1NS_6TPanicIS0_EEEPKcS3_iNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE + 52
#4 0 hello-gltf 0x0000000104af5490 _ZN5utils6TPanicINS_18PostconditionPanicEE5panicEPKcS4_iS4_z + 240
#5 0 hello-gltf 0x0000000104ab7aa0 _ZN8filament7backend5metal20PipelineStateCreatorclEPU19objcproto9MTLDevice11objc_objectRKNS1_13PipelineStateE + 2000
#6 0 hello-gltf 0x0000000104a8c1a0 ZN8filament7backend5metal10StateCacheINS1_13PipelineStateEPU33objcproto22MTLRenderPipelineState11objc_objectNS1_20PipelineStateCreatorEE16getOrCreateStateERKS3 + 184
#7 0 hello-gltf 0x0000000104a766c4 _ZN8filament7backend5metal11MetalDriver4drawENS0_13PipelineStateENS0_6HandleINS0_17HwRenderPrimitiveEEE + 616
#8 0 hello-gltf 0x0000000104aa1454 _ZN8filament7backend10trampolineIMNS0_5metal11MetalDriverEFvNS0_13PipelineStateENS0_6HandleINS0_17HwRenderPrimitiveEEEERS3_RNSt3__15tupleIJS4_S7_EEEJLm0ELm1EEEEvOT_OT0_OT1_NSB_16integer_sequenceImJXspT2_EEEE + 236
#9 0 hello-gltf 0x0000000104aa1348 ZN8filament7backend5applyIMNS0_5metal11MetalDriverEFvNS0_13PipelineStateENS0_6HandleINS0_17HwRenderPrimitiveEEEERS3_RNSt3__15tupleIJS4_S7_EEEEEvOT_OT0_OT1 + 88
#10 0 hello-gltf 0x0000000104a76444 _ZN8filament7backend11CommandTypeIJMNS0_6DriverEFvNS0_13PipelineStateENS0_6HandleINS0_17HwRenderPrimitiveEEEEEE7CommandIXadL_ZNS2_4drawES3_S6_EEE7executeIMNS0_5metal11MetalDriverEFvS3_S6_ERSE_EEvOT_OT0_PNS0_11CommandBaseEPl + 120
#11 0 hello-gltf 0x0000000104a72614 _ZN8filament7backend18ConcreteDispatcherINS0_5metal11MetalDriverEE4drawERNS0_6DriverEPNS0_11CommandBaseEPl + 72
#12 0 hello-gltf 0x0000000104a16870 _ZN8filament7backend11CommandBase7executeERNS0_6DriverE + 64
#13 0 hello-gltf 0x0000000104a16788 _ZN8filament7backend13CommandStream7executeEPv + 164
#14 0 hello-gltf 0x0000000104951c48 _ZN8filament7details7FEngine7executeEv + 188
#15 0 hello-gltf 0x000000010494d3f4 _ZN8filament7details7FEngine4loopEv + 516
#16 0 hello-gltf 0x0000000104966b60 ZNSt3__1L8__invokeIMN8filament7details7FEngineEFivEPS3_JEvEEDTcldsdeclsr3std3__1E7forwardIT0_Efp0_Efp_spclsr3std3__1E7forwardIT1_Efp1_EEEOT_OS7_DpOS8 + 128
#17 0 hello-gltf 0x0000000104966a58 _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEMN8filament7details7FEngineEFivEJPS8_EJLm2EEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 68
libc++abi.dylib: terminating with uncaught exception of type utils::PostconditionPanic
Printing description of error:
Error Domain=AGXMetalA10 Code=3 "Cannot convert attribute from MTLAttributeFormatChar4 to an unsigned integer type" UserInfo={NSLocalizedDescription=Cannot convert attribute from MTLAttributeFormatChar4 to an unsigned integer type}

Desktop (please complete the following information):

  • OS:iOS
  • GPU: PowerVR / Apple GPU
  • Backend: Metal

Smartphone (please complete the following information):

  • Device: all iPhone
  • OS: iOS 12

Additional context
glb with morph targets.
DamagedHelmet.glb.zip

@bejado bejado self-assigned this Aug 15, 2019
@bejado bejado added the ios Issue/request for iOS only label Aug 15, 2019
@bejado
Copy link
Member

bejado commented Aug 15, 2019

Thanks for the report, I'm able to reproduce. Note that on iOS, OpenGL crashes as well. On desktop, Metal crashes for the same reason, and OpenGL fails to render anything.

@bejado bejado added bug Something isn't working and removed ios Issue/request for iOS only labels Aug 15, 2019
@prideout
Copy link
Contributor

OpenGL looks ok to me on macOS

Screen Shot 2019-08-15 at 2 22 43 PM

@bejado
Copy link
Member

bejado commented Aug 16, 2019

Ah yes, desktop OpenGL does work, I was seeing a separate issue related to IBLs / sunlight.

@bejado
Copy link
Member

bejado commented Aug 19, 2019

As a quick workaround, you could replace the MTLVertexFormatChar4 here with MTLVertexFormatUChar4.

@bejado bejado added the metal Issue/request specific to Metal label Sep 18, 2019
prideout added a commit that referenced this issue Sep 18, 2019
To prevent an excess of variants, sometimes our vertex shaders declare
inputs that they never read from. For example, our skin-and-morph
variant might never read from the skinning attribute, but still declares
the input.

This PR is a sister to #1663, which is a fix for #1525.

See also #1279.
prideout added a commit that referenced this issue Sep 19, 2019
To prevent an excess of variants, sometimes our vertex shaders declare
inputs that they never read from. For example, our skin-and-morph
variant might never read from the skinning attribute, but still declares
the input.

This PR is a sister to #1663, which is a fix for #1525.

See also #1279.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metal Issue/request specific to Metal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants