41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package c.o.b.d;
|
|
|
|
import android.opengl.GLES20;
|
|
import c.o.b.a.d;
|
|
import c.o.b.c.f;
|
|
import d0.p;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: GlShader.kt */
|
|
public final class c {
|
|
public static final a a = new a(null);
|
|
public final int b;
|
|
|
|
/* compiled from: GlShader.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
public c(int i, String str) {
|
|
m.checkNotNullParameter(str, "source");
|
|
int r0 = p.m86constructorimpl(GLES20.glCreateShader(p.m86constructorimpl(i)));
|
|
d.b("glCreateShader type=" + i);
|
|
GLES20.glShaderSource(r0, str);
|
|
GLES20.glCompileShader(r0);
|
|
int[] iArr = new int[1];
|
|
GLES20.glGetShaderiv(r0, f.l, iArr, 0);
|
|
if (iArr[0] != 0) {
|
|
this.b = r0;
|
|
return;
|
|
}
|
|
StringBuilder M = c.d.b.a.a.M("Could not compile shader ", i, ": '");
|
|
M.append(GLES20.glGetShaderInfoLog(r0));
|
|
M.append("' source: ");
|
|
M.append(str);
|
|
String sb = M.toString();
|
|
GLES20.glDeleteShader(r0);
|
|
throw new RuntimeException(sb);
|
|
}
|
|
}
|