[PATCH vkd3d 5/9] vkd3d-shader: Translate global float64 flags.

Joshua Ashton joshua at froggi.es
Wed Jun 16 02:21:26 CDT 2021



On 6/15/21 10:53 PM, Henri Verbeet wrote:
> On Mon, 14 Jun 2021 at 05:27, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
>> diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
>> index d5152a38..c2826445 100644
>> --- a/libs/vkd3d-shader/spirv.c
>> +++ b/libs/vkd3d-shader/spirv.c
>> @@ -335,6 +335,7 @@ struct vkd3d_spirv_builder
>>       uint64_t capability_mask;
>>       uint64_t capability_draw_parameters : 1;
>>       uint64_t capability_demote_to_helper_invocation : 1;
>> +    uint64_t capability_float_64 : 1;
>>       uint32_t ext_instr_set_glsl_450;
>>       uint32_t invocation_count;
>>       SpvExecutionModel execution_model;
>> @@ -385,6 +386,10 @@ static void vkd3d_spirv_enable_capability(struct vkd3d_spirv_builder *builder,
>>       {
>>           builder->capability_demote_to_helper_invocation = 1;
>>       }
>> +    else if (cap == SpvCapabilityFloat64)
>> +    {
>> +        builder->capability_float_64 = 1;
>> +    }
> 
> This is dead code; SpvCapabilityFloat64 is one of the capabilities <
> 64, so we'll use the "capability_mask" field, and never set
> "capability_float_64". If it did get set, we'd need a corresponding
> vkd3d_spirv_build_op_capability() call in
> vkd3d_spirv_compile_module().

Despite this patch having my name on it, it was not submitted by me and 
has been changed from what I wrote without telling me.

This defect does not exist in the version I made for use in vkd3d-proton.

- Joshie 🐸✨

> 
>> diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
>> index 859c428c..dd12b896 100644
>> --- a/libs/vkd3d-shader/trace.c
>> +++ b/libs/vkd3d-shader/trace.c
>> @@ -368,6 +368,8 @@ static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler, ui
>>           {VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS, "enableRawAndStructuredBuffers"},
>>           {VKD3DSGF_ENABLE_MINIMUM_PRECISION,          "enableMinimumPrecision"},
>>           {VKD3DSGF_SKIP_OPTIMIZATION,                 "skipOptimization"},
>> +        {VKD3DSGF_ENABLE_DOUBLE_PRECISION_FLOAT_OPS, "enableDoublePrecisionFloatOps"},
>> +        {VKD3DSGF_ENABLE_11_1_DOUBLE_EXTENSIONS,     "enable11_1DoubleExtensions"},
>>       };
>>
>>       for (i = 0; i < ARRAY_SIZE(global_flag_info); ++i)
>> diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
>> index f56ca183..f7a3c60e 100644
>> --- a/libs/vkd3d-shader/vkd3d_shader_private.h
>> +++ b/libs/vkd3d-shader/vkd3d_shader_private.h
>> @@ -485,10 +485,12 @@ enum vkd3d_shader_interpolation_mode
>>   enum vkd3d_shader_global_flags
>>   {
>>       VKD3DSGF_REFACTORING_ALLOWED               = 0x01,
>> +    VKD3DSGF_ENABLE_DOUBLE_PRECISION_FLOAT_OPS = 0x02,
>>       VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL         = 0x04,
>>       VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x08,
>>       VKD3DSGF_SKIP_OPTIMIZATION                 = 0x10,
>> -    VKD3DSGF_ENABLE_MINIMUM_PRECISION          = 0x20
>> +    VKD3DSGF_ENABLE_MINIMUM_PRECISION          = 0x20,
>> +    VKD3DSGF_ENABLE_11_1_DOUBLE_EXTENSIONS     = 0x40,
>>   };
>>
> 
> It ends up being not so bad in this case, but as a matter of
> principle, this patch does three separate things:
> 
>    - Disassembler support for "enableDoublePrecisionFloatOps".
>    - Disassembler support for "enable11_1DoubleExtensions".
>    - Enabling SpvCapabilityFloat64 when either of those is set.
> 



More information about the wine-devel mailing list