mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-22 21:42:30 +00:00
util: Add fast-hash.h to simplify xxHash usage
This commit is contained in:
parent
a4115cf8b3
commit
8602863f36
@ -20,9 +20,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nv2a_int.h"
|
#include "nv2a_int.h"
|
||||||
#include "util/xxHash/xxh3.h"
|
|
||||||
#include "s3tc.h"
|
#include "s3tc.h"
|
||||||
#include "ui/xemu-settings.h"
|
#include "ui/xemu-settings.h"
|
||||||
|
#include "qemu/fast-hash.h"
|
||||||
|
|
||||||
#define DBG_SURFACES 0
|
#define DBG_SURFACES 0
|
||||||
#define DBG_SURFACE_SYNC 0
|
#define DBG_SURFACE_SYNC 0
|
||||||
@ -433,7 +433,6 @@ static gboolean shader_equal(gconstpointer a, gconstpointer b);
|
|||||||
static unsigned int kelvin_map_stencil_op(uint32_t parameter);
|
static unsigned int kelvin_map_stencil_op(uint32_t parameter);
|
||||||
static unsigned int kelvin_map_polygon_mode(uint32_t parameter);
|
static unsigned int kelvin_map_polygon_mode(uint32_t parameter);
|
||||||
static unsigned int kelvin_map_texgen(uint32_t parameter, unsigned int channel);
|
static unsigned int kelvin_map_texgen(uint32_t parameter, unsigned int channel);
|
||||||
static uint64_t fast_hash(const uint8_t *data, size_t len);
|
|
||||||
static void pgraph_reload_surface_scale_factor(NV2AState *d);
|
static void pgraph_reload_surface_scale_factor(NV2AState *d);
|
||||||
|
|
||||||
static uint32_t pgraph_rdi_read(PGRAPHState *pg,
|
static uint32_t pgraph_rdi_read(PGRAPHState *pg,
|
||||||
@ -6825,8 +6824,3 @@ static unsigned int kelvin_map_texgen(uint32_t parameter, unsigned int channel)
|
|||||||
}
|
}
|
||||||
return texgen;
|
return texgen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t fast_hash(const uint8_t *data, size_t len)
|
|
||||||
{
|
|
||||||
return XXH3_64bits(data, len);
|
|
||||||
}
|
|
||||||
|
9
include/qemu/fast-hash.h
Normal file
9
include/qemu/fast-hash.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef QEMU_FAST_HASH_H
|
||||||
|
#define QEMU_FAST_HASH_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
uint64_t fast_hash(const uint8_t *data, size_t len);
|
||||||
|
|
||||||
|
#endif /* QEMU_FAST_HASH_H */
|
7
util/fast-hash.c
Normal file
7
util/fast-hash.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include "qemu/fast-hash.h"
|
||||||
|
#include "util/xxHash/xxh3.h"
|
||||||
|
|
||||||
|
uint64_t fast_hash(const uint8_t *data, size_t len)
|
||||||
|
{
|
||||||
|
return XXH3_64bits(data, len);
|
||||||
|
}
|
@ -47,6 +47,7 @@ util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c'))
|
|||||||
util_ss.add(files('guest-random.c'))
|
util_ss.add(files('guest-random.c'))
|
||||||
util_ss.add(files('yank.c'))
|
util_ss.add(files('yank.c'))
|
||||||
util_ss.add(when: 'CONFIG_WIN32', if_true: files('miniz/miniz.c'))
|
util_ss.add(when: 'CONFIG_WIN32', if_true: files('miniz/miniz.c'))
|
||||||
|
util_ss.add(files('fast-hash.c'))
|
||||||
|
|
||||||
if have_user
|
if have_user
|
||||||
util_ss.add(files('selfmap.c'))
|
util_ss.add(files('selfmap.c'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user