gl: fix disembodied player model found in #141 (#484)

Regression introduced in #262 by the glow port, correct the raw size to
include all elements in set_float_multi().

See https://github.com/iceiix/stevenarella/issues/141#issuecomment-762417970
This commit is contained in:
iceiix 2021-01-18 11:50:00 -08:00 committed by GitHub
parent 56f9c0e908
commit 2b6103e6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -590,8 +590,10 @@ impl Uniform {
pub fn set_float_multi(&self, v: &[[f32; 4]]) {
unsafe {
glow_context()
.uniform_4_f32_slice(Some(&self.0), &*(v as *const [[f32; 4]] as *const [f32; 4]))
glow_context().uniform_4_f32_slice(
Some(&self.0),
std::slice::from_raw_parts(v.as_ptr() as *const _, v.len() * 4),
)
}
}