Add NVX_gpu_memory_info extension support and return 'getParameter' as an int if an unknown param ID

This commit is contained in:
Joshua Granick
2019-10-04 14:22:55 -07:00
parent 40f16ab2f9
commit 4edb4b413a
2 changed files with 17 additions and 1 deletions

View File

@@ -1605,6 +1605,7 @@ class NativeOpenGLRenderContext
{
__extensionObjects = new Map();
var supportedExtensions = getSupportedExtensions();
trace(supportedExtensions);
for (extension in supportedExtensions)
{
@@ -1861,7 +1862,8 @@ class NativeOpenGLRenderContext
return data;
default:
return null;
return getInteger(pname);
// return null;
}
}
@@ -3367,6 +3369,7 @@ class NativeOpenGLRenderContext
__extensionObjectConstructors["NV_read_stencil"] = NV_read_stencil.new;
__extensionObjectConstructors["NV_texture_compression_s3tc_update"] = NV_texture_compression_s3tc_update.new;
__extensionObjectConstructors["NV_texture_npot_2D_mipmap"] = NV_texture_npot_2D_mipmap.new;
__extensionObjectConstructors["NVX_gpu_memory_info"] = NVX_gpu_memory_info.new;
__extensionObjectConstructors["OES_EGL_image"] = OES_EGL_image.new;
__extensionObjectConstructors["OES_EGL_image_external"] = OES_EGL_image_external.new;
__extensionObjectConstructors["OES_compressed_ETC1_RGB8_texture"] = OES_compressed_ETC1_RGB8_texture.new;

View File

@@ -0,0 +1,13 @@
package lime.graphics.opengl.ext;
@:keep
@:noCompletion class NVX_gpu_memory_info
{
public var GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047;
public var GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048;
public var GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049;
public var GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A;
public var GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B;
@:noCompletion private function new() {}
}