rbfx / empty-project

Minimal sample project for Desktop platforms.
MIT License
2 stars 1 forks source link

Not working with [diligent] branch? (MacOS M2 Apple Silicon Chip) #1

Open ad184hl opened 1 year ago

ad184hl commented 1 year ago

I am trying to build the empty project along with rbfx diligent branch on MacOS M2 Chip according to this setting.

The build succeeded, however, the application will crash due to some nullptr in ImGuiDiligentRendering part, the call stack is as following:

image

The console log print are:

[23:41:04] [info] [main] : [diligent] User-defined allocator is not provided. Using default allocator.
[23:41:04] [info] [main] : [diligent] Attached to OpenGL 4.1 context (4.1 Metal - 83.1, Apple M2 Pro)
[23:41:04] [info] [main] : [diligent] GPU Vendor: apple
[23:41:04] [info] [main] : [diligent] Disabling separable shader programs
[23:41:04] [info] [main] : RenderDevice is initialized for OpenGL: size=3024x1890px (1512x945dp), color=TEX_FORMAT_RGBA8_UNORM_SRGB, depth=TEX_FORMAT_D32_FLOAT_S8X24_UINT
[23:41:04] [info] [main] : Set screen mode: 3024x1890 pixels at 120 Hz at monitor 0 [Borderless]
[23:41:04] [info] [main] : Initialized input
[23:41:04] [error] [main] : Could not find resource 'Techniques/NoTexture.xml'
[23:41:04] [error] [main] : Could not find resource 'Textures/Ramp.png'
[23:41:04] [error] [main] : Could not find resource 'Textures/Spot.png'
[23:41:04] [info] [main] : Initialized renderer
[23:41:04] [error] [main] : Failed to create GPU Pipeline State Cache.
[23:41:05] [info] [main] : Set audio mode 44100 Hz 5.1 Surround interpolated
[23:41:05] [error] [main] : Could not find resource 'Shaders/HLSL/v2/X_ImGui.hlsl'
[23:41:05] [info] [main] : Initialized engine
[23:41:05] [error] [main] : Could not find resource 'Models/Box.mdl'
[23:41:05] [error] [main] : Could not find resource 'Materials/DefaultGrey.xml'
2023-08-17 23:41:05.198039-0700 EmptyProject[86447:10096599] AudioHardware-mac-imp.cpp:660    AudioObjectGetPropertyData: no object with given ID 0
[23:41:05] [info] [main] : Set audio mode 44100 Hz 5.1 Surround interpolated
[23:41:05] [info] [main] : [diligent] Resizing the swap chain to 3024x1890
[23:41:05] [error] [main] : Could not find resource 'Shaders/HLSL/v2/X_CopyFramebuffer.hlsl'
[23:41:05] [error] [main] : Could not find resource 'Shaders/HLSL/v2/X_ClearFramebuffer.hlsl'
Exception: EXC_BAD_ACCESS (code=1, address=0x0)
eugeneko commented 1 year ago

That usually means that the engine uses wrong version of sharers. Can you debug why exactly Graphics::GetShader fails? It really shouldn't.

ad184hl commented 1 year ago

I think it's related how the resource folder is specified.

The Sample binary is compiled with resource package

image

However, the EmptyProject is compiled as exec without resource package.

image

But I tried to specify the running folder according to the doc

--pp path/to/sample-project/Project

I tried many various ones with bin/, without bin/ project folder, rbfx folder, etc; None of them working. So I suspect might I need to specify it in CMakeList file. I don't want to do all those complicated resource packaging for this though.