/** * Returns false if the GL context doesn't support sufficient numbers of vertex uniform vectors * to allow this shader to run with good performance, true otherwise. */ public static boolean isLikelyToPerform(GLContext ctx) { int maxVecs = usableMaxUniformVectors(ctx); // assume we're better off with indexed tris if we can't push at least 16 quads at a time return (maxVecs >= 16*BASE_VEC4S_PER_QUAD); }
public QuadShader(GLContext ctx) { super(ctx); int maxVecs = usableMaxUniformVectors(ctx) - extraVec4s(); if (maxVecs < vec4sPerQuad()) throw new RuntimeException( "GL_MAX_VERTEX_UNIFORM_VECTORS too low: have " + maxVecs + ", need at least " + vec4sPerQuad()); maxQuads = maxVecs / vec4sPerQuad(); }