diff options
author | Matthew Netsch <quic_mnetsch@quicinc.com> | 2022-01-07 11:02:38 -0500 |
---|---|---|
committer | Matthew Netsch <quic_mnetsch@quicinc.com> | 2022-01-07 11:02:38 -0500 |
commit | 073a18c63a9c2d1ec5ec83d72915d92e33ff271b (patch) | |
tree | 6ecb5b11a1a9a97882efe53bb3bff285697a4110 /framework | |
parent | 62d5a5e901018c8d6f199df2d694b6d404083d00 (diff) | |
parent | d7f8a77c12c93ec004faa4100eb2f58e507c1d81 (diff) | |
download | VK-GL-CTS-073a18c63a9c2d1ec5ec83d72915d92e33ff271b.tar.gz VK-GL-CTS-073a18c63a9c2d1ec5ec83d72915d92e33ff271b.tar.bz2 VK-GL-CTS-073a18c63a9c2d1ec5ec83d72915d92e33ff271b.zip |
Merge vk-gl-cts/vulkan-cts-1.2.5 into vk-gl-cts/vulkan-cts-1.2.6
Change-Id: I8e4fb16c3f82b6cc42af849e201d50ad2f053d6e
Diffstat (limited to 'framework')
23 files changed, 80 insertions, 75 deletions
diff --git a/framework/common/tcuAstcUtil.cpp b/framework/common/tcuAstcUtil.cpp index 096b8b968..8bb38c8c6 100644 --- a/framework/common/tcuAstcUtil.cpp +++ b/framework/common/tcuAstcUtil.cpp @@ -1973,9 +1973,9 @@ static void writeBlockMode (AssignBlock128& dst, const NormalBlockParams& blockP if (de::inRange(blockParams.weightGridWidth, widthMin, widthMax) && de::inRange(blockParams.weightGridHeight, heightMin, heightMax)) { - deUint32 dummy = 0; - deUint32& widthVariable = layout.gridWidthVariableTerm == A ? a : layout.gridWidthVariableTerm == B ? b : dummy; - deUint32& heightVariable = layout.gridHeightVariableTerm == A ? a : layout.gridHeightVariableTerm == B ? b : dummy; + deUint32 defaultvalue = 0; + deUint32& widthVariable = layout.gridWidthVariableTerm == A ? a : layout.gridWidthVariableTerm == B ? b : defaultvalue; + deUint32& heightVariable = layout.gridHeightVariableTerm == A ? a : layout.gridHeightVariableTerm == B ? b : defaultvalue; widthVariable = blockParams.weightGridWidth - layout.gridWidthConstantTerm; heightVariable = blockParams.weightGridHeight - layout.gridHeightConstantTerm; @@ -2896,15 +2896,15 @@ void generateRandomValidBlocks (deUint8* dst, size_t numBlocks, CompressedTexFor } } -// Generate a number of trivial dummy blocks to fill unneeded space in a texture. -void generateDummyVoidExtentBlocks (deUint8* dst, size_t numBlocks) +// Generate a number of trivial blocks to fill unneeded space in a texture. +void generateDefaultVoidExtentBlocks (deUint8* dst, size_t numBlocks) { AssignBlock128 block = generateVoidExtentBlock(VoidExtentParams(false, 0, 0, 0, 0)); for (size_t ndx = 0; ndx < numBlocks; ndx++) block.assignToMemory(&dst[ndx * BLOCK_SIZE_BYTES]); } -void generateDummyNormalBlocks (deUint8* dst, size_t numBlocks, int blockWidth, int blockHeight) +void generateDefaultNormalBlocks (deUint8* dst, size_t numBlocks, int blockWidth, int blockHeight) { NormalBlockParams blockParams; diff --git a/framework/common/tcuAstcUtil.hpp b/framework/common/tcuAstcUtil.hpp index 620e49285..2bb114a7c 100644 --- a/framework/common/tcuAstcUtil.hpp +++ b/framework/common/tcuAstcUtil.hpp @@ -67,8 +67,8 @@ void generateBlockCaseTestData (std::vector<deUint8>& dst, CompressedTexForma void generateRandomBlocks (deUint8* dst, size_t numBlocks, CompressedTexFormat format, deUint32 seed); void generateRandomValidBlocks (deUint8* dst, size_t numBlocks, CompressedTexFormat format, TexDecompressionParams::AstcMode mode, deUint32 seed); -void generateDummyVoidExtentBlocks (deUint8* dst, size_t numBlocks); -void generateDummyNormalBlocks (deUint8* dst, size_t numBlocks, int blockWidth, int blockHeight); +void generateDefaultVoidExtentBlocks (deUint8* dst, size_t numBlocks); +void generateDefaultNormalBlocks (deUint8* dst, size_t numBlocks, int blockWidth, int blockHeight); bool isValidBlock (const deUint8* data, CompressedTexFormat format, TexDecompressionParams::AstcMode mode); diff --git a/framework/common/tcuCPUWarmup.cpp b/framework/common/tcuCPUWarmup.cpp index 13b6e0f3e..b20075c9b 100644 --- a/framework/common/tcuCPUWarmup.cpp +++ b/framework/common/tcuCPUWarmup.cpp @@ -34,7 +34,7 @@ namespace tcu namespace warmupCPUInternal { -volatile Dummy g_dummy; +volatile Unused g_unused; }; @@ -64,7 +64,7 @@ static inline float floatRelativeMedianAbsoluteDeviation (const T (&v)[Size]) return floatMedian(absoluteDeviations) / median; } -static inline float dummyComputation (float initial, int numIterations) +static inline float unusedComputation (float initial, int numIterations) { float a = initial; int b = 123; @@ -84,10 +84,10 @@ static inline float dummyComputation (float initial, int numIterations) void warmupCPU (void) { - float dummy = *warmupCPUInternal::g_dummy.m_v; + float unused = *warmupCPUInternal::g_unused.m_v; int computationSize = 1; - // Do a rough calibration for computationSize to get dummyComputation's running time above a certain threshold. + // Do a rough calibration for computationSize to get unusedComputation's running time above a certain threshold. while (computationSize < 1<<30) // \note This condition is unlikely to be met. The "real" loop exit is the break below. { const float singleMeasurementThreshold = 10000.0f; @@ -97,7 +97,7 @@ void warmupCPU (void) for (int i = 0; i < numMeasurements; i++) { const deUint64 startTime = deGetMicroseconds(); - dummy = dummyComputation(dummy, computationSize); + unused = unusedComputation(unused, computationSize); times[i] = (deInt64)(deGetMicroseconds() - startTime); } @@ -107,7 +107,7 @@ void warmupCPU (void) computationSize *= 2; } - // Do dummyComputations until running time seems stable enough. + // Do unusedComputations until running time seems stable enough. { const int maxNumMeasurements = 50; const int numConsecutiveMeasurementsRequired = 5; @@ -123,12 +123,12 @@ void warmupCPU (void) measurementNdx++) { const deUint64 startTime = deGetMicroseconds(); - dummy = dummyComputation(dummy, computationSize); + unused = unusedComputation(unused, computationSize); latestTimes[measurementNdx % numConsecutiveMeasurementsRequired] = (deInt64)(deGetMicroseconds() - startTime); } } - *warmupCPUInternal::g_dummy.m_v = dummy; + *warmupCPUInternal::g_unused.m_v = unused; } } // tcu diff --git a/framework/common/tcuCPUWarmup.hpp b/framework/common/tcuCPUWarmup.hpp index 879487d8d..95c6a3f54 100644 --- a/framework/common/tcuCPUWarmup.hpp +++ b/framework/common/tcuCPUWarmup.hpp @@ -26,7 +26,7 @@ namespace tcu { -//! Does some dummy calculations to try and get the CPU working at full speed. +//! Does some unused calculations to try and get the CPU working at full speed. void warmupCPU (void); namespace warmupCPUInternal @@ -34,16 +34,16 @@ namespace warmupCPUInternal // \note Used in an attempt to prevent compiler from doing optimizations. Not supposed to be touched elsewhere. -class Dummy +class Unused { public: - Dummy (void) : m_v(new float) {} - ~Dummy (void) { delete m_v; } + Unused (void) : m_v(new float) {} + ~Unused (void) { delete m_v; } volatile float* volatile m_v; }; -extern volatile Dummy g_dummy; +extern volatile Unused g_unused; }; diff --git a/framework/common/tcuThreadUtil.cpp b/framework/common/tcuThreadUtil.cpp index 4ee3b338a..964c2132f 100644 --- a/framework/common/tcuThreadUtil.cpp +++ b/framework/common/tcuThreadUtil.cpp @@ -177,14 +177,14 @@ Thread::~Thread (void) m_operations.clear(); } -deUint8* Thread::getDummyData (size_t size) +deUint8* Thread::getUnusedData (size_t size) { - if (m_dummyData.size() < size) + if (m_unusedData.size() < size) { - m_dummyData.resize(size); + m_unusedData.resize(size); } - return &(m_dummyData[0]); + return &(m_unusedData[0]); } void Thread::addOperation (Operation* operation) diff --git a/framework/common/tcuThreadUtil.hpp b/framework/common/tcuThreadUtil.hpp index d6c412473..e7b04cd21 100644 --- a/framework/common/tcuThreadUtil.hpp +++ b/framework/common/tcuThreadUtil.hpp @@ -174,7 +174,7 @@ public: void exec (void); - deUint8* getDummyData (size_t size); //!< Return data pointer that contains at least size bytes. Valid until next call + deUint8* getUnusedData (size_t size); //!< Return data pointer that contains at least size bytes. Valid until next call ThreadStatus getStatus (void) const { de::ScopedLock lock(m_statusLock); return m_status; } void setStatus (ThreadStatus status) { de::ScopedLock lock(m_statusLock); m_status = status; } @@ -199,7 +199,7 @@ private: std::vector<Message> m_messages; mutable de::Mutex m_statusLock; ThreadStatus m_status; - std::vector<deUint8> m_dummyData; + std::vector<deUint8> m_unusedData; // Disabled Thread (const Thread&); diff --git a/framework/delibs/decpp/deBlockBuffer.cpp b/framework/delibs/decpp/deBlockBuffer.cpp index 7e00594e4..e2f532208 100644 --- a/framework/delibs/decpp/deBlockBuffer.cpp +++ b/framework/delibs/decpp/deBlockBuffer.cpp @@ -25,6 +25,7 @@ #include "deRandom.hpp" #include "deThread.hpp" #include "deInt32.h" +#include "deMemory.h" #include <vector> @@ -239,6 +240,8 @@ public: deUint8 tmp[1024]; Random rnd(m_seed); + deMemset(tmp, 0, DE_LENGTH_OF_ARRAY(tmp)); + for (;;) { int blockSize = rnd.getInt(1, DE_LENGTH_OF_ARRAY(tmp)); diff --git a/framework/delibs/decpp/dePoolArray.cpp b/framework/delibs/decpp/dePoolArray.cpp index 3169e2001..c9867e760 100644 --- a/framework/delibs/decpp/dePoolArray.cpp +++ b/framework/delibs/decpp/dePoolArray.cpp @@ -39,7 +39,7 @@ static void intArrayTest (void) /* Test pushBack(). */ for (i = 0; i < 5000; i++) { - /* Dummy alloc to try to break alignments. */ + /* Unused alloc to try to break alignments. */ pool.alloc(1); arr.pushBack(i); @@ -113,7 +113,7 @@ static void alignedIntArrayTest (void) /* Test pushBack(). */ for (i = 0; i < 5000; i++) { - /* Dummy alloc to try to break alignments. */ + /* Unused alloc to try to break alignments. */ pool.alloc(1); arr.pushBack(i); diff --git a/framework/delibs/depool/dePoolArray.c b/framework/delibs/depool/dePoolArray.c index aff04de3c..ddbf7539c 100644 --- a/framework/delibs/depool/dePoolArray.c +++ b/framework/delibs/depool/dePoolArray.c @@ -164,7 +164,7 @@ void dePoolArray_selfTest (void) /* Test pushBack(). */ for (i = 0; i < 5000; i++) { - /* Dummy alloc to try to break alignments. */ + /* Unused alloc to try to break alignments. */ deMemPool_alloc(pool, 1); dePoolIntArray_pushBack(arr, i); diff --git a/framework/delibs/depool/dePoolArray.h b/framework/delibs/depool/dePoolArray.h index 8365e7f06..8278f115b 100644 --- a/framework/delibs/depool/dePoolArray.h +++ b/framework/delibs/depool/dePoolArray.h @@ -207,7 +207,7 @@ DE_INLINE void TYPENAME##_swap (DE_PTR_TYPE(TYPENAME) arr, int aNdx, int bNdx) \ TYPENAME##_set(arr, bNdx, tmp); \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Declare a sort function for an array. @@ -284,7 +284,7 @@ DE_INLINE void TYPENAME##_##SORTNAME (DE_PTR_TYPE(TYPENAME) arr) \ } \ } \ \ -struct TYPENAME##SORTNAME##Dummy_s { int dummy; } +struct TYPENAME##SORTNAME##unused_s { int unused; } /* Basic array types. */ diff --git a/framework/delibs/depool/dePoolHash.h b/framework/delibs/depool/dePoolHash.h index 5316f322d..6d8992782 100644 --- a/framework/delibs/depool/dePoolHash.h +++ b/framework/delibs/depool/dePoolHash.h @@ -182,7 +182,7 @@ DE_INLINE VALUETYPE TYPENAME##Iter_getValue (const TYPENAME##Iter* iter) \ return iter->curSlot->values[iter->curElemIndex]; \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Implement a template pool hash class. @@ -416,13 +416,13 @@ void TYPENAME##_delete (DE_PTR_TYPE(TYPENAME) hash, KEYTYPE key) \ DE_ASSERT(slot); \ } \ } \ -struct TYPENAME##Dummy2_s { int dummy; } +struct TYPENAME##Unused2_s { int unused; } /* Copy-to-array templates. */ #define DE_DECLARE_POOL_HASH_TO_ARRAY(HASHTYPENAME, KEYARRAYTYPENAME, VALUEARRAYTYPENAME) \ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* set, DE_PTR_TYPE(KEYARRAYTYPENAME) keyArray, DE_PTR_TYPE(VALUEARRAYTYPENAME) valueArray); \ - struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_declare_dummy { int dummy; } + struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_declare_unused { int unused; } #define DE_IMPLEMENT_POOL_HASH_TO_ARRAY(HASHTYPENAME, KEYARRAYTYPENAME, VALUEARRAYTYPENAME) \ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* hash, DE_PTR_TYPE(KEYARRAYTYPENAME) keyArray, DE_PTR_TYPE(VALUEARRAYTYPENAME) valueArray) \ @@ -455,6 +455,6 @@ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* hash, DE_PTR_TYPE(KEYARRAY DE_ASSERT(arrayNdx == numElements); \ return DE_TRUE; \ } \ -struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_implement_dummy { int dummy; } +struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_implement_unused { int unused; } #endif /* _DEPOOLHASH_H */ diff --git a/framework/delibs/depool/dePoolHashArray.h b/framework/delibs/depool/dePoolHashArray.h index cf9cfbe5b..7b2da1a07 100644 --- a/framework/delibs/depool/dePoolHashArray.h +++ b/framework/delibs/depool/dePoolHashArray.h @@ -103,7 +103,7 @@ DE_INLINE void TYPENAME##_reset (DE_PTR_TYPE(TYPENAME) hashArray) \ TYPENAME##Array_reset(hashArray->array); \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Implement a template pool hash-array class. @@ -166,6 +166,6 @@ deBool TYPENAME##_copyToArray (const TYPENAME* hashArray, DE_PTR_TYPE(KEYARRAYTY return DE_TRUE; \ } \ \ -struct TYPENAME##Dummy2_s { int dummy; } +struct TYPENAME##Unused2_s { int unused; } #endif /* _DEPOOLHASHARRAY_H */ diff --git a/framework/delibs/depool/dePoolHashSet.h b/framework/delibs/depool/dePoolHashSet.h index 3d823b291..a9f1491a6 100644 --- a/framework/delibs/depool/dePoolHashSet.h +++ b/framework/delibs/depool/dePoolHashSet.h @@ -146,7 +146,7 @@ DE_INLINE deBool TYPENAME##_exists (const TYPENAME* hashSet, KEYTYPE key, VALUET return DE_FALSE; \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Implement a template pool hash-set class. @@ -164,7 +164,7 @@ struct TYPENAME##Dummy_s { int dummy; } #define DE_IMPLEMENT_POOL_HASH_SET(TYPENAME, KEYTYPE, VALUETYPE, KEYHASHFUNC, KEYCMPFUNC, VALUEHASHFUNC, VALUECMPFUNC) \ DE_IMPLEMENT_POOL_SET(TYPENAME##Set, VALUETYPE, VALUEHASHFUNC, VALUECMPFUNC); \ DE_IMPLEMENT_POOL_HASH(TYPENAME##Hash, KEYTYPE, TYPENAME##Set*, KEYHASHFUNC, KEYCMPFUNC); \ -struct TYPENAME##Dummy2_s { int dummy; } +struct TYPENAME##Unused2_s { int unused; } /* Copy-to-array templates. */ @@ -172,7 +172,7 @@ struct TYPENAME##Dummy2_s { int dummy; } #define DE_DECLARE_POOL_HASH_TO_ARRAY(HASHTYPENAME, KEYARRAYTYPENAME, VALUEARRAYTYPENAME) \ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* set, KEYARRAYTYPENAME* keyArray, VALUEARRAYTYPENAME* valueArray); \ - struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_declare_dummy { int dummy; } + struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_declare_unused { int unused; } #define DE_IMPLEMENT_POOL_HASH_TO_ARRAY(HASHTYPENAME, KEYARRAYTYPENAME, VALUEARRAYTYPENAME) \ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* hash, KEYARRAYTYPENAME* keyArray, VALUEARRAYTYPENAME* valueArray) \ @@ -205,7 +205,7 @@ deBool HASHTYPENAME##_copyToArray(const HASHTYPENAME* hash, KEYARRAYTYPENAME* ke DE_ASSERT(arrayNdx == numElements); \ return DE_TRUE; \ } \ -struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_implement_dummy { int dummy; } +struct HASHTYPENAME##_##KEYARRAYTYPENAME##_##VALUEARRAYTYPENAME##_implement_unused { int unused; } #endif diff --git a/framework/delibs/depool/dePoolHeap.c b/framework/delibs/depool/dePoolHeap.c index 4e5e4b692..213a6bbb7 100644 --- a/framework/delibs/depool/dePoolHeap.c +++ b/framework/delibs/depool/dePoolHeap.c @@ -75,7 +75,7 @@ void dePoolHeap_selfTest (void) /* Push items -1000..1000 into heap. */ for (i = -1000; i < 1000; i++) { - /* Dummy alloc to try to break alignments. */ + /* Unused alloc to try to break alignments. */ deMemPool_alloc(pool, 1); TestHeap_push(heap, HeapItem_create(i, -i)); } diff --git a/framework/delibs/depool/dePoolHeap.h b/framework/delibs/depool/dePoolHeap.h index 9df1b89f5..61ff8e1b2 100644 --- a/framework/delibs/depool/dePoolHeap.h +++ b/framework/delibs/depool/dePoolHeap.h @@ -163,6 +163,6 @@ DE_INLINE VALUETYPE TYPENAME##_popMin (DE_PTR_TYPE(TYPENAME) heap) \ return tmp; \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } #endif /* _DEPOOLHEAP_H */ diff --git a/framework/delibs/depool/dePoolMultiSet.h b/framework/delibs/depool/dePoolMultiSet.h index c5dce8541..8079c3950 100644 --- a/framework/delibs/depool/dePoolMultiSet.h +++ b/framework/delibs/depool/dePoolMultiSet.h @@ -104,7 +104,7 @@ DE_INLINE void TYPENAME##_delete (DE_PTR_TYPE(TYPENAME) set, KEYTYPE key) \ TYPENAME##_setKeyCount(set, key, oldCount - 1); \ } \ \ -struct TYPENAME##DeclareDummy_s { int dummy; } +struct TYPENAME##DeclareUnused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Implement a template pool multiset class. @@ -162,7 +162,7 @@ deBool TYPENAME##_setKeyCount (DE_PTR_TYPE(TYPENAME) set, KEYTYPE key, int newCo return DE_TRUE; \ } \ \ -struct TYPENAME##ImplementDummy_s { int dummy; } +struct TYPENAME##ImplementUnused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Declare set-wise operations for a multiset template. @@ -197,7 +197,7 @@ struct TYPENAME##ImplementDummy_s { int dummy; } deBool TYPENAME##_sumInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b); \ deBool TYPENAME##_difference (DE_PTR_TYPE(TYPENAME) to, const TYPENAME* a, const TYPENAME* b); \ void TYPENAME##_differenceInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b); \ - struct TYPENAME##SetwiseDeclareDummy_s { int dummy; } + struct TYPENAME##SetwiseDeclareUnused_s { int unused; } #define DE_IMPLEMENT_POOL_MULTISET_SETWISE_OPERATIONS(TYPENAME, KEYTYPE) \ deBool TYPENAME##_union (DE_PTR_TYPE(TYPENAME) to, const TYPENAME* a, const TYPENAME* b) \ @@ -291,6 +291,6 @@ void TYPENAME##_differenceInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b) \ DE_FATAL("Not implemented."); \ } \ \ -struct TYPENAME##SetwiseImplementDummy_s { int dummy; } +struct TYPENAME##SetwiseImplementUnused_s { int unused; } #endif /* _DEPOOLMULTISET_H */ diff --git a/framework/delibs/depool/dePoolSet.h b/framework/delibs/depool/dePoolSet.h index 214bc1758..240904563 100644 --- a/framework/delibs/depool/dePoolSet.h +++ b/framework/delibs/depool/dePoolSet.h @@ -190,7 +190,7 @@ DE_INLINE void TYPENAME##_safeDelete (DE_PTR_TYPE(TYPENAME) set, KEYTYPE key) \ TYPENAME##_delete(set, key); \ } \ \ -struct TYPENAME##Dummy_s { int dummy; } +struct TYPENAME##Unused_s { int unused; } /*--------------------------------------------------------------------*//*! * \brief Implement a template pool set class. @@ -424,13 +424,13 @@ void TYPENAME##_delete (DE_PTR_TYPE(TYPENAME) set, KEYTYPE key) \ } \ } \ \ -struct TYPENAME##Dummy2_s { int dummy; } +struct TYPENAME##Unused2_s { int unused; } /* Copy-to-array templates. */ #define DE_DECLARE_POOL_SET_TO_ARRAY(SETTYPENAME, ARRAYTYPENAME) \ deBool SETTYPENAME##_copyToArray(const SETTYPENAME* set, DE_PTR_TYPE(ARRAYTYPENAME) array); \ - struct SETTYPENAME##_##ARRAYTYPENAME##_declare_dummy { int dummy; } + struct SETTYPENAME##_##ARRAYTYPENAME##_declare_unused { int unused; } #define DE_IMPLEMENT_POOL_SET_TO_ARRAY(SETTYPENAME, ARRAYTYPENAME) \ deBool SETTYPENAME##_copyToArray(const SETTYPENAME* set, DE_PTR_TYPE(ARRAYTYPENAME) array) \ @@ -456,7 +456,7 @@ struct TYPENAME##Dummy2_s { int dummy; } DE_ASSERT(arrayNdx == numElements); \ return DE_TRUE; \ } \ - struct SETTYPENAME##_##ARRAYTYPENAME##_implement_dummy { int dummy; } + struct SETTYPENAME##_##ARRAYTYPENAME##_implement_unused { int unused; } /*--------------------------------------------------------------------*//*! * \brief Declare set-wise operations for a set template. @@ -487,7 +487,7 @@ struct TYPENAME##Dummy2_s { int dummy; } void TYPENAME##_intersectInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b); \ deBool TYPENAME##_difference (DE_PTR_TYPE(TYPENAME) to, const TYPENAME* a, const TYPENAME* b); \ void TYPENAME##_differenceInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b); \ - struct TYPENAME##SetwiseDeclareDummy_s { int dummy; } + struct TYPENAME##SetwiseDeclareUnused_s { int unused; } #define DE_IMPLEMENT_POOL_SET_SETWISE_OPERATIONS(TYPENAME, KEYTYPE) \ deBool TYPENAME##_union (DE_PTR_TYPE(TYPENAME) to, const TYPENAME* a, const TYPENAME* b) \ @@ -572,6 +572,6 @@ void TYPENAME##_differenceInplace (DE_PTR_TYPE(TYPENAME) a, const TYPENAME* b) \ } \ } \ \ -struct TYPENAME##UnionIntersectImplementDummy_s { int dummy; } +struct TYPENAME##UnionIntersectImplementUnused_s { int unused; } #endif /* _DEPOOLSET_H */ diff --git a/framework/delibs/destream/deRingbuffer.c b/framework/delibs/destream/deRingbuffer.c index 7468484c4..cb26a2da0 100644 --- a/framework/delibs/destream/deRingbuffer.c +++ b/framework/delibs/destream/deRingbuffer.c @@ -270,7 +270,7 @@ static deStreamResult consumerStream_deinit (deStreamData* stream) } /* There are no sensible errors so status is always good */ -deStreamStatus dummy_getStatus (deStreamData* stream) +deStreamStatus empty_getStatus (deStreamData* stream) { DE_UNREF(stream); @@ -278,7 +278,7 @@ deStreamStatus dummy_getStatus (deStreamData* stream) } /* There are no sensible errors in ringbuffer */ -static const char* dummy_getError (deStreamData* stream) +static const char* empty_getError (deStreamData* stream) { DE_ASSERT(stream); DE_UNREF(stream); @@ -288,19 +288,19 @@ static const char* dummy_getError (deStreamData* stream) static const deIOStreamVFTable producerStreamVFTable = { DE_NULL, producerStream_write, - dummy_getError, + empty_getError, producerStream_flush, producerStream_deinit, - dummy_getStatus + empty_getStatus }; static const deIOStreamVFTable consumerStreamVFTable = { consumerStream_read, DE_NULL, - dummy_getError, + empty_getError, DE_NULL, consumerStream_deinit, - dummy_getStatus + empty_getStatus }; void deProducerStream_init (deOutStream* stream, deRingbuffer* buffer) diff --git a/framework/egl/egluNativeWindow.hpp b/framework/egl/egluNativeWindow.hpp index 5d417c028..e5c99fbc2 100644 --- a/framework/egl/egluNativeWindow.hpp +++ b/framework/egl/egluNativeWindow.hpp @@ -96,7 +96,7 @@ public: //! Return native pointer that can be used with eglCreatePlatformWindowSurface(). Default implementation throws tcu::NotSupportedError(). virtual void* getPlatformNative (void); - // Process window events. Defaults to dummy implementation, that does nothing. + // Process window events. Defaults to empty implementation, that does nothing. virtual void processEvents (void) {} // Get current size of window's logical surface. Default implementation throws tcu::NotSupportedError() diff --git a/framework/opengl/gluDummyRenderContext.hpp b/framework/opengl/gluDummyRenderContext.hpp index a76aa2c55..41812d9f2 100644 --- a/framework/opengl/gluDummyRenderContext.hpp +++ b/framework/opengl/gluDummyRenderContext.hpp @@ -41,13 +41,13 @@ namespace glu * currently depend on having access to the glw::Functions already in test * case constructor; in such situations there may not be a proper render * context available (like in test case list dumping mode). This is a - * simple workaround for that: a dummy render context with a glw::Functions + * simple workaround for that: a empty render context with a glw::Functions * containing just null pointers. *//*--------------------------------------------------------------------*/ -class DummyRenderContext : public RenderContext +class EmptyRenderContext : public RenderContext { public: - explicit DummyRenderContext (ContextType ctxType = ContextType()) : m_ctxType(ctxType) {} + explicit EmptyRenderContext (ContextType ctxType = ContextType()) : m_ctxType(ctxType) {} virtual ContextType getType (void) const { return m_ctxType; } virtual const glw::Functions& getFunctions (void) const { return m_functions; } diff --git a/framework/opengl/gluShaderLibrary.cpp b/framework/opengl/gluShaderLibrary.cpp index 8343cba76..293c91980 100644 --- a/framework/opengl/gluShaderLibrary.cpp +++ b/framework/opengl/gluShaderLibrary.cpp @@ -1287,9 +1287,9 @@ void ShaderParser::parsePipelineProgram (ProgramSpecification& program) } else if (m_curToken == TOKEN_REQUIRE) { - vector<RequiredCapability> dummyCaps; + vector<RequiredCapability> unusedCaps; size_t size = program.requiredExtensions.size(); - parseRequirement(dummyCaps, program.requiredExtensions); + parseRequirement(unusedCaps, program.requiredExtensions); if (size == program.requiredExtensions.size()) parseError("only extension requirements are allowed inside pipeline program"); diff --git a/framework/opengl/simplereference/sglrReferenceContext.cpp b/framework/opengl/simplereference/sglrReferenceContext.cpp index bd38151a2..6ac67951f 100644 --- a/framework/opengl/simplereference/sglrReferenceContext.cpp +++ b/framework/opengl/simplereference/sglrReferenceContext.cpp @@ -37,6 +37,8 @@ #include "rrFragmentOperations.hpp" #include "rrRenderer.hpp" +#include <cstdint> + namespace sglr { @@ -4081,7 +4083,7 @@ void ReferenceContext::drawElementsInstancedBaseVertex (deUint32 mode, int count // All is ok { const rr::PrimitiveType primitiveType = sglr::rr_util::mapGLPrimitiveType(mode); - const void* indicesPtr = (vao.m_elementArrayBufferBinding) ? (vao.m_elementArrayBufferBinding->getData() + ((const deUint8*)indices - (const deUint8*)DE_NULL)) : (indices); + const void* indicesPtr = (vao.m_elementArrayBufferBinding) ? (vao.m_elementArrayBufferBinding->getData() + reinterpret_cast<uintptr_t>(indices)) : (indices); drawWithReference(rr::PrimitiveList(primitiveType, count, rr::DrawIndices(indicesPtr, sglr::rr_util::mapGLIndexType(type), baseVertex)), instanceCount); } @@ -4124,12 +4126,12 @@ void ReferenceContext::drawArraysIndirect (deUint32 mode, const void *indirect) RC_IF_ERROR(!deIsAlignedPtr(indirect, 4), GL_INVALID_OPERATION, RC_RET_VOID); // \note watch for overflows, indirect might be close to 0xFFFFFFFF and indirect+something might overflow - RC_IF_ERROR((size_t)((const char*)indirect - (const char*)DE_NULL) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); - RC_IF_ERROR((size_t)((const char*)indirect - (const char*)DE_NULL) + sizeof(DrawArraysIndirectCommand) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); + RC_IF_ERROR((size_t)reinterpret_cast<uintptr_t>(indirect) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); + RC_IF_ERROR((size_t)reinterpret_cast<uintptr_t>(indirect) + sizeof(DrawArraysIndirectCommand) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); // Check values - command = (const DrawArraysIndirectCommand*)(m_drawIndirectBufferBinding->getData() + ((const char*)indirect - (const char*)DE_NULL)); + command = (const DrawArraysIndirectCommand*)(m_drawIndirectBufferBinding->getData() + reinterpret_cast<uintptr_t>(indirect)); RC_IF_ERROR(command->reservedMustBeZero != 0, GL_INVALID_OPERATION, RC_RET_VOID); // draw @@ -4166,12 +4168,12 @@ void ReferenceContext::drawElementsIndirect (deUint32 mode, deUint32 type, const RC_IF_ERROR(!deIsAlignedPtr(indirect, 4), GL_INVALID_OPERATION, RC_RET_VOID); // \note watch for overflows, indirect might be close to 0xFFFFFFFF and indirect+something might overflow - RC_IF_ERROR((size_t)((const char*)indirect - (const char*)DE_NULL) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); - RC_IF_ERROR((size_t)((const char*)indirect - (const char*)DE_NULL) + sizeof(DrawElementsIndirectCommand) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); + RC_IF_ERROR((size_t)reinterpret_cast<uintptr_t>(indirect) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); + RC_IF_ERROR((size_t)reinterpret_cast<uintptr_t>(indirect) + sizeof(DrawElementsIndirectCommand) > (size_t)m_drawIndirectBufferBinding->getSize(), GL_INVALID_OPERATION, RC_RET_VOID); // Check values - command = (const DrawElementsIndirectCommand*)(m_drawIndirectBufferBinding->getData() + ((const char*)indirect - (const char*)DE_NULL)); + command = (const DrawElementsIndirectCommand*)(m_drawIndirectBufferBinding->getData() + reinterpret_cast<uintptr_t>(indirect)); RC_IF_ERROR(command->reservedMustBeZero != 0, GL_INVALID_OPERATION, RC_RET_VOID); // Check command error conditions @@ -4434,7 +4436,7 @@ void ReferenceContext::drawWithReference (const rr::PrimitiveList& primitives, i vertexAttribs[ndx].size = sglr::rr_util::mapGLSize(vao.m_arrays[ndx].size); vertexAttribs[ndx].stride = vao.m_arrays[ndx].stride; vertexAttribs[ndx].instanceDivisor = vao.m_arrays[ndx].divisor; - vertexAttribs[ndx].pointer = (vao.m_arrays[ndx].bufferBinding) ? (vao.m_arrays[ndx].bufferBinding->getData() + ((const deUint8*)vao.m_arrays[ndx].pointer - (const deUint8*)DE_NULL)) : (vao.m_arrays[ndx].pointer); + vertexAttribs[ndx].pointer = (vao.m_arrays[ndx].bufferBinding) ? (vao.m_arrays[ndx].bufferBinding->getData() + reinterpret_cast<uintptr_t>(vao.m_arrays[ndx].pointer)) : (vao.m_arrays[ndx].pointer); } } } diff --git a/framework/randomshaders/rsgShaderGenerator.cpp b/framework/randomshaders/rsgShaderGenerator.cpp index 7af96232a..388279bab 100644 --- a/framework/randomshaders/rsgShaderGenerator.cpp +++ b/framework/randomshaders/rsgShaderGenerator.cpp @@ -333,7 +333,7 @@ void ShaderGenerator::generate (const ShaderParameters& shaderParams, Shader& sh m_varManager.popVariableScope(); m_varManager.popValueScope(); - // Fill undefined (unused) components in inputs with dummy values + // Fill undefined (unused) components in inputs with unused values fillUndefinedShaderInputs(shader.getInputs()); fillUndefinedShaderInputs(shader.getUniforms()); |