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
85092279
Commit
85092279
authored
5 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
better handle unsupported extensions
parent
d0189523
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-gl/shader/mesh.vert.ts
+2
-2
2 additions, 2 deletions
src/mol-gl/shader/mesh.vert.ts
src/mol-gl/webgl/extensions.ts
+15
-12
15 additions, 12 deletions
src/mol-gl/webgl/extensions.ts
with
17 additions
and
14 deletions
src/mol-gl/shader/mesh.vert.ts
+
2
−
2
View file @
85092279
...
...
@@ -23,7 +23,7 @@ attribute mat4 aTransform;
attribute float aInstance;
attribute float aGroup;
#if
n
def
dFlatShaded
#if
!
def
ined(
dFlatShaded
) || !defined(enabledStandardDerivatives)
#ifdef dGeoTexture
uniform sampler2D tNormal;
#else
...
...
@@ -38,7 +38,7 @@ void main(){
#include assign_marker_varying
#include assign_position
#if
n
def
dFlatShaded
#if
!
def
ined(
dFlatShaded
) || !defined(enabledStandardDerivatives)
#ifdef dGeoTexture
vec3 normal = readFromTexture(tNormal, aGroup, uGeoTexDim).xyz;
#else
...
...
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/extensions.ts
+
15
−
12
View file @
85092279
...
...
@@ -5,6 +5,7 @@
*/
import
{
GLRenderingContext
,
COMPAT_instanced_arrays
,
COMPAT_standard_derivatives
,
COMPAT_vertex_array_object
,
getInstancedArrays
,
getStandardDerivatives
,
getVertexArrayObject
,
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
,
getDepthTexture
,
COMPAT_depth_texture
}
from
'
./compat
'
;
import
{
isDebugMode
}
from
'
../../mol-util/debug
'
;
export
type
WebGLExtensions
=
{
instancedArrays
:
COMPAT_instanced_arrays
...
...
@@ -37,43 +38,45 @@ export function createExtensions(gl: GLRenderingContext): WebGLExtensions {
}
const
standardDerivatives
=
getStandardDerivatives
(
gl
)
if
(
standardDerivatives
===
null
)
{
//
TODO handle
non-support downstream (
e.g. no
flat shading)
//
throw new Error('Could not find support for "standard_derivatives"')
if
(
isDebugMode
&&
standardDerivatives
===
null
)
{
//
-
non-support
handled
downstream (flat shading
option is ignored
)
//
- can't be a required extension because it is not supported by `headless-gl`
console
.
log
(
'
Could not find support for "standard_derivatives"
'
)
}
const
textureFloatLinear
=
getTextureFloatLinear
(
gl
)
if
(
textureFloatLinear
===
null
)
{
if
(
isDebugMode
&&
textureFloatLinear
===
null
)
{
// TODO handle non-support downstream (no gpu gaussian calc, no gpu mc???)
//
throw new Error('Could not find support for "texture_float_linear"')
//
- can't be a required extension because it is not supported by `headless-gl`
console
.
log
(
'
Could not find support for "texture_float_linear"
'
)
}
const
depthTexture
=
getDepthTexture
(
gl
)
if
(
depthTexture
===
null
)
{
if
(
isDebugMode
&&
depthTexture
===
null
)
{
console
.
log
(
'
Could not find support for "depth_texture"
'
)
}
const
blendMinMax
=
getBlendMinMax
(
gl
)
if
(
blendMinMax
===
null
)
{
if
(
isDebugMode
&&
blendMinMax
===
null
)
{
// TODO handle non-support downstream (e.g. no gpu gaussian calc)
// - can't be a required extension because it is not supported by `headless-gl`
console
.
log
(
'
Could not find support for "blend_minmax"
'
)
}
const
vertexArrayObject
=
getVertexArrayObject
(
gl
)
if
(
vertexArrayObject
===
null
)
{
if
(
isDebugMode
&&
vertexArrayObject
===
null
)
{
console
.
log
(
'
Could not find support for "vertex_array_object"
'
)
}
const
fragDepth
=
getFragDepth
(
gl
)
if
(
fragDepth
===
null
)
{
if
(
isDebugMode
&&
fragDepth
===
null
)
{
console
.
log
(
'
Could not find support for "frag_depth"
'
)
}
const
colorBufferFloat
=
getColorBufferFloat
(
gl
)
if
(
colorBufferFloat
===
null
)
{
if
(
isDebugMode
&&
colorBufferFloat
===
null
)
{
console
.
log
(
'
Could not find support for "color_buffer_float"
'
)
}
const
drawBuffers
=
getDrawBuffers
(
gl
)
if
(
drawBuffers
===
null
)
{
if
(
isDebugMode
&&
drawBuffers
===
null
)
{
console
.
log
(
'
Could not find support for "draw_buffers"
'
)
}
const
shaderTextureLod
=
getShaderTextureLod
(
gl
)
if
(
shaderTextureLod
===
null
)
{
if
(
isDebugMode
&&
shaderTextureLod
===
null
)
{
console
.
log
(
'
Could not find support for "shader_texture_lod"
'
)
}
...
...
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