"ATI RV570"
};
+static const char* r300_get_family_name(struct r300_screen* r300screen)
+{
+ return chip_families[r300screen->caps.family];
+}
+
static const char* r300_get_name(struct pipe_screen* pscreen)
{
struct r300_screen* r300screen = r300_screen(pscreen);
- return chip_families[r300screen->caps.family];
+ return r300_get_family_name(r300screen);
+}
+
+static void r300_disk_cache_create(struct r300_screen* r300screen)
+{
+ struct mesa_sha1 ctx;
+ unsigned char sha1[20];
+ char cache_id[20 * 2 + 1];
+
+ _mesa_sha1_init(&ctx);
+ if (!disk_cache_get_function_identifier(r300_disk_cache_create,
+ &ctx))
+ return;
+
+ _mesa_sha1_final(&ctx, sha1);
+ disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
+
+ r300screen->disk_shader_cache =
+ disk_cache_create(r300_get_family_name(r300screen),
+ cache_id,
+ r300screen->debug);
+}
+
+static struct disk_cache* r300_get_disk_shader_cache(struct pipe_screen* pscreen)
+{
+ struct r300_screen* r300screen = r300_screen(pscreen);
+ return r300screen->disk_shader_cache;
}
static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
mtx_destroy(&r300screen->cmask_mutex);
slab_destroy_parent(&r300screen->pool_transfers);
+ disk_cache_destroy(r300screen->disk_shader_cache);
+
if (rws)
rws->destroy(rws);
r300screen->screen.get_name = r300_get_name;
r300screen->screen.get_vendor = r300_get_vendor;
r300screen->screen.get_device_vendor = r300_get_device_vendor;
+ r300screen->screen.get_disk_shader_cache = r300_get_disk_shader_cache;
r300screen->screen.get_param = r300_get_param;
r300screen->screen.get_shader_param = r300_get_shader_param;
r300screen->screen.get_paramf = r300_get_paramf;
r300_init_screen_resource_functions(r300screen);
+ r300_disk_cache_create(r300screen);
+
slab_create_parent(&r300screen->pool_transfers, sizeof(struct pipe_transfer), 64);
(void) mtx_init(&r300screen->cmask_mutex, mtx_plain);
#include "r300_chipset.h"
#include "radeon/radeon_winsys.h"
#include "pipe/p_screen.h"
+#include "util/disk_cache.h"
#include "util/slab.h"
#include "os/os_thread.h"
#include <stdio.h>
/** Combination of DBG_xxx flags */
unsigned debug;
+ struct disk_cache *disk_shader_cache;
+
struct slab_parent_pool pool_transfers;
/* The MSAA texture with CMASK access; */