move u_math to src/util
Currently we have two sets of functions for bit counts, one in gallium and one in core mesa. The ones in core mesa are header only in many cases, since they reduce to "#define _mesa_bitcount popcount", but they provide a fallback implementation. This is important because 32bit msvc doesn't have popcountll, just popcount; so when nir (for example) includes the core mesa header it doesn't (and shouldn't) link with core mesa. To fix this we'll promote the version out of gallium util, then replace the core mesa uses with the util version, since nir (and other non-core mesa users) can and do link with mesautils. Acked-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
aa4386ebfe
commit
80825abb5d
|
@ -26,7 +26,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <gallium/auxiliary/util/u_math.h>
|
||||
#include "util/u_math.h"
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
#include <valgrind.h>
|
||||
|
|
|
@ -294,8 +294,6 @@ C_SOURCES := \
|
|||
util/u_linear.h \
|
||||
util/u_log.c \
|
||||
util/u_log.h \
|
||||
util/u_math.c \
|
||||
util/u_math.h \
|
||||
util/u_memory.h \
|
||||
util/u_mm.c \
|
||||
util/u_mm.h \
|
||||
|
|
|
@ -314,8 +314,6 @@ files_libgallium = files(
|
|||
'util/u_linear.h',
|
||||
'util/u_log.c',
|
||||
'util/u_log.h',
|
||||
'util/u_math.c',
|
||||
'util/u_math.h',
|
||||
'util/u_memory.h',
|
||||
'util/u_mm.c',
|
||||
'util/u_mm.h',
|
||||
|
|
|
@ -32,11 +32,11 @@
|
|||
* @author Jose Fonseca <jfonseca@vmware.com>
|
||||
*/
|
||||
|
||||
#include "u_math.h"
|
||||
#include "u_memory.h"
|
||||
#include "u_format.h"
|
||||
#include "u_format_s3tc.h"
|
||||
#include "u_surface.h"
|
||||
#include "util/u_math.h"
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "u_math.h"
|
||||
#include "u_format.h"
|
||||
#include "u_format_bptc.h"
|
||||
#include "util/format_srgb.h"
|
||||
#include "util/u_math.h"
|
||||
|
||||
#define BPTC_BLOCK_DECODE
|
||||
#include "../../../mesa/main/texcompress_bptc_tmp.h"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#include "u_math.h"
|
||||
#include "u_format_other.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/format_rgb9e5.h"
|
||||
#include "util/format_r11g11b10f.h"
|
||||
|
||||
|
|
|
@ -702,7 +702,7 @@ def is_format_hand_written(format):
|
|||
def generate(formats):
|
||||
print()
|
||||
print('#include "pipe/p_compiler.h"')
|
||||
print('#include "u_math.h"')
|
||||
print('#include "util/u_math.h"')
|
||||
print('#include "u_half.h"')
|
||||
print('#include "u_format.h"')
|
||||
print('#include "u_format_other.h"')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
**************************************************************************/
|
||||
|
||||
#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"
|
||||
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "u_math.h"
|
||||
#include "util/u_math.h"
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
|
||||
#include "u_debug.h"
|
||||
#include "u_math.h"
|
||||
#include "u_format_zs.h"
|
||||
#include "util/u_math.h"
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -55,6 +55,8 @@ MESA_UTIL_FILES := \
|
|||
u_atomic.h \
|
||||
u_dynarray.h \
|
||||
u_endian.h \
|
||||
u_math.c \
|
||||
u_math.h \
|
||||
u_queue.c \
|
||||
u_queue.h \
|
||||
u_string.h \
|
||||
|
|
|
@ -85,6 +85,8 @@ files_mesa_util = files(
|
|||
'u_thread.h',
|
||||
'u_vector.c',
|
||||
'u_vector.h',
|
||||
'u_math.c',
|
||||
'u_math.h',
|
||||
'vma.c',
|
||||
'vma.h',
|
||||
)
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <float.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "util/bitscan.h"
|
||||
#include "bitscan.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
Loading…
Reference in New Issue