diff --git a/libs/sdl/GLImports.h b/libs/sdl/GLImports.h index 07ed86c9a..c6e1222e5 100644 --- a/libs/sdl/GLImports.h +++ b/libs/sdl/GLImports.h @@ -73,6 +73,9 @@ GL_IMPORT(glShaderStorageBlockBinding, SHADERSTORAGEBLOCKBINDING); GL_IMPORT(glMultiDrawElementsIndirect, MULTIDRAWELEMENTSINDIRECT); GL_IMPORT(glColorMaski, COLORMASKI); +GL_IMPORT(glTexStorage2D, TEXSTORAGE2D); +GL_IMPORT(glTexStorage3D, TEXSTORAGE3D); + #if !defined(HL_MESA) GL_IMPORT(glGetQueryObjectui64v, GETQUERYOBJECTUI64V); GL_IMPORT(glQueryCounter, QUERYCOUNTER); diff --git a/libs/sdl/gl.c b/libs/sdl/gl.c index 59475cb29..371e2ddd2 100644 --- a/libs/sdl/gl.c +++ b/libs/sdl/gl.c @@ -326,6 +326,14 @@ HL_PRIM void HL_NAME(gl_tex_image3d)( int target, int level, int internalFormat, glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, image); } +HL_PRIM void HL_NAME(gl_tex_storage2d)( int target, int levels, int internalFormat, int width, int height) { + glTexStorage2D(target, levels, internalFormat, width, height); +} + +HL_PRIM void HL_NAME(gl_tex_storage3d)( int target, int levels, int internalFormat, int width, int height, int depth) { + glTexStorage3D(target, levels, internalFormat, width, height, depth); +} + HL_PRIM void HL_NAME(gl_tex_image2d_multisample)( int target, int samples, int internalFormat, int width, int height, bool fixedsamplelocations) { glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedsamplelocations); } @@ -706,6 +714,8 @@ DEFINE_PRIM(_VOID,gl_tex_parameteri,_I32 _I32 _I32); DEFINE_PRIM(_VOID,gl_tex_parameterf,_I32 _I32 _F32); DEFINE_PRIM(_VOID,gl_tex_image2d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES); DEFINE_PRIM(_VOID,gl_tex_image3d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES); +DEFINE_PRIM(_VOID,gl_tex_storage2d,_I32 _I32 _I32 _I32 _I32); +DEFINE_PRIM(_VOID,gl_tex_storage3d,_I32 _I32 _I32 _I32 _I32 _I32); DEFINE_PRIM(_VOID,gl_tex_image2d_multisample,_I32 _I32 _I32 _I32 _I32 _BOOL); DEFINE_PRIM(_VOID,gl_compressed_tex_image2d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES); DEFINE_PRIM(_VOID,gl_compressed_tex_image3d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES); diff --git a/libs/sdl/sdl/GL.hx b/libs/sdl/sdl/GL.hx index d46849991..020440186 100644 --- a/libs/sdl/sdl/GL.hx +++ b/libs/sdl/sdl/GL.hx @@ -210,6 +210,10 @@ class GL { public static function bindTexture( t : Int, texture : Texture ) { } + @:hlNative("?sdl","gl_bind_image_texture") + public static function bindImageTexture( unit : Int, texture : Int, level : Int, layered : Bool, layer : Int, access : Int, format : Int ) { + } + public static function texParameteri( t : Int, key : Int, value : Int ) { } @@ -252,6 +256,14 @@ class GL { public static function compressedTexSubImage3D( target : Int, level : Int, xoffset : Int, yoffset : Int, zoffset : Int, width : Int, height : Int, depth : Int, format : Int, type : Int, image : hl.Bytes ) { } + @:hlNative("?sdl","gl_tex_storage2d") + public static function texStorage2D( target : Int, levels : Int, internalFormat : Int, width : Int, height : Int ) { + } + + @:hlNative("?sdl","gl_tex_storage3d") + public static function texStorage3D( target : Int, levels : Int, internalFormat : Int, width : Int, height : Int, depth : Int ) { + } + public static function generateMipmap( t : Int ) { } @@ -781,6 +793,10 @@ class GL { public static inline var TEXTURE = 0x1702; public static inline var TEXTURE_2D_ARRAY = 0x8C1A; + public static inline var TEXTURE_1D = 0x0DE0; + public static inline var TEXTURE_1D_ARRAY = 0x8C18; + public static inline var TEXTURE_CUBE_MAP_ARRAY = 0x9009; + public static inline var TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; public static inline var TEXTURE_CUBE_MAP = 0x8513; public static inline var TEXTURE_BINDING_CUBE_MAP = 0x8514; @@ -792,6 +808,22 @@ class GL { public static inline var TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; public static inline var MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + /* Image */ + + public static inline var READ_ONLY = 0x88B8; + public static inline var WRITE_ONLY = 0x88B9; + public static inline var READ_WRITE = 0x88BA; + + public static inline var IMAGE_1D = 0x904C; + public static inline var IMAGE_2D = 0x904D; + public static inline var IMAGE_3D = 0x904E; + public static inline var IMAGE_2D_RECT = 0x904F; + public static inline var IMAGE_CUBE = 0x9050; + public static inline var IMAGE_BUFFER = 0x9051; + public static inline var IMAGE_1D_ARRAY = 0x9052; + public static inline var IMAGE_2D_ARRAY = 0x9053; + public static inline var IMAGE_CUBE_MAP_ARRAY = 0x9054; + /* TextureUnit */ public static inline var TEXTURE0 = 0x84C0; public static inline var TEXTURE1 = 0x84C1;