From 1185bd464092f372430cbfaa15a7be4dcaa90752 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 6 Nov 2018 14:28:25 -0500 Subject: Feature/shared library refactor (#712) * * Added ISlangSharedLibraryLoader and ISlangSharedLibrary * Implemented default implementations * Added slang API function to get/set the ISlangSharedLibraryLoader on the session * Put function caching onto the Session - so that if the loader is chaged, its easy to reset the shared libraries, and functions * Run premake. * Fix problem with setting null, would cause an unnecessary function/shared lib flush. * * Unload SharedLibrary when DefaultSharedLibrary is deleted. * Make SharedLibrary handle unload safely if already unloaded. * Refactor SharedLibrary, such that it becomes a utility class - simplifying it's semantics. * Simplified ISlangSharedLibrary such that doesn't have unload and isLoaded so easier to implement. Use updated SharedLibrary impl. * Disable aarch64 on windows * Premake windows files without aarch64 build. * Moved slang-shared-library to core (so can be used in code outside of main slang) Fixed problem in premake5 where on windows projects were incorrectly constructed * Allowed RefObject to base class of com types Added ConfigurableSharedLibraryLoader Added -dxc-path -fxc-path -glslang-path Fix problem with dxc-path not honoring it's path when loading dxil * Added documentation for command line control of dll loading paths. * Remove some tabbing issues. * Change name of include guard. --- source/core/smart-pointer.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/core/smart-pointer.h') diff --git a/source/core/smart-pointer.h b/source/core/smart-pointer.h index abd7763ee..dd00acabd 100644 --- a/source/core/smart-pointer.h +++ b/source/core/smart-pointer.h @@ -32,23 +32,25 @@ namespace Slang virtual ~RefObject() {} - void addReference() + UInt addReference() { - referenceCount++; + return ++referenceCount; } - void decreaseReference() + UInt decreaseReference() { - --referenceCount; + return --referenceCount; } - void releaseReference() + UInt releaseReference() { SLANG_ASSERT(referenceCount != 0); if(--referenceCount == 0) { delete this; + return 0; } + return referenceCount; } bool isUniquelyReferenced() -- cgit v1.2.3