Coder Social home page Coder Social logo

goofy's Issues

GCC/Linux support

https://github.com/SergeyMakeev/Goofy/blob/master/GoofyTC/goofy_tc.h#L1453

blRangeY.m128i_u8[0] is not available outside MSVC.

Possible replacement (and I am no expert in using processor intrinsics):

alignas(16) unsigned char m128i_u8[16];
_mm_storeu_si128((__m128i*)m128i_u8, blRangeY);

const uint32_t block0a = etc1BrighnessRangeTocontrolByte[m128i_u8[0]] | ((baseColors.r0 << 3ull) & 0xFFFFFF);

Seems to work OK for me.

Some other things needed

#if defined(__GNUC__) || defined(__clang__)
#  define ALIGN(x) __attribute__ ((aligned(x)))
# define goofy_inline __attribute__((always_inline)) inline
#  define goofy_restrict __restrict
#elif defined(_MSC_VER)
#  define ALIGN(x) __declspec(align(x))
#  define goofy_restrict __restrict
#  define goofy_inline __forceinline
#else
#  error "Unknown compiler; can't define ALIGN"
#endif

    // constants
    ALIGN(16) static const uint32_t gConstEight[4] = { 0x08080808, 0x08080808, 0x08080808, 0x08080808 };
    ALIGN(16) static const uint32_t gConstSixteen[4] = { 0x10101010, 0x10101010, 0x10101010, 0x10101010 };
    ALIGN(16) static const uint32_t gConstMaxInt[4] = { 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f };

Possibly also x86intrin.h instead of immintrin.h

Also, the program completely fails if compressETC1 is not wrapped in #pragma optimize( "", off ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.