@@ -495,18 +495,12 @@ struct DescriptorSetLayoutBinding {
495495 DescriptorFlags flags = DescriptorFlags::NONE;
496496 uint16_t count = 0 ;
497497
498- // TODO: uncomment when needed. Note that this class is used as hash key. We need to ensure
499- // no uninitialized padding bytes.
500- // uint8_t externalSamplerDataIndex = EXTERNAL_SAMPLER_DATA_INDEX_UNUSED;
501-
502498 friend bool operator ==(DescriptorSetLayoutBinding const & lhs,
503499 DescriptorSetLayoutBinding const & rhs) noexcept {
504500 return lhs.type == rhs.type &&
505501 lhs.flags == rhs.flags &&
506502 lhs.count == rhs.count &&
507503 lhs.stageFlags == rhs.stageFlags ;
508- // lhs.stageFlags == rhs.stageFlags &&
509- // lhs.externalSamplerDataIndex == rhs.externalSamplerDataIndex;
510504 }
511505};
512506
@@ -1254,26 +1248,6 @@ enum class SamplerCompareFunc : uint8_t {
12541248 N // !< Never. The depth / stencil test always fails.
12551249};
12561250
1257- // ! this API is copied from (and only applies to) the Vulkan spec.
1258- // ! These specify YUV to RGB conversions.
1259- enum class SamplerYcbcrModelConversion : uint8_t {
1260- RGB_IDENTITY = 0 ,
1261- YCBCR_IDENTITY = 1 ,
1262- YCBCR_709 = 2 ,
1263- YCBCR_601 = 3 ,
1264- YCBCR_2020 = 4 ,
1265- };
1266-
1267- enum class SamplerYcbcrRange : uint8_t {
1268- ITU_FULL = 0 ,
1269- ITU_NARROW = 1 ,
1270- };
1271-
1272- enum class ChromaLocation : uint8_t {
1273- COSITED_EVEN = 0 ,
1274- MIDPOINT = 1 ,
1275- };
1276-
12771251// ! Sampler parameters
12781252struct SamplerParams { // NOLINT
12791253 SamplerMagFilter filterMag : 1 ; // !< magnification filter (NEAREST)
@@ -1342,94 +1316,9 @@ static_assert(sizeof(SamplerParams) == 4);
13421316static_assert (sizeof (SamplerParams) <= sizeof (uint64_t ),
13431317 " SamplerParams must be no more than 64 bits" );
13441318
1345- // ! Sampler parameters
1346- struct SamplerYcbcrConversion {// NOLINT
1347- SamplerYcbcrModelConversion ycbcrModel : 4 ;
1348- TextureSwizzle r : 4 ;
1349- TextureSwizzle g : 4 ;
1350- TextureSwizzle b : 4 ;
1351- TextureSwizzle a : 4 ;
1352- SamplerYcbcrRange ycbcrRange : 1 ;
1353- ChromaLocation xChromaOffset : 1 ;
1354- ChromaLocation yChromaOffset : 1 ;
1355- SamplerMagFilter chromaFilter : 1 ;
1356- uint8_t padding;
1357-
1358- struct Hasher {
1359- size_t operator ()(const SamplerYcbcrConversion p) const noexcept {
1360- // we don't use std::hash<> here, so we don't have to include <functional>
1361- return *reinterpret_cast <uint32_t const *>(reinterpret_cast <char const *>(&p));
1362- }
1363- };
1364-
1365- struct EqualTo {
1366- bool operator ()(SamplerYcbcrConversion lhs, SamplerYcbcrConversion rhs) const noexcept {
1367- assert_invariant (lhs.padding == 0 );
1368- auto * pLhs = reinterpret_cast <uint32_t const *>(reinterpret_cast <char const *>(&lhs));
1369- auto * pRhs = reinterpret_cast <uint32_t const *>(reinterpret_cast <char const *>(&rhs));
1370- return *pLhs == *pRhs;
1371- }
1372- };
1373-
1374- struct LessThan {
1375- bool operator ()(SamplerYcbcrConversion lhs, SamplerYcbcrConversion rhs) const noexcept {
1376- assert_invariant (lhs.padding == 0 );
1377- auto * pLhs = reinterpret_cast <uint32_t const *>(reinterpret_cast <char const *>(&lhs));
1378- auto * pRhs = reinterpret_cast <uint32_t const *>(reinterpret_cast <char const *>(&rhs));
1379- return *pLhs < *pRhs;
1380- }
1381- };
1382-
1383- private:
1384- friend bool operator == (SamplerYcbcrConversion lhs, SamplerYcbcrConversion rhs)
1385- noexcept {
1386- return SamplerYcbcrConversion::EqualTo{}(lhs, rhs);
1387- }
1388- friend bool operator != (SamplerYcbcrConversion lhs, SamplerYcbcrConversion rhs)
1389- noexcept {
1390- return !SamplerYcbcrConversion::EqualTo{}(lhs, rhs);
1391- }
1392- friend bool operator < (SamplerYcbcrConversion lhs, SamplerYcbcrConversion rhs)
1393- noexcept {
1394- return SamplerYcbcrConversion::LessThan{}(lhs, rhs);
1395- }
1396- };
1397-
1398- static_assert (sizeof (SamplerYcbcrConversion) == 4 );
1399-
1400- static_assert (sizeof (SamplerYcbcrConversion) <= sizeof (uint64_t ),
1401- " SamplerYcbcrConversion must be no more than 64 bits" );
1402-
1403- struct ExternalSamplerDatum {
1404- ExternalSamplerDatum (SamplerYcbcrConversion ycbcr, SamplerParams spm, uint32_t extFmt)
1405- : YcbcrConversion(ycbcr),
1406- samplerParams (spm),
1407- externalFormat(extFmt) {}
1408- bool operator ==(ExternalSamplerDatum const & rhs) const {
1409- return (YcbcrConversion == rhs.YcbcrConversion && samplerParams == rhs.samplerParams &&
1410- externalFormat == rhs.externalFormat );
1411- }
1412- struct EqualTo {
1413- bool operator ()(const ExternalSamplerDatum& lhs,
1414- const ExternalSamplerDatum& rhs) const noexcept {
1415- return (lhs.YcbcrConversion == rhs.YcbcrConversion &&
1416- lhs.samplerParams == rhs.samplerParams &&
1417- lhs.externalFormat == rhs.externalFormat );
1418- }
1419- };
1420- SamplerYcbcrConversion YcbcrConversion;
1421- SamplerParams samplerParams;
1422- uint32_t externalFormat;
1423- };
1424- // No implicit padding allowed due to it being a hash key.
1425- static_assert (sizeof (ExternalSamplerDatum) == 12 );
1426-
14271319struct DescriptorSetLayout {
14281320 std::variant<utils::StaticString, utils::CString, std::monostate> label;
14291321 utils::FixedCapacityVector<DescriptorSetLayoutBinding> bindings;
1430-
1431- // TODO: uncomment when needed
1432- // utils::FixedCapacityVector<ExternalSamplerDatum> externalSamplerData;
14331322};
14341323
14351324// ! blending equation function
0 commit comments