Added a new `Ref<T>` struct for reference semantics. Added the `RenderGraph` system for managing rendering passes. Added the `RenderTexture` class for encapsulating GPU resources. Added `GraphicsBuffer` class for effective GPU resource management. Changed `CommandList` methods from public to internal for visibility control. Changed `IRenderPass` interface from internal to public for accessibility. Changed `GetData<T>()` in `ComponentObject.cs` to return `CompRef<T>`. Changed `GetComponent<T>()` in `EntityManager.cs` to return `CompRef<T>`. Changed `GetSingleton<T>()` in `World.cs` to use `CompRef<T>`. Changed `IQueryTypeParameter` to use `CompRef<T>` for consistency. Changed `QueryItem<T0>` and related structs to use `CompRef<T>`. Changed `Material` class to support bindless textures. Changed `Shader` class to support bindless rendering. Changed `Mesh` class to support bindless vertex and index buffer access. Updated documentation to reflect the new bindless rendering architecture.
42 lines
774 B
C#
42 lines
774 B
C#
using Ghost.Entities.Components;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Ghost.Entities.Query;
|
|
|
|
public interface IQueryTypeParameter
|
|
{
|
|
}
|
|
|
|
public ref struct CompRef<T> : IQueryTypeParameter
|
|
where T : IComponentData
|
|
{
|
|
internal ref T _value;
|
|
|
|
public ref T ValueRW
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
get => ref _value;
|
|
}
|
|
|
|
public readonly ref T ValueRO
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
get => ref _value;
|
|
}
|
|
|
|
public readonly bool IsValid
|
|
{
|
|
get;
|
|
init;
|
|
}
|
|
|
|
public CompRef(ref T value, bool isValid)
|
|
{
|
|
_value = ref value;
|
|
IsValid = isValid;
|
|
}
|
|
|
|
public CompRef(ref T value) : this(ref value, true)
|
|
{
|
|
}
|
|
} |