webgl: Make the api return the context limits and use them for validations

This allows keeping the VertexAttrib* calls asynchronous.

Another option would be to do the validation in the apply() function,
but that'd require us passing an unnecessary channel around and add
extra synchronization.

The counterpart of this is that it has to be updated when the context
changes, but that's less problem.
This commit is contained in:
Emilio Cobos Álvarez 2016-03-27 16:08:52 +02:00 committed by Emilio Cobos Álvarez
parent 8d7ee15ace
commit 6fcc03c965
7 changed files with 44 additions and 25 deletions

View file

@ -101,6 +101,7 @@ impl WebGLShader {
&BuiltInResources::default()).unwrap();
match validator.compile_and_translate(&[source]) {
Ok(translated_source) => {
debug!("Shader translated: {}", translated_source);
// NOTE: At this point we should be pretty sure that the compilation in the paint thread
// will succeed.
// It could be interesting to retrieve the info log from the paint thread though