Jump to content

duzenko

Active Developer
  • Posts

    4159
  • Joined

  • Last visited

  • Days Won

    50

Posts posted by duzenko

  1. It sounds like in this case, the GCC compiler is more capable than the Windows compiler, even though this bug (and make no mistake, this is a bug!) affects all OSes. I have a feeling that, overall, the GCC compiler may be much more thorough than the Windows compiler, but I have no hard evidence for this, only my experience over many years of the GCC suite getting better and better at finding problems in my (and others') code. If the Windows compiler has the equivalent of the GCC compiler options "-Wall" ("enables all the warnings about constructions that some users consider questionable") and/or "-Wextra" ("enables some extra warning flags that are not enabled by -Wall"), then it might be wise to enable them (assuming they aren't already), to see what folks compiling under Windows may have been missing for a while. In fact, I'd ask anyone compiling TDM under Windows (duzenko, maybe?) to check: Did it warn about this particular "memset()" call?

    With EnableAllWarnings (/Wall) MSVC swallows Model_ase.cpp quietly.

     

    the Dhewm branch has removed the memset. That's a pretty good endorsement for it's removal. :)

    Agree.

  2. I don't like warnings-laden code as well.

    However in that particular example with sizeof, what would be the fix?

    That looks like a bug - but who knows what the fix is - clear the pointer, dealloc mem or zero fill ? Or maybe comment out that line altogether?

  3. Actually, I believe that Hamlet's patch in the post immediately above yours will help.

    Oops, that hurt :).

    It kinda compiles for me now :awesome:. Didn't test how it runs because I'm on a VM and you guys run it on real hardware.

    Here's my svn patch that combines the changes from multiple Hamlet's patches.

    I think we're at the point where it should be applied to trunk.

     

     

    Index: game/gamesys/TypeInfo.cpp
    ===================================================================
    --- game/gamesys/TypeInfo.cpp    (revision 6735)
    +++ game/gamesys/TypeInfo.cpp    (working copy)
    @@ -17,6 +17,29 @@
     
     ******************************************************************************/
     
    +// As stated below, the trick of defining "private" and "protected" is pure evil.
    +// We pay for it in class definitions that implicitly declare private members
    +// without using the (default) private visibility declaration.
    +// This becomes a real problem in code like the one found in GCC 6.2, along the lines:
    +//     
    +//     class Class {
    +//       struct PrivateStruct; // forward declaration
    +//       // ...
    +//         private:
    +//       struct PrivateStruct {}; // actual definition
    +//     };
    +//
    +// In this case, PrivateStruct is implicitly declared private, and then defined as
    +// "private", that after our trick becomes "public". Joy ensues.
    +// We import all the things like that before the trick takes places.
    +// We loose access to some variable inspection, but we gain in compilability
    +// (and a bit in sanity).
    +#if defined(__GNUC__) && (__GNUC__ == 6)
    +// these were observed in GNU GCC 6.2.0 (not in 5.4.0):
    +#include <sstream>
    + #endif // if GCC 6+
    +
    +
     // This is real evil but allows the code to inspect arbitrary class variables.
     #define private        public
     #define protected    public
    Index: game/pugixml/pugixml.hpp
    ===================================================================
    --- game/pugixml/pugixml.hpp    (revision 6735)
    +++ game/pugixml/pugixml.hpp    (working copy)
    @@ -17,6 +17,9 @@
     #include "pugiconfig.hpp"
     
     #ifndef PUGIXML_NO_STL
    +#if defined(__clang__) || defined(__GNUC__)
    +#include <string>
    +#else
     namespace std
     {
         struct bidirectional_iterator_tag;
    @@ -43,6 +46,7 @@
         template <> class char_traits<char>;
     #endif
     }
    +#endif // if not clang nor GCC
     #endif
     
     // Macro for deprecated features
    Index: idlib/geometry/RenderMatrix.cpp
    ===================================================================
    --- idlib/geometry/RenderMatrix.cpp    (revision 6735)
    +++ idlib/geometry/RenderMatrix.cpp    (working copy)
    @@ -40,11 +40,13 @@
     #include "../bv/Bounds.h"
     #include "RenderMatrix.h"
     
    -//anon begin -- just comment this out to disable intrinsics
    -#define USE_INTRINSICS
    -#include <intrin.h>
    -#include "sys_intrinsics.h"
    -//anon end
    +//anon begin -- just comment this out to disable intrinsics
    +#ifdef _MSC_VER
    +#define USE_INTRINSICS
    +#include <intrin.h>
    +#include "sys_intrinsics.h"
    +#endif // if MicroSoft Compiler
    +//anon end
     
     // FIXME:    it would be nice if all render matrices were 16-byte aligned
     //            so there is no need for unaligned loads and stores everywhere
    Index: include/devil/IL/devil_internal_exports.h
    ===================================================================
    --- include/devil/IL/devil_internal_exports.h    (revision 6735)
    +++ include/devil/IL/devil_internal_exports.h    (working copy)
    @@ -24,7 +24,7 @@
     #ifndef NOINLINE
     #ifndef INLINE
     #if defined(__GNUC__)
    -    #define INLINE extern inline
    +    #define INLINE /* extern */ inline
     #elif defined(_MSC_VER)
         #define NOINLINE
         #define INLINE
    Index: include/devil/il_bmp.h
    ===================================================================
    --- include/devil/il_bmp.h    (revision 6735)
    +++ include/devil/il_bmp.h    (working copy)
    @@ -71,11 +71,11 @@
     ILboolean    ilReadRLE4Bmp(BMPHEAD *Info);
     ILboolean    iGetOS2Bmp(OS2_HEAD *Header);
     
    -#ifdef IL_BMP_C
    +/*#ifdef IL_BMP_C
     #undef NOINLINE
     #undef INLINE
     #define INLINE
    -#endif
    +#endif*/
     
     #ifndef NOINLINE
     INLINE ILvoid GetShiftFromMask(const ILuint Mask, ILuint * CONST_RESTRICT ShiftLeft, ILuint * CONST_RESTRICT ShiftRight) {
    Index: include/devil/il_endian.h
    ===================================================================
    --- include/devil/il_endian.h    (revision 6735)
    +++ include/devil/il_endian.h    (working copy)
    @@ -56,36 +56,36 @@
         #define BigDouble(d) iSwapDouble(d)
     #endif
     
    -ILvoid   iSwapUShort(ILushort *s);
    -ILvoid   iSwapShort(ILshort *s);
    -ILvoid   iSwapUInt(ILuint *i);
    -ILvoid   iSwapInt(ILint *i);
    -ILvoid   iSwapFloat(ILfloat *f);
    -ILvoid   iSwapDouble(ILdouble *d);
    -ILushort GetLittleUShort();
    -ILshort  GetLittleShort();
    -ILuint   GetLittleUInt();
    -ILint    GetLittleInt();
    -ILfloat  GetLittleFloat();
    -ILdouble GetLittleDouble();
    -ILushort GetBigUShort();
    -ILshort  GetBigShort();
    -ILuint   GetBigUInt();
    -ILint    GetBigInt();
    -ILfloat  GetBigFloat();
    -ILdouble GetBigDouble();
    -ILubyte SaveLittleUShort(ILushort s);
    -ILubyte SaveLittleShort(ILshort s);
    -ILubyte SaveLittleUInt(ILuint i);
    -ILubyte SaveLittleInt(ILint i);
    -ILubyte SaveLittleFloat(ILfloat f);
    -ILubyte SaveLittleDouble(ILdouble d);
    -ILubyte SaveBigUShort(ILushort s);
    -ILubyte SaveBigShort(ILshort s);
    -ILubyte SaveBigUInt(ILuint i);
    -ILubyte SaveBigInt(ILint i);
    -ILubyte SaveBigFloat(ILfloat f);
    -ILubyte SaveBigDouble(ILdouble d);
    +inline ILvoid   iSwapUShort(ILushort *s);
    +inline ILvoid   iSwapShort(ILshort *s);
    +inline ILvoid   iSwapUInt(ILuint *i);
    +inline ILvoid   iSwapInt(ILint *i);
    +inline ILvoid   iSwapFloat(ILfloat *f);
    +inline ILvoid   iSwapDouble(ILdouble *d);
    +inline ILushort GetLittleUShort();
    +inline ILshort  GetLittleShort();
    +inline ILuint   GetLittleUInt();
    +inline ILint    GetLittleInt();
    +inline ILfloat  GetLittleFloat();
    +inline ILdouble GetLittleDouble();
    +inline ILushort GetBigUShort();
    +inline ILshort  GetBigShort();
    +inline ILuint   GetBigUInt();
    +inline ILint    GetBigInt();
    +inline ILfloat  GetBigFloat();
    +inline ILdouble GetBigDouble();
    +inline ILubyte SaveLittleUShort(ILushort s);
    +inline ILubyte SaveLittleShort(ILshort s);
    +inline ILubyte SaveLittleUInt(ILuint i);
    +inline ILubyte SaveLittleInt(ILint i);
    +inline ILubyte SaveLittleFloat(ILfloat f);
    +inline ILubyte SaveLittleDouble(ILdouble d);
    +inline ILubyte SaveBigUShort(ILushort s);
    +inline ILubyte SaveBigShort(ILshort s);
    +inline ILubyte SaveBigUInt(ILuint i);
    +inline ILubyte SaveBigInt(ILint i);
    +inline ILubyte SaveBigFloat(ILfloat f);
    +inline ILubyte SaveBigDouble(ILdouble d);
     
     #ifdef IL_ENDIAN_C
     #undef NOINLINE
    
    

     

     

  4. Crinkelite: If you have not already done so:

    duzenko: When you return:

     

    I would encourage you both to take a look at Hamlet's patches, specifically the 'pugi_strings.patch.txt' patch. I think it will further your compilation attempts under Ubuntu 16.10.

     

    I would be interested to hear your results if you get a chance to try it.

    Pugxml has stopped complaining with that patch. It's good to be applied to trunk IMHO.

    Now I have this access redeclaration error. AFAIR it was mentioned somewhere already but can't remember where and whether it has been sorted out.

    P.S. Great job so far, Hamlet, NightStalker :)

    allout.txt

    • Like 1
  5. No. I'm running 304.132 (circa 26 Sep 2016). The latest is 304.134. I'd already downloaded it 2 days ago but haven't installed it because the changelog between 304.132 and 304.134 has only 2 entries, neither of which seemed to be relevant to this issue. At some point, I will upgrade the video driver, but I didn't want to do that in the middle of testing. Something I did do (but failed to mention) -- I removed the 2nd video card (the 640GT), but it offered no improvement. I left it out for now anyway.

    ...

    Thanks for the suggestion. I will try that at my next opportunity and report back.

    Probably not worth trying.

    They have stopped supporting 7600gt years ago, so Sep 2016 is as good as any other.

    And EXT_pixel_buffer_object is not in the ext list either.

    ...

    I wonder how many people run TDM on gt7000 generation gpu's.

    I used to own one and it was great until it burned.

    Happy for them if they run TDM under windows so that the pixel pack thingy is functional.

    I wish there was a way to enable it under Linux but regret nVidia decided to screw the Linux guys on this one.

  6. GL_EXT_packed_pixels

    I'm no OpenGL guru but I think that's something else.

    I think we should be looking for one of these: ARB_pixel_buffer_object and EXT_pixel_buffer_object.

    Apparently your Linux driver is not advertising any of these even though the hardware is probably capable so technically it's correct and the fault is in my code.

    My excuse is

    1 - none of the pixel pack examples on web are doing the ext check

    2 - 7600gt is really old

    3 - windows driver supports this ext and 7600 gt is known to be 2.1 compatible

    4 - most of people with dual card system run their 3d games on the newer card

    But it's still my fault of course.

    Here's how it looks for me (intel 515)

    post-3508-0-19213900-1482576895_thumb.png

  7. As an aside, I also tested with the same exact hardware, but using 2.05-beta under Windows XP. It runs fine there, which tends to make me suspect a video driver issue rather than the video hardware. Regardless, the patch needs hardening.

    So in the end it's what appears to be a driver bug.

    Is your driver the latest for this GPU?

    What is the reported opengl version? I think it should be 2.1 for pixel pack.

    I absolutely agree that there should have been more checks on glGetError.

    I will fix that when I'm back unless someone fixes it before.

    ...

    What happens if you replace GL_PIXEL_PACK_BUFFER with GL_PIXEL_PACK_BUFFER_EXT?

  8. Sadly, while this change did offer a nice little performance boost, it was completely blown out by Duzenko's awesome

    "Pixel Pack Buffer" optimization which offered a HUGE performance boost. :D:laugh: Thus relegating my fix to the

    category of "a minor improvement".

     

    Pixel pack may show more difference on a fully-clocked system, but my laptop CPU throttles all the way to 1.1GHz under full load and your optimization makes a better job in that case. :awesome:

    • Like 2
  9. Can't comment on Baal's error since I don't have access to that forum and Baal is not posting here.

    R_ParseImageProgram_r is old code that has not been changed for years. Problem could be in code that executes before that, e.g. idImage::GenerateImage but since neither you nor me can repeat the error then we can't prove it is fixed.

     

    VC was short for videocard. I think the 640 you have as secondary output is way newer and more powerful than 7600gt.

    My suspicion here is that 7600gt may not fully support the pixel pack feature on the hardware level.

    So running TDM on 640 would tell us if TDM maybe is not properly checking if the driver/hardware supports the required feature before using it.

     

    I will be traveling for the next 7 days and will be AFK most of the time. I hope it's not going to be a big inconvenience for you. I just want you to know that Linux build is priority #1 right now for me when it comes to TDM.

  10. Yes, but I have no idea what version of GCC comes with Ubuntu 16.10. Can you please run 'gcc --version' and report that (both now and anytime you switch to another Linux distro for compiling)?

    Thanks for the URL. It looks like it will be useful at some point.

    gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005

     

  11. In fact, I've gone beyond that, bisecting the source code backwards from the latest SVN and building TDM many times, to try to identify the change(s) that cause the crash. But I gave up in frustration (and exhaustion) after finding a reference point (SVN #6642) that successfully compiled but, sadly, failed to actually run a mission. Since I obviously didn't make any of those SVN commits between 2.04 and 2.05 (let alone between 2.04 and latest SVN), I'm not best qualified to determine what broke the build. And I stated as much in my post about all this.

     

    When Baal asked (on Dec 8th) for the 2.05-beta source code, which is something I was 1 breath away from doing myself, he's told to "PM taaaki". Both he and I PMed taaaki for access to the source code, myself on 10 Dec 2016. Today, 9 days later, I still have not gotten a reply to that PM.

    I'm still waiting Taaki to answer my month-old request :rolleyes: It's not like he ignores you only. :D

    #6642 crashes for you - how about #6640 or #6637?

    I could probably upload a particular svn branch if you aren't granted access in the next hours.

    P.S. I really appreciate your efforts, and I admire the "do it now" spirit a lot. AFAIR Grayman warned that he has really little time this time of year.

  12. NightStalker,

    It's ubuntu 16.10 32-bit, default gcc that comes with it.

    My web searches resulted in this

    http://stackoverflow.com/questions/34571583/understanding-gcc-5s-glibcxx-use-cxx11-abi-or-the-new-abi

    I had no time to test this just yet

     

    One thing I should probably mention is that Compilation guide did not exactly work for me.

    sudo apt-get install g++ scons libglew1.5-dev libpng12-dev libjpeg62-dev

    threw errors beyond my understanding so I dropped 1.5 and 12 and 62.

  13. NightStalker,

    Can you try image_mipmapMode 0?

     

    I also have this error when compiling trunk under 32-bit ubuntu:

    In file included from game/script/Script_Doc_Export.cpp:26:0:
    game/script/../pugixml/pugixml.hpp:1070:2: error: reference to ‘basic_string’ is ambiguous
      std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
      ^~~
    In file included from game/script/Script_Doc_Export.cpp:26:0:
×
×
  • Create New...