Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EXT_shader_texture_lod extension. #300

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Only the following for now:
* [`WEBGL_draw_buffers`](https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/)
* [`EXT_blend_minmax`](https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/)
* [`EXT_texture_filter_anisotropic`](https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/)
* [`EXT_shader_texture_lod`](https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/)

### How can I keep up to date with what has changed in headless-gl?

Expand Down
14 changes: 14 additions & 0 deletions src/javascript/extensions/ext-shader-texture-lod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class EXTShaderTextureLod {}

function getEXTShaderTextureLod (context) {
let result = null
const exts = context.getSupportedExtensions()

if (exts && exts.indexOf('EXT_shader_texture_lod') >= 0) {
result = new EXTShaderTextureLod()
}

return result
}

module.exports = { getEXTShaderTextureLod, EXTShaderTextureLod }
8 changes: 7 additions & 1 deletion src/javascript/webgl-rendering-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const { getSTACKGLResizeDrawingBuffer } = require('./extensions/stackgl-resize-d
const { getWebGLDrawBuffers } = require('./extensions/webgl-draw-buffers')
const { getEXTBlendMinMax } = require('./extensions/ext-blend-minmax')
const { getEXTTextureFilterAnisotropic } = require('./extensions/ext-texture-filter-anisotropic')
const { getEXTShaderTextureLod } = require('./extensions/ext-shader-texture-lod')
const { getOESVertexArrayObject } = require('./extensions/oes-vertex-array-object')
const {
bindPublics,
Expand Down Expand Up @@ -65,7 +66,8 @@ const availableExtensions = {
stackgl_resize_drawingbuffer: getSTACKGLResizeDrawingBuffer,
webgl_draw_buffers: getWebGLDrawBuffers,
ext_blend_minmax: getEXTBlendMinMax,
ext_texture_filter_anisotropic: getEXTTextureFilterAnisotropic
ext_texture_filter_anisotropic: getEXTTextureFilterAnisotropic,
ext_shader_texture_lod: getEXTShaderTextureLod
}

const privateMethods = [
Expand Down Expand Up @@ -1227,6 +1229,10 @@ class WebGLRenderingContext extends NativeWebGLRenderingContext {
exts.push('OES_vertex_array_object')
}

if (supportedExts.indexOf('GL_EXT_shader_texture_lod') >= 0) {
exts.push('EXT_shader_texture_lod')
}

return exts
}

Expand Down