[Mesa-dev] [PATCH 3/3] radv: add VK_KHR_shader_atomic_int64 but disable it for now

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Apr 17 20:02:11 UTC 2019


On 4/17/19 9:05 PM, Samuel Pitoiset wrote:
>
> On 4/17/19 8:52 PM, Bas Nieuwenhuizen wrote:
>> On Tue, Apr 16, 2019 at 10:35 AM Samuel Pitoiset
>> <samuel.pitoiset at gmail.com> wrote:
>>> No support for 64-bit compare&swap atomic operations.
>>>
>>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>>> ---
>>>   src/amd/vulkan/radv_device.c      | 10 ++++++++++
>>>   src/amd/vulkan/radv_extensions.py |  1 +
>>>   src/amd/vulkan/radv_shader.c      |  1 +
>>>   3 files changed, 12 insertions(+)
>>>
>>> diff --git a/src/amd/vulkan/radv_device.c 
>>> b/src/amd/vulkan/radv_device.c
>>> index 1f77dcadb17..13021a9f2da 100644
>>> --- a/src/amd/vulkan/radv_device.c
>>> +++ b/src/amd/vulkan/radv_device.c
>>> @@ -906,6 +906,16 @@ void radv_GetPhysicalDeviceFeatures2(
>>>                          features->shaderInt8 = true;
>>>                          break;
>>>                  }
>>> +               case 
>>> VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR: {
>>> + VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *features =
>>> + (VkPhysicalDeviceShaderAtomicInt64FeaturesKHR *)ext;
>>> +                       /* TODO: Enable this once the driver 
>>> supports 64-bit
>>> +                        * compare&swap atomic operations.
>>> +                        */
>>> +                       features->shaderBufferInt64Atomics = false;
>>> +                       features->shaderSharedInt64Atomics = false;
>>> +                       break;
>>> +               }
>>>                  default:
>>>                          break;
>>>                  }
>>> diff --git a/src/amd/vulkan/radv_extensions.py 
>>> b/src/amd/vulkan/radv_extensions.py
>>> index 13fe391e623..2d2d3f0c447 100644
>>> --- a/src/amd/vulkan/radv_extensions.py
>>> +++ b/src/amd/vulkan/radv_extensions.py
>>> @@ -81,6 +81,7 @@ EXTENSIONS = [
>>>       Extension('VK_KHR_push_descriptor',                   1, True),
>>>       Extension('VK_KHR_relaxed_block_layout',              1, True),
>>>       Extension('VK_KHR_sampler_mirror_clamp_to_edge',      1, True),
>>> +    Extension('VK_KHR_shader_atomic_int64',               1, 
>>> 'HAVE_LLVM >= 0x900'),
>> I'd prefer we make this constant False as long we never enable any of
>> the features.
>>
>> Otherwise r-b for the series.
> Looks good to me, I will fix before pushing, thanks!

Oh we can't do this, it introduces a compilation error.

src/amd/vulkan/radv_extensions.c:163:4: note: (near initialization for 
‘radv_device_extensions’)
src/amd/vulkan/radv_extensions.c: In function 
‘radv_fill_device_extension_table’:
src/amd/vulkan/radv_extensions.c:214:11: error: ‘struct 
radv_device_extension_table’ has no member named 
‘KHR_shader_atomic_int64’; did you mean ‘KHR_shader_float16_int8’?
     table->KHR_shader_atomic_int64 = false && 
(instance->enabled_extensions.KHR_get_physical_device_properties2 || 
instance->apiVersion >= VK_API_VERSION_1_1);
            ^~~~~~~~~~~~~~~~~~~~~~~
            KHR_shader_float16_int8

>>
>>> Extension('VK_KHR_shader_draw_parameters',            1, True),
>>>       Extension('VK_KHR_shader_float16_int8',               1, True),
>>>       Extension('VK_KHR_storage_buffer_storage_class',      1, True),
>>> diff --git a/src/amd/vulkan/radv_shader.c 
>>> b/src/amd/vulkan/radv_shader.c
>>> index a9677094772..c802abb0e08 100644
>>> --- a/src/amd/vulkan/radv_shader.c
>>> +++ b/src/amd/vulkan/radv_shader.c
>>> @@ -235,6 +235,7 @@ radv_shader_compile_to_nir(struct radv_device 
>>> *device,
>>>                                  .int8 = true,
>>>                                  .int16 = true,
>>>                                  .int64 = true,
>>> +                               .int64_atomics = true,
>>>                                  .multiview = true,
>>> .physical_storage_buffer_address = true,
>>>                                  .runtime_descriptor_array = true,
>>> -- 
>>> 2.21.0
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list