Przeglądaj źródła

Change the Bool type to C++'s bool

Panagiotis Christopoulos Charitos 7 lat temu
rodzic
commit
2be41f9205
62 zmienionych plików z 150 dodań i 138 usunięć
  1. 1 1
      src/anki/collision/ConvexHullShape.h
  2. 1 1
      src/anki/core/App.h
  3. 1 1
      src/anki/core/NativeWindow.h
  4. 1 1
      src/anki/core/StdinListener.h
  5. 2 2
      src/anki/gr/RenderGraph.cpp
  6. 6 6
      src/anki/gr/RenderGraph.h
  7. 5 5
      src/anki/gr/gl/CommandBuffer.cpp
  8. 2 2
      src/anki/gr/gl/CommandBufferImpl.cpp
  9. 2 2
      src/anki/gr/gl/CommandBufferImpl.h
  10. 1 1
      src/anki/gr/gl/Common.cpp
  11. 2 6
      src/anki/gr/gl/Common.h
  12. 2 2
      src/anki/gr/gl/FramebufferImpl.h
  13. 2 2
      src/anki/gr/gl/GlState.h
  14. 1 1
      src/anki/gr/gl/RenderingThread.h
  15. 1 1
      src/anki/gr/gl/ShaderProgramImpl.h
  16. 3 3
      src/anki/gr/gl/StateTracker.h
  17. 1 1
      src/anki/gr/gl/TextureImpl.h
  18. 1 1
      src/anki/gr/vulkan/BufferImpl.h
  19. 6 6
      src/anki/gr/vulkan/CommandBufferImpl.h
  20. 2 2
      src/anki/gr/vulkan/DescriptorSet.h
  21. 1 1
      src/anki/gr/vulkan/FramebufferImpl.h
  22. 1 1
      src/anki/gr/vulkan/GpuMemoryManager.cpp
  23. 1 1
      src/anki/gr/vulkan/GpuMemoryManager.h
  24. 3 3
      src/anki/gr/vulkan/GrManagerImpl.h
  25. 7 7
      src/anki/gr/vulkan/Pipeline.h
  26. 1 1
      src/anki/gr/vulkan/SwapchainFactory.h
  27. 1 1
      src/anki/input/Input.h
  28. 3 3
      src/anki/physics/PhysicsWorld.cpp
  29. 1 1
      src/anki/physics/PhysicsWorld.h
  30. 2 2
      src/anki/renderer/Dbg.h
  31. 1 1
      src/anki/renderer/MainRenderer.h
  32. 1 1
      src/anki/renderer/RenderQueue.h
  33. 2 2
      src/anki/renderer/ShadowMapping.cpp
  34. 1 1
      src/anki/renderer/TileAllocator.h
  35. 3 3
      src/anki/resource/AsyncLoader.h
  36. 2 2
      src/anki/resource/MaterialResource.h
  37. 1 1
      src/anki/resource/ParticleEmitterResource.h
  38. 3 3
      src/anki/resource/RenderingKey.h
  39. 2 2
      src/anki/resource/ResourceFilesystem.h
  40. 5 5
      src/anki/resource/ShaderProgramPreProcessor.h
  41. 3 3
      src/anki/resource/ShaderProgramResource.h
  42. 1 1
      src/anki/scene/ParticleEmitterNode.h
  43. 1 1
      src/anki/scene/SceneNode.h
  44. 1 1
      src/anki/scene/components/DecalComponent.h
  45. 1 1
      src/anki/scene/components/FogDensityComponent.h
  46. 1 1
      src/anki/scene/components/ReflectionProbeComponent.h
  47. 2 2
      src/anki/scene/components/RenderComponent.h
  48. 1 1
      src/anki/scene/components/SkinComponent.h
  49. 3 3
      src/anki/scene/components/SpatialComponent.h
  50. 2 2
      src/anki/scene/events/Event.h
  51. 1 1
      src/anki/script/lua_glue_gen.py
  52. 1 1
      src/anki/ui/Canvas.h
  53. 1 1
      src/anki/util/Allocator.h
  54. 1 1
      src/anki/util/BitSet.h
  55. 1 1
      src/anki/util/Enum.h
  56. 1 1
      src/anki/util/Memory.h
  57. 1 1
      src/anki/util/Ptr.h
  58. 4 5
      src/anki/util/StdTypes.h
  59. 8 0
      src/anki/util/String.cpp
  60. 28 19
      src/anki/util/String.h
  61. 1 1
      src/anki/util/Thread.h
  62. 1 1
      src/anki/util/ThreadPool.cpp

+ 1 - 1
src/anki/collision/ConvexHullShape.h

@@ -104,7 +104,7 @@ private:
 #endif
 		;
 
-	Bool8 m_trfIdentity; ///< Optimization.
+	Bool m_trfIdentity; ///< Optimization.
 
 	void check() const
 	{

+ 1 - 1
src/anki/core/App.h

@@ -170,7 +170,7 @@ private:
 
 	// Misc
 	UiImmediateModeBuilderPtr m_statsUi;
-	Bool8 m_displayStats = false;
+	Bool m_displayStats = false;
 	Timestamp m_globalTimestamp = 1;
 	ThreadHive* m_threadHive = nullptr;
 	String m_settingsDir; ///< The path that holds the configuration

+ 1 - 1
src/anki/core/NativeWindow.h

@@ -29,7 +29,7 @@ public:
 	U32 m_samplesCount = 0;
 	static const Bool m_doubleBuffer = true;
 	/// Create a fullscreen window with the desktop's resolution
-	Bool8 m_fullscreenDesktopRez = false;
+	Bool m_fullscreenDesktopRez = false;
 
 	CString m_title = "Untitled window";
 };

+ 1 - 1
src/anki/core/StdinListener.h

@@ -37,7 +37,7 @@ private:
 	List<String> m_q;
 	Mutex m_mtx; ///< Protect the queue
 	Thread m_thrd; ///< The thread
-	Bool8 m_quit = false;
+	Bool m_quit = false;
 
 	static Error workingFunc(ThreadCallbackInfo& info); ///< The thread function
 };

+ 2 - 2
src/anki/gr/RenderGraph.cpp

@@ -61,7 +61,7 @@ public:
 		BufferInfo m_buffer;
 	};
 
-	Bool8 m_isTexture;
+	Bool m_isTexture;
 
 	Barrier(U32 rtIdx, TextureUsageBit usageBefore, TextureUsageBit usageAfter, const TextureSurfaceInfo& surf)
 		: m_texture({rtIdx, usageBefore, usageAfter, surf})
@@ -94,7 +94,7 @@ public:
 	Array<TextureUsageBit, MAX_COLOR_ATTACHMENTS> m_colorUsages = {}; ///< For beginRender pass
 	TextureUsageBit m_dsUsage = TextureUsageBit::NONE; ///< For beginRender pass
 
-	Bool8 m_drawsToPresentable = false;
+	Bool m_drawsToPresentable = false;
 
 	/// WARNING: Should be the same as RenderPassDependency::TextureInfo
 	class ConsumedTextureInfo

+ 6 - 6
src/anki/gr/RenderGraph.h

@@ -41,12 +41,12 @@ class RenderTargetHandle
 	friend class RenderPassDescriptionBase;
 
 public:
-	bool operator==(const RenderTargetHandle& b) const
+	Bool operator==(const RenderTargetHandle& b) const
 	{
 		return m_idx == b.m_idx;
 	}
 
-	bool operator!=(const RenderTargetHandle& b) const
+	Bool operator!=(const RenderTargetHandle& b) const
 	{
 		return m_idx != b.m_idx;
 	}
@@ -76,12 +76,12 @@ class RenderPassBufferHandle
 public:
 	operator BufferPtr() const;
 
-	bool operator==(const RenderPassBufferHandle& b) const
+	Bool operator==(const RenderPassBufferHandle& b) const
 	{
 		return m_idx == b.m_idx;
 	}
 
-	bool operator!=(const RenderPassBufferHandle& b) const
+	Bool operator!=(const RenderPassBufferHandle& b) const
 	{
 		return m_idx != b.m_idx;
 	}
@@ -257,7 +257,7 @@ private:
 		BufferInfo m_buffer;
 	};
 
-	Bool8 m_isTexture;
+	Bool m_isTexture;
 };
 
 /// The base of compute/transfer and graphics renderpasses for RenderGraph.
@@ -309,7 +309,7 @@ protected:
 	BitSet<MAX_RENDER_GRAPH_RENDER_TARGETS, U64> m_writeRtMask = {false};
 	BitSet<MAX_RENDER_GRAPH_BUFFERS, U64> m_readBuffMask = {false};
 	BitSet<MAX_RENDER_GRAPH_BUFFERS, U64> m_writeBuffMask = {false};
-	Bool8 m_hasBufferDeps = false; ///< Opt.
+	Bool m_hasBufferDeps = false; ///< Opt.
 
 	String m_name;
 

+ 5 - 5
src/anki/gr/gl/CommandBuffer.cpp

@@ -61,7 +61,7 @@ void CommandBuffer::bindVertexBuffer(
 		U32 m_binding;
 		PtrSize m_offset;
 		PtrSize m_stride;
-		Bool8 m_instanced;
+		Bool m_instanced;
 
 		Cmd(U32 binding, BufferPtr buff, PtrSize offset, PtrSize stride, Bool instanced)
 			: m_buff(buff)
@@ -99,7 +99,7 @@ void CommandBuffer::setVertexAttribute(U32 location, U32 buffBinding, Format fmt
 		U32 m_buffBinding;
 		U8 m_compSize;
 		GLenum m_fmt;
-		Bool8 m_normalized;
+		Bool m_normalized;
 		PtrSize m_relativeOffset;
 
 		Cmd(U32 location, U32 buffBinding, U8 compSize, GLenum fmt, Bool normalized, PtrSize relativeOffset)
@@ -167,7 +167,7 @@ void CommandBuffer::setPrimitiveRestart(Bool enable)
 	class Cmd final : public GlCommand
 	{
 	public:
-		Bool8 m_enable;
+		Bool m_enable;
 
 		Cmd(Bool enable)
 			: m_enable(enable)
@@ -455,7 +455,7 @@ void CommandBuffer::setDepthWrite(Bool enable)
 	class Cmd final : public GlCommand
 	{
 	public:
-		Bool8 m_enable;
+		Bool m_enable;
 
 		Cmd(Bool enable)
 			: m_enable(enable)
@@ -795,7 +795,7 @@ void CommandBuffer::bindTextureBuffer(U32 set, U32 binding, BufferPtr buff, PtrS
 		}
 	};
 
-	Bool8 compressed;
+	Bool compressed;
 	GLenum format;
 	GLenum internalFormat;
 	GLenum type;

+ 2 - 2
src/anki/gr/gl/CommandBufferImpl.cpp

@@ -236,7 +236,7 @@ void CommandBufferImpl::flushDrawcall(CommandBuffer& cmdb)
 	class DepthTestCmd final : public GlCommand
 	{
 	public:
-		Bool8 m_enable;
+		Bool m_enable;
 
 		DepthTestCmd(Bool enable)
 			: m_enable(enable)
@@ -265,7 +265,7 @@ void CommandBufferImpl::flushDrawcall(CommandBuffer& cmdb)
 	class StencilTestCmd final : public GlCommand
 	{
 	public:
-		Bool8 m_enable;
+		Bool m_enable;
 
 		StencilTestCmd(Bool enable)
 			: m_enable(enable)

+ 2 - 2
src/anki/gr/gl/CommandBufferImpl.h

@@ -45,11 +45,11 @@ public:
 	GlCommand* m_firstCommand = nullptr;
 	GlCommand* m_lastCommand = nullptr;
 	CommandBufferAllocator<U8> m_alloc;
-	Bool8 m_immutable = false;
+	Bool m_immutable = false;
 	CommandBufferFlag m_flags;
 
 #if ANKI_EXTRA_CHECKS
-	Bool8 m_executed = false;
+	Bool m_executed = false;
 #endif
 
 	StateTracker m_state;

+ 1 - 1
src/anki/gr/gl/Common.cpp

@@ -272,7 +272,7 @@ GLenum convertBlendFactor(BlendFactor in)
 }
 
 void convertTextureInformation(
-	Format pf, Bool8& compressed, GLenum& format, GLenum& internalFormat, GLenum& type, DepthStencilAspectBit& dsAspect)
+	Format pf, Bool& compressed, GLenum& format, GLenum& internalFormat, GLenum& type, DepthStencilAspectBit& dsAspect)
 {
 	compressed = formatIsCompressed(pf);
 	dsAspect = computeFormatAspect(pf);

+ 2 - 6
src/anki/gr/gl/Common.h

@@ -178,12 +178,8 @@ inline GLenum convertPrimitiveTopology(PrimitiveTopology ak)
 	return out;
 }
 
-void convertTextureInformation(Format pf,
-	Bool8& compressed,
-	GLenum& format,
-	GLenum& internalFormat,
-	GLenum& type,
-	DepthStencilAspectBit& dsAspect);
+void convertTextureInformation(
+	Format pf, Bool& compressed, GLenum& format, GLenum& internalFormat, GLenum& type, DepthStencilAspectBit& dsAspect);
 /// @}
 
 } // end namespace anki

+ 2 - 2
src/anki/gr/gl/FramebufferImpl.h

@@ -49,8 +49,8 @@ private:
 	Array<GLenum, MAX_COLOR_ATTACHMENTS> m_drawBuffers;
 	Array<GLenum, MAX_COLOR_ATTACHMENTS + 1> m_invalidateBuffers;
 	U8 m_invalidateBuffersCount = 0;
-	Bool8 m_clearDepth = false;
-	Bool8 m_clearStencil = false;
+	Bool m_clearDepth = false;
+	Bool m_clearStencil = false;
 
 	/// Attach a texture
 	static void attachTextureInternal(

+ 2 - 2
src/anki/gr/gl/GlState.h

@@ -28,7 +28,7 @@ public:
 	GlExtensions m_extensions = GlExtensions::NONE;
 	I32 m_version = -1; ///< Minor major GL version. Something like 430
 	GpuVendor m_gpu = GpuVendor::UNKNOWN;
-	Bool8 m_registerMessages = false;
+	Bool m_registerMessages = false;
 
 	ShaderProgramPtr m_crntProg;
 
@@ -48,7 +48,7 @@ public:
 		{{true, true, true, true}},
 		{{true, true, true, true}}}};
 
-	Bool8 m_depthWriteMask = true;
+	Bool m_depthWriteMask = true;
 
 	Array<U32, 2> m_stencilWriteMask = {{MAX_U32, MAX_U32}};
 	/// @}

+ 1 - 1
src/anki/gr/gl/RenderingThread.h

@@ -67,7 +67,7 @@ private:
 	CommandBufferPtr m_swapBuffersCommands;
 	ConditionVariable m_frameCondVar;
 	Mutex m_frameMtx;
-	Bool8 m_frameWait = false;
+	Bool m_frameWait = false;
 	/// @}
 
 	ThreadId m_serverThreadId;

+ 1 - 1
src/anki/gr/gl/ShaderProgramImpl.h

@@ -50,7 +50,7 @@ public:
 private:
 	Array<ShaderPtr, U(ShaderType::COUNT)> m_shaders;
 	ShaderProgramImplReflection m_refl;
-	Bool8 m_reflInitialized = false;
+	Bool m_reflInitialized = false;
 
 	ANKI_USE_RESULT Error link(GLuint vert, GLuint frag);
 };

+ 3 - 3
src/anki/gr/gl/StateTracker.h

@@ -136,7 +136,7 @@ public:
 	/// @name scissor_state
 	/// @{
 	Array<GLsizei, 4> m_scissor = {{0, 0, MAX_I32, MAX_I32}};
-	Bool8 m_scissorSet = false;
+	Bool m_scissorSet = false;
 
 	Bool setScissor(GLsizei minx, GLsizei miny, GLsizei width, GLsizei height)
 	{
@@ -245,7 +245,7 @@ public:
 		return changed;
 	}
 
-	Array<Bool8, 2> m_glStencilFuncSeparateDirty = {{false, false}};
+	Array<Bool, 2> m_glStencilFuncSeparateDirty = {{false, false}};
 	Array<CompareOperation, 2> m_stencilCompare = {{CompareOperation::COUNT, CompareOperation::COUNT}};
 
 	void setStencilCompareOperation(FaceSelectionBit face, CompareOperation comp)
@@ -374,7 +374,7 @@ public:
 	{
 	public:
 		ColorBit m_writeMask = INVALID_COLOR_MASK;
-		Bool8 m_enableBlend = 2;
+		Bool m_enableBlend = 2;
 		BlendFactor m_blendSrcFactorRgb = BlendFactor::COUNT;
 		BlendFactor m_blendDstFactorRgb = BlendFactor::COUNT;
 		BlendFactor m_blendSrcFactorA = BlendFactor::COUNT;

+ 1 - 1
src/anki/gr/gl/TextureImpl.h

@@ -33,7 +33,7 @@ public:
 	GLenum m_glType = GL_NONE;
 	U32 m_surfaceCountPerLevel = 0;
 	U8 m_faceCount = 0; ///< 6 for cubes and 1 for the rest.
-	Bool8 m_compressed = false;
+	Bool m_compressed = false;
 
 	TextureImpl(GrManager* manager, CString name)
 		: Texture(manager, name)

+ 1 - 1
src/anki/gr/vulkan/BufferImpl.h

@@ -72,7 +72,7 @@ private:
 	PtrSize m_actualSize = 0;
 
 #if ANKI_EXTRA_CHECKS
-	Bool8 m_mapped = false;
+	Bool m_mapped = false;
 #endif
 
 	Bool isCreated() const

+ 6 - 6
src/anki/gr/vulkan/CommandBufferImpl.h

@@ -339,10 +339,10 @@ private:
 	MicroCommandBufferPtr m_microCmdb;
 	VkCommandBuffer m_handle = VK_NULL_HANDLE;
 	CommandBufferFlag m_flags = CommandBufferFlag::NONE;
-	Bool8 m_renderedToDefaultFb = false;
-	Bool8 m_finalized = false;
-	Bool8 m_empty = true;
-	Bool8 m_beganRecording = false;
+	Bool m_renderedToDefaultFb = false;
+	Bool m_finalized = false;
+	Bool m_empty = true;
+	Bool m_beganRecording = false;
 	ThreadId m_tid = ~ThreadId(0);
 #if ANKI_EXTRA_CHECKS
 	U32 m_commandCount = 0;
@@ -372,9 +372,9 @@ private:
 	/// @{
 	Array<U32, 4> m_viewport = {{0, 0, 0, 0}};
 	Array<U32, 4> m_scissor = {{0, 0, MAX_U32, MAX_U32}};
-	Bool8 m_viewportDirty = true;
+	Bool m_viewportDirty = true;
 	VkViewport m_lastViewport = {};
-	Bool8 m_scissorDirty = true;
+	Bool m_scissorDirty = true;
 	VkRect2D m_lastScissor = {{-1, -1}, {MAX_U32, MAX_U32}};
 	Array<U32, 2> m_stencilCompareMasks = {{0x5A5A5A5A, 0x5A5A5A5A}}; ///< Use a stupid number to initialize.
 	Array<U32, 2> m_stencilWriteMasks = {{0x5A5A5A5A, 0x5A5A5A5A}};

+ 2 - 2
src/anki/gr/vulkan/DescriptorSet.h

@@ -176,8 +176,8 @@ private:
 
 	Array<AnyBinding, MAX_BINDINGS_PER_DESCRIPTOR_SET> m_bindings;
 
-	Bool8 m_anyBindingDirty = true;
-	Bool8 m_layoutDirty = true;
+	Bool m_anyBindingDirty = true;
+	Bool m_layoutDirty = true;
 	BitSet<MAX_BINDINGS_PER_DESCRIPTOR_SET> m_dynamicOffsetDirty = {true};
 	U64 m_lastHash = 0;
 

+ 1 - 1
src/anki/gr/vulkan/FramebufferImpl.h

@@ -110,7 +110,7 @@ private:
 
 	U32 m_width = 0;
 	U32 m_height = 0;
-	Bool8 m_presentableTex = false;
+	Bool m_presentableTex = false;
 
 	Array<TextureViewPtr, MAX_COLOR_ATTACHMENTS + 1> m_refs; ///< @note The pos of every attachment is fixed.
 

+ 1 - 1
src/anki/gr/vulkan/GpuMemoryManager.cpp

@@ -160,7 +160,7 @@ public:
 class GpuMemoryManager::ClassAllocator : public ClassGpuAllocator
 {
 public:
-	Bool8 m_isDeviceMemory;
+	Bool m_isDeviceMemory;
 };
 
 GpuMemoryManager::~GpuMemoryManager()

+ 1 - 1
src/anki/gr/vulkan/GpuMemoryManager.h

@@ -31,7 +31,7 @@ public:
 private:
 	ClassGpuAllocatorHandle m_classHandle;
 	U8 m_memTypeIdx = MAX_U8;
-	Bool8 m_linear = false;
+	Bool m_linear = false;
 };
 
 /// Dynamic GPU memory allocator for all types.

+ 3 - 3
src/anki/gr/vulkan/GrManagerImpl.h

@@ -294,9 +294,9 @@ private:
 
 	PipelineCache m_pplineCache;
 
-	Bool8 m_r8g8b8ImagesSupported = false;
-	Bool8 m_s8ImagesSupported = false;
-	Bool8 m_d24S8ImagesSupported = false;
+	Bool m_r8g8b8ImagesSupported = false;
+	Bool m_s8ImagesSupported = false;
+	Bool m_d24S8ImagesSupported = false;
 
 	mutable HashMap<U64, StringAuto> m_vkHandleToName;
 	mutable SpinLock m_vkHandleToNameLock;

+ 7 - 7
src/anki/gr/vulkan/Pipeline.h

@@ -65,7 +65,7 @@ class PPInputAssemblerStateInfo : public NonCopyable
 {
 public:
 	PrimitiveTopology m_topology = PrimitiveTopology::TRIANGLES;
-	Bool8 m_primitiveRestartEnabled = false;
+	Bool m_primitiveRestartEnabled = false;
 };
 
 class PPTessellationStateInfo : public NonCopyable
@@ -77,7 +77,7 @@ public:
 class PPViewportStateInfo : public NonCopyable
 {
 public:
-	Bool8 m_scissorEnabled = false;
+	Bool m_scissorEnabled = false;
 };
 
 class PPRasterizerStateInfo : public NonCopyable
@@ -93,7 +93,7 @@ public:
 class PPDepthStateInfo : public NonCopyable
 {
 public:
-	Bool8 m_depthWriteEnabled = true;
+	Bool m_depthWriteEnabled = true;
 	CompareOperation m_depthCompareFunction = CompareOperation::LESS;
 };
 
@@ -127,7 +127,7 @@ public:
 class PPColorStateInfo : public NonCopyable
 {
 public:
-	Bool8 m_alphaToCoverageEnabled = false;
+	Bool m_alphaToCoverageEnabled = false;
 	Array<PPColorAttachmentStateInfo, MAX_COLOR_ATTACHMENTS> m_attachments;
 };
 
@@ -500,9 +500,9 @@ private:
 	BitSet<MAX_COLOR_ATTACHMENTS, U8> m_shaderColorAttachmentWritemask = {false};
 
 	// Renderpass info
-	Bool8 m_fbDepth = false;
-	Bool8 m_fbStencil = false;
-	Bool8 m_defaultFb = false;
+	Bool m_fbDepth = false;
+	Bool m_fbStencil = false;
+	Bool m_defaultFb = false;
 	BitSet<MAX_COLOR_ATTACHMENTS, U8> m_fbColorAttachmentMask = {false};
 	VkRenderPass m_rpass = VK_NULL_HANDLE;
 	FramebufferPtr m_fb; ///< Hold the reference.

+ 1 - 1
src/anki/gr/vulkan/SwapchainFactory.h

@@ -102,7 +102,7 @@ public:
 
 private:
 	GrManagerImpl* m_gr = nullptr;
-	Bool8 m_vsync = false;
+	Bool m_vsync = false;
 	MicroObjectRecycler<MicroSwapchain> m_recycler;
 };
 /// @}

+ 1 - 1
src/anki/input/Input.h

@@ -121,7 +121,7 @@ private:
 
 	Array<U8, static_cast<U>(InputEvent::COUNT)> m_events;
 
-	Bool8 m_lockCurs = false;
+	Bool m_lockCurs = false;
 
 	/// Initialize the platform's input system
 	ANKI_USE_RESULT Error initInternal(NativeWindow* nativeWindow);

+ 3 - 3
src/anki/physics/PhysicsWorld.cpp

@@ -32,7 +32,7 @@ static void btFree(void* ptr)
 class PhysicsWorld::MyOverlapFilterCallback : public btOverlapFilterCallback
 {
 public:
-	bool needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) const override
+	Bool needBroadphaseCollision(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) const override
 	{
 		ANKI_ASSERT(proxy0 && proxy1);
 
@@ -94,7 +94,7 @@ class PhysicsWorld::MyRaycastCallback : public btCollisionWorld::RayResultCallba
 public:
 	PhysicsWorldRayCastCallback* m_raycast = nullptr;
 
-	bool needsCollision(btBroadphaseProxy* proxy) const override
+	Bool needsCollision(btBroadphaseProxy* proxy) const override
 	{
 		ANKI_ASSERT(proxy);
 
@@ -109,7 +109,7 @@ public:
 		return !!(fobj->getMaterialGroup() & m_raycast->m_materialMask);
 	}
 
-	btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) final
+	btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, Bool normalInWorldSpace) final
 	{
 		// No idea why
 		if(m_raycast->m_firstHit)

+ 1 - 1
src/anki/physics/PhysicsWorld.h

@@ -24,7 +24,7 @@ public:
 	Vec3 m_from;
 	Vec3 m_to;
 	PhysicsMaterialBit m_materialMask; ///< Materials to check
-	Bool8 m_firstHit = true;
+	Bool m_firstHit = true;
 
 	PhysicsWorldRayCastCallback(const Vec3& from, const Vec3& to, PhysicsMaterialBit materialMask)
 		: m_from(from)

+ 2 - 2
src/anki/renderer/Dbg.h

@@ -76,8 +76,8 @@ anki_internal:
 	}
 
 private:
-	Bool8 m_enabled = false;
-	Bool8 m_initialized = false; ///< Lazily initialize.
+	Bool m_enabled = false;
+	Bool m_initialized = false; ///< Lazily initialize.
 	RenderTargetDescription m_rtDescr;
 	FramebufferDescription m_fbDescr;
 	BitSet<U(RenderQueueDebugDrawFlag::COUNT), U32> m_debugDrawFlags = {false};

+ 1 - 1
src/anki/renderer/MainRenderer.h

@@ -72,7 +72,7 @@ private:
 	StackAllocator<U8> m_frameAlloc;
 
 	UniquePtr<Renderer> m_r;
-	Bool8 m_rDrawToDefaultFb = false;
+	Bool m_rDrawToDefaultFb = false;
 
 	ShaderProgramResourcePtr m_blitProg;
 	ShaderProgramPtr m_blitGrProg;

+ 1 - 1
src/anki/renderer/RenderQueue.h

@@ -247,7 +247,7 @@ public:
 	};
 
 	F32 m_density;
-	Bool8 m_isBox;
+	Bool m_isBox;
 
 	FogDensityQueueElement()
 	{

+ 2 - 2
src/anki/renderer/ShadowMapping.cpp

@@ -39,8 +39,8 @@ public:
 	Array<U32, 4> m_viewportOut; ///< Viewport in the ESM RT.
 	F32 m_cameraNear;
 	F32 m_cameraFar;
-	Bool8 m_blur;
-	Bool8 m_perspectiveProjection;
+	Bool m_blur;
+	Bool m_perspectiveProjection;
 };
 
 ShadowMapping::~ShadowMapping()

+ 1 - 1
src/anki/renderer/TileAllocator.h

@@ -57,7 +57,7 @@ private:
 	U16 m_tileCountX = 0; ///< Tile count for LOD 0
 	U16 m_tileCountY = 0; ///< Tile count for LOD 0
 	U8 m_lodCount = 0;
-	Bool8 m_cachingEnabled = false;
+	Bool m_cachingEnabled = false;
 
 	U32 translateTileIdx(U32 x, U32 y, U32 lod) const
 	{

+ 3 - 3
src/anki/resource/AsyncLoader.h

@@ -92,9 +92,9 @@ private:
 	Mutex m_mtx;
 	ConditionVariable m_condVar;
 	IntrusiveList<AsyncLoaderTask> m_taskQueue;
-	Bool8 m_quit = false;
-	Bool8 m_paused = false;
-	Bool8 m_sync = false;
+	Bool m_quit = false;
+	Bool m_paused = false;
+	Bool m_sync = false;
 
 	Atomic<U64> m_completedTaskCount = {0};
 

+ 2 - 2
src/anki/resource/MaterialResource.h

@@ -257,8 +257,8 @@ public:
 private:
 	ShaderProgramResourcePtr m_prog;
 
-	Bool8 m_shadow = true;
-	Bool8 m_forwardShading = false;
+	Bool m_shadow = true;
+	Bool m_forwardShading = false;
 	U8 m_lodCount = 1;
 	U8 m_descriptorSetIdx = 0; ///< Cache the value from the m_prog;
 

+ 1 - 1
src/anki/resource/ParticleEmitterResource.h

@@ -77,7 +77,7 @@ public:
 
 	U32 m_particlesPerEmission = 1; ///< How many particles are emitted every emission. Required
 
-	Bool8 m_usePhysicsEngine = false; ///< Use bullet for the simulation
+	Bool m_usePhysicsEngine = false; ///< Use bullet for the simulation
 	/// @}
 
 	Bool forceEnabled() const

+ 3 - 3
src/anki/resource/RenderingKey.h

@@ -28,10 +28,10 @@ public:
 	Pass m_pass;
 	U8 m_lod;
 	U8 m_instanceCount;
-	Bool8 m_skinned;
-	Bool8 m_velocity;
+	Bool m_skinned;
+	Bool m_velocity;
 
-	RenderingKey(Pass pass, U8 lod, U instanceCount, Bool8 skinned, Bool8 velocity)
+	RenderingKey(Pass pass, U8 lod, U instanceCount, Bool skinned, Bool velocity)
 		: m_pass(pass)
 		, m_lod(lod)
 		, m_instanceCount(instanceCount)

+ 2 - 2
src/anki/resource/ResourceFilesystem.h

@@ -97,8 +97,8 @@ private:
 	public:
 		StringList m_files; ///< Files inside the directory.
 		String m_path; ///< A directory or an archive.
-		Bool8 m_isArchive = false;
-		Bool8 m_isCache = false;
+		Bool m_isArchive = false;
+		Bool m_isCache = false;
 
 		Path() = default;
 

+ 5 - 5
src/anki/resource/ShaderProgramPreProcessor.h

@@ -51,7 +51,7 @@ public:
 private:
 	StringAuto m_name;
 	DynamicArrayAuto<I32> m_values;
-	Bool8 m_instanced = false;
+	Bool m_instanced = false;
 };
 
 /// @memberof ShaderProgramPreprocessor
@@ -95,8 +95,8 @@ private:
 	StringAuto m_name;
 	StringAuto m_preproc;
 	ShaderVariableDataType m_dataType = ShaderVariableDataType::NONE;
-	Bool8 m_const = false;
-	Bool8 m_instanced = false;
+	Bool m_const = false;
+	Bool m_instanced = false;
 };
 
 /// This is a special preprocessor that run before the usual preprocessor. Its purpose is to add some meta information
@@ -177,10 +177,10 @@ private:
 	DynamicArrayAuto<Input> m_inputs;
 
 	ShaderTypeBit m_shaderTypes = ShaderTypeBit::NONE;
-	Bool8 m_insideShader = false;
+	Bool m_insideShader = false;
 	U32 m_set = 0;
 	U32 m_instancedMutatorIdx = MAX_U32;
-	Bool8 m_foundInstancedInput = false;
+	Bool m_foundInstancedInput = false;
 
 	ANKI_USE_RESULT Error parseFile(CString fname, U32 depth);
 	ANKI_USE_RESULT Error parseLine(CString line, CString fname, Bool& foundPragmaOnce, U32 depth);

+ 3 - 3
src/anki/resource/ShaderProgramResource.h

@@ -109,8 +109,8 @@ private:
 	String m_preprocExpr;
 	U32 m_idx;
 	ShaderVariableDataType m_dataType = ShaderVariableDataType::NONE;
-	Bool8 m_const = false;
-	Bool8 m_instanced = false;
+	Bool m_const = false;
+	Bool m_instanced = false;
 
 	Bool isTexture() const
 	{
@@ -198,7 +198,7 @@ private:
 	DynamicArray<ShaderVariableBlockInfo> m_blockInfos;
 	U32 m_uniBlockSize = 0;
 	DynamicArray<I16> m_texUnits;
-	Bool8 m_usesPushConstants = false;
+	Bool m_usesPushConstants = false;
 };
 
 /// The value of a constant.

+ 1 - 1
src/anki/scene/ParticleEmitterNode.h

@@ -57,7 +57,7 @@ private:
 	Obb m_obb;
 
 	// Opt: We dont have to make extra calculations if the ParticleEmitterNode's rotation is the identity
-	Bool8 m_identityRotation = true;
+	Bool m_identityRotation = true;
 
 	U32 m_aliveParticlesCount = 0;
 

+ 1 - 1
src/anki/scene/SceneNode.h

@@ -222,7 +222,7 @@ private:
 
 	Timestamp m_maxComponentTimestamp = 0;
 
-	Bool8 m_markedForDeletion = false;
+	Bool m_markedForDeletion = false;
 };
 /// @}
 

+ 1 - 1
src/anki/scene/components/DecalComponent.h

@@ -158,7 +158,7 @@ private:
 	Vec3 m_sizes = Vec3(1.0f);
 	Transform m_trf = Transform::getIdentity();
 	Obb m_obb = Obb(Vec4(0.0f), Mat3x4::getIdentity(), Vec4(1.0f, 1.0f, 1.0f, 0.0f));
-	Bool8 m_markedForUpdate = true;
+	Bool m_markedForUpdate = true;
 
 	ANKI_USE_RESULT Error setLayer(CString texAtlasFname, CString texAtlasSubtexName, F32 blendFactor, LayerType type);
 

+ 1 - 1
src/anki/scene/components/FogDensityComponent.h

@@ -102,7 +102,7 @@ private:
 	Vec4 m_worldPos{0.0f};
 
 	F32 m_density = 1.0f;
-	Bool8 m_box = false;
+	Bool m_box = false;
 };
 
 } // end namespace anki

+ 1 - 1
src/anki/scene/components/ReflectionProbeComponent.h

@@ -76,7 +76,7 @@ private:
 	Vec3 m_pos = Vec3(0.0f);
 	Vec3 m_aabbMin = Vec3(+1.0f);
 	Vec3 m_aabbMax = Vec3(-1.0f);
-	Bool8 m_markedForRendering = false;
+	Bool m_markedForRendering = false;
 
 	static void reflectionProbeQueueElementFeedbackCallback(Bool fillRenderQueuesOnNextFrame, void* userData)
 	{

+ 2 - 2
src/anki/scene/components/RenderComponent.h

@@ -41,8 +41,8 @@ public:
 	virtual void setupRenderableQueueElement(RenderableQueueElement& el) const = 0;
 
 protected:
-	Bool8 m_castsShadow = false;
-	Bool8 m_isForwardShading = false;
+	Bool m_castsShadow = false;
+	Bool m_isForwardShading = false;
 };
 
 /// A wrapper on top of MaterialVariable

+ 1 - 1
src/anki/scene/components/SkinComponent.h

@@ -42,7 +42,7 @@ private:
 	public:
 		AnimationResourcePtr m_anim;
 		F64 m_time;
-		Bool8 m_repeat;
+		Bool m_repeat;
 	};
 
 	SceneNode* m_node;

+ 3 - 3
src/anki/scene/components/SpatialComponent.h

@@ -110,9 +110,9 @@ private:
 
 	OctreePlaceable m_octreeInfo;
 
-	Bool8 m_markedForUpdate = false;
-	Bool8 m_placed = false;
-	Bool8 m_updateOctreeBounds = true;
+	Bool m_markedForUpdate = false;
+	Bool m_placed = false;
+	Bool m_updateOctreeBounds = true;
 };
 
 /// A class that holds spatial information and implements the SpatialComponent virtuals. You just need to update the

+ 2 - 2
src/anki/scene/events/Event.h

@@ -109,8 +109,8 @@ protected:
 	Second m_startTime = 0.0;
 	Second m_duration = 0.0;
 
-	Bool8 m_markedForDeletion = false;
-	Bool8 m_reanimate = false;
+	Bool m_markedForDeletion = false;
+	Bool m_reanimate = false;
 
 	DynamicArray<SceneNode*> m_associatedNodes;
 

+ 1 - 1
src/anki/script/lua_glue_gen.py

@@ -50,7 +50,7 @@ def ident(number):
 def type_is_bool(type):
 	""" Check if a type is boolean """
 
-	return type == "Bool" or type == "Bool8" or type == "bool"
+	return type == "Bool" or type == "bool"
 
 def type_is_number(type):
 	""" Check if a type is number """

+ 1 - 1
src/anki/ui/Canvas.h

@@ -89,7 +89,7 @@ private:
 	List<IntrusivePtr<UiObject>> m_references;
 
 #if ANKI_EXTRA_CHECKS
-	Bool8 m_building = false;
+	Bool m_building = false;
 #endif
 
 	void reset();

+ 1 - 1
src/anki/util/Allocator.h

@@ -119,7 +119,7 @@ public:
 	}
 
 	/// Check if it's initialized.
-	operator bool() const
+	operator Bool() const
 	{
 		return m_pool != nullptr;
 	}

+ 1 - 1
src/anki/util/BitSet.h

@@ -130,7 +130,7 @@ public:
 		return !getAny();
 	}
 
-	operator bool() const
+	operator Bool() const
 	{
 		return getAny();
 	}

+ 1 - 1
src/anki/util/Enum.h

@@ -92,7 +92,7 @@ constexpr inline typename EnumUnderlyingType<TEnum>::Type enumToType(TEnum e)
 	}
 
 #define _ANKI_ENUM_NEGATIVE_OPERATOR(enum_, qualifier_) \
-	qualifier_ bool operator!(const enum_& a) \
+	qualifier_ Bool operator!(const enum_& a) \
 	{ \
 		using Int = EnumUnderlyingType<enum_>::Type; \
 		return static_cast<Int>(a) == 0; \

+ 1 - 1
src/anki/util/Memory.h

@@ -252,7 +252,7 @@ private:
 	PtrSize m_nextChunkBias = 0;
 
 	/// Ignore deallocation errors.
-	Bool8 m_ignoreDeallocationErrors = false;
+	Bool m_ignoreDeallocationErrors = false;
 
 	/// The current chunk. Chose the more strict memory order to avoid compiler
 	/// re-ordering of instructions

+ 1 - 1
src/anki/util/Ptr.h

@@ -55,7 +55,7 @@ public:
 
 	/// @name Compare operators
 	/// @{
-	operator bool() const
+	operator Bool() const
 	{
 		return isCreated();
 	}

+ 4 - 5
src/anki/util/StdTypes.h

@@ -70,9 +70,8 @@ using F64 = double; ///< Floating point 64bit
 const F64 MAX_F64 = std::numeric_limits<F64>::max();
 const F64 MIN_F64 = -std::numeric_limits<F64>::max();
 
-using Bool = int; ///< Fast boolean type
-using Bool8 = I8; ///< Small 8bit boolean type
-using Bool32 = I32; ///< A 32bit boolean
+using Bool = bool; ///< 1 byte boolean type. The same as C++'s bool.
+static_assert(sizeof(bool) == 1, "Wrong size for bool");
 
 using Second = F64; ///< The base time unit is second.
 const Second MAX_SECOND = MAX_F64;
@@ -145,7 +144,7 @@ public:
 	/// Check if it is an error.
 	operator Bool() const
 	{
-		return m_code != NONE;
+		return ANKI_UNLIKELY(m_code != NONE);
 	}
 
 	/// @privatesection
@@ -165,7 +164,7 @@ private:
 	do \
 	{ \
 		Error error = x_; \
-		if(ANKI_UNLIKELY(error)) \
+		if(error) \
 		{ \
 			return error; \
 		} \

+ 8 - 0
src/anki/util/String.cpp

@@ -135,6 +135,14 @@ Error CString::toNumber(U8& out) const
 	return Error::NONE;
 }
 
+Error CString::toNumber(Bool& out) const
+{
+	I32 i;
+	ANKI_CHECK(toNumber(i));
+	out = i != 0;
+	return Error::NONE;
+}
+
 String& String::operator=(StringAuto&& b)
 {
 	m_data = std::move(b.m_data);

+ 28 - 19
src/anki/util/String.h

@@ -118,12 +118,12 @@ public:
 	}
 
 	/// Return true if the string is not initialized.
-	bool isEmpty() const
+	Bool isEmpty() const
 	{
 		return m_ptr == nullptr || getLength() == 0;
 	}
 
-	bool operator==(const CString& b) const
+	Bool operator==(const CString& b) const
 	{
 		if(m_ptr == nullptr || b.m_ptr == nullptr)
 		{
@@ -135,12 +135,12 @@ public:
 		}
 	}
 
-	bool operator!=(const CString& b) const
+	Bool operator!=(const CString& b) const
 	{
 		return !((*this) == b);
 	}
 
-	bool operator<(const CString& b) const
+	Bool operator<(const CString& b) const
 	{
 		if(m_ptr == nullptr || b.m_ptr == nullptr)
 		{
@@ -152,7 +152,7 @@ public:
 		}
 	}
 
-	bool operator<=(const CString& b) const
+	Bool operator<=(const CString& b) const
 	{
 		if(m_ptr == nullptr || b.m_ptr == nullptr)
 		{
@@ -164,7 +164,7 @@ public:
 		}
 	}
 
-	bool operator>(const CString& b) const
+	Bool operator>(const CString& b) const
 	{
 		if(m_ptr == nullptr || b.m_ptr == nullptr)
 		{
@@ -176,7 +176,7 @@ public:
 		}
 	}
 
-	bool operator>=(const CString& b) const
+	Bool operator>=(const CString& b) const
 	{
 		if(m_ptr == nullptr || b.m_ptr == nullptr)
 		{
@@ -234,6 +234,9 @@ public:
 	/// Convert to U32.
 	ANKI_USE_RESULT Error toNumber(U32& out) const;
 
+	/// Convert to Bool.
+	ANKI_USE_RESULT Error toNumber(Bool& out) const;
+
 	/// Compute the hash.
 	U32 computeHash() const
 	{
@@ -375,7 +378,7 @@ public:
 	}
 
 	/// Return true if strings are equal
-	bool operator==(const String& b) const
+	Bool operator==(const String& b) const
 	{
 		checkInit();
 		b.checkInit();
@@ -383,13 +386,13 @@ public:
 	}
 
 	/// Return true if strings are not equal
-	bool operator!=(const String& b) const
+	Bool operator!=(const String& b) const
 	{
 		return !(*this == b);
 	}
 
 	/// Return true if this is less than b
-	bool operator<(const String& b) const
+	Bool operator<(const String& b) const
 	{
 		checkInit();
 		b.checkInit();
@@ -397,7 +400,7 @@ public:
 	}
 
 	/// Return true if this is less or equal to b
-	bool operator<=(const String& b) const
+	Bool operator<=(const String& b) const
 	{
 		checkInit();
 		b.checkInit();
@@ -405,7 +408,7 @@ public:
 	}
 
 	/// Return true if this is greater than b
-	bool operator>(const String& b) const
+	Bool operator>(const String& b) const
 	{
 		checkInit();
 		b.checkInit();
@@ -413,7 +416,7 @@ public:
 	}
 
 	/// Return true if this is greater or equal to b
-	bool operator>=(const String& b) const
+	Bool operator>=(const String& b) const
 	{
 		checkInit();
 		b.checkInit();
@@ -421,41 +424,41 @@ public:
 	}
 
 	/// Return true if strings are equal
-	bool operator==(const CStringType& cstr) const
+	Bool operator==(const CStringType& cstr) const
 	{
 		checkInit();
 		return std::strcmp(&m_data[0], cstr.get()) == 0;
 	}
 
 	/// Return true if strings are not equal
-	bool operator!=(const CStringType& cstr) const
+	Bool operator!=(const CStringType& cstr) const
 	{
 		return !(*this == cstr);
 	}
 
 	/// Return true if this is less than cstr.
-	bool operator<(const CStringType& cstr) const
+	Bool operator<(const CStringType& cstr) const
 	{
 		checkInit();
 		return std::strcmp(&m_data[0], cstr.get()) < 0;
 	}
 
 	/// Return true if this is less or equal to cstr.
-	bool operator<=(const CStringType& cstr) const
+	Bool operator<=(const CStringType& cstr) const
 	{
 		checkInit();
 		return std::strcmp(&m_data[0], cstr.get()) <= 0;
 	}
 
 	/// Return true if this is greater than cstr.
-	bool operator>(const CStringType& cstr) const
+	Bool operator>(const CStringType& cstr) const
 	{
 		checkInit();
 		return std::strcmp(&m_data[0], cstr.get()) > 0;
 	}
 
 	/// Return true if this is greater or equal to cstr.
-	bool operator>=(const CStringType& cstr) const
+	Bool operator>=(const CStringType& cstr) const
 	{
 		checkInit();
 		return std::strcmp(&m_data[0], cstr.get()) >= 0;
@@ -576,6 +579,12 @@ public:
 		return toCString().toNumber(out);
 	}
 
+	/// Convert to Bool.
+	ANKI_USE_RESULT Error toNumber(Bool& out) const
+	{
+		return toCString().toNumber(out);
+	}
+
 protected:
 	DynamicArray<Char> m_data;
 

+ 1 - 1
src/anki/util/Thread.h

@@ -76,7 +76,7 @@ private:
 	void* m_userData = nullptr; ///< The user date to pass to the callback
 
 #if ANKI_EXTRA_CHECKS
-	Bool8 m_started = false;
+	Bool m_started = false;
 #endif
 };
 

+ 1 - 1
src/anki/util/ThreadPool.cpp

@@ -22,7 +22,7 @@ public:
 	Thread m_thread; ///< Runs the workingFunc
 	ThreadPoolTask* m_task; ///< Its NULL if there is no pending task
 	ThreadPool* m_threadpool;
-	Bool8 m_quit = false;
+	Bool m_quit = false;
 
 	/// Constructor
 	ThreadPoolThread(U32 id, ThreadPool* threadpool, Bool pinToCore)