mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-24 07:50:26 +00:00
i965: Rename 'aux' to 'prog_data' in program cache.
'aux' is a very generic name, suggesting it can be a bunch of things. However, it's always the brw_*_prog_data structure. So, call it that. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
a4be2bcee2
commit
8a5bc304ff
@ -69,7 +69,7 @@ struct brw_cache_item {
|
||||
|
||||
/** for variable-sized keys */
|
||||
GLuint key_size;
|
||||
GLuint aux_size;
|
||||
GLuint prog_data_size;
|
||||
const void *key;
|
||||
|
||||
uint32_t offset;
|
||||
@ -182,7 +182,7 @@ bool
|
||||
brw_search_cache(struct brw_cache *cache,
|
||||
enum brw_cache_id cache_id,
|
||||
const void *key, GLuint key_size,
|
||||
uint32_t *inout_offset, void *inout_aux)
|
||||
uint32_t *inout_offset, void *inout_prog_data)
|
||||
{
|
||||
struct brw_context *brw = cache->brw;
|
||||
struct brw_cache_item *item;
|
||||
@ -200,12 +200,13 @@ brw_search_cache(struct brw_cache *cache,
|
||||
if (item == NULL)
|
||||
return false;
|
||||
|
||||
void *aux = ((char *) item->key) + item->key_size;
|
||||
void *prog_data = ((char *) item->key) + item->key_size;
|
||||
|
||||
if (item->offset != *inout_offset || aux != *((void **) inout_aux)) {
|
||||
if (item->offset != *inout_offset ||
|
||||
prog_data != *((void **) inout_prog_data)) {
|
||||
brw->ctx.NewDriverState |= (1 << cache_id);
|
||||
*inout_offset = item->offset;
|
||||
*((void **) inout_aux) = aux;
|
||||
*((void **) inout_prog_data) = prog_data;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -320,10 +321,10 @@ brw_upload_cache(struct brw_cache *cache,
|
||||
GLuint key_size,
|
||||
const void *data,
|
||||
GLuint data_size,
|
||||
const void *aux,
|
||||
GLuint aux_size,
|
||||
const void *prog_data,
|
||||
GLuint prog_data_size,
|
||||
uint32_t *out_offset,
|
||||
void *out_aux)
|
||||
void *out_prog_data)
|
||||
{
|
||||
struct brw_cache_item *item = CALLOC_STRUCT(brw_cache_item);
|
||||
const struct brw_cache_item *matching_data =
|
||||
@ -335,7 +336,7 @@ brw_upload_cache(struct brw_cache *cache,
|
||||
item->size = data_size;
|
||||
item->key = key;
|
||||
item->key_size = key_size;
|
||||
item->aux_size = aux_size;
|
||||
item->prog_data_size = prog_data_size;
|
||||
hash = hash_key(item);
|
||||
item->hash = hash;
|
||||
|
||||
@ -354,11 +355,11 @@ brw_upload_cache(struct brw_cache *cache,
|
||||
memcpy(cache->map + item->offset, data, data_size);
|
||||
}
|
||||
|
||||
/* Set up the memory containing the key and aux_data */
|
||||
tmp = malloc(key_size + aux_size);
|
||||
/* Set up the memory containing the key and prog_data */
|
||||
tmp = malloc(key_size + prog_data_size);
|
||||
|
||||
memcpy(tmp, key, key_size);
|
||||
memcpy(tmp + key_size, aux, aux_size);
|
||||
memcpy(tmp + key_size, prog_data, prog_data_size);
|
||||
|
||||
item->key = tmp;
|
||||
|
||||
@ -371,7 +372,7 @@ brw_upload_cache(struct brw_cache *cache,
|
||||
cache->n_items++;
|
||||
|
||||
*out_offset = item->offset;
|
||||
*(void **)out_aux = (void *)((char *)item->key + item->key_size);
|
||||
*(void **)out_prog_data = (void *)((char *)item->key + item->key_size);
|
||||
cache->brw->ctx.NewDriverState |= 1 << cache_id;
|
||||
}
|
||||
|
||||
@ -412,8 +413,8 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache)
|
||||
c->cache_id == BRW_CACHE_GS_PROG ||
|
||||
c->cache_id == BRW_CACHE_FS_PROG ||
|
||||
c->cache_id == BRW_CACHE_CS_PROG) {
|
||||
const void *item_aux = c->key + c->key_size;
|
||||
brw_stage_prog_data_free(item_aux);
|
||||
const void *item_prog_data = c->key + c->key_size;
|
||||
brw_stage_prog_data_free(item_prog_data);
|
||||
}
|
||||
free((void *)c->key);
|
||||
free(c);
|
||||
|
Loading…
Reference in New Issue
Block a user