Skip to content

Commit 7f3adf1

Browse files
authored
Update R16G16_S10_5_NV format to R16G16_SFIXED5_NV (#921)
and fix Ruby search to look for virtual environments.
1 parent 562509c commit 7f3adf1

19 files changed

Lines changed: 1167 additions & 342 deletions

File tree

cmake/mkvk.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ if(NOT PERL_EXECUTABLE)
6262
message(FATAL_ERROR "Perl executable ${not_found_error}")
6363
endif()
6464

65+
set(Ruby_FIND_VIRTUALENV FIRST)
6566
find_package(Ruby 3 QUIET)
6667
if(NOT Ruby_EXECUTABLE)
6768
message(FATAL_ERROR "Ruby v3 executable ${not_found_error}")

external/dfdutils/createdfd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static uint32_t setChannelFlags(uint32_t channel, enum VkSuffix suffix)
9494
channel |= KHR_DF_SAMPLE_DATATYPE_LINEAR;
9595
}
9696
break;
97-
case s_S10_5:
97+
case s_SFIXED5:
9898
channel |=
9999
KHR_DF_SAMPLE_DATATYPE_SIGNED;
100100
break;
@@ -162,7 +162,7 @@ static void writeSample(uint32_t *DFD, int sampleNo, int channel,
162162
upper.f = 1.0f;
163163
lower.f = 0.0f;
164164
break;
165-
case s_S10_5:
165+
case s_SFIXED5:
166166
assert(bits == 16 && "Format with this suffix must be 16 bits per channel.");
167167
upper.i = 32;
168168
lower.i = ~upper.i + 1; // -32

external/dfdutils/dfd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum VkSuffix {
3636
s_SFLOAT, /*!< Signed float format. */
3737
s_UFLOAT, /*!< Unsigned float format. */
3838
s_SRGB, /*!< sRGB normalized format. */
39-
s_S10_5 /*!< 2's complement fixed-point; 5 fractional bits. */
39+
s_SFIXED5 /*!< 2's complement fixed-point; 5 fractional bits. */
4040
};
4141

4242
/** Compression scheme, in Vulkan terms. */

external/dfdutils/dfd2vk.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ if (KHR_DFDVAL(dfd + 1, MODEL) == KHR_DF_MODEL_RGBSDA || KHR_DFDVAL(dfd + 1, MOD
178178
if (!(r & i_NORMALIZED_FORMAT_BIT) && (r & i_SIGNED_FORMAT_BIT)) return VK_FORMAT_R8_SINT;
179179
}
180180
} else if (wordBytes == 2) {
181-
if ((r & i_FIXED_FORMAT_BIT) && R.size == 2 && G.size == 2) return VK_FORMAT_R16G16_S10_5_NV;
181+
if ((r & i_FIXED_FORMAT_BIT) && R.size == 2 && G.size == 2) return VK_FORMAT_R16G16_SFIXED5_NV;
182182
if (A.size > 0) { /* 4 channels */
183183
if (R.offset == 0) { /* RGBA */
184184
if ((r & i_FLOAT_FORMAT_BIT)) return VK_FORMAT_R16G16B16A16_SFLOAT;

external/dfdutils/makedfd2vk.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ sub checkSuffices {
396396
print " }\n";
397397
} elsif ($byteSize == 2) {
398398
print " } else if (wordBytes == $byteSize) {\n";
399-
# Handle VK_FORMAT_R16G16_S10_5_NV. Non-standard naming means
400-
# checkSuffices can't handle it.
401-
print " if ((r & i_FIXED_FORMAT_BIT) && R.size == 2 && G.size == 2) return VK_FORMAT_R16G16_S10_5_NV;\n";
399+
# Handle VK_FORMAT_R16G16_SFIXED5_NV. checkSuffices does not
400+
# handle this unique suffix.
401+
print " if ((r & i_FIXED_FORMAT_BIT) && R.size == 2 && G.size == 2) return VK_FORMAT_R16G16_SFIXED5_NV;\n";
402402
} else {
403403
print " } else if (wordBytes == $byteSize) {\n";
404404
}

external/dfdutils/makevk2dfd.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ sub formatProcessed {
293293
print "case $format: return createDFDUnpacked($bigEndian, $numChannels, $bytesPerChannel, $rbswap, s_$suffix);\n";
294294
# Add the format we've processed to our "done" hash
295295
$foundFormats{$format} = 1;
296-
} elsif ($format =~ m/R16G16_S10_5_NV/) {
297-
# Currently only this 2-channel S10_5 format exists so an
296+
} elsif ($format =~ m/R16G16_SFIXED5_NV/) {
297+
# Currently only this 2-channel SFIXED5 format exists so an
298298
# explicit match is used.
299299

300300
# Output the case entry
301-
print "case $format: return createDFDUnpacked($bigEndian, 2, 2, 0, s_S10_5);\n";
301+
print "case $format: return createDFDUnpacked($bigEndian, 2, 2, 0, s_SFIXED5);\n";
302302
}
303303
}
304304

external/dfdutils/vk2dfd.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ case VK_FORMAT_ASTC_6x6x5_SFLOAT_BLOCK_EXT: return createDFDCompressed(c_ASTC, 6
400400
case VK_FORMAT_ASTC_6x6x6_UNORM_BLOCK_EXT: return createDFDCompressed(c_ASTC, 6, 6, 6, s_UNORM);
401401
case VK_FORMAT_ASTC_6x6x6_SRGB_BLOCK_EXT: return createDFDCompressed(c_ASTC, 6, 6, 6, s_SRGB);
402402
case VK_FORMAT_ASTC_6x6x6_SFLOAT_BLOCK_EXT: return createDFDCompressed(c_ASTC, 6, 6, 6, s_SFLOAT);
403-
case VK_FORMAT_R16G16_S10_5_NV: return createDFDUnpacked(0, 2, 2, 0, s_S10_5);
403+
case VK_FORMAT_R16G16_SFIXED5_NV: return createDFDUnpacked(0, 2, 2, 0, s_SFIXED5);
404404
case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR: {
405405
int channels[] = {0,1,2,3}; int bits[] = {5,5,5,1};
406406
return createDFDPacked(0, 4, bits, channels, s_UNORM);

external/dfdutils/vulkan/build_custom_vulkan_core

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if [ ! "${dst:0:1}" = "/" ]; then
4646
fi
4747

4848
cd $1
49-
scripts/genvk.py -extension VK_EXT_extension_289 -removeExtensions '(VK_KHR_video_decode_h264|VK_KHR_video_decode_h265)' -registry xml/vk.xml -o $dst vulkan_core.h
49+
scripts/genvk.py -extension VK_EXT_extension_289 -removeExtensions '(VK_KHR_video_decode_av1|VK_KHR_video_decode_h264|VK_KHR_video_encode_h264|VK_KHR_video_decode_h265|VK_KHR_video_encode_h265)' -registry xml/vk.xml -o $dst vulkan_core.h
5050

5151
# To use with Docker
5252
# 1. Install Docker

0 commit comments

Comments
 (0)