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
e236db51
Commit
e236db51
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
commented out some gl log messages
parent
402dd629
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/webgl/program.ts
+3
-3
3 additions, 3 deletions
src/mol-gl/webgl/program.ts
src/mol-gl/webgl/render-item.ts
+11
-10
11 additions, 10 deletions
src/mol-gl/webgl/render-item.ts
src/mol-gl/webgl/uniform.ts
+1
-1
1 addition, 1 deletion
src/mol-gl/webgl/uniform.ts
with
15 additions
and
14 deletions
src/mol-gl/webgl/program.ts
+
3
−
3
View file @
e236db51
...
@@ -36,9 +36,9 @@ function getAttributeLocations(ctx: Context, program: WebGLProgram, schema: Rend
...
@@ -36,9 +36,9 @@ function getAttributeLocations(ctx: Context, program: WebGLProgram, schema: Rend
const
spec
=
schema
[
k
]
const
spec
=
schema
[
k
]
if
(
spec
.
type
===
'
attribute
'
)
{
if
(
spec
.
type
===
'
attribute
'
)
{
const
loc
=
gl
.
getAttribLocation
(
program
,
k
)
const
loc
=
gl
.
getAttribLocation
(
program
,
k
)
if
(
loc
===
-
1
)
{
//
if (loc === -1) {
console
.
info
(
`Could not get attribute location for '
${
k
}
'`
)
//
console.info(`Could not get attribute location for '${k}'`)
}
//
}
locations
[
k
]
=
loc
locations
[
k
]
=
loc
}
}
})
})
...
...
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/render-item.ts
+
11
−
10
View file @
e236db51
...
@@ -116,14 +116,14 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -116,14 +116,14 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
Object
.
keys
(
defineValues
).
forEach
(
k
=>
{
Object
.
keys
(
defineValues
).
forEach
(
k
=>
{
const
value
=
defineValues
[
k
]
const
value
=
defineValues
[
k
]
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
console
.
log
(
'
define version changed
'
,
k
)
//
console.log('define version changed', k)
defineChange
=
true
defineChange
=
true
versions
[
k
]
=
value
.
ref
.
version
versions
[
k
]
=
value
.
ref
.
version
}
}
})
})
if
(
defineChange
)
{
if
(
defineChange
)
{
console
.
log
(
'
some defines changed, need to rebuild programs
'
)
//
console.log('some defines changed, need to rebuild programs')
Object
.
keys
(
RenderVariantDefines
).
forEach
(
k
=>
{
Object
.
keys
(
RenderVariantDefines
).
forEach
(
k
=>
{
const
variantDefineValues
:
Values
<
RenderableSchema
>
=
(
RenderVariantDefines
as
any
)[
k
]
const
variantDefineValues
:
Values
<
RenderableSchema
>
=
(
RenderVariantDefines
as
any
)[
k
]
programs
[
k
].
free
()
programs
[
k
].
free
()
...
@@ -135,12 +135,12 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -135,12 +135,12 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
}
}
if
(
values
.
drawCount
.
ref
.
version
!==
versions
.
drawCount
)
{
if
(
values
.
drawCount
.
ref
.
version
!==
versions
.
drawCount
)
{
console
.
log
(
'
drawCount version changed
'
)
//
console.log('drawCount version changed')
drawCount
=
values
.
drawCount
.
ref
.
value
drawCount
=
values
.
drawCount
.
ref
.
value
versions
.
drawCount
=
values
.
drawCount
.
ref
.
version
versions
.
drawCount
=
values
.
drawCount
.
ref
.
version
}
}
if
(
values
.
instanceCount
.
ref
.
version
!==
versions
.
instanceCount
)
{
if
(
values
.
instanceCount
.
ref
.
version
!==
versions
.
instanceCount
)
{
console
.
log
(
'
instanceCount version changed
'
)
//
console.log('instanceCount version changed')
instanceCount
=
values
.
instanceCount
.
ref
.
value
instanceCount
=
values
.
instanceCount
.
ref
.
value
versions
.
instanceCount
=
values
.
instanceCount
.
ref
.
version
versions
.
instanceCount
=
values
.
instanceCount
.
ref
.
version
}
}
...
@@ -152,10 +152,10 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -152,10 +152,10 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
const
buffer
=
attributeBuffers
[
k
]
const
buffer
=
attributeBuffers
[
k
]
if
(
buffer
.
length
>=
value
.
ref
.
value
.
length
)
{
if
(
buffer
.
length
>=
value
.
ref
.
value
.
length
)
{
console
.
log
(
'
attribute array large enough to update
'
,
k
)
//
console.log('attribute array large enough to update', k)
attributeBuffers
[
k
].
updateData
(
value
.
ref
.
value
)
attributeBuffers
[
k
].
updateData
(
value
.
ref
.
value
)
}
else
{
}
else
{
console
.
log
(
'
attribute array to small, need to create new attribute
'
,
k
)
//
console.log('attribute array to small, need to create new attribute', k)
attributeBuffers
[
k
].
destroy
()
attributeBuffers
[
k
].
destroy
()
const
spec
=
schema
[
k
]
as
AttributeSpec
<
ArrayKind
>
const
spec
=
schema
[
k
]
as
AttributeSpec
<
ArrayKind
>
attributeBuffers
[
k
]
=
createAttributeBuffer
(
ctx
,
value
.
ref
.
value
,
spec
.
itemSize
,
spec
.
divisor
)
attributeBuffers
[
k
]
=
createAttributeBuffer
(
ctx
,
value
.
ref
.
value
,
spec
.
itemSize
,
spec
.
divisor
)
...
@@ -167,10 +167,10 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -167,10 +167,10 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
if
(
elementsBuffer
&&
values
.
elements
.
ref
.
version
!==
versions
.
elements
)
{
if
(
elementsBuffer
&&
values
.
elements
.
ref
.
version
!==
versions
.
elements
)
{
if
(
elementsBuffer
.
length
>=
values
.
elements
.
ref
.
value
.
length
)
{
if
(
elementsBuffer
.
length
>=
values
.
elements
.
ref
.
value
.
length
)
{
console
.
log
(
'
elements array large enough to update
'
)
//
console.log('elements array large enough to update')
elementsBuffer
.
updateData
(
values
.
elements
.
ref
.
value
)
elementsBuffer
.
updateData
(
values
.
elements
.
ref
.
value
)
}
else
{
}
else
{
console
.
log
(
'
elements array to small, need to create new elements
'
)
//
console.log('elements array to small, need to create new elements')
elementsBuffer
.
destroy
()
elementsBuffer
.
destroy
()
elementsBuffer
=
createElementsBuffer
(
ctx
,
values
.
elements
.
ref
.
value
)
elementsBuffer
=
createElementsBuffer
(
ctx
,
values
.
elements
.
ref
.
value
)
bufferChange
=
true
bufferChange
=
true
...
@@ -179,8 +179,9 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -179,8 +179,9 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
}
}
if
(
defineChange
||
bufferChange
)
{
if
(
defineChange
||
bufferChange
)
{
console
.
log
(
'
program/defines or buffers changed, rebuild vaos
'
)
//
console.log('program/defines or buffers changed, rebuild vaos')
Object
.
keys
(
RenderVariantDefines
).
forEach
(
k
=>
{
Object
.
keys
(
RenderVariantDefines
).
forEach
(
k
=>
{
deleteVertexArray
(
ctx
,
vertexArrays
[
k
])
vertexArrays
[
k
]
=
createVertexArray
(
ctx
,
programs
[
k
].
value
,
attributeBuffers
,
elementsBuffer
)
vertexArrays
[
k
]
=
createVertexArray
(
ctx
,
programs
[
k
].
value
,
attributeBuffers
,
elementsBuffer
)
})
})
}
}
...
@@ -188,7 +189,7 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
...
@@ -188,7 +189,7 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
Object
.
keys
(
textureValues
).
forEach
(
k
=>
{
Object
.
keys
(
textureValues
).
forEach
(
k
=>
{
const
value
=
textureValues
[
k
]
const
value
=
textureValues
[
k
]
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
if
(
value
.
ref
.
version
!==
versions
[
k
])
{
console
.
log
(
'
texture version changed, uploading image
'
,
k
)
//
console.log('texture version changed, uploading image', k)
textures
[
k
].
load
(
value
.
ref
.
value
)
textures
[
k
].
load
(
value
.
ref
.
value
)
versions
[
k
]
=
value
.
ref
.
version
versions
[
k
]
=
value
.
ref
.
version
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mol-gl/webgl/uniform.ts
+
1
−
1
View file @
e236db51
...
@@ -34,7 +34,7 @@ function createUniformSetter(ctx: Context, program: WebGLProgram, name: string,
...
@@ -34,7 +34,7 @@ function createUniformSetter(ctx: Context, program: WebGLProgram, name: string,
const
{
gl
}
=
ctx
const
{
gl
}
=
ctx
const
location
=
gl
.
getUniformLocation
(
program
,
name
)
const
location
=
gl
.
getUniformLocation
(
program
,
name
)
if
(
location
===
null
)
{
if
(
location
===
null
)
{
console
.
info
(
`Could not get WebGL uniform location for '
${
name
}
'`
)
//
console.info(`Could not get WebGL uniform location for '${name}'`)
}
}
switch
(
kind
)
{
switch
(
kind
)
{
case
'
f
'
:
return
(
value
:
number
)
=>
gl
.
uniform1f
(
location
,
value
)
case
'
f
'
:
return
(
value
:
number
)
=>
gl
.
uniform1f
(
location
,
value
)
...
...
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