Add astc and dxt GraphicsFeatures;

This commit is contained in:
bjorn 2019-06-09 23:59:57 -07:00
parent b0a7d5c122
commit 98f4365474
3 changed files with 8 additions and 0 deletions

View File

@ -401,8 +401,12 @@ static int l_lovrGraphicsTock(lua_State* L) {
static int l_lovrGraphicsGetFeatures(lua_State* L) {
const GpuFeatures* features = lovrGraphicsGetFeatures();
lua_newtable(L);
lua_pushboolean(L, features->astc);
lua_setfield(L, -2, "astc");
lua_pushboolean(L, features->compute);
lua_setfield(L, -2, "compute");
lua_pushboolean(L, features->dxt);
lua_setfield(L, -2, "dxt");
lua_pushboolean(L, features->singlepass);
lua_setfield(L, -2, "singlepass");
return 1;

View File

@ -282,7 +282,9 @@ void lovrGraphicsFill(struct Texture* texture, float u, float v, float w, float
// GPU
typedef struct {
bool astc;
bool compute;
bool dxt;
bool singlepass;
bool timers;
} GpuFeatures;

View File

@ -993,7 +993,9 @@ void lovrGpuInit(getProcAddressProc getProcAddress) {
#endif
#ifndef LOVR_WEBGL
state.features.astc = GLAD_GL_ES_VERSION_3_2;
state.features.compute = GLAD_GL_ARB_compute_shader;
state.features.dxt = GLAD_GL_EXT_texture_compression_s3tc;
state.features.singlepass = GLAD_GL_ARB_viewport_array && GLAD_GL_AMD_vertex_shader_viewport_index && GLAD_GL_ARB_fragment_layer_viewport;
state.features.timers = GLAD_GL_VERSION_3_3 || GLAD_GL_EXT_disjoint_timer_query;
glEnable(GL_LINE_SMOOTH);