All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.bgfx.BGFXCaps Maven / Gradle / Ivy

Go to download

A cross-platform, graphics API agnostic rendering library. It provides a high performance, low level abstraction for common platform graphics APIs like OpenGL, Direct3D and Apple Metal.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.bgfx;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;

import static org.lwjgl.bgfx.BGFX.BGFX_TEXTURE_FORMAT_COUNT;

/**
 * Renderer capabilities.
 * 
 * 

Member documentation

* *
    *
  • {@code rendererType} – renderer backend type. One of:
    {@link BGFX#BGFX_RENDERER_TYPE_NOOP RENDERER_TYPE_NOOP}{@link BGFX#BGFX_RENDERER_TYPE_DIRECT3D9 RENDERER_TYPE_DIRECT3D9}{@link BGFX#BGFX_RENDERER_TYPE_DIRECT3D11 RENDERER_TYPE_DIRECT3D11}
    {@link BGFX#BGFX_RENDERER_TYPE_DIRECT3D12 RENDERER_TYPE_DIRECT3D12}{@link BGFX#BGFX_RENDERER_TYPE_GNM RENDERER_TYPE_GNM}{@link BGFX#BGFX_RENDERER_TYPE_METAL RENDERER_TYPE_METAL}
    {@link BGFX#BGFX_RENDERER_TYPE_OPENGLES RENDERER_TYPE_OPENGLES}{@link BGFX#BGFX_RENDERER_TYPE_OPENGL RENDERER_TYPE_OPENGL}{@link BGFX#BGFX_RENDERER_TYPE_VULKAN RENDERER_TYPE_VULKAN}
  • *
  • {@code supported} – supported functionality. One or more of:
    {@link BGFX#BGFX_CAPS_ALPHA_TO_COVERAGE CAPS_ALPHA_TO_COVERAGE}{@link BGFX#BGFX_CAPS_BLEND_INDEPENDENT CAPS_BLEND_INDEPENDENT}{@link BGFX#BGFX_CAPS_COMPUTE CAPS_COMPUTE}{@link BGFX#BGFX_CAPS_CONSERVATIVE_RASTER CAPS_CONSERVATIVE_RASTER}
    {@link BGFX#BGFX_CAPS_DRAW_INDIRECT CAPS_DRAW_INDIRECT}{@link BGFX#BGFX_CAPS_FRAGMENT_DEPTH CAPS_FRAGMENT_DEPTH}{@link BGFX#BGFX_CAPS_FRAGMENT_ORDERING CAPS_FRAGMENT_ORDERING}{@link BGFX#BGFX_CAPS_GRAPHICS_DEBUGGER CAPS_GRAPHICS_DEBUGGER}
    {@link BGFX#BGFX_CAPS_HIDPI CAPS_HIDPI}{@link BGFX#BGFX_CAPS_HMD CAPS_HMD}{@link BGFX#BGFX_CAPS_INDEX32 CAPS_INDEX32}{@link BGFX#BGFX_CAPS_INSTANCING CAPS_INSTANCING}
    {@link BGFX#BGFX_CAPS_OCCLUSION_QUERY CAPS_OCCLUSION_QUERY}{@link BGFX#BGFX_CAPS_RENDERER_MULTITHREADED CAPS_RENDERER_MULTITHREADED}{@link BGFX#BGFX_CAPS_SWAP_CHAIN CAPS_SWAP_CHAIN}{@link BGFX#BGFX_CAPS_TEXTURE_2D_ARRAY CAPS_TEXTURE_2D_ARRAY}
    {@link BGFX#BGFX_CAPS_TEXTURE_3D CAPS_TEXTURE_3D}{@link BGFX#BGFX_CAPS_TEXTURE_BLIT CAPS_TEXTURE_BLIT}{@link BGFX#BGFX_CAPS_TEXTURE_COMPARE_ALL CAPS_TEXTURE_COMPARE_ALL}{@link BGFX#BGFX_CAPS_TEXTURE_COMPARE_LEQUAL CAPS_TEXTURE_COMPARE_LEQUAL}
    {@link BGFX#BGFX_CAPS_TEXTURE_CUBE_ARRAY CAPS_TEXTURE_CUBE_ARRAY}{@link BGFX#BGFX_CAPS_TEXTURE_DIRECT_ACCESS CAPS_TEXTURE_DIRECT_ACCESS}{@link BGFX#BGFX_CAPS_TEXTURE_READ_BACK CAPS_TEXTURE_READ_BACK}{@link BGFX#BGFX_CAPS_VERTEX_ATTRIB_HALF CAPS_VERTEX_ATTRIB_HALF}
    {@link BGFX#BGFX_CAPS_VERTEX_ATTRIB_UINT10 CAPS_VERTEX_ATTRIB_UINT10}
  • *
  • {@code vendorId} – selected GPU vendor PCI id. One of:
    {@link BGFX#BGFX_PCI_ID_NONE PCI_ID_NONE}{@link BGFX#BGFX_PCI_ID_SOFTWARE_RASTERIZER PCI_ID_SOFTWARE_RASTERIZER}{@link BGFX#BGFX_PCI_ID_AMD PCI_ID_AMD}{@link BGFX#BGFX_PCI_ID_INTEL PCI_ID_INTEL}{@link BGFX#BGFX_PCI_ID_NVIDIA PCI_ID_NVIDIA}
  • *
  • {@code deviceId} – selected GPU device id
  • *
  • {@code homogeneousDepth} – true when NDC depth is in [-1, 1] range, otherwise its [0, 1]
  • *
  • {@code originBottomLeft} – true when NDC origin is at bottom left
  • *
  • {@code numGPUs} – number of enumerated GPUs
  • *
  • {@code gpu} – enumerated GPUs
  • *
  • {@code limits} – rendering limits
  • *
  • {@code formats} – supported texture formats
  • *
* *

Layout

* *
 * struct bgfx_caps_t {
 *     bgfx_renderer_type_t rendererType;
 *     uint64_t supported;
 *     uint16_t vendorId;
 *     uint16_t deviceId;
 *     bool homogeneousDepth;
 *     bool originBottomLeft;
 *     uint8_t numGPUs;
 *     {@link BGFXCapsGPU bgfx_caps_gpu_t} gpu[4];
 *     {@link BGFXCapsLimits bgfx_caps_limits_t} limits;
 *     uint16_t formats[BGFX_TEXTURE_FORMAT_COUNT];
 * }
*/ @NativeType("struct bgfx_caps_t") public class BGFXCaps extends Struct { /** The struct size in bytes. */ public static final int SIZEOF; public static final int ALIGNOF; /** The struct member offsets. */ public static final int RENDERERTYPE, SUPPORTED, VENDORID, DEVICEID, HOMOGENEOUSDEPTH, ORIGINBOTTOMLEFT, NUMGPUS, GPU, LIMITS, FORMATS; static { Layout layout = __struct( __member(4), __member(8), __member(2), __member(2), __member(1), __member(1), __member(1), __array(BGFXCapsGPU.SIZEOF, BGFXCapsGPU.ALIGNOF, 4), __member(BGFXCapsLimits.SIZEOF, BGFXCapsLimits.ALIGNOF), __array(2, BGFX_TEXTURE_FORMAT_COUNT) ); SIZEOF = layout.getSize(); ALIGNOF = layout.getAlignment(); RENDERERTYPE = layout.offsetof(0); SUPPORTED = layout.offsetof(1); VENDORID = layout.offsetof(2); DEVICEID = layout.offsetof(3); HOMOGENEOUSDEPTH = layout.offsetof(4); ORIGINBOTTOMLEFT = layout.offsetof(5); NUMGPUS = layout.offsetof(6); GPU = layout.offsetof(7); LIMITS = layout.offsetof(8); FORMATS = layout.offsetof(9); } BGFXCaps(long address, @Nullable ByteBuffer container) { super(address, container); } /** * Creates a {@link BGFXCaps} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be * visible to the struct instance and vice versa. * *

The created instance holds a strong reference to the container object.

*/ public BGFXCaps(ByteBuffer container) { this(memAddress(container), __checkContainer(container, SIZEOF)); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code rendererType} field. */ @NativeType("bgfx_renderer_type_t") public int rendererType() { return nrendererType(address()); } /** Returns the value of the {@code supported} field. */ @NativeType("uint64_t") public long supported() { return nsupported(address()); } /** Returns the value of the {@code vendorId} field. */ @NativeType("uint16_t") public short vendorId() { return nvendorId(address()); } /** Returns the value of the {@code deviceId} field. */ @NativeType("uint16_t") public short deviceId() { return ndeviceId(address()); } /** Returns the value of the {@code homogeneousDepth} field. */ @NativeType("bool") public boolean homogeneousDepth() { return nhomogeneousDepth(address()); } /** Returns the value of the {@code originBottomLeft} field. */ @NativeType("bool") public boolean originBottomLeft() { return noriginBottomLeft(address()); } /** Returns the value of the {@code numGPUs} field. */ @NativeType("uint8_t") public byte numGPUs() { return nnumGPUs(address()); } /** Returns a {@link BGFXCapsGPU}.Buffer view of the {@code gpu} field. */ @NativeType("bgfx_caps_gpu_t[4]") public BGFXCapsGPU.Buffer gpu() { return ngpu(address()); } /** Returns a {@link BGFXCapsGPU} view of the struct at the specified index of the {@code gpu} field. */ @NativeType("bgfx_caps_gpu_t") public BGFXCapsGPU gpu(int index) { return ngpu(address(), index); } /** Returns a {@link BGFXCapsLimits} view of the {@code limits} field. */ @NativeType("bgfx_caps_limits_t") public BGFXCapsLimits limits() { return nlimits(address()); } /** Returns a {@link ShortBuffer} view of the {@code formats} field. */ @NativeType("uint16_t[BGFX_TEXTURE_FORMAT_COUNT]") public ShortBuffer formats() { return nformats(address()); } /** Returns the value at the specified index of the {@code formats} field. */ @NativeType("uint16_t") public short formats(int index) { return nformats(address(), index); } // ----------------------------------- /** Returns a new {@link BGFXCaps} instance for the specified memory address. */ public static BGFXCaps create(long address) { return new BGFXCaps(address, null); } /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static BGFXCaps createSafe(long address) { return address == NULL ? null : create(address); } /** * Create a {@link BGFXCaps.Buffer} instance at the specified memory. * * @param address the memory address * @param capacity the buffer capacity */ public static BGFXCaps.Buffer create(long address, int capacity) { return new Buffer(address, capacity); } /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ @Nullable public static BGFXCaps.Buffer createSafe(long address, int capacity) { return address == NULL ? null : create(address, capacity); } // ----------------------------------- /** Unsafe version of {@link #rendererType}. */ public static int nrendererType(long struct) { return memGetInt(struct + BGFXCaps.RENDERERTYPE); } /** Unsafe version of {@link #supported}. */ public static long nsupported(long struct) { return memGetLong(struct + BGFXCaps.SUPPORTED); } /** Unsafe version of {@link #vendorId}. */ public static short nvendorId(long struct) { return memGetShort(struct + BGFXCaps.VENDORID); } /** Unsafe version of {@link #deviceId}. */ public static short ndeviceId(long struct) { return memGetShort(struct + BGFXCaps.DEVICEID); } /** Unsafe version of {@link #homogeneousDepth}. */ public static boolean nhomogeneousDepth(long struct) { return memGetByte(struct + BGFXCaps.HOMOGENEOUSDEPTH) != 0; } /** Unsafe version of {@link #originBottomLeft}. */ public static boolean noriginBottomLeft(long struct) { return memGetByte(struct + BGFXCaps.ORIGINBOTTOMLEFT) != 0; } /** Unsafe version of {@link #numGPUs}. */ public static byte nnumGPUs(long struct) { return memGetByte(struct + BGFXCaps.NUMGPUS); } /** Unsafe version of {@link #gpu}. */ public static BGFXCapsGPU.Buffer ngpu(long struct) { return BGFXCapsGPU.create(struct + BGFXCaps.GPU, Byte.toUnsignedInt(nnumGPUs(struct))); } /** Unsafe version of {@link #gpu(int) gpu}. */ public static BGFXCapsGPU ngpu(long struct, int index) { if (CHECKS) { check(index, Byte.toUnsignedInt(nnumGPUs(struct))); } return BGFXCapsGPU.create(struct + BGFXCaps.GPU + index * BGFXCapsGPU.SIZEOF); } /** Unsafe version of {@link #limits}. */ public static BGFXCapsLimits nlimits(long struct) { return BGFXCapsLimits.create(struct + BGFXCaps.LIMITS); } /** Unsafe version of {@link #formats}. */ public static ShortBuffer nformats(long struct) { return memShortBuffer(struct + BGFXCaps.FORMATS, BGFX_TEXTURE_FORMAT_COUNT); } /** Unsafe version of {@link #formats(int) formats}. */ public static short nformats(long struct, int index) { if (CHECKS) { check(index, BGFX_TEXTURE_FORMAT_COUNT); } return memGetShort(struct + BGFXCaps.FORMATS + index * 2); } // ----------------------------------- /** An array of {@link BGFXCaps} structs. */ public static class Buffer extends StructBuffer { /** * Creates a new {@link BGFXCaps.Buffer} instance backed by the specified container. * * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided * by {@link BGFXCaps#SIZEOF}, and its mark will be undefined. * *

The created buffer instance holds a strong reference to the container object.

*/ public Buffer(ByteBuffer container) { super(container, container.remaining() / SIZEOF); } public Buffer(long address, int cap) { super(address, null, -1, 0, cap, cap); } Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { super(address, container, mark, pos, lim, cap); } @Override protected Buffer self() { return this; } @Override protected Buffer newBufferInstance(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { return new Buffer(address, container, mark, pos, lim, cap); } @Override protected BGFXCaps newInstance(long address) { return new BGFXCaps(address, container); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code rendererType} field. */ @NativeType("bgfx_renderer_type_t") public int rendererType() { return BGFXCaps.nrendererType(address()); } /** Returns the value of the {@code supported} field. */ @NativeType("uint64_t") public long supported() { return BGFXCaps.nsupported(address()); } /** Returns the value of the {@code vendorId} field. */ @NativeType("uint16_t") public short vendorId() { return BGFXCaps.nvendorId(address()); } /** Returns the value of the {@code deviceId} field. */ @NativeType("uint16_t") public short deviceId() { return BGFXCaps.ndeviceId(address()); } /** Returns the value of the {@code homogeneousDepth} field. */ @NativeType("bool") public boolean homogeneousDepth() { return BGFXCaps.nhomogeneousDepth(address()); } /** Returns the value of the {@code originBottomLeft} field. */ @NativeType("bool") public boolean originBottomLeft() { return BGFXCaps.noriginBottomLeft(address()); } /** Returns the value of the {@code numGPUs} field. */ @NativeType("uint8_t") public byte numGPUs() { return BGFXCaps.nnumGPUs(address()); } /** Returns a {@link BGFXCapsGPU}.Buffer view of the {@code gpu} field. */ @NativeType("bgfx_caps_gpu_t[4]") public BGFXCapsGPU.Buffer gpu() { return BGFXCaps.ngpu(address()); } /** Returns a {@link BGFXCapsGPU} view of the struct at the specified index of the {@code gpu} field. */ @NativeType("bgfx_caps_gpu_t") public BGFXCapsGPU gpu(int index) { return BGFXCaps.ngpu(address(), index); } /** Returns a {@link BGFXCapsLimits} view of the {@code limits} field. */ @NativeType("bgfx_caps_limits_t") public BGFXCapsLimits limits() { return BGFXCaps.nlimits(address()); } /** Returns a {@link ShortBuffer} view of the {@code formats} field. */ @NativeType("uint16_t[BGFX_TEXTURE_FORMAT_COUNT]") public ShortBuffer formats() { return BGFXCaps.nformats(address()); } /** Returns the value at the specified index of the {@code formats} field. */ @NativeType("uint16_t") public short formats(int index) { return BGFXCaps.nformats(address(), index); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy