Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uniforms in pyglet.graphics.shader #1103

Merged
merged 1 commit into from May 7, 2024
Merged

Conversation

salehqt
Copy link
Contributor

@salehqt salehqt commented May 6, 2024

Fixing a bug in Pyglet where the Uniform object doesn't have the reference to the ShaderProgram it belongs to.

This causes problems when we try to write a numpy array to the uniform object.

When we try to assign to a uniform from Numpy array, it throws an error without this patch:

        self.program["thresholds"] = np.array([self.threshold1, self.threshold2, 0])

Where thresholds is defined like this in the shader source code:

uniform float thresholds[3];

Fixing a bug in Pyglet where the `Uniform` object doesn't have the reference to the `ShaderProgram` it belongs to.

This causes problems when we try to write a numpy array to the uniform object.
@benmoran56 benmoran56 merged commit 03c2da1 into pyglet:master May 7, 2024
16 checks passed
@benmoran56
Copy link
Member

Thanks for catching that, and for the PR. This will get into the next point release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants