Skip to content

Commit

Permalink
Attempt to force unsigned type for attrib 0 with glVertexAttribI4ui
Browse files Browse the repository at this point in the history
  • Loading branch information
iceiix committed Dec 31, 2020
1 parent 8561107 commit 116bee0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ opt-level = 1
cfg-if = "1.0.0"
wasm-bindgen = "0.2.69"
winit = { version = "0.24.0", features = [ "web-sys" ]}
glow = "0.7.1"
#glow = "0.7.1"
glow = { git = "https://github.com/iceiix/glow", branch = "i4ui" }
byteorder = "1.3.4"
serde = "1.0.118"
serde_json = "1.0.60"
Expand Down
8 changes: 7 additions & 1 deletion src/gl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ impl Uniform {
}

#[derive(Clone, Copy)]
pub struct Attribute(i32);
pub struct Attribute(pub i32);

impl Attribute {
pub fn enable(&self) {
Expand All @@ -631,6 +631,12 @@ impl Attribute {
}
}

pub fn vertex_attrib_i_4_ui(&self, x: u32, y: u32, z: u32, w: u32) {
unsafe {
glow_context().vertex_attrib_i_4_ui(self.0 as u32, x, y, z, w);
}
}

pub fn vertex_pointer(&self, size: i32, ty: Type, normalized: bool, stride: i32, offset: i32) {
unsafe {
glow_context().vertex_attrib_pointer_f32(
Expand Down
1 change: 1 addition & 0 deletions src/render/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl Manager {
if let Some(v) = collection.shader.id {
v.vertex_pointer_int(1, gl::UNSIGNED_BYTE, 36, 32)
}
gl::Attribute(0).vertex_attrib_i_4_ui(0, 0, 0, 0);

let mut model = Model {
// For culling only
Expand Down

0 comments on commit 116bee0

Please sign in to comment.