summaryrefslogtreecommitdiff
path: root/lib/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa')
-rw-r--r--lib/mesa/src/egl/SConscript3
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_etc.c8
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_latc.c24
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_other.c40
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_rgtc.c24
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c133
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h12
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_tests.c27
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_tests.h6
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_zs.c29
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_format_zs.h2
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_mm.c9
-rw-r--r--lib/mesa/src/gallium/auxiliary/util/u_surfaces.c4
-rw-r--r--lib/mesa/src/gallium/state_trackers/dri/SConscript4
-rw-r--r--lib/mesa/src/gallium/state_trackers/hgl/SConscript1
-rw-r--r--lib/mesa/src/gallium/state_trackers/osmesa/SConscript4
-rw-r--r--lib/mesa/src/gallium/tests/graw/SConscript2
-rw-r--r--lib/mesa/src/gallium/tests/unit/SConscript12
-rw-r--r--lib/mesa/src/gallium/winsys/svga/drm/SConscript9
-rw-r--r--lib/mesa/src/mesa/drivers/dri/common/SConscript8
20 files changed, 210 insertions, 151 deletions
diff --git a/lib/mesa/src/egl/SConscript b/lib/mesa/src/egl/SConscript
index 927092d22..f8102db6f 100644
--- a/lib/mesa/src/egl/SConscript
+++ b/lib/mesa/src/egl/SConscript
@@ -8,7 +8,6 @@ env = env.Clone()
env.Append(CPPPATH = [
'#/include',
- '#/include/HaikuGL',
'#/src/egl/main',
'#/src',
])
@@ -24,8 +23,6 @@ env.Append(CPPDEFINES = [
])
egl_sources.append('drivers/haiku/egl_haiku.cpp')
-env.Prepend(LIBS = [mesautil])
-
egl = env.SharedLibrary(
target = 'EGL',
source = egl_sources,
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_etc.c b/lib/mesa/src/gallium/auxiliary/util/u_format_etc.c
index cc0a6ae5a..63e03ff5c 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_etc.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_etc.c
@@ -17,9 +17,7 @@ util_format_etc1_rgb8_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
}
void
-util_format_etc1_rgb8_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_etc1_rgb8_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
assert(0);
}
@@ -59,9 +57,7 @@ util_format_etc1_rgb8_unpack_rgba_float(float *dst_row, unsigned dst_stride, con
}
void
-util_format_etc1_rgb8_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const float *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_etc1_rgb8_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
{
assert(0);
}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_latc.c b/lib/mesa/src/gallium/auxiliary/util/u_format_latc.c
index f145081d5..31d72b5a0 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_latc.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_latc.c
@@ -23,11 +23,11 @@
**************************************************************************/
#include <stdio.h>
+#include "u_math.h"
#include "u_format.h"
#include "u_format_rgtc.h"
#include "u_format_latc.h"
#include "util/rgtc.h"
-#include "util/u_math.h"
void
util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
@@ -100,24 +100,19 @@ util_format_latc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigne
}
void
-util_format_latc1_snorm_fetch_rgba_8unorm(UNUSED uint8_t *dst, UNUSED const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+util_format_latc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_latc1_snorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_latc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_latc1_snorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_latc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
@@ -236,24 +231,19 @@ util_format_latc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigne
void
-util_format_latc2_snorm_fetch_rgba_8unorm(UNUSED uint8_t *dst, UNUSED const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+util_format_latc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_latc2_snorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_latc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_latc2_snorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_latc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_other.c b/lib/mesa/src/gallium/auxiliary/util/u_format_other.c
index 213cb9fd9..20752d469 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_other.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_other.c
@@ -26,10 +26,10 @@
**************************************************************************/
+#include "u_math.h"
#include "u_format_other.h"
-#include "util/u_math.h"
-#include "util/format_rgb9e5.h"
-#include "util/format_r11g11b10f.h"
+#include "u_format_rgb9e5.h"
+#include "u_format_r11g11b10f.h"
void
@@ -75,7 +75,7 @@ util_format_r9g9b9e5_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride
void
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+ unsigned i, unsigned j)
{
uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
rgb9e5_to_float3(value, dst);
@@ -178,7 +178,7 @@ util_format_r11g11b10_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_strid
void
util_format_r11g11b10_float_fetch_rgba_float(float *dst, const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+ unsigned i, unsigned j)
{
uint32_t value = util_cpu_to_le32(*(const uint32_t *)src);
r11g11b10f_to_float3(value, dst);
@@ -239,44 +239,44 @@ util_format_r11g11b10_float_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stri
void
-util_format_r1_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_r1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+ const uint8_t *src_row, unsigned src_stride,
+ unsigned width, unsigned height)
{
}
void
-util_format_r1_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const float *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_r1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+ const float *src_row, unsigned src_stride,
+ unsigned width, unsigned height)
{
}
void
-util_format_r1_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+util_format_r1_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+ unsigned i, unsigned j)
{
}
void
-util_format_r1_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_r1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+ const uint8_t *src_row, unsigned src_stride,
+ unsigned width, unsigned height)
{
}
void
-util_format_r1_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_r1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+ const uint8_t *src_row, unsigned src_stride,
+ unsigned width, unsigned height)
{
}
@@ -407,7 +407,7 @@ util_format_r8g8bx_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+ unsigned i, unsigned j)
{
uint16_t value = util_cpu_to_le16(*(const uint16_t *)src);
int16_t r, g;
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_rgtc.c b/lib/mesa/src/gallium/auxiliary/util/u_format_rgtc.c
index 0b98c01a9..159691743 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_rgtc.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_rgtc.c
@@ -23,9 +23,9 @@
**************************************************************************/
#include <stdio.h>
+#include "u_math.h"
#include "u_format.h"
#include "u_format_rgtc.h"
-#include "util/u_math.h"
#include "util/rgtc.h"
void
@@ -144,24 +144,19 @@ util_format_rgtc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigne
}
void
-util_format_rgtc1_snorm_fetch_rgba_8unorm(UNUSED uint8_t *dst, UNUSED const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+util_format_rgtc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_rgtc1_snorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_rgtc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_rgtc1_snorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_rgtc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
@@ -355,24 +350,19 @@ util_format_rgtc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigne
void
-util_format_rgtc2_snorm_fetch_rgba_8unorm(UNUSED uint8_t *dst, UNUSED const uint8_t *src,
- UNUSED unsigned i, UNUSED unsigned j)
+util_format_rgtc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_rgtc2_snorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_rgtc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
void
-util_format_rgtc2_snorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
- UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
- UNUSED unsigned width, UNUSED unsigned height)
+util_format_rgtc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
{
fprintf(stderr,"%s\n", __func__);
}
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
index 69ca62a96..cd3e165d3 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.c
@@ -24,19 +24,138 @@
**************************************************************************/
#include "u_dl.h"
+#include "u_math.h"
#include "u_format.h"
#include "u_format_s3tc.h"
#include "util/format_srgb.h"
-#include "util/u_math.h"
-#include "../../../mesa/main/texcompress_s3tc_tmp.h"
-util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
-util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
-util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
-util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
+#if defined(_WIN32) || defined(WIN32)
+#define DXTN_LIBNAME "dxtn.dll"
+#elif defined(__APPLE__)
+#define DXTN_LIBNAME "libtxc_dxtn.dylib"
+#else
+#define DXTN_LIBNAME "libtxc_dxtn.so"
+#endif
-util_format_dxtn_pack_t util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
+
+static void
+util_format_dxt1_rgb_fetch_stub(int src_stride,
+ const uint8_t *src,
+ int col, int row,
+ uint8_t *dst)
+{
+ assert(0);
+}
+
+
+static void
+util_format_dxt1_rgba_fetch_stub(int src_stride,
+ const uint8_t *src,
+ int col, int row,
+ uint8_t *dst )
+{
+ assert(0);
+}
+
+
+static void
+util_format_dxt3_rgba_fetch_stub(int src_stride,
+ const uint8_t *src,
+ int col, int row,
+ uint8_t *dst )
+{
+ assert(0);
+}
+
+
+static void
+util_format_dxt5_rgba_fetch_stub(int src_stride,
+ const uint8_t *src,
+ int col, int row,
+ uint8_t *dst )
+{
+ assert(0);
+}
+
+
+static void
+util_format_dxtn_pack_stub(int src_comps,
+ int width, int height,
+ const uint8_t *src,
+ enum util_format_dxtn dst_format,
+ uint8_t *dst,
+ int dst_stride)
+{
+ assert(0);
+}
+
+
+boolean util_format_s3tc_enabled = FALSE;
+
+util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch = util_format_dxt1_rgb_fetch_stub;
+util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch = util_format_dxt1_rgba_fetch_stub;
+util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch = util_format_dxt3_rgba_fetch_stub;
+util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch = util_format_dxt5_rgba_fetch_stub;
+
+util_format_dxtn_pack_t util_format_dxtn_pack = util_format_dxtn_pack_stub;
+
+
+void
+util_format_s3tc_init(void)
+{
+ static boolean first_time = TRUE;
+ struct util_dl_library *library = NULL;
+ util_dl_proc fetch_2d_texel_rgb_dxt1;
+ util_dl_proc fetch_2d_texel_rgba_dxt1;
+ util_dl_proc fetch_2d_texel_rgba_dxt3;
+ util_dl_proc fetch_2d_texel_rgba_dxt5;
+ util_dl_proc tx_compress_dxtn;
+
+ if (!first_time)
+ return;
+ first_time = FALSE;
+
+ if (util_format_s3tc_enabled)
+ return;
+
+ library = util_dl_open(DXTN_LIBNAME);
+ if (!library) {
+ debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
+ "compression/decompression unavailable\n");
+ return;
+ }
+
+ fetch_2d_texel_rgb_dxt1 =
+ util_dl_get_proc_address(library, "fetch_2d_texel_rgb_dxt1");
+ fetch_2d_texel_rgba_dxt1 =
+ util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt1");
+ fetch_2d_texel_rgba_dxt3 =
+ util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt3");
+ fetch_2d_texel_rgba_dxt5 =
+ util_dl_get_proc_address(library, "fetch_2d_texel_rgba_dxt5");
+ tx_compress_dxtn =
+ util_dl_get_proc_address(library, "tx_compress_dxtn");
+
+ if (!util_format_dxt1_rgb_fetch ||
+ !util_format_dxt1_rgba_fetch ||
+ !util_format_dxt3_rgba_fetch ||
+ !util_format_dxt5_rgba_fetch ||
+ !util_format_dxtn_pack) {
+ debug_printf("couldn't reference all symbols in " DXTN_LIBNAME
+ ", software DXTn compression/decompression "
+ "unavailable\n");
+ util_dl_close(library);
+ return;
+ }
+
+ util_format_dxt1_rgb_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgb_dxt1;
+ util_format_dxt1_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt1;
+ util_format_dxt3_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt3;
+ util_format_dxt5_rgba_fetch = (util_format_dxtn_fetch_t)fetch_2d_texel_rgba_dxt5;
+ util_format_dxtn_pack = (util_format_dxtn_pack_t)tx_compress_dxtn;
+ util_format_s3tc_enabled = TRUE;
+}
/*
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
index 6f188c67f..97770abd4 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_s3tc.h
@@ -32,9 +32,6 @@
#include "pipe/p_compiler.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
enum util_format_dxtn {
UTIL_FORMAT_DXT1_RGB = 0x83F0,
@@ -58,6 +55,8 @@ typedef void
uint8_t *dst,
int dst_stride);
+extern boolean util_format_s3tc_enabled;
+
extern util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch;
extern util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch;
extern util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch;
@@ -67,6 +66,10 @@ extern util_format_dxtn_pack_t util_format_dxtn_pack;
void
+util_format_s3tc_init(void);
+
+
+void
util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
void
@@ -211,8 +214,5 @@ util_format_dxt5_srgba_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, co
void
util_format_dxt5_srgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j);
-#ifdef __cplusplus
-}
-#endif
#endif /* U_FORMAT_S3TC_H_ */
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
index 94bea2363..64224cd2e 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.c
@@ -30,7 +30,7 @@
#include <float.h>
#include "pipe/p_config.h"
-#include "util/u_memory.h"
+#include "u_memory.h"
#include "u_format_tests.h"
@@ -140,12 +140,6 @@ util_format_test_cases[] =
{PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xc0000000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
- {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x000003ff), UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x000ffc00), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
- {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x3ff00000), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
- {PIPE_FORMAT_R10G10B10X2_UNORM, PACKED_1x32(0x3fffffff), PACKED_1x32(0x3fffffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
-
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000003ff), UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
{PIPE_FORMAT_B10G10R10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000ffc00), UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
@@ -170,19 +164,6 @@ util_format_test_cases[] =
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
- {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x003e), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
- {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0x07c0), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
- {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0xf800), UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_X1B5G5R5_UNORM, PACKED_1x16(0xfffe), PACKED_1x16(0xfffe), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
-
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x003e), UNPACKED_1x1(0.0, 0.0, 1.0, 0.0)},
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x07c0), UNPACKED_1x1(0.0, 1.0, 0.0, 0.0)},
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf800), UNPACKED_1x1(1.0, 0.0, 0.0, 0.0)},
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0001), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_A1B5G5R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
-
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x000f), UNPACKED_1x1(0.0, 0.0, 1.0, 1.0)},
{PIPE_FORMAT_B4G4R4X4_UNORM, PACKED_1x16(0x0fff), PACKED_1x16(0x00f0), UNPACKED_1x1(0.0, 1.0, 0.0, 1.0)},
@@ -236,10 +217,6 @@ util_format_test_cases[] =
{PIPE_FORMAT_L8_SRGB, PACKED_1x8(0xff), PACKED_1x8(0xbc), UNPACKED_1x1(0.502886458033, 0.502886458033, 0.502886458033, 1.0)},
{PIPE_FORMAT_L8_SRGB, PACKED_1x8(0xff), PACKED_1x8(0xff), UNPACKED_1x1(1.0, 1.0, 1.0, 1.0)},
- {PIPE_FORMAT_R8_SRGB, PACKED_1x8(0xff), PACKED_1x8(0x00), UNPACKED_1x1(0.0, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_R8_SRGB, PACKED_1x8(0xff), PACKED_1x8(0xbc), UNPACKED_1x1(0.502886458033, 0.0, 0.0, 1.0)},
- {PIPE_FORMAT_R8_SRGB, PACKED_1x8(0xff), PACKED_1x8(0xff), UNPACKED_1x1(1.0, 0.0, 0.0, 1.0)},
-
{PIPE_FORMAT_L8A8_SRGB, PACKED_1x16(0xffff), PACKED_1x16(0x0000), UNPACKED_1x1(0.0, 0.0, 0.0, 0.0)},
{PIPE_FORMAT_L8A8_SRGB, PACKED_1x16(0xffff), PACKED_1x16(0x00bc), UNPACKED_1x1(0.502886458033, 0.502886458033, 0.502886458033, 0.0)},
{PIPE_FORMAT_L8A8_SRGB, PACKED_1x16(0xffff), PACKED_1x16(0x00ff), UNPACKED_1x1(1.0, 1.0, 1.0, 0.0)},
@@ -1031,4 +1008,4 @@ util_format_test_cases[] =
};
-const unsigned util_format_nr_test_cases = ARRAY_SIZE(util_format_test_cases);
+const unsigned util_format_nr_test_cases = Elements(util_format_test_cases);
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.h b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.h
index d5f0b347b..f59563f4f 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_tests.h
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_tests.h
@@ -34,9 +34,9 @@
#include "pipe/p_format.h"
-#define UTIL_FORMAT_MAX_PACKED_BYTES 32 // R64G64B64A64_FLOAT
-#define UTIL_FORMAT_MAX_UNPACKED_WIDTH 12 // ASTC 12x12
-#define UTIL_FORMAT_MAX_UNPACKED_HEIGHT 12
+#define UTIL_FORMAT_MAX_PACKED_BYTES 16
+#define UTIL_FORMAT_MAX_UNPACKED_WIDTH 4
+#define UTIL_FORMAT_MAX_UNPACKED_HEIGHT 4
/**
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_zs.c b/lib/mesa/src/gallium/auxiliary/util/u_format_zs.c
index 4c977172b..69f2f2971 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_zs.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_zs.c
@@ -26,8 +26,9 @@
**************************************************************************/
+#include "u_debug.h"
+#include "u_math.h"
#include "u_format_zs.h"
-#include "util/u_math.h"
/*
@@ -448,26 +449,6 @@ util_format_z24_unorm_s8_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_stride
}
void
-util_format_z24_unorm_s8_uint_pack_separate(uint8_t *dst_row, unsigned dst_stride,
- const uint32_t *z_src_row, unsigned z_src_stride,
- const uint8_t *s_src_row, unsigned s_src_stride,
- unsigned width, unsigned height)
-{
- unsigned x, y;
- for (y = 0; y < height; ++y) {
- const uint32_t *z_src = z_src_row;
- const uint8_t *s_src = s_src_row;
- uint32_t *dst = (uint32_t *)dst_row;
- for (x = 0; x < width; ++x) {
- *dst++ = (*z_src++ & 0x00ffffff) | (*s_src++ << 24);
- }
- dst_row += dst_stride / sizeof(*dst_row);
- z_src_row += z_src_stride / sizeof(*z_src_row);
- s_src_row += s_src_stride / sizeof(*s_src_row);
- }
-}
-
-void
util_format_s8_uint_z24_unorm_unpack_z_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
@@ -830,11 +811,11 @@ util_format_z32_float_s8x24_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_str
unsigned x, y;
for(y = 0; y < height; ++y) {
const uint8_t *src = src_row;
- uint32_t *dst = ((uint32_t *)dst_row) + 1;
+ uint8_t *dst = dst_row + 4;
for(x = 0; x < width; ++x) {
- *dst = util_cpu_to_le32(*src);
+ *dst = *src;
src += 1;
- dst += 2;
+ dst += 8;
}
dst_row += dst_stride/sizeof(*dst_row);
src_row += src_stride/sizeof(*src_row);
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_format_zs.h b/lib/mesa/src/gallium/auxiliary/util/u_format_zs.h
index bed3c5198..adddfaf3a 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_format_zs.h
+++ b/lib/mesa/src/gallium/auxiliary/util/u_format_zs.h
@@ -112,8 +112,6 @@ util_format_z24_unorm_s8_uint_unpack_s_8uint(uint8_t *dst_row, unsigned dst_stri
void
util_format_z24_unorm_s8_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
-void
-util_format_z24_unorm_s8_uint_pack_separate(uint8_t *dst_row, unsigned dst_stride, const uint32_t *z_src_row, unsigned z_src_stride, const uint8_t *s_src_row, unsigned s_src_stride, unsigned width, unsigned height);
void
util_format_s8_uint_z24_unorm_unpack_z_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_mm.c b/lib/mesa/src/gallium/auxiliary/util/u_mm.c
index c15f62dd7..2069b56f4 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_mm.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_mm.c
@@ -34,7 +34,7 @@ void
u_mmDumpMemInfo(const struct mem_block *heap)
{
debug_printf("Memory heap %p:\n", (void *) heap);
- if (heap == NULL) {
+ if (heap == 0) {
debug_printf(" heap == 0\n");
}
else {
@@ -106,7 +106,7 @@ u_mmInit(int ofs, int size)
static struct mem_block *
SliceBlock(struct mem_block *p,
int startofs, int size,
- int reserved, UNUSED int alignment)
+ int reserved, int alignment)
{
struct mem_block *newblock;
@@ -183,10 +183,7 @@ u_mmAllocMem(struct mem_block *heap, int size, int align2, int startSearch)
assert(size >= 0);
assert(align2 >= 0);
- /* Make sure that a byte alignment isn't getting passed for our
- * power-of-two alignment arg.
- */
- assert(align2 < 32);
+ assert(align2 <= 12); /* sanity check, 2^12 (4KB) enough? */
if (!heap || align2 < 0 || size <= 0)
return NULL;
diff --git a/lib/mesa/src/gallium/auxiliary/util/u_surfaces.c b/lib/mesa/src/gallium/auxiliary/util/u_surfaces.c
index 78b2506e4..c2f2b74c9 100644
--- a/lib/mesa/src/gallium/auxiliary/util/u_surfaces.c
+++ b/lib/mesa/src/gallium/auxiliary/util/u_surfaces.c
@@ -59,7 +59,7 @@ util_surfaces_do_get(struct util_surfaces *us, unsigned surface_struct_size,
}
ps = (struct pipe_surface *)CALLOC(1, surface_struct_size);
- if (!ps)
+ if(!ps)
{
*res = NULL;
return FALSE;
@@ -114,7 +114,7 @@ util_surfaces_destroy(struct util_surfaces *us, struct pipe_resource *pt, void (
for(i = 0; i <= pt->last_level; ++i)
{
struct pipe_surface *ps = us->u.array[i];
- if (ps)
+ if(ps)
destroy_surface(ps);
}
FREE(us->u.array);
diff --git a/lib/mesa/src/gallium/state_trackers/dri/SConscript b/lib/mesa/src/gallium/state_trackers/dri/SConscript
index fa48fb8a0..657300baf 100644
--- a/lib/mesa/src/gallium/state_trackers/dri/SConscript
+++ b/lib/mesa/src/gallium/state_trackers/dri/SConscript
@@ -15,6 +15,10 @@ env.Append(CPPPATH = [
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
])
+env.Append(CPPDEFINES = [
+ ('GALLIUM_STATIC_TARGETS', '1'),
+])
+
sources = env.ParseSourceList('Makefile.sources', 'common_SOURCES')
# XXX: if HAVE_DRISW
diff --git a/lib/mesa/src/gallium/state_trackers/hgl/SConscript b/lib/mesa/src/gallium/state_trackers/hgl/SConscript
index d2389c808..82a0ce0a3 100644
--- a/lib/mesa/src/gallium/state_trackers/hgl/SConscript
+++ b/lib/mesa/src/gallium/state_trackers/hgl/SConscript
@@ -9,7 +9,6 @@ env.Append(CPPPATH = [
'#/src',
'#/src/mapi',
'#/src/mesa',
- '#/include/HaikuGL',
])
sources = [
diff --git a/lib/mesa/src/gallium/state_trackers/osmesa/SConscript b/lib/mesa/src/gallium/state_trackers/osmesa/SConscript
index be67d0fe7..f5519f137 100644
--- a/lib/mesa/src/gallium/state_trackers/osmesa/SConscript
+++ b/lib/mesa/src/gallium/state_trackers/osmesa/SConscript
@@ -14,8 +14,10 @@ if env['platform'] == 'windows':
env.AppendUnique(CPPDEFINES = [
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
'WIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx
- '_GLAPI_NO_EXPORTS', # prevent _glapi_* from being declared __declspec(dllimport)
])
+ if not env['gles']:
+ # prevent _glapi_* from being declared __declspec(dllimport)
+ env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
st_osmesa = env.ConvenienceLibrary(
target ='st_osmesa',
diff --git a/lib/mesa/src/gallium/tests/graw/SConscript b/lib/mesa/src/gallium/tests/graw/SConscript
index d9d480e85..c5fa3fe59 100644
--- a/lib/mesa/src/gallium/tests/graw/SConscript
+++ b/lib/mesa/src/gallium/tests/graw/SConscript
@@ -6,7 +6,7 @@ env.Prepend(LIBS = [mesautil, gallium])
env.Prepend(LIBPATH = [graw.dir])
env.Prepend(LIBS = ['graw'])
-
+
if env['platform'] in ('freebsd8', 'sunos'):
env.Append(LIBS = ['m'])
diff --git a/lib/mesa/src/gallium/tests/unit/SConscript b/lib/mesa/src/gallium/tests/unit/SConscript
index 065080401..a816e2fea 100644
--- a/lib/mesa/src/gallium/tests/unit/SConscript
+++ b/lib/mesa/src/gallium/tests/unit/SConscript
@@ -24,8 +24,10 @@ for progname in progs:
target = progname,
source = progname + '.c',
)
- if progname not in [
- 'u_cache_test', # too long
- 'translate_test', # unreliable
- ]:
- env.UnitTest(progname, prog)
+
+ env.Alias(progname, env.InstallProgram(prog))
+
+ # http://www.scons.org/wiki/UnitTests
+ test_alias = env.Alias('unit', [prog], prog[0].abspath)
+ AlwaysBuild(test_alias)
+
diff --git a/lib/mesa/src/gallium/winsys/svga/drm/SConscript b/lib/mesa/src/gallium/winsys/svga/drm/SConscript
index 739896859..25850531d 100644
--- a/lib/mesa/src/gallium/winsys/svga/drm/SConscript
+++ b/lib/mesa/src/gallium/winsys/svga/drm/SConscript
@@ -4,9 +4,12 @@ env = env.Clone()
env.PkgUseModules('DRM')
-env.Append(CPPDEFINES = [
- '-D_FILE_OFFSET_BITS=64',
-])
+if env['gcc'] or env['clang'] or env['icc']:
+ env.Append(CCFLAGS = ['-fvisibility=hidden'])
+ env.Append(CPPDEFINES = [
+ 'HAVE_STDINT_H',
+ '-D_FILE_OFFSET_BITS=64',
+ ])
env.Prepend(CPPPATH = [
'#/src/gallium/drivers/svga',
diff --git a/lib/mesa/src/mesa/drivers/dri/common/SConscript b/lib/mesa/src/mesa/drivers/dri/common/SConscript
index defd6bfb4..52d201f89 100644
--- a/lib/mesa/src/mesa/drivers/dri/common/SConscript
+++ b/lib/mesa/src/mesa/drivers/dri/common/SConscript
@@ -7,6 +7,7 @@ drienv = env.Clone()
drienv.Replace(CPPPATH = [
'#src/mesa/drivers/dri/common',
+ xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
'#include',
'#include/GL/internal',
'#src',
@@ -25,10 +26,13 @@ drienv.Replace(CPPPATH = [
'#src/mesa/swrast_setup',
'#src/egl/main',
'#src/egl/drivers/dri',
- xmlpool_options.dir.dir,
])
-sources = drienv.ParseSourceList('Makefile.sources', ['DRI_COMMON_FILES'])
+drienv.AppendUnique(LIBS = [
+ 'expat',
+])
+
+sources = drienv.ParseSourceList('Makefile.sources', ['DRI_COMMON_FILES', 'XMLCONFIG_FILES' ])
dri_common = drienv.ConvenienceLibrary(
target = 'dri_common',