Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
05758ef7
Commit
05758ef7
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added shaderTextureLod compat
parent
08a84903
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-gl/shader-code.ts
+10
-0
10 additions, 0 deletions
src/mol-gl/shader-code.ts
src/mol-gl/webgl/compat.ts
+7
-0
7 additions, 0 deletions
src/mol-gl/webgl/compat.ts
src/mol-gl/webgl/context.ts
+9
-2
9 additions, 2 deletions
src/mol-gl/webgl/context.ts
with
26 additions
and
2 deletions
src/mol-gl/shader-code.ts
+
10
−
0
View file @
05758ef7
...
@@ -19,6 +19,7 @@ export interface ShaderExtensions {
...
@@ -19,6 +19,7 @@ export interface ShaderExtensions {
readonly
standardDerivatives
?:
boolean
readonly
standardDerivatives
?:
boolean
readonly
fragDepth
?:
boolean
readonly
fragDepth
?:
boolean
readonly
drawBuffers
?:
boolean
readonly
drawBuffers
?:
boolean
readonly
shaderTextureLod
?:
boolean
}
}
export
interface
ShaderCode
{
export
interface
ShaderCode
{
...
@@ -115,6 +116,14 @@ function getGlsl100FragPrefix(extensions: WebGLExtensions, shaderExtensions: Sha
...
@@ -115,6 +116,14 @@ function getGlsl100FragPrefix(extensions: WebGLExtensions, shaderExtensions: Sha
throw
new
Error
(
`requested 'GL_EXT_draw_buffers' extension is unavailable`
)
throw
new
Error
(
`requested 'GL_EXT_draw_buffers' extension is unavailable`
)
}
}
}
}
if
(
shaderExtensions
.
shaderTextureLod
)
{
if
(
extensions
.
shaderTextureLod
)
{
prefix
.
push
(
'
#extension GL_EXT_shader_texture_lod : enable
'
)
prefix
.
push
(
'
#define enabledShaderTextureLod
'
)
}
else
{
throw
new
Error
(
`requested 'GL_EXT_shader_texture_lod' extension is unavailable`
)
}
}
return
prefix
.
join
(
'
\n
'
)
+
'
\n
'
return
prefix
.
join
(
'
\n
'
)
+
'
\n
'
}
}
...
@@ -136,6 +145,7 @@ layout(location = 7) out highp vec4 out_FragData7;
...
@@ -136,6 +145,7 @@ layout(location = 7) out highp vec4 out_FragData7;
#define varying in
#define varying in
#define texture2D texture
#define texture2D texture
#define texture2DLodEXT textureLod
#define gl_FragColor out_FragData0
#define gl_FragColor out_FragData0
#define gl_FragDepthEXT gl_FragDepth
#define gl_FragDepthEXT gl_FragDepth
...
...
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/compat.ts
+
7
−
0
View file @
05758ef7
...
@@ -213,4 +213,11 @@ export function getDrawBuffers(gl: GLRenderingContext): COMPAT_draw_buffers | nu
...
@@ -213,4 +213,11 @@ export function getDrawBuffers(gl: GLRenderingContext): COMPAT_draw_buffers | nu
MAX_DRAW_BUFFERS
:
ext
.
MAX_DRAW_BUFFERS_WEBGL
,
MAX_DRAW_BUFFERS
:
ext
.
MAX_DRAW_BUFFERS_WEBGL
,
}
}
}
}
}
export
interface
COMPAT_shader_texture_lod
{
}
export
function
getShaderTextureLod
(
gl
:
GLRenderingContext
):
COMPAT_shader_texture_lod
|
null
{
return
isWebGL2
(
gl
)
?
{}
:
gl
.
getExtension
(
'
EXT_shader_texture_lod
'
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/context.ts
+
9
−
2
View file @
05758ef7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
{
createProgramCache
,
ProgramCache
}
from
'
./program
'
import
{
createProgramCache
,
ProgramCache
}
from
'
./program
'
import
{
createShaderCache
,
ShaderCache
}
from
'
./shader
'
import
{
createShaderCache
,
ShaderCache
}
from
'
./shader
'
import
{
GLRenderingContext
,
COMPAT_instanced_arrays
,
COMPAT_standard_derivatives
,
COMPAT_vertex_array_object
,
getInstancedArrays
,
getStandardDerivatives
,
getVertexArrayObject
,
isWebGL2
,
COMPAT_element_index_uint
,
getElementIndexUint
,
COMPAT_texture_float
,
getTextureFloat
,
COMPAT_texture_float_linear
,
getTextureFloatLinear
,
COMPAT_blend_minmax
,
getBlendMinMax
,
getFragDepth
,
COMPAT_frag_depth
,
COMPAT_color_buffer_float
,
getColorBufferFloat
,
COMPAT_draw_buffers
,
getDrawBuffers
}
from
'
./compat
'
;
import
{
GLRenderingContext
,
COMPAT_instanced_arrays
,
COMPAT_standard_derivatives
,
COMPAT_vertex_array_object
,
getInstancedArrays
,
getStandardDerivatives
,
getVertexArrayObject
,
isWebGL2
,
COMPAT_element_index_uint
,
getElementIndexUint
,
COMPAT_texture_float
,
getTextureFloat
,
COMPAT_texture_float_linear
,
getTextureFloatLinear
,
COMPAT_blend_minmax
,
getBlendMinMax
,
getFragDepth
,
COMPAT_frag_depth
,
COMPAT_color_buffer_float
,
getColorBufferFloat
,
COMPAT_draw_buffers
,
getDrawBuffers
,
getShaderTextureLod
,
COMPAT_shader_texture_lod
}
from
'
./compat
'
;
import
{
createFramebufferCache
,
FramebufferCache
,
checkFramebufferStatus
}
from
'
./framebuffer
'
;
import
{
createFramebufferCache
,
FramebufferCache
,
checkFramebufferStatus
}
from
'
./framebuffer
'
;
import
{
Scheduler
}
from
'
mol-task
'
;
import
{
Scheduler
}
from
'
mol-task
'
;
import
{
isDebugMode
}
from
'
mol-util/debug
'
;
import
{
isDebugMode
}
from
'
mol-util/debug
'
;
...
@@ -158,6 +158,7 @@ export type WebGLExtensions = {
...
@@ -158,6 +158,7 @@ export type WebGLExtensions = {
fragDepth
:
COMPAT_frag_depth
|
null
fragDepth
:
COMPAT_frag_depth
|
null
colorBufferFloat
:
COMPAT_color_buffer_float
|
null
colorBufferFloat
:
COMPAT_color_buffer_float
|
null
drawBuffers
:
COMPAT_draw_buffers
|
null
drawBuffers
:
COMPAT_draw_buffers
|
null
shaderTextureLod
:
COMPAT_shader_texture_lod
|
null
}
}
function
createExtensions
(
gl
:
GLRenderingContext
):
WebGLExtensions
{
function
createExtensions
(
gl
:
GLRenderingContext
):
WebGLExtensions
{
...
@@ -201,6 +202,11 @@ function createExtensions(gl: GLRenderingContext): WebGLExtensions {
...
@@ -201,6 +202,11 @@ function createExtensions(gl: GLRenderingContext): WebGLExtensions {
if
(
drawBuffers
===
null
)
{
if
(
drawBuffers
===
null
)
{
console
.
log
(
'
Could not find support for "draw_buffers"
'
)
console
.
log
(
'
Could not find support for "draw_buffers"
'
)
}
}
const
shaderTextureLod
=
getShaderTextureLod
(
gl
)
if
(
shaderTextureLod
===
null
)
{
console
.
log
(
'
Could not find support for "shader_texture_lod"
'
)
}
return
{
return
{
instancedArrays
,
instancedArrays
,
...
@@ -212,7 +218,8 @@ function createExtensions(gl: GLRenderingContext): WebGLExtensions {
...
@@ -212,7 +218,8 @@ function createExtensions(gl: GLRenderingContext): WebGLExtensions {
vertexArrayObject
,
vertexArrayObject
,
fragDepth
,
fragDepth
,
colorBufferFloat
,
colorBufferFloat
,
drawBuffers
drawBuffers
,
shaderTextureLod
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment