2017-10-31 08:14:09 +00:00
|
|
|
#include <stdbool.h>
|
2022-04-21 09:16:17 +00:00
|
|
|
#include <stdint.h>
|
2016-09-21 07:55:53 +00:00
|
|
|
|
2017-01-26 10:20:30 +00:00
|
|
|
#pragma once
|
2016-09-27 06:48:09 +00:00
|
|
|
|
2022-04-21 09:16:17 +00:00
|
|
|
typedef struct {
|
2022-04-22 20:28:59 +00:00
|
|
|
uint32_t deviceId;
|
|
|
|
uint32_t vendorId;
|
2022-04-21 09:16:17 +00:00
|
|
|
const char* name;
|
|
|
|
const char* renderer;
|
|
|
|
uint32_t subgroupSize;
|
2022-04-22 20:28:59 +00:00
|
|
|
bool discrete;
|
2022-04-21 09:16:17 +00:00
|
|
|
} GraphicsDevice;
|
|
|
|
|
|
|
|
typedef struct {
|
2022-04-26 22:31:51 +00:00
|
|
|
bool textureBC;
|
|
|
|
bool textureASTC;
|
2022-04-21 09:16:17 +00:00
|
|
|
bool wireframe;
|
|
|
|
bool depthClamp;
|
|
|
|
bool indirectDrawFirstInstance;
|
|
|
|
bool float64;
|
|
|
|
bool int64;
|
|
|
|
bool int16;
|
|
|
|
} GraphicsFeatures;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t textureSize2D;
|
|
|
|
uint32_t textureSize3D;
|
|
|
|
uint32_t textureSizeCube;
|
|
|
|
uint32_t textureLayers;
|
|
|
|
uint32_t renderSize[3];
|
|
|
|
uint32_t uniformBufferRange;
|
|
|
|
uint32_t storageBufferRange;
|
|
|
|
uint32_t uniformBufferAlign;
|
|
|
|
uint32_t storageBufferAlign;
|
|
|
|
uint32_t vertexAttributes;
|
|
|
|
uint32_t vertexBufferStride;
|
|
|
|
uint32_t vertexShaderOutputs;
|
2022-04-26 22:31:51 +00:00
|
|
|
uint32_t clipDistances;
|
|
|
|
uint32_t cullDistances;
|
|
|
|
uint32_t clipAndCullDistances;
|
2022-04-21 09:16:17 +00:00
|
|
|
uint32_t computeDispatchCount[3];
|
|
|
|
uint32_t computeWorkgroupSize[3];
|
|
|
|
uint32_t computeWorkgroupVolume;
|
|
|
|
uint32_t computeSharedMemory;
|
|
|
|
uint32_t shaderConstantSize;
|
|
|
|
uint32_t indirectDrawCount;
|
|
|
|
uint32_t instances;
|
|
|
|
float anisotropy;
|
|
|
|
float pointSize;
|
|
|
|
} GraphicsLimits;
|
|
|
|
|
2022-04-21 07:27:13 +00:00
|
|
|
bool lovrGraphicsInit(bool debug);
|
2019-02-17 22:39:51 +00:00
|
|
|
void lovrGraphicsDestroy(void);
|
2022-04-21 09:16:17 +00:00
|
|
|
|
|
|
|
void lovrGraphicsGetDevice(GraphicsDevice* device);
|
|
|
|
void lovrGraphicsGetFeatures(GraphicsFeatures* features);
|
|
|
|
void lovrGraphicsGetLimits(GraphicsLimits* limits);
|