radv/meta_decompress: fix pointer to integer conversion

Submitted by Mauro Rossi on Aug. 14, 2018, 8:48 p.m.

Details

Message ID 20180814204828.31194-1-issor.oruam@gmail.com
State New
Headers show
Series "radv/meta_decompress: fix pointer to integer conversion" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Mauro Rossi Aug. 14, 2018, 8:48 p.m.
(VkShaderModule) cast is added before NULL to avoid following building error:

external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
incompatible pointer to integer conversion passing 'void *' to parameter
of type 'VkShaderModule' (aka 'unsigned long long') [-Werror,-Wint-conversion]
                VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples,
                                                                   ^~~~
prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
note: expanded from macro 'NULL' 
#  define NULL ((void*)0)
               ^~~~~~~~~~
external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
note: passing argument to parameter 'vs_module_h' here
                VkShaderModule vs_module_h,
                               ^
1 error generated.

Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
---
 src/amd/vulkan/radv_meta_decompress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
index 41ed7b6d04..183be1fd88 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -362,7 +362,7 @@  static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
 		return;
 
 	if (!meta_state->depth_decomp[samples_log2].decompress_pipeline) {
-		VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples,
+		VkResult ret = create_pipeline(cmd_buffer->device, (VkShaderModule) NULL, samples,
 		                               meta_state->depth_decomp[samples_log2].pass,
 		                               meta_state->depth_decomp[samples_log2].p_layout,
 		                               &meta_state->depth_decomp[samples_log2].decompress_pipeline,

Comments

On Tue, Aug 14, 2018 at 10:48 PM, Mauro Rossi <issor.oruam@gmail.com> wrote:
> (VkShaderModule) cast is added before NULL to avoid following building error:
>
> external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
> incompatible pointer to integer conversion passing 'void *' to parameter
> of type 'VkShaderModule' (aka 'unsigned long long') [-Werror,-Wint-conversion]
>                 VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples,
>                                                                    ^~~~
> prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
> note: expanded from macro 'NULL'
> #  define NULL ((void*)0)
>                ^~~~~~~~~~
> external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
> note: passing argument to parameter 'vs_module_h' here
>                 VkShaderModule vs_module_h,
>                                ^
> 1 error generated.
>
> Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.")
> Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
> ---
>  src/amd/vulkan/radv_meta_decompress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
> index 41ed7b6d04..183be1fd88 100644
> --- a/src/amd/vulkan/radv_meta_decompress.c
> +++ b/src/amd/vulkan/radv_meta_decompress.c
> @@ -362,7 +362,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
>                 return;
>
>         if (!meta_state->depth_decomp[samples_log2].decompress_pipeline) {
> -               VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples,
> +               VkResult ret = create_pipeline(cmd_buffer->device, (VkShaderModule) NULL, samples,

Instead of the cast, use VK_NULL_HANDLE.

>                                                meta_state->depth_decomp[samples_log2].pass,
>                                                meta_state->depth_decomp[samples_log2].p_layout,
>                                                &meta_state->depth_decomp[samples_log2].decompress_pipeline,
> --
> 2.17.1
>
Hi Bas,

Il giorno mar 14 ago 2018 alle ore 23:10 Bas Nieuwenhuizen <
bas@basnieuwenhuizen.nl> ha scritto:

> On Tue, Aug 14, 2018 at 10:48 PM, Mauro Rossi <issor.oruam@gmail.com>
> wrote:
> > (VkShaderModule) cast is added before NULL to avoid following building
> error:
> >
> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
> > incompatible pointer to integer conversion passing 'void *' to parameter
> > of type 'VkShaderModule' (aka 'unsigned long long')
> [-Werror,-Wint-conversion]
> >                 VkResult ret = create_pipeline(cmd_buffer->device, NULL,
> samples,
> >                                                                    ^~~~
> >
> prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
> > note: expanded from macro 'NULL'
> > #  define NULL ((void*)0)
> >                ^~~~~~~~~~
> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
> > note: passing argument to parameter 'vs_module_h' here
> >                 VkShaderModule vs_module_h,
> >                                ^
> > 1 error generated.
> >
> > Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in
> shaders.")
> > Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
> > ---
> >  src/amd/vulkan/radv_meta_decompress.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/amd/vulkan/radv_meta_decompress.c
> b/src/amd/vulkan/radv_meta_decompress.c
> > index 41ed7b6d04..183be1fd88 100644
> > --- a/src/amd/vulkan/radv_meta_decompress.c
> > +++ b/src/amd/vulkan/radv_meta_decompress.c
> > @@ -362,7 +362,7 @@ static void radv_process_depth_image_inplace(struct
> radv_cmd_buffer *cmd_buffer,
> >                 return;
> >
> >         if (!meta_state->depth_decomp[samples_log2].decompress_pipeline)
> {
> > -               VkResult ret = create_pipeline(cmd_buffer->device, NULL,
> samples,
> > +               VkResult ret = create_pipeline(cmd_buffer->device,
> (VkShaderModule) NULL, samples,
>
> Instead of the cast, use VK_NULL_HANDLE.
>

I've applied that change and it is working.

Do you prefer I send a v2 patch version to mesa-dev ML or may I apply to
gitlab master with your Reviewed-by ?
Thanks

Mauro


>
> >
> meta_state->depth_decomp[samples_log2].pass,
> >
> meta_state->depth_decomp[samples_log2].p_layout,
> >
> &meta_state->depth_decomp[samples_log2].decompress_pipeline,
> > --
> > 2.17.1
> >
>
On Wed, Aug 15, 2018 at 2:04 PM, Mauro Rossi <issor.oruam@gmail.com> wrote:
> Hi Bas,
>
> Il giorno mar 14 ago 2018 alle ore 23:10 Bas Nieuwenhuizen
> <bas@basnieuwenhuizen.nl> ha scritto:
>>
>> On Tue, Aug 14, 2018 at 10:48 PM, Mauro Rossi <issor.oruam@gmail.com>
>> wrote:
>> > (VkShaderModule) cast is added before NULL to avoid following building
>> > error:
>> >
>> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error:
>> > incompatible pointer to integer conversion passing 'void *' to parameter
>> > of type 'VkShaderModule' (aka 'unsigned long long')
>> > [-Werror,-Wint-conversion]
>> >                 VkResult ret = create_pipeline(cmd_buffer->device, NULL,
>> > samples,
>> >                                                                    ^~~~
>> >
>> > prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16:
>> > note: expanded from macro 'NULL'
>> > #  define NULL ((void*)0)
>> >                ^~~~~~~~~~
>> > external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32:
>> > note: passing argument to parameter 'vs_module_h' here
>> >                 VkShaderModule vs_module_h,
>> >                                ^
>> > 1 error generated.
>> >
>> > Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in
>> > shaders.")
>> > Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
>> > ---
>> >  src/amd/vulkan/radv_meta_decompress.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/amd/vulkan/radv_meta_decompress.c
>> > b/src/amd/vulkan/radv_meta_decompress.c
>> > index 41ed7b6d04..183be1fd88 100644
>> > --- a/src/amd/vulkan/radv_meta_decompress.c
>> > +++ b/src/amd/vulkan/radv_meta_decompress.c
>> > @@ -362,7 +362,7 @@ static void radv_process_depth_image_inplace(struct
>> > radv_cmd_buffer *cmd_buffer,
>> >                 return;
>> >
>> >         if (!meta_state->depth_decomp[samples_log2].decompress_pipeline)
>> > {
>> > -               VkResult ret = create_pipeline(cmd_buffer->device, NULL,
>> > samples,
>> > +               VkResult ret = create_pipeline(cmd_buffer->device,
>> > (VkShaderModule) NULL, samples,
>>
>> Instead of the cast, use VK_NULL_HANDLE.
>
>
> I've applied that change and it is working.
>
> Do you prefer I send a v2 patch version to mesa-dev ML or may I apply to
> gitlab master with your Reviewed-by ?

Sorry for that, yes it is

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

with the change.

> Thanks
>
> Mauro
>
>>
>>
>> >
>> > meta_state->depth_decomp[samples_log2].pass,
>> >
>> > meta_state->depth_decomp[samples_log2].p_layout,
>> >
>> > &meta_state->depth_decomp[samples_log2].decompress_pipeline,
>> > --
>> > 2.17.1
>> >