build: add -wconversion and fix the related conversion issues#7
build: add -wconversion and fix the related conversion issues#7dabrain34 wants to merge 8 commits into
Conversation
5cfbe9c to
64769ce
Compare
|
@zlatinski Can you give a glance to this PR. It allows to avoid non regression when we change something in vulkan-video-samples. I had the issue today again with CTS bots failing because of Vulkan-Video-Samples. This is quite a big change but necessary. |
zlatinski
left a comment
There was a problem hiding this comment.
Thank you, Stephane, for these changes. These look good in general, but I would like to request a bit more improvements. If you want, you can change the VP9 types to concrete, but you don't have to at this point because we are updating the parser based on the latest Vulkan VP9 spec, anyway.
b184ffc to
c18a749
Compare
zlatinski
left a comment
There was a problem hiding this comment.
Thank you, Stephane. Your change has exposed some issues, which are indeed good to address. Thank you for doing that! Unfortunately, there are more fixes needed :( sorry!
ba1547b to
2cd1ba3
Compare
2cd1ba3 to
dbec2b1
Compare
|
@zlatinski are you okay to merge this change ? |
|
ping @zlatinski |
zlatinski
left a comment
There was a problem hiding this comment.
Thank you for the fixes, Stephane! I'm fine with the changes, as long as after applying the changes, the Fluster's results don't get regressed.
e7e05b7 to
d415221
Compare
|
Found some regression with Fluster AV1 tests that have been addressed. Having a bot to check that would be great but thanks for asking to check that again. Unfortunately the bot is unhappy now because of spirv. Need to investigate whats happening ... |
6909596 to
a131d28
Compare
|
Just pushed a new serie to fix the latest conversion issues. I gave a try to fluster AV1, H264, H265, VP9 and so far no regressions. Would request anyway another review to be sure about it. |
a131d28 to
3d4758c
Compare
Due to -Wconversion, a lot of conversion have been discovered.
3d4758c to
b13efdc
Compare
As -1 is not shaderc_shader_kind, use the default one as shaderc_glsl_infer_from_source. Conversion issue.
b13efdc to
3c57c30
Compare
clang does not support string to boolean conversation in the assert.
3c57c30 to
41629a0
Compare
| size_t i = 0; | ||
| { | ||
| static const int lanes = (int)svcntb(); | ||
| static const uint8_t lanes = (uint8_t)svcntb(); |
There was a problem hiding this comment.
SVE vector length is hardware-dependent, using uint8_t for svcntb() is unsafe because implementations could expose vector lengths larger than 255 bytes.
| inline int VulkanAV1Decoder::ReadDeltaQ(uint32_t bits) | ||
| { | ||
| return u(1) ? ReadSignedBits(bits) : 0; | ||
| return u(1) ? (uint8_t)ReadSignedBits(bits) : 0; |
There was a problem hiding this comment.
I would drop the (uint8_t). ReadDeltaQ return type is int.
In line 1314, where ReadDeltaQ is called, the return value is converted to int8_t.
The -Wconversion warning should already be silenced by the explicit (int8_t) in line 1314 and other places where the function is called.
| #define VKVS_DEBUG_TRAP() abort() | ||
| #endif | ||
|
|
||
| #define VKVS_ASSERT(cond, fmt, ...) \ |
There was a problem hiding this comment.
This changes the behavior of release builds. Now if the assertion is triggered, it always writes to stderr, only the abort() is conditional.
| if (scaleInput) { | ||
| if (displayWidth && (displayWidth != inputImageToDrawFrom->imageWidth)) { | ||
| constants.texMatrix[0] = vk::Vec2((float)displayWidth / inputImageToDrawFrom->imageWidth, 0.0f); | ||
| constants.texMatrix[0] = vk::Vec2((float)(double)displayWidth / (float)(double)inputImageToDrawFrom->imageWidth, 0.0f); |
There was a problem hiding this comment.
See previous review comment:#7 (comment).
The code was changed to:
constants.texMatrix[0] = vk::Vec2((float)(double)displayWidth / (float)(double)inputImageToDrawFrom->imageWidth, 0.0f);
It keeps the division precision in float instead of double.
Same for line 800.
| h264->svcext.f.ref_layer_chroma_phase_x_plus1_flag = slh->ref_layer_chroma_phase_x_plus1_flag; | ||
| h264->svcext.f.store_ref_base_pic_flag = slh->store_ref_base_pic_flag; | ||
| h264->svcext.f.inter_layer_deblocking_filter_control_present_flag = sps->svc.inter_layer_deblocking_filter_control_present_flag & 0x1; | ||
| h264->svcext.f.extended_spatial_scalability_idc = sps->svc.extended_spatial_scalability_idc & 0x3; |
There was a problem hiding this comment.
seq_parameter_set_svc_extension_s has not been modified yet, therefore these changes are not reverted. Is there a plan for this?
| assert(!"Invalid level idc"); | ||
| return -1; | ||
| VKVS_FAIL("Invalid level idc"); | ||
| return 0; |
There was a problem hiding this comment.
Is it correct to return here 0 instead of -1?
Are the callers also treating 0 as an error?
| @@ -2442,13 +2442,13 @@ bool VulkanH265Decoder::dpb_sequence_start(VkSharedBaseObj<hevc_seq_param_s>& sp | |||
| nvsi.frameRate = PackFrameRate(sps->stdVui.vui_time_scale, sps->stdVui.vui_num_units_in_tick); | |||
| } | |||
| nvsi.bProgSeq = 1; //!sps->vui.field_seq_flag; | |||
There was a problem hiding this comment.
bProgSeq type changed to bool. To be consistent, assign here to true
| m_loopFilterRefDeltas[i] = u(6); | ||
| m_loopFilterRefDeltas[i] = (int8_t)u(6); | ||
| if (u(1)) { // sign | ||
| m_loopFilterRefDeltas[i] = -m_loopFilterRefDeltas[i]; |
There was a problem hiding this comment.
This line now triggers a warning with Clang 21.1.8:
error: implicit conversion loses integer precision: 'int' to 'int8_t' (aka 'signed char') on negation [-Werror,-Wimplicit-int-conversion-on-negation].
Same for lines 667 and 757.
| m_loopFilterModeDeltas[i] = u(6); | ||
| m_loopFilterModeDeltas[i] = (int8_t)u(6); | ||
| if(u(1)) { // sign | ||
| m_loopFilterModeDeltas[i] = -m_loopFilterRefDeltas[i]; |
There was a problem hiding this comment.
Apart from the warning with newer clang versions mentioned for line 656, this line seems line a copy paste error (already existing bug before this PR).
m_loopFilterModeDeltas[i] should be assigned to -m_loopFilterModeDeltas[i], not -m_loopFilterRefDeltas[i].
Description
Fix the conversion issues using -Wconversion during the build. Usefull for CTS.
Type of change
bug fix
Issue (optional)
Tests
Intel(R) Iris(R) Xe Graphics (ADL GT2) / Intel open-source Mesa driver Mesa 26.2.0-devel (git-e6064cf077) / Ubuntu 24.04.4 LTS
Total Tests: 77
Passed: 52
Crashed: 0
Failed: 0
Not Supported: 16
Skipped: 9 (in skip list)
Success Rate: 100.0%
Additional Details (optional)