From dfd3e65ba486450de388f9fa2da97e1f0a442fa2 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 13 Jul 2023 17:16:50 -0500 Subject: [PATCH 1/7] gtest tweaks refactor concurency test conu=sumer thread runner to generate timeouts at excessive attempts (32ms*runlength) threadsafefreelist reporting augs scripttest object name conflict resolutions skip testing platform window creation if no monitor was found --- Engine/source/console/test/ScriptTest.cpp | 12 +++---- .../threads/test/threadSafeDequeTest.cpp | 33 +++++++++++-------- .../test/threadSafePriorityQueueTest.cpp | 4 +-- .../platform/threads/threadSafeFreeList.h | 2 +- .../windowManager/test/windowManagerTest.cpp | 5 ++- 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Engine/source/console/test/ScriptTest.cpp b/Engine/source/console/test/ScriptTest.cpp index f86368cea..1ef168b91 100644 --- a/Engine/source/console/test/ScriptTest.cpp +++ b/Engine/source/console/test/ScriptTest.cpp @@ -443,7 +443,7 @@ TEST(Script, ForEachLoop) %count = 0; foreach (%obj in %this) { - if (%obj.getName() $= "A") + if (%obj.getName() $= "A_FEC") continue; %count++; @@ -454,7 +454,7 @@ TEST(Script, ForEachLoop) function a() { %set = new SimSet(); - %set.add(new SimObject(A)); + %set.add(new SimObject(A_FEC)); %set.add(new SimObject()); %set.add(new SimObject()); @@ -471,7 +471,7 @@ TEST(Script, ForEachLoop) { foreach (%obj in %this) { - if (%obj.getName() $= "A") + if (%obj.getName() $= "A_FER") return 76; } return 0; @@ -480,7 +480,7 @@ TEST(Script, ForEachLoop) function a() { %set = new SimSet(); - %set.add(new SimObject(A)); + %set.add(new SimObject(A_FER)); %set.add(new SimObject()); %set.add(new SimObject()); @@ -499,7 +499,7 @@ TEST(Script, ForEachLoop) { foreach (%innerObj in %this) { - if (%innerObj.getName() $= "A") + if (%innerObj.getName() $= "A_FENR") return 42; } } @@ -509,7 +509,7 @@ TEST(Script, ForEachLoop) function a() { %set = new SimSet(); - %set.add(new SimObject(A)); + %set.add(new SimObject(A_FENR)); %set.add(new SimObject()); %set.add(new SimObject()); diff --git a/Engine/source/platform/threads/test/threadSafeDequeTest.cpp b/Engine/source/platform/threads/test/threadSafeDequeTest.cpp index 3559ebd13..d434bf4d9 100644 --- a/Engine/source/platform/threads/test/threadSafeDequeTest.cpp +++ b/Engine/source/platform/threads/test/threadSafeDequeTest.cpp @@ -91,18 +91,6 @@ public: ValueRef val = new Value(i, tick); mDeque.pushBack(val); } - - // WORKAROUND: due to a bug in the Deque, we lose an item, and thus the test will loop forever. We currently - // don't have a timeout solution, so instead push som extra elements just to make sure Consumer - // doesn't get stuck. - for(U32 i = mValues.size(); i < mValues.size() + 5; i++) - { - U32 tick = Platform::getRealMilliseconds(); - - ValueRef val = new Value(i, tick); - - mDeque.pushBack(val); - } } }; @@ -115,10 +103,27 @@ public: virtual void run(void*) { - for(U32 i = 0; i < mValues.size(); i++) + S32 timeOut = mValues.size() * 32; + U32 endTime = Platform::getRealMilliseconds() + timeOut; + + for (U32 i = 0; i < mValues.size(); i++) { ValueRef value; - while(!mDeque.tryPopFront(value)); + bool timedOut = false; + while (!mDeque.tryPopFront(value)) + { + if (timeOut && Platform::getRealMilliseconds() >= endTime) + { + timedOut = true; + break; + } + }; + + ASSERT_FALSE(timedOut) + << "consumer thread timed out!"; + + if (timedOut) return; + EXPECT_EQ(i, value->mIndex); EXPECT_EQ(value->mTick, mValues[i]); } diff --git a/Engine/source/platform/threads/test/threadSafePriorityQueueTest.cpp b/Engine/source/platform/threads/test/threadSafePriorityQueueTest.cpp index 668117633..3a241a3b9 100644 --- a/Engine/source/platform/threads/test/threadSafePriorityQueueTest.cpp +++ b/Engine/source/platform/threads/test/threadSafePriorityQueueTest.cpp @@ -35,7 +35,7 @@ TEST(ThreadSafePriorityQueue, Serial) const U32 len = 11; U32 indices[len] = { 2, 7, 4, 6, 1, 5, 3, 8, 6, 9, 0}; - F32 priorities[len] = {0.2, 0.7, 0.4, 0.6, 0.1, 0.5, 0.3, 0.8, 0.6, 0.9, 0}; + F32 priorities[len] = {0.2f, 0.7f, 0.4f, 0.6f, 0.1f, 0.5f, 0.3f, 0.8f, 0.6f, 0.9f, 0.0f}; ThreadSafePriorityQueue minQueue; ThreadSafePriorityQueue maxQueue; @@ -92,7 +92,7 @@ TEST(ThreadSafePriorityQueue, Concurrent) virtual void run(void*) { U32 indices[LEN] = { 2, 7, 4, 6, 1, 5, 3, 8, 6, 9, 0}; - F32 priorities[LEN] = {0.2, 0.7, 0.4, 0.6, 0.1, 0.5, 0.3, 0.8, 0.6, 0.9, 0}; + F32 priorities[LEN] = {0.2f, 0.7f, 0.4f, 0.6f, 0.1f, 0.5f, 0.3f, 0.8f, 0.6f, 0.9f, 0.0f}; for(U32 i = 0; i < LEN; i++) { diff --git a/Engine/source/platform/threads/threadSafeFreeList.h b/Engine/source/platform/threads/threadSafeFreeList.h index bb34e6bbe..c657b9847 100644 --- a/Engine/source/platform/threads/threadSafeFreeList.h +++ b/Engine/source/platform/threads/threadSafeFreeList.h @@ -85,7 +85,7 @@ class ThreadSafeFreeList { #ifdef TORQUE_DEBUG AssertWarn( mNumNodesTotal == mNumNodesFree, - "ThreadSafeFreeList::~ThreadSafeFreeList() - still got live instances" ); + avar("ThreadSafeFreeList::~ThreadSafeFreeList() - still got live instances:[%i/%i]", mNumNodesTotal,mNumNodesFree) ); #endif // Destroy remaining nodes. Not synchronized. We assume all diff --git a/Engine/source/windowManager/test/windowManagerTest.cpp b/Engine/source/windowManager/test/windowManagerTest.cpp index d6179c96b..e0fe5712b 100644 --- a/Engine/source/windowManager/test/windowManagerTest.cpp +++ b/Engine/source/windowManager/test/windowManagerTest.cpp @@ -29,6 +29,9 @@ TEST(WinMgr, BasicAPI) { PlatformWindowManager *pwm = CreatePlatformWindowManager(); + ASSERT_TRUE(pwm) + << "no monitor to test against!"; + // Check out the primary desktop area... RectI primary = pwm->getPrimaryDesktopArea(); @@ -55,4 +58,4 @@ TEST(WinMgr, BasicAPI) // No way to destroy the window manager. }; -#endif \ No newline at end of file +#endif From e0fa082cf9b971bda6494d2d0f445c6dac056195 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 13 Jul 2023 18:43:01 -0500 Subject: [PATCH 2/7] sleep for an actual tick (also do so between dfiletouch and isfile on the off chance the o/s is choking) --- Engine/source/platform/test/platformFileIOTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Engine/source/platform/test/platformFileIOTest.cpp b/Engine/source/platform/test/platformFileIOTest.cpp index 198baca4f..0afd61593 100644 --- a/Engine/source/platform/test/platformFileIOTest.cpp +++ b/Engine/source/platform/test/platformFileIOTest.cpp @@ -68,13 +68,17 @@ TEST(File, TouchAndTime) // Touch a file and note its last-modified. dFileTouch("testTouch.file"); + + // Sleep for a tick + Platform::sleep(32); + EXPECT_TRUE(Platform::isFile("testTouch.file")) << "We just touched this file - it should exist."; EXPECT_TRUE(Platform::getFileTimes("testTouch.file", &create[0], &modify[0])) << "Failed to get filetimes for a file we just created."; // Sleep for a tick - Platform::sleep(10); + Platform::sleep(32); // Touch it again, and compare the last-modifieds. EXPECT_TRUE(Platform::isFile("testTouch.file")) From 38b81eb8043d2f003864ac16e2005ee37d81c9da Mon Sep 17 00:00:00 2001 From: JeffR Date: Mon, 17 Jul 2023 21:12:46 -0500 Subject: [PATCH 3/7] Adds a logical check for when we try and check for found adapters, so if we're defined to use a Null device, we can skip looking around --- Engine/source/gfx/gfxInit.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Engine/source/gfx/gfxInit.cpp b/Engine/source/gfx/gfxInit.cpp index 0a5c66466..0f102a92b 100644 --- a/Engine/source/gfx/gfxInit.cpp +++ b/Engine/source/gfx/gfxInit.cpp @@ -333,17 +333,26 @@ GFXAdapter *GFXInit::getBestAdapterChoice() } } - // Return best found in order DX11, GL - if (foundAdapter11) - return foundAdapter11; + if (renderer.equal("NullDevice", String::NoCase) == false) + { + // Return best found in order DX11, GL + if (foundAdapter11) + return foundAdapter11; - if (foundAdapterGL) - return foundAdapterGL; + if (foundAdapterGL) + return foundAdapterGL; - // Uh oh - we didn't find anything. Grab whatever we can that's not Null... - for(S32 i=0; imType != NullDevice) - return smAdapters[i]; + // Uh oh - we didn't find anything. Grab whatever we can that's not Null... + for (S32 i = 0; i < smAdapters.size(); i++) + if (smAdapters[i]->mType != NullDevice) + return smAdapters[i]; + } + else + { + for (S32 i = 0; i < smAdapters.size(); i++) + if (smAdapters[i]->mType == NullDevice) + return smAdapters[i]; + } // Dare we return a null device? No. Just return NULL. return NULL; From e325902bac87273df43c05c0b0eaac1ef7b08c80 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 19 Jul 2023 13:36:14 +0100 Subject: [PATCH 4/7] init commit --- Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp | 8 ++++---- Engine/source/gfx/gfxStateBlock.cpp | 1 + Engine/source/gfx/gfxStateBlock.h | 2 ++ Engine/source/gfx/gl/gfxGLEnumTranslate.cpp | 2 +- Engine/source/gfx/gl/gfxGLTextureObject.cpp | 1 + Engine/source/gfx/sim/gfxStateBlockData.cpp | 2 ++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp index 23844665b..f2197c929 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp @@ -186,10 +186,10 @@ GFXD3D11StateBlock::GFXD3D11StateBlock(const GFXStateBlockDesc& desc) else mSamplerDesc[i].Filter = comparison ? D3D11_FILTER_COMPARISON_ANISOTROPIC : D3D11_FILTER_ANISOTROPIC; - mSamplerDesc[i].BorderColor[0] = 1.0f; - mSamplerDesc[i].BorderColor[1] = 1.0f; - mSamplerDesc[i].BorderColor[2] = 1.0f; - mSamplerDesc[i].BorderColor[3] = 1.0f; + mSamplerDesc[i].BorderColor[0] = gfxSamplerState.borderColor.red; + mSamplerDesc[i].BorderColor[1] = gfxSamplerState.borderColor.green; + mSamplerDesc[i].BorderColor[2] = gfxSamplerState.borderColor.blue; + mSamplerDesc[i].BorderColor[3] = gfxSamplerState.borderColor.alpha; mSamplerDesc[i].ComparisonFunc = GFXD3D11CmpFunc[gfxSamplerState.samplerFunc]; hr = D3D11DEVICE->CreateSamplerState(&mSamplerDesc[i], &mSamplerStates[i]); diff --git a/Engine/source/gfx/gfxStateBlock.cpp b/Engine/source/gfx/gfxStateBlock.cpp index 61ff8958c..80d3289ee 100644 --- a/Engine/source/gfx/gfxStateBlock.cpp +++ b/Engine/source/gfx/gfxStateBlock.cpp @@ -278,6 +278,7 @@ GFXSamplerStateDesc::GFXSamplerStateDesc() samplerFunc = GFXCmpNever; maxAnisotropy = 1; mipLODBias = 0.0f; + borderColor = LinearColorF::WHITE; } GFXSamplerStateDesc GFXSamplerStateDesc::getWrapLinear() diff --git a/Engine/source/gfx/gfxStateBlock.h b/Engine/source/gfx/gfxStateBlock.h index f8f19f360..5cefd381a 100644 --- a/Engine/source/gfx/gfxStateBlock.h +++ b/Engine/source/gfx/gfxStateBlock.h @@ -49,6 +49,8 @@ struct GFXSamplerStateDesc GFXCmpFunc samplerFunc; + LinearColorF borderColor; + /// The maximum anisotropy used when one of the filter types /// is set to anisotropic. /// diff --git a/Engine/source/gfx/gl/gfxGLEnumTranslate.cpp b/Engine/source/gfx/gl/gfxGLEnumTranslate.cpp index 93c8ee57c..b5b56fc6f 100644 --- a/Engine/source/gfx/gl/gfxGLEnumTranslate.cpp +++ b/Engine/source/gfx/gl/gfxGLEnumTranslate.cpp @@ -93,7 +93,7 @@ void GFXGLEnumTranslate::init() GFXGLTextureAddress[GFXAddressWrap] = GL_REPEAT; GFXGLTextureAddress[GFXAddressMirror] = GL_REPEAT; GFXGLTextureAddress[GFXAddressClamp] = GL_CLAMP_TO_EDGE; - GFXGLTextureAddress[GFXAddressBorder] = GL_REPEAT; + GFXGLTextureAddress[GFXAddressBorder] = GL_CLAMP_TO_BORDER; GFXGLTextureAddress[GFXAddressMirrorOnce] = GL_REPEAT; // Stencil ops diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 198292dbc..9d60401cc 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -220,6 +220,7 @@ void GFXGLTextureObject::initSamplerState(const GFXSamplerStateDesc &ssd) if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) glTexParameterf(mBinding, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); + glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, ssd.borderColor); mNeedInitSamplerState = false; mSampler = ssd; } diff --git a/Engine/source/gfx/sim/gfxStateBlockData.cpp b/Engine/source/gfx/sim/gfxStateBlockData.cpp index 9b015559d..ffbd36f76 100644 --- a/Engine/source/gfx/sim/gfxStateBlockData.cpp +++ b/Engine/source/gfx/sim/gfxStateBlockData.cpp @@ -315,6 +315,8 @@ void GFXSamplerStateData::initPersistFields() endGroup( "Filter State" ); + addField("borderColor", TypeColorF, Offset(mState.borderColor, GFXSamplerStateData), ""); + addField("samplerFunc", TypeGFXCmpFunc, Offset(mState.samplerFunc, GFXSamplerStateData), "Compares sampled data against existing sampled data. The default is GFXCmpNever."); } From 63b2aba46771ceee484b4f27649dc167ce8c86a5 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 19 Jul 2023 15:41:24 +0100 Subject: [PATCH 5/7] Apply suggestions from code review --- Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp | 9 +++++---- Engine/source/gfx/gfxStateBlock.cpp | 2 +- Engine/source/gfx/gfxStateBlock.h | 2 +- Engine/source/gfx/gl/gfxGLTextureObject.cpp | 4 +++- Engine/source/gfx/sim/gfxStateBlockData.cpp | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp index f2197c929..a7a3789b7 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11StateBlock.cpp @@ -186,10 +186,11 @@ GFXD3D11StateBlock::GFXD3D11StateBlock(const GFXStateBlockDesc& desc) else mSamplerDesc[i].Filter = comparison ? D3D11_FILTER_COMPARISON_ANISOTROPIC : D3D11_FILTER_ANISOTROPIC; - mSamplerDesc[i].BorderColor[0] = gfxSamplerState.borderColor.red; - mSamplerDesc[i].BorderColor[1] = gfxSamplerState.borderColor.green; - mSamplerDesc[i].BorderColor[2] = gfxSamplerState.borderColor.blue; - mSamplerDesc[i].BorderColor[3] = gfxSamplerState.borderColor.alpha; + LinearColorF bc = LinearColorF(gfxSamplerState.borderColor); + mSamplerDesc[i].BorderColor[0] = bc.red; + mSamplerDesc[i].BorderColor[1] = bc.green; + mSamplerDesc[i].BorderColor[2] = bc.blue; + mSamplerDesc[i].BorderColor[3] = bc.alpha; mSamplerDesc[i].ComparisonFunc = GFXD3D11CmpFunc[gfxSamplerState.samplerFunc]; hr = D3D11DEVICE->CreateSamplerState(&mSamplerDesc[i], &mSamplerStates[i]); diff --git a/Engine/source/gfx/gfxStateBlock.cpp b/Engine/source/gfx/gfxStateBlock.cpp index 80d3289ee..66f19e54c 100644 --- a/Engine/source/gfx/gfxStateBlock.cpp +++ b/Engine/source/gfx/gfxStateBlock.cpp @@ -278,7 +278,7 @@ GFXSamplerStateDesc::GFXSamplerStateDesc() samplerFunc = GFXCmpNever; maxAnisotropy = 1; mipLODBias = 0.0f; - borderColor = LinearColorF::WHITE; + borderColor = ColorI::WHITE; } GFXSamplerStateDesc GFXSamplerStateDesc::getWrapLinear() diff --git a/Engine/source/gfx/gfxStateBlock.h b/Engine/source/gfx/gfxStateBlock.h index 5cefd381a..21ca5b4d5 100644 --- a/Engine/source/gfx/gfxStateBlock.h +++ b/Engine/source/gfx/gfxStateBlock.h @@ -49,7 +49,7 @@ struct GFXSamplerStateDesc GFXCmpFunc samplerFunc; - LinearColorF borderColor; + ColorI borderColor; /// The maximum anisotropy used when one of the filter types /// is set to anisotropic. diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 9d60401cc..07f72802f 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -220,7 +220,9 @@ void GFXGLTextureObject::initSamplerState(const GFXSamplerStateDesc &ssd) if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) glTexParameterf(mBinding, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); - glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, ssd.borderColor); + LinearColorF bc = LinearColorF(ssd.borderColor); + GLfloat color[4]={bc.red, bc.green, bc.blue, bc.alpha}; + glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, color); mNeedInitSamplerState = false; mSampler = ssd; } diff --git a/Engine/source/gfx/sim/gfxStateBlockData.cpp b/Engine/source/gfx/sim/gfxStateBlockData.cpp index ffbd36f76..853250221 100644 --- a/Engine/source/gfx/sim/gfxStateBlockData.cpp +++ b/Engine/source/gfx/sim/gfxStateBlockData.cpp @@ -315,7 +315,7 @@ void GFXSamplerStateData::initPersistFields() endGroup( "Filter State" ); - addField("borderColor", TypeColorF, Offset(mState.borderColor, GFXSamplerStateData), ""); + addField("borderColor", TypeColorI, Offset(mState.borderColor, GFXSamplerStateData), ""); addField("samplerFunc", TypeGFXCmpFunc, Offset(mState.samplerFunc, GFXSamplerStateData), "Compares sampled data against existing sampled data. The default is GFXCmpNever."); From e0119efbb5e00a97a93b27d5cf07ccbee3f0fb1d Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Wed, 19 Jul 2023 16:33:01 +0100 Subject: [PATCH 6/7] move border to gfxglstateblock --- Engine/source/gfx/gl/gfxGLStateBlock.cpp | 11 ++++++++++- Engine/source/gfx/gl/gfxGLTextureObject.cpp | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Engine/source/gfx/gl/gfxGLStateBlock.cpp b/Engine/source/gfx/gl/gfxGLStateBlock.cpp index 12eab71b0..1d2968776 100644 --- a/Engine/source/gfx/gl/gfxGLStateBlock.cpp +++ b/Engine/source/gfx/gl/gfxGLStateBlock.cpp @@ -55,7 +55,16 @@ GFXGLStateBlock::GFXGLStateBlock(const GFXStateBlockDesc& desc) : glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GFXGLTextureAddress[ssd.addressModeU]); glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GFXGLTextureAddress[ssd.addressModeV]); glSamplerParameteri(id, GL_TEXTURE_WRAP_R, GFXGLTextureAddress[ssd.addressModeW]); - + + if (ssd.addressModeU == GFXAddressBorder || + ssd.addressModeV == GFXAddressBorder || + ssd.addressModeW == GFXAddressBorder) + { + LinearColorF bc = LinearColorF(ssd.borderColor); + GLfloat color[4] = { bc.red, bc.green, bc.blue, bc.alpha }; + glSamplerParameterfv(id, GL_TEXTURE_BORDER_COLOR, color); + } + //compare modes const bool comparison = ssd.samplerFunc != GFXCmpNever; glSamplerParameteri(id, GL_TEXTURE_COMPARE_MODE, comparison ? GL_COMPARE_R_TO_TEXTURE_ARB : GL_NONE ); diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 07f72802f..06ee43dc0 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -219,10 +219,7 @@ void GFXGLTextureObject::initSamplerState(const GFXSamplerStateDesc &ssd) glTexParameteri(mBinding, GL_TEXTURE_WRAP_R, GFXGLTextureAddress[ssd.addressModeW]); if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() ) glTexParameterf(mBinding, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy); - - LinearColorF bc = LinearColorF(ssd.borderColor); - GLfloat color[4]={bc.red, bc.green, bc.blue, bc.alpha}; - glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, color); + mNeedInitSamplerState = false; mSampler = ssd; } From a0f2f2bf06591511c0857a6c97a8b7a44a52bd2b Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 20 Jul 2023 08:54:52 -0500 Subject: [PATCH 7/7] define particles then emitters saves a re-execution attempt --- .../BaseGame/game/data/ExampleModule/ExampleModule.tscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript index ddb70fa85..63c051431 100644 --- a/Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript +++ b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.tscript @@ -24,10 +24,10 @@ function ExampleModule::onCreateGameServer(%this) %this.registerDatablock("./scripts/managedData/managedForestItemData"); if(isFile("./scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension)) %this.registerDatablock("./scripts/managedData/managedForestBrushData"); - if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension)) - %this.registerDatablock("./scripts/managedData/managedParticleEmitterData"); if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension)) %this.registerDatablock("./scripts/managedData/managedParticleData"); + if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension)) + %this.registerDatablock("./scripts/managedData/managedParticleEmitterData"); } //This is called when the server is shut down due to the game/map being exited