func setSupportInfos() { // Extensions var num gl.Int gl.GetIntegerv(gl.NUM_EXTENSIONS, &num) Support.Extensions = make([]string, num) if num > 0 { for i := gl.Int(0); i < num; i++ { Support.Extensions[i] = Util.Stri(gl.EXTENSIONS, gl.Uint(i)) } } // Sampling limits, textures // Support.Textures.StreamUpdatesViaPixelBuffer = true if Util.Extension("texture_filter_anisotropic") { gl.GetFloatv(gl.MAX_TEXTURE_MAX_ANISOTROPY_EXT, &Support.Textures.MaxFilterAnisotropy) } gl.GetFloatv(gl.MAX_TEXTURE_LOD_BIAS, &Support.Textures.MaxMipLoadBias) Support.Textures.ImageUnits.MaxCombined = Util.Val(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS) Support.Textures.ImageUnits.MaxFragment = Util.Val(gl.MAX_TEXTURE_IMAGE_UNITS) Support.Textures.ImageUnits.MaxGeometry = Util.Val(gl.MAX_GEOMETRY_TEXTURE_IMAGE_UNITS) Support.Textures.ImageUnits.MaxVertex = Util.Val(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) // GL version-specifics if Support.GlVersion.Is42 { Support.Buffers.AtomicCounter, Support.Textures.Immutable = true, true } if Support.GlVersion.Is43 { Support.Textures.ImageUnits.MaxCompute = Util.Val(gl.MAX_COMPUTE_TEXTURE_IMAGE_UNITS) Support.Buffers.DispatchIndirect, Support.Buffers.ShaderStorage = true, true } // GLSL version-specifics if Support.Glsl.Version.Is400 { Support.Glsl.Shaders.TessellationStages = true } if Support.Glsl.Version.Is430 { Support.Glsl.Shaders.ComputeStage = true } Cache.onGlInit() }
// Returns the specified n integers as returned by gl.GetIntegerv(). func (_ GlUtil) Vals(name gl.Enum, n uint) (vals []gl.Int) { vals = make([]gl.Int, n) gl.GetIntegerv(name, &vals[0]) return }
// Returns the specified integer as returned by gl.GetIntegerv(). // Example: numExts := GlVal(gl.NUM_EXTENSIONS) func (_ GlUtil) Val(name gl.Enum) (val gl.Int) { gl.GetIntegerv(name, &val) return }