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

bgfx conversion issue #4

Closed
burgreen opened this issue Jun 2, 2018 · 3 comments
Closed

bgfx conversion issue #4

burgreen opened this issue Jun 2, 2018 · 3 comments

Comments

@burgreen
Copy link

burgreen commented Jun 2, 2018

For both gcc-4.9.3 and gcc-7.3.0, the bgfx compilation is failing at the below conversions. I have tried various casts with no luck.

Any suggestions?

../../../mud/3rdparty/bgfx/src/renderer_gl.cpp: In member function ‘void bgfx::gl::TextureGL::create(const bgfx::Memory*, uint32_t, uint8_t)’:
../../../mud/3rdparty/bgfx/src/renderer_gl.cpp:5167:10: error: cannot convert ‘uint8_t* {aka unsigned char*}’ to ‘bx::AllocatorI*’ for argument ‘1’ to ‘void bimg::imageDecodeToRgba8(bx::AllocatorI*, void*, const void*, uint32_t, uint32_t, uint32_t, bimg::TextureFormat::Enum)’
);
^
../../../mud/3rdparty/bgfx/src/renderer_gl.cpp: In member function ‘void bgfx::gl::TextureGL::update(uint8_t, uint8_t, const bgfx::Rect&, uint16_t, uint16_t, uint16_t, const bgfx::Memory*)’:
../../../mud/3rdparty/bgfx/src/renderer_gl.cpp:5330:112: error: cannot convert ‘uint8_t* {aka unsigned char*}’ to ‘bx::AllocatorI*’ for argument ‘1’ to ‘void bimg::imageDecodeToRgba8(bx::AllocatorI*, void*, const void*, uint32_t, uint32_t, uint32_t, bimg::TextureFormat::Enum)’
bimg::imageDecodeToRgba8(temp, data, width, height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat) );

@hugoam
Copy link
Owner

hugoam commented Jun 2, 2018

Hi ! There is no cast needed, it seems to be a git submodules issue : the signature of the function has changed in bimg library, so if you have an earlier version of bgfx with a more recent version of bimg, you get the error you have. The versions of bgfx and bimg must match.
I'm not sure why you have a more recent bimg version though, in theory they are identified by the commit hash : https://github.com/hugoam/mud/tree/master/3rdparty
So your bimg repo should be at the https://github.com/bkaradzic/bimg/tree/bd3366bba0ab15df20ac5be5547c526ef147cfb1 commit and the bgfx repo should be at the https://github.com/hugoam/bgfx/tree/acf4b80bad43d0a7bd96706fa587d4eb87f7f57f commit. This should be the default situation just after you cloned "fresh" mud.

Did you by any chance pull a more recent version of bimg ?

@burgreen
Copy link
Author

burgreen commented Jun 5, 2018

Yes, I did. I manually cloned each dependency submodule. I will pay more attention to clone the proper commit.

When I do use the proper commits for bimg and the mud-sample mud, everything compiles fine.

For whatever reason, I get the following error in a normal clone:

$ git clone --recursive git://github.com/hugoam/mud.git
Initialized empty Git repository in /var/tmp/burgreen/dev/mud/github/mud/.git/
remote: Counting objects: 5009, done.
remote: Compressing objects: 100% (462/462), done.
remote: Total 5009 (delta 539), reused 527 (delta 353), pack-reused 4193
Receiving objects: 100% (5009/5009), 58.54 MiB | 12.39 MiB/s, done.
Resolving deltas: 100% (3249/3249), done.
Submodule '3rdparty/FastNoise' (https://github.com/Auburns/FastNoise) registered for path '3rdparty/FastNoise'
Submodule '3rdparty/GENie' (https://github.com/hugoam/GENie) registered for path '3rdparty/GENie'
Submodule '3rdparty/amalgamate' (https://github.com/edlund/amalgamate) registered for path '3rdparty/amalgamate'
Submodule '3rdparty/bgfx' (https://github.com/hugoam/bgfx) registered for path '3rdparty/bgfx'
Submodule '3rdparty/bimg' (https://github.com/bkaradzic/bimg) registered for path '3rdparty/bimg'
Submodule '3rdparty/bx' (https://github.com/bkaradzic/bx) registered for path '3rdparty/bx'
Submodule '3rdparty/glfw' (https://github.com/glfw/glfw) registered for path '3rdparty/glfw'
Submodule '3rdparty/glm' (https://github.com/g-truc/glm) registered for path '3rdparty/glm'
Submodule '3rdparty/json11' (https://github.com/dropbox/json11) registered for path '3rdparty/json11'
Submodule '3rdparty/lua' (https://github.com/lua/lua) registered for path '3rdparty/lua'
No url found for submodule path '3rdparty/nanovg-layers' in .gitmodules

@hugoam
Copy link
Owner

hugoam commented Aug 10, 2018

The cloning issues should be solved by now, if you encounter them again please reopen an issue

@hugoam hugoam closed this as completed Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants