Possible bug when running Sample_ImageVoxelizer on MacOS

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 237
Joined: Thu Oct 14, 2010 12:30 pm
x 58

Possible bug when running Sample_ImageVoxelizer on MacOS

Post by Hotshot5000 »

I am not sure if this is a hardware limitation (I am testing on an M1 Macbook Pro laptop) or an actual issue. The error I get when trying to run the image voxelizer sample is:

Code: Select all

Mesh: Loading tudorhouse.mesh.
WARNING: tudorhouse.mesh is an older format ([MeshSerializer_v1.8]); you should upgrade it as soon as possible using the OgreMeshTool tool.
Can't assign material 1 - Default because this Material does not exist. Have you forgotten to define it in a .material script?
Shader 0AabbCalcultor_cs compiled successfully.
Shader 1AabbWorldSpace_cs compiled successfully.
Shader 2ClearUav_cs compiled successfully.
Shader 3ClearUav_cs compiled successfully.
Shader 4Voxelizer_cs compiled successfully.
Shader 5Voxelizer_cs compiled successfully.
Shader 10ImageVoxelizer_cs compiled successfully.
Shader 12LightInjection_cs compiled successfully.
Shader 13AnisotropicMipVctStep0_cs compiled successfully.
Shader 14AnisotropicMipVctStep1_cs compiled successfully.
Shader 19LightVctBounceInject_cs compiled successfully.
Compiler failed to build request
Metal SL Compiler Error in 26LightVctBounceInject_cs:
program_source:473:34: error: cannot reserve 'texture' resource location at index 8
        texture3d<float, access::write> lightVoxel [[texture(UAV_SLOT_START+0)]],
                                 ^

Error retrieving entry point 'main_metal' in shader 26LightVctBounceInject_cs
High-level program 26LightVctBounceInject_cs encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Fragment Program 26LightVctBounceInject_cs failed to compile. See compile log above for details. in MetalProgram::compile at /Users/sebastian/Downloads/ogre-next-ios/Ogre/ogre-next/RenderSystems/Metal/src/OgreMetalProgram.mm (line 266)
Compiler failed to build request
Metal SL Compiler Error in 26LightVctBounceInject_cs:
program_source:473:34: error: cannot reserve 'texture' resource location at index 8
        texture3d<float, access::write> lightVoxel [[texture(UAV_SLOT_START+0)]],
                                 ^

Error retrieving entry point 'main_metal' in shader 26LightVctBounceInject_cs
WARNING: GraphicsSystem::deinitialize() not called!!!
An exception has occured: OGRE EXCEPTION(3:RenderingAPIException): Fragment Program 26LightVctBounceInject_cs failed to compile. See compile log above for details. in MetalProgram::compile at /Users/sebastian/Downloads/ogre-next-ios/Ogre/ogre-next/RenderSystems/Metal/src/OgreMetalProgram.mm (line 266)
Program ended with exit code: 255

Should I file this as a bug?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5448
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1349

Re: Possible bug when running Sample_ImageVoxelizer on MacOS

Post by dark_sylinc »

ImageVoxelizer doesn't work on Metal due to how we implemented the backend (which traces back to not-so-old iOS HW being limited to just 31 textures).

The roadmap to 3.0 had something about migrating Metal to use RootLayouts like Vulkan does, which would allow us to dynamically assign resource slots based on what's needed.
But right now I have little interest in this, so it's been postponed.

ImageVoxelizer is quite aggressive on resource usage, so it can hit D3D11 limits too. That is our fault though, since we use a lot of sampler slots when only a few are needed.

The sample only works well on Vulkan.

Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 237
Joined: Thu Oct 14, 2010 12:30 pm
x 58

Re: Possible bug when running Sample_ImageVoxelizer on MacOS

Post by Hotshot5000 »

Ok. No problem, thank you for the answer! I was just playing around I don't need this feature in my project. Just for learning for myself. It's a known issue then, so I won't create a bug report.