mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix gldemo
The GL program needs to be used before accessing its attributes. #minor-release PiperOrigin-RevId: 410768017
This commit is contained in:
parent
f946ade1d0
commit
fc0e6a075e
1 changed files with 1 additions and 1 deletions
|
|
@ -88,6 +88,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
|
program.use();
|
||||||
GlUtil.Attribute[] attributes = program.getAttributes();
|
GlUtil.Attribute[] attributes = program.getAttributes();
|
||||||
for (GlUtil.Attribute attribute : attributes) {
|
for (GlUtil.Attribute attribute : attributes) {
|
||||||
if (attribute.name.equals("a_position")) {
|
if (attribute.name.equals("a_position")) {
|
||||||
|
|
@ -142,7 +143,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
// Run the shader program.
|
// Run the shader program.
|
||||||
GlUtil.Uniform[] uniforms = checkNotNull(this.uniforms);
|
GlUtil.Uniform[] uniforms = checkNotNull(this.uniforms);
|
||||||
GlUtil.Attribute[] attributes = checkNotNull(this.attributes);
|
GlUtil.Attribute[] attributes = checkNotNull(this.attributes);
|
||||||
checkNotNull(program).use();
|
|
||||||
for (GlUtil.Uniform uniform : uniforms) {
|
for (GlUtil.Uniform uniform : uniforms) {
|
||||||
switch (uniform.name) {
|
switch (uniform.name) {
|
||||||
case "tex_sampler_0":
|
case "tex_sampler_0":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue