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

Make GlesPixelProgram / GlesTexProgram Send + Sync #1603

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/renderer/gles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ impl GlesRenderer {
let tint = CStr::from_bytes_with_nul(b"tint\0").expect("NULL terminated");

unsafe {
Ok(GlesPixelProgram(Rc::new(GlesPixelProgramInner {
Ok(GlesPixelProgram(Arc::new(GlesPixelProgramInner {
normal: GlesPixelProgramInternal {
program,
uniform_matrix: self
Expand Down
10 changes: 8 additions & 2 deletions src/backend/renderer/gles/shaders/implicit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ pub(in super::super) struct GlesTexProgramVariant {
}

/// Gles texture shader
///
/// The program can be used with the same [`GlesRenderer`] it was created with, or one using a
/// shared [`EGLContext`].
#[derive(Debug, Clone)]
pub struct GlesTexProgram(pub(in super::super) Rc<GlesTexProgramInner>);
pub struct GlesTexProgram(pub(in super::super) Arc<GlesTexProgramInner>);

#[derive(Debug)]
pub(in super::super) struct GlesTexProgramInner {
Expand Down Expand Up @@ -82,8 +85,11 @@ pub(in super::super) struct GlesSolidProgram {
}

/// Gles pixel shader
///
/// The program can be used with the same [`GlesRenderer`] it was created with, or one using a
/// shared [`EGLContext`].
#[derive(Debug, Clone)]
pub struct GlesPixelProgram(pub(in super::super) Rc<GlesPixelProgramInner>);
pub struct GlesPixelProgram(pub(in super::super) Arc<GlesPixelProgramInner>);

#[derive(Debug)]
pub(in super::super) struct GlesPixelProgramInner {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/renderer/gles/shaders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub(super) unsafe fn texture_program(
})
};

Ok(GlesTexProgram(Rc::new(GlesTexProgramInner {
Ok(GlesTexProgram(Arc::new(GlesTexProgramInner {
variants: [
create_variant(&[])?,
create_variant(&[shaders::NO_ALPHA])?,
Expand Down
3 changes: 3 additions & 0 deletions src/backend/renderer/gles/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use super::*;
use std::sync::Arc;

/// A handle to a GLES texture
///
/// The texture can be used with the same [`GlesRenderer`] it was created with, or one using a
/// shared [`EGLContext`].
#[derive(Debug, Clone)]
pub struct GlesTexture(pub(super) Arc<GlesTextureInternal>);

Expand Down
Loading