Updated astc lib.

This commit is contained in:
Бранимир Караџић
2021-03-12 07:47:28 -08:00
parent 7b70810f4b
commit 200165a0dd
4 changed files with 22 additions and 9 deletions

View File

@@ -19,7 +19,6 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h>
#include "mathlib.h" #include "mathlib.h"
#ifndef MIN #ifndef MIN

View File

@@ -53,6 +53,7 @@ namespace
{ 0, 1, 2, 3 }, // ASTC_RGBA { 0, 1, 2, 3 }, // ASTC_RGBA
{ 2, 1, 0, 3 }, // ASTC_BGRA { 2, 1, 0, 3 }, // ASTC_BGRA
{ 0, 0, 0, 1 }, // ASTC_ENC_NORMAL_RA { 0, 0, 0, 1 }, // ASTC_ENC_NORMAL_RA
{ 0, 0, 0, 1 }, // ASTC_ENC_NORMAL_RA_PCPT
{ 0, 3, 6, 5 }, // ASTC_DEC_RA_NORMAL { 0, 3, 6, 5 }, // ASTC_DEC_RA_NORMAL
}; };

View File

@@ -1,4 +1,4 @@
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/** /**
* This confidential and proprietary software may be used only as * This confidential and proprietary software may be used only as
* authorised by a licensing agreement from ARM Limited * authorised by a licensing agreement from ARM Limited
@@ -10,8 +10,8 @@
* by a licensing agreement from ARM Limited. * by a licensing agreement from ARM Limited.
* *
* @brief Library of math functions. * @brief Library of math functions.
*/ */
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#define _USE_MATH_DEFINES // for M_PI on windows #define _USE_MATH_DEFINES // for M_PI on windows
@@ -116,7 +116,7 @@ float4 fmin(float4 p, float4 q)
return float4(fmin(p.x, q.x), fmin(p.y, q.y), fmin(p.z, q.z), fmin(p.w, q.w)); return float4(fmin(p.x, q.x), fmin(p.y, q.y), fmin(p.z, q.z), fmin(p.w, q.w));
} }
/* /*
float dot( float2 p, float2 q ) { return p.x*q.x + p.y*q.y; } float dot( float3 p, float3 q ) { return p.x*q.x + p.y*q.y + p.z*q.z; } float dot( float4 p, float4 q ) { return p.x*q.x + p.y*q.y + float dot( float2 p, float2 q ) { return p.x*q.x + p.y*q.y; } float dot( float3 p, float3 q ) { return p.x*q.x + p.y*q.y + p.z*q.z; } float dot( float4 p, float4 q ) { return p.x*q.x + p.y*q.y +
p.z*q.z + p.w*q.w; } */ p.z*q.z + p.w*q.w; } */
@@ -225,7 +225,7 @@ float4 normalize(float4 p)
*************************************************/ *************************************************/
/* /*
struct mat2 { float2 v[2]; }; struct mat2 { float2 v[2]; };
struct mat3 { float3 v[3]; }; struct mat3 { float3 v[3]; };
struct mat4 { float4 v[4]; }; struct mat4 { float4 v[4]; };
@@ -265,7 +265,7 @@ float determinant(mat4 p)
} }
/* /*
characteristic polynomials for matrices. These polynomials are monic, meaning that the coefficient of the highest component is 1; this component is omitted. The first component is the constant characteristic polynomials for matrices. These polynomials are monic, meaning that the coefficient of the highest component is 1; this component is omitted. The first component is the constant
part. */ part. */
@@ -293,7 +293,7 @@ float4 characteristic_poly(mat4 p)
} }
/* /*
Root finders for monic polynomials (highest coefficient is equal to 1) Root finders for monic polynomials (highest coefficient is equal to 1)
Returns a vector with length equal to the number of roots that the polynomial has; Returns a vector with length equal to the number of roots that the polynomial has;
@@ -362,7 +362,7 @@ float3 solve_monic(float3 p)
} }
/* /*
* This function is not overflow-safe. Use with care. * This function is not overflow-safe. Use with care.
*/ */
float4 solve_monic(float4 p) float4 solve_monic(float4 p)

View File

@@ -42,4 +42,17 @@ project "bimg_encode"
"-fPIC", "-fPIC",
} }
configuration { "mingw* or linux* or osx*" }
buildoptions {
"-Wno-implicit-fallthrough",
"-Wno-shadow",
"-Wno-shift-negative-value",
"-Wno-undef",
}
buildoptions_cpp {
"-Wno-class-memaccess",
"-Wno-deprecated-copy",
}
configuration {} configuration {}