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) {
|
function loadShader(gl, type, source) {
|
||||||
const shader = gl.createShader(type);
|
const shader = gl.createShader(type);
|
||||||
|
|
||||||
gl.shaderSource(shader, source);
|
try {
|
||||||
gl.compileShader(shader);
|
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)) {
|
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
||||||
alert(
|
alert(
|
||||||
|
|
Loading…
Reference in a new issue