Menu

#326 fix maximal primitive count and INSTALL_DIR for 64 bit platforms

closed-fixed
None
5
2024-06-15
2022-11-25
Jon Daniel
No
1 Attachments

Discussion

  • Michael Zeilfelder

    Thanks for your patch.

    It's a bit of a mix of patches mixed into one, but I'll try to comment it as I understand most of it:

    The reason we use c headers is that we don't use STL in Irrlicht. There were plans to change it one day maybe, but there are also some advantages when it comes to portability (as I'm seeing you also work on H-Craft, me using STL there is afaik the reason the binary got broken on Debian at some point, if had stayed with Irrlicht and c-libs it would likely still work).

    getMaximalPrimitiveCount is not limited by the u32 type used. CNullDriver could use the constant I suppose, but for OpenGL it's not correct as the limit here is glDrawArrays which uses GLsizei which is signed. Could probably improve documenation, but it's not accident the value there is different.

    Not sure right now why you replace ifeq with ifneq. Sorry, I'm not working that regularly with Makefile, but without testing it right now - ifneq sounds like it would do the opposite. But don't we want 64 for 64-bit systems? Other way round seems to make less sense? Please explain that one.

    About changing INSTALL_DIR, I have to read up on that first. On a quick look on my 64-bit debian system the lib64 is nearly unused (a single soft-link in there), so I don't know if it's really correct to use this. If you have more info about this please tell.

    The echo change looks good.

     
  • Jon Daniel

    Jon Daniel - 2022-11-25

    HOSTTYPE is a bash variable not an environment variable and needs to be exported before or set when executing make in order to access it in Makefile.

    I just switched to:

    HOSTTYPE := $(shell arch)
    BITS := $(shell getconf LONG_BIT)
    

    Using LFS/gentoo multilib FHS defaults to $PREFIX/lib64 as the main 64-bit library install directory.

    I changed irrTypes.h now to use the C includes as you proposed and use INT32_MAX
    for both drivers since GLsizei is always int32_t fixing MaximalPrimitiveCount in H-Craft Championship.

    Changes are included in the new attachment

     

    Last edit: Jon Daniel 2022-11-25
  • Michael Zeilfelder

    OK, will have to check Makefile - probably makes sense.

    I'm not getting yet why you need those includes? Is there a compile problem on your system without them? I don't have the feeling they all belong in irrTypes.h. Are there specific files which have a problem compiling on your platform? If so we should solve that. Adding them globally is probably not necessary and it might also be a case of a define going down the wrong path (hard to believe we miss that many includes).

    The GLSizei doesn't restrict the null driver - different drivers can have different values here. I think we can just let it be as it is.

     
  • Jon Daniel

    Jon Daniel - 2024-06-15

    Separated Makefile changes for multilib directories.

     
  • Michael Zeilfelder

    Thanks. I've modified it slightly as you were correct about HOSTTYPE not being set in the Makefile, but with your changes it's also no longer needed anywhere so it could be kicked out.

    I've not seen any further feedback about the include troubles... so not sure, can I close this one or is there still something you need for those? But please explain it if so.

     
  • Jon Daniel

    Jon Daniel - 2024-06-15

    Yes, please close it I'll check later if PrimitiveCount bug still appears.

     
  • Michael Zeilfelder

    • status: open --> closed-fixed
    • assigned_to: Michael Zeilfelder
     

Log in to post a comment.