diff options
author | Marek Olšák <[email protected]> | 2020-02-05 14:52:38 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-26 20:35:50 +0000 |
commit | f6d1dd34d76c1930b6f5223ae7e1c6b7f52ec4cd (patch) | |
tree | b83dac41c23afe083a8ffff554b1eb90528e7d15 /src/gallium/state_trackers/nine | |
parent | 502840855acac744fbc8dd090d931adc07755ead (diff) |
gallium/hash_table: remove some function wrappers
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/iunknown.c | 19 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 32 |
3 files changed, 21 insertions, 34 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index bac92c44586..c5b5eff128e 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -3023,7 +3023,7 @@ NineDevice9_ProcessVertices( struct NineDevice9 *This, if (FAILED(hr)) return hr; vdecl->fvf = FVF; - util_hash_table_set(This->ff.ht_fvf, &vdecl->fvf, vdecl); + _mesa_hash_table_insert(This->ff.ht_fvf, &vdecl->fvf, vdecl); NineUnknown_ConvertRefToBind(NineUnknown(vdecl)); } } @@ -3183,7 +3183,7 @@ NineDevice9_SetFVF( struct NineDevice9 *This, if (FAILED(hr)) return hr; vdecl->fvf = FVF; - util_hash_table_set(This->ff.ht_fvf, &vdecl->fvf, vdecl); + _mesa_hash_table_insert(This->ff.ht_fvf, &vdecl->fvf, vdecl); NineUnknown_ConvertRefToBind(NineUnknown(vdecl)); } return NineDevice9_SetVertexDeclaration( diff --git a/src/gallium/state_trackers/nine/iunknown.c b/src/gallium/state_trackers/nine/iunknown.c index 3835651f536..2d69afd5496 100644 --- a/src/gallium/state_trackers/nine/iunknown.c +++ b/src/gallium/state_trackers/nine/iunknown.c @@ -59,7 +59,7 @@ NineUnknown_ctor( struct NineUnknown *This, This->guids = pParams->guids; This->dtor = pParams->dtor; - This->pdata = util_hash_table_create(ht_guid_hash, ht_guid_compare); + This->pdata = _mesa_hash_table_create(NULL, ht_guid_hash, ht_guid_compare); if (!This->pdata) return E_OUTOFMEMORY; @@ -74,7 +74,7 @@ NineUnknown_dtor( struct NineUnknown *This ) if (This->pdata) { util_hash_table_foreach(This->pdata, ht_guid_delete, NULL); - util_hash_table_destroy(This->pdata); + _mesa_hash_table_destroy(This->pdata, NULL); } FREE(This); @@ -224,16 +224,9 @@ NineUnknown_SetPrivateData( struct NineUnknown *This, memcpy(header_data, user_data, header->size); memcpy(&header->guid, refguid, sizeof(header->guid)); - err = util_hash_table_set(This->pdata, &header->guid, header); - if (err == PIPE_OK) { - if (header->unknown) { IUnknown_AddRef(*(IUnknown **)header_data); } - return D3D_OK; - } - - FREE(header); - if (err == PIPE_ERROR_OUT_OF_MEMORY) { return E_OUTOFMEMORY; } - - return D3DERR_DRIVERINTERNALERROR; + _mesa_hash_table_insert(This->pdata, &header->guid, header); + if (header->unknown) { IUnknown_AddRef(*(IUnknown **)header_data); } + return D3D_OK; } HRESULT NINE_WINAPI @@ -289,7 +282,7 @@ NineUnknown_FreePrivateData( struct NineUnknown *This, return D3DERR_NOTFOUND; ht_guid_delete(NULL, header, NULL); - util_hash_table_remove(This->pdata, refguid); + _mesa_hash_table_remove_key(This->pdata, refguid); return D3D_OK; } diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index 8973dcbbc28..a97a83ff1c3 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -1563,7 +1563,6 @@ nine_ff_get_vs(struct NineDevice9 *device) { const struct nine_context *context = &device->context; struct NineVertexShader9 *vs; - enum pipe_error err; struct vs_build_ctx bld; struct nine_ff_vs_key key; unsigned s, i; @@ -1695,9 +1694,7 @@ nine_ff_get_vs(struct NineDevice9 *device) memcpy(&vs->ff_key, &key, sizeof(vs->ff_key)); - err = util_hash_table_set(device->ff.ht_vs, &vs->ff_key, vs); - (void)err; - assert(err == PIPE_OK); + _mesa_hash_table_insert(device->ff.ht_vs, &vs->ff_key, vs); device->ff.num_vs++; vs->num_inputs = bld.num_inputs; @@ -1719,7 +1716,6 @@ nine_ff_get_ps(struct NineDevice9 *device) struct nine_context *context = &device->context; D3DMATRIX *projection_matrix = GET_D3DTS(PROJECTION); struct NinePixelShader9 *ps; - enum pipe_error err; struct nine_ff_ps_key key; unsigned s; uint8_t sampler_mask = 0; @@ -1847,9 +1843,7 @@ nine_ff_get_ps(struct NineDevice9 *device) if (ps) { memcpy(&ps->ff_key, &key, sizeof(ps->ff_key)); - err = util_hash_table_set(device->ff.ht_ps, &ps->ff_key, ps); - (void)err; - assert(err == PIPE_OK); + _mesa_hash_table_insert(device->ff.ht_ps, &ps->ff_key, ps); device->ff.num_ps++; ps->rt_mask = 0x1; @@ -2089,13 +2083,13 @@ nine_ff_update(struct NineDevice9 *device) boolean nine_ff_init(struct NineDevice9 *device) { - device->ff.ht_vs = util_hash_table_create(nine_ff_vs_key_hash, - nine_ff_vs_key_comp); - device->ff.ht_ps = util_hash_table_create(nine_ff_ps_key_hash, - nine_ff_ps_key_comp); + device->ff.ht_vs = _mesa_hash_table_create(NULL, nine_ff_vs_key_hash, + nine_ff_vs_key_comp); + device->ff.ht_ps = _mesa_hash_table_create(NULL, nine_ff_ps_key_hash, + nine_ff_ps_key_comp); - device->ff.ht_fvf = util_hash_table_create(nine_ff_fvf_key_hash, - nine_ff_fvf_key_comp); + device->ff.ht_fvf = _mesa_hash_table_create(NULL, nine_ff_fvf_key_hash, + nine_ff_fvf_key_comp); device->ff.vs_const = CALLOC(NINE_FF_NUM_VS_CONST, 4 * sizeof(float)); device->ff.ps_const = CALLOC(NINE_FF_NUM_PS_CONST, 4 * sizeof(float)); @@ -2116,15 +2110,15 @@ nine_ff_fini(struct NineDevice9 *device) { if (device->ff.ht_vs) { util_hash_table_foreach(device->ff.ht_vs, nine_ff_ht_delete_cb, NULL); - util_hash_table_destroy(device->ff.ht_vs); + _mesa_hash_table_destroy(device->ff.ht_vs, NULL); } if (device->ff.ht_ps) { util_hash_table_foreach(device->ff.ht_ps, nine_ff_ht_delete_cb, NULL); - util_hash_table_destroy(device->ff.ht_ps); + _mesa_hash_table_destroy(device->ff.ht_ps, NULL); } if (device->ff.ht_fvf) { util_hash_table_foreach(device->ff.ht_fvf, nine_ff_ht_delete_cb, NULL); - util_hash_table_destroy(device->ff.ht_fvf); + _mesa_hash_table_destroy(device->ff.ht_fvf, NULL); } device->ff.vs = NULL; /* destroyed by unbinding from hash table */ device->ff.ps = NULL; @@ -2142,7 +2136,7 @@ nine_ff_prune_vs(struct NineDevice9 *device) /* could destroy the bound one here, so unbind */ context->pipe->bind_vs_state(context->pipe, NULL); util_hash_table_foreach(device->ff.ht_vs, nine_ff_ht_delete_cb, NULL); - util_hash_table_clear(device->ff.ht_vs); + _mesa_hash_table_clear(device->ff.ht_vs, NULL); device->ff.num_vs = 0; context->changed.group |= NINE_STATE_VS; } @@ -2156,7 +2150,7 @@ nine_ff_prune_ps(struct NineDevice9 *device) /* could destroy the bound one here, so unbind */ context->pipe->bind_fs_state(context->pipe, NULL); util_hash_table_foreach(device->ff.ht_ps, nine_ff_ht_delete_cb, NULL); - util_hash_table_clear(device->ff.ht_ps); + _mesa_hash_table_clear(device->ff.ht_ps, NULL); device->ff.num_ps = 0; context->changed.group |= NINE_STATE_PS; } |