Skip to content

Commit

Permalink
Expose more constants (#313)
Browse files Browse the repository at this point in the history
* Add `HALF_FLOAT_OES`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `ALIASED_POINT_SIZE_RANGE`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `STENCIL_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `RED_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `GREEN_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `BLUE_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `DEPTH_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `ALPHA_BITS`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `GENERATE_MIPMAP_HINT`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
  • Loading branch information
sagudev authored Oct 22, 2024
1 parent 3228dec commit 9938c26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,12 +1837,16 @@ pub const ACTIVE_VARIABLES: u32 = 0x9305;

pub const ALIASED_LINE_WIDTH_RANGE: u32 = 0x846E;

pub const ALIASED_POINT_SIZE_RANGE: u32 = 0x846D;

pub const ALL_BARRIER_BITS: u32 = 0xFFFFFFFF;

pub const ALL_SHADER_BITS: u32 = 0xFFFFFFFF;

pub const ALPHA: u32 = 0x1906;

pub const ALPHA_BITS: u32 = 0x0D55;

pub const ALREADY_SIGNALED: u32 = 0x911A;

pub const ALWAYS: u32 = 0x0207;
Expand Down Expand Up @@ -1939,6 +1943,8 @@ pub const BLOCK_INDEX: u32 = 0x92FD;

pub const BLUE: u32 = 0x1905;

pub const BLUE_BITS: u32 = 0x0D54;

pub const BLUE_INTEGER: u32 = 0x8D96;

pub const BOOL: u32 = 0x8B56;
Expand Down Expand Up @@ -2369,6 +2375,8 @@ pub const DEPTH32F_STENCIL8: u32 = 0x8CAD;

pub const DEPTH_ATTACHMENT: u32 = 0x8D00;

pub const DEPTH_BITS: u32 = 0x0D56;

pub const DEPTH_BUFFER_BIT: u32 = 0x00000100;

pub const DEPTH_CLAMP: u32 = 0x864F;
Expand Down Expand Up @@ -2661,6 +2669,8 @@ pub const FUNC_REVERSE_SUBTRACT: u32 = 0x800B;

pub const FUNC_SUBTRACT: u32 = 0x800A;

pub const GENERATE_MIPMAP_HINT: u32 = 0x8192;

pub const GEOMETRY_INPUT_TYPE: u32 = 0x8917;

pub const GEOMETRY_OUTPUT_TYPE: u32 = 0x8918;
Expand Down Expand Up @@ -2691,10 +2701,14 @@ pub const GREATER: u32 = 0x0204;

pub const GREEN: u32 = 0x1904;

pub const GREEN_BITS: u32 = 0x0D53;

pub const GREEN_INTEGER: u32 = 0x8D95;

pub const GUILTY_CONTEXT_RESET: u32 = 0x8253;

pub const HALF_FLOAT_OES: u32 = 0x8D61;

pub const HALF_FLOAT: u32 = 0x140B;

pub const HIGH_FLOAT: u32 = 0x8DF2;
Expand Down Expand Up @@ -3589,6 +3603,8 @@ pub const READ_WRITE: u32 = 0x88BA;

pub const RED: u32 = 0x1903;

pub const RED_BITS: u32 = 0x0D52;

pub const RED_INTEGER: u32 = 0x8D94;

pub const REFERENCED_BY_COMPUTE_SHADER: u32 = 0x930B;
Expand Down Expand Up @@ -3929,6 +3945,8 @@ pub const STENCIL_BACK_VALUE_MASK: u32 = 0x8CA4;

pub const STENCIL_BACK_WRITEMASK: u32 = 0x8CA5;

pub const STENCIL_BITS: u32 = 0x0D57;

pub const STENCIL_BUFFER_BIT: u32 = 0x00000400;

pub const STENCIL_CLEAR_VALUE: u32 = 0x0B91;
Expand Down
3 changes: 2 additions & 1 deletion src/web_sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5841,7 +5841,8 @@ unsafe fn texture_data_view(ty: u32, bytes: &[u8]) -> js_sys::Object {
| UNSIGNED_SHORT_5_6_5
| UNSIGNED_SHORT_5_5_5_1
| UNSIGNED_SHORT_4_4_4_4
| HALF_FLOAT => {
| HALF_FLOAT
| HALF_FLOAT_OES => {
#[allow(clippy::cast_ptr_alignment)]
let data = from_raw_parts(bytes.as_ptr() as *const u16, bytes.len() / size_of::<u16>());
js_sys::Uint16Array::view(data).into()
Expand Down

0 comments on commit 9938c26

Please sign in to comment.