Class BufferWriter

java.lang.Object
dev.engine.core.gpu.BufferWriter

public final class BufferWriter extends Object
Writes typed values to a NativeMemory for GPU buffer upload. Works with any buffer: UBOs, SSBOs, mapped streaming buffers, staging buffers.

Matrices are written in column-major order (GPU convention). Booleans are written as 4-byte ints (GLSL bool layout). Texture handles are written as uint64 (bindless).

  • Field Details

  • Method Details

    • write

      public static void write(NativeMemory mem, long offset, float value)
    • write

      public static void write(NativeMemory mem, long offset, int value)
    • write

      public static void write(NativeMemory mem, long offset, boolean value)
    • write

      public static void write(NativeMemory mem, long offset, Vec2 v)
    • write

      public static void write(NativeMemory mem, long offset, Vec3 v)
    • write

      public static void write(NativeMemory mem, long offset, Vec4 v)
    • write

      public static void write(NativeMemory mem, long offset, Mat4 m)
    • writeTextureHandle

      public static void writeTextureHandle(NativeMemory mem, long offset, long handle)
    • write

      public static void write(NativeMemory mem, long offset, Object value)
    • sizeOf

      public static int sizeOf(Class<?> type)
      Returns the GPU byte size for a given type.
    • supports

      public static boolean supports(Class<?> type)
      Returns true if the type is supported by BufferWriter.