mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 22:39:33 +09:00
enhance(frontend): シェーダーコンパイルに失敗した場合詳細なエラー内容を出力できるように (MisskeyIO#221)
This commit is contained in:
parent
510c2b6808
commit
0ff83829ba
@ -24,8 +24,16 @@ const props = withDefaults(defineProps<{
|
||||
function loadShader(gl, type, source) {
|
||||
const shader = gl.createShader(type);
|
||||
|
||||
gl.shaderSource(shader, source);
|
||||
gl.compileShader(shader);
|
||||
try {
|
||||
gl.shaderSource(shader, source);
|
||||
gl.compileShader(shader);
|
||||
} catch (error) {
|
||||
alert(
|
||||
`failed to compile shader: ${error} ${gl.getShaderInfoLog(shader)}`,
|
||||
);
|
||||
gl.deleteShader(shader);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||
alert(
|
||||
|
Loading…
Reference in New Issue
Block a user