Skip to content

DiGi.ComputeSharp.Core.Classes

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.ComputeSharp.Core.Classes Namespace

Structs

Bool Struct

Represents a boolean value stored as an integer, typically used for compatibility with compute shaders or GPU buffers.

public readonly struct Bool

Constructors

Bool(bool) Constructor

Initializes a new instance of the Bool struct using a standard boolean value.

public Bool(bool value);

Parameters

value System.Boolean

The boolean value to convert.

Bool(int) Constructor

Initializes a new instance of the Bool struct using an integer value.

public Bool(int value);

Parameters

value System.Int32

The integer value to convert (1 is treated as true, all other values are false).

Fields

Bool.Value Field

The underlying integer representation of the boolean value, where 0 is false and 1 is true.

public readonly int Value;

Field Value

System.Int32

Methods

Bool.ToBool() Method

Converts the internal integer representation back to a standard C# boolean.

public bool ToBool();

Returns

System.Boolean
True if the internal value is 1; otherwise, false.

Bool.ToString() Method

Returns a string representation of the boolean value.

public override string ToString();

Returns

System.String
The string "True" or "False".

Clone this wiki locally