[Mesa-dev] [PATCH] radeonsi: avoid int-to-pointer-cast warnings on 32bit
Grazvydas Ignotas
notasas at gmail.com
Sat Feb 3 22:19:44 UTC 2018
I hope the actual dropping of MSB is ok, but that's what's already
happened before this change.
---
src/gallium/drivers/radeonsi/si_descriptors.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 17115e1..009e803 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -2263,11 +2263,12 @@ static uint64_t si_create_texture_handle(struct pipe_context *ctx,
return 0;
}
handle = tex_handle->desc_slot;
- if (!_mesa_hash_table_insert(sctx->tex_handles, (void *)handle,
+ if (!_mesa_hash_table_insert(sctx->tex_handles,
+ (void *)(uintptr_t)handle,
tex_handle)) {
FREE(tex_handle);
return 0;
}
@@ -2282,11 +2283,12 @@ static void si_delete_texture_handle(struct pipe_context *ctx, uint64_t handle)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_texture_handle *tex_handle;
struct hash_entry *entry;
- entry = _mesa_hash_table_search(sctx->tex_handles, (void *)handle);
+ entry = _mesa_hash_table_search(sctx->tex_handles,
+ (void *)(uintptr_t)handle);
if (!entry)
return;
tex_handle = (struct si_texture_handle *)entry->data;
@@ -2304,11 +2306,12 @@ static void si_make_texture_handle_resident(struct pipe_context *ctx,
struct si_context *sctx = (struct si_context *)ctx;
struct si_texture_handle *tex_handle;
struct si_sampler_view *sview;
struct hash_entry *entry;
- entry = _mesa_hash_table_search(sctx->tex_handles, (void *)handle);
+ entry = _mesa_hash_table_search(sctx->tex_handles,
+ (void *)(uintptr_t)handle);
if (!entry)
return;
tex_handle = (struct si_texture_handle *)entry->data;
sview = (struct si_sampler_view *)tex_handle->view;
@@ -2406,11 +2409,12 @@ static uint64_t si_create_image_handle(struct pipe_context *ctx,
return 0;
}
handle = img_handle->desc_slot;
- if (!_mesa_hash_table_insert(sctx->img_handles, (void *)handle,
+ if (!_mesa_hash_table_insert(sctx->img_handles,
+ (void *)(uintptr_t)handle,
img_handle)) {
FREE(img_handle);
return 0;
}
@@ -2425,11 +2429,12 @@ static void si_delete_image_handle(struct pipe_context *ctx, uint64_t handle)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_image_handle *img_handle;
struct hash_entry *entry;
- entry = _mesa_hash_table_search(sctx->img_handles, (void *)handle);
+ entry = _mesa_hash_table_search(sctx->img_handles,
+ (void *)(uintptr_t)handle);
if (!entry)
return;
img_handle = (struct si_image_handle *)entry->data;
@@ -2446,11 +2451,12 @@ static void si_make_image_handle_resident(struct pipe_context *ctx,
struct si_image_handle *img_handle;
struct pipe_image_view *view;
struct r600_resource *res;
struct hash_entry *entry;
- entry = _mesa_hash_table_search(sctx->img_handles, (void *)handle);
+ entry = _mesa_hash_table_search(sctx->img_handles,
+ (void *)(uintptr_t)handle);
if (!entry)
return;
img_handle = (struct si_image_handle *)entry->data;
view = &img_handle->view;
--
2.7.4
More information about the mesa-dev
mailing list