Directly activate a WebGL context from JS
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, wasm
- Área
- computer-graphics, web-dev
Línea de trabajo
Start with test/browser/test_preinitialized_webgl_context.c and trace the existing preinitializedWebGLContext and emscripten_webgl_context_create() path. Compare that behavior with the --pre-js makeWebGL2ContextCurrent extension described here. Done should establish whether direct activation and multiple dynamically created WebGL contexts can be supported through a clear, tested API.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Using an already existing WebGL context requires a somewhat confusing dance with preinitializedWebGLContext.
To activate a GL context (as in https://github.com/emscripten-core/emscripten/blob/25c255b66fe553a4bff3761cbeb7add8f1583d25/test/browser/test_preinitialized_webgl_context.c):
- set
preinitalizedWebGLContexton module creation - call
emscripten_webgl_context_create(), necessarily passing a valid canvas element reference and context attributes. These arguments will not really be used, this function returns (a handle to) thepreinitializedWebGLContext. - call
emscripten_webgl_make_context_current(handle)
This appears more confusing than necessary. Also, this process does not seem to allow using the module with more than one WebGL context. This is something that we'd like to, to reuse our module to render into multiple (dynamically created) canvases.
To work around this, we've extended the Module with this --pre-js file.
// Activates the given WebGL context for rendering. Does _not_ register a context handle for the context and thus it cannot be referenced from WASM.
Module.makeWebGL2ContextCurrent = (ctx) => {
GL.currentContext = {
handle: -1, // unused?
attributes: {}, // unused?
version: 2,
GLctx: ctx
};
Module['ctx'] = GLctx = GL.currentContext?.GLctx;
}
With this, we don't need any of the steps 1. - 3. above; we only call module.makeWebGL2ContextCurrent(gl) for our canvas and proceed to call into the WASM to render.
Questions:
- Is there a pre-existing functionality that already achieves what our --pre-js extension does?
- If not, would it be useful to add this to emscripten directly?
- Lenguaje dominante
- C++
- Estrellas
- 27.8k
- Forks
- 3.6k
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 179
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de emscripten-core/emscripten
-
`other.test_cmake_cxx_import_std` fails on CMake 3.30–4.0.2 due to missing `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` UUIDsPosiblemente ocupada @subhaushsingh la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
emscripten-core/emscripten#28160 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
emscripten-core/emscripten#27994 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precisionPosiblemente ocupada @TheTomBritton la tomó hace 12 días. AbiertoDesktop OpenGL emulation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
emscripten-core/emscripten#27948 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
emscripten-core/emscripten#27906 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
run_python, run_python_compiler could readlink -fPosiblemente ocupada @kapouer la tomó hace 128 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
emscripten-core/emscripten#27211 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de emscripten-core/emscripten
Issues similares
-
Linux npm packaging leaves workspace files that block subsequent CI checkoutPosiblemente ocupada @Spockkk0225 la tomó hoy. Abiertoci
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
alibaba/neug#1195 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
QA/No release-notes/exclude tests tests/missing-coverage tests/test-quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
brave/brave-browser#61019 ·
Los mantenedores suelen responder en 1 día
-
? - Needs Triage bug CUTLASS C++
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 4 días