mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Add support for WebGL2 MIN_PROGRAM_TEXEL_OFFSET
Improves the support of the WebGL2 `MIN_PROGRAM_TEXEL_OFFSET` property (ie. stores it as a signed integer) and adds support for querying it using GetParameter. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
This commit is contained in:
parent
ff33b88f72
commit
1431a389da
4 changed files with 14 additions and 8 deletions
|
@ -95,7 +95,7 @@ impl GLLimitsDetect for GLLimits {
|
|||
if webgl_version == WebGLVersion::WebGL2 {
|
||||
max_uniform_block_size = gl.get_integer64(gl::MAX_UNIFORM_BLOCK_SIZE);
|
||||
max_uniform_buffer_bindings = gl.get_integer(gl::MAX_UNIFORM_BUFFER_BINDINGS);
|
||||
min_program_texel_offset = gl.get_integer(gl::MIN_PROGRAM_TEXEL_OFFSET);
|
||||
min_program_texel_offset = gl.get_signed_integer(gl::MIN_PROGRAM_TEXEL_OFFSET);
|
||||
max_program_texel_offset = gl.get_integer(gl::MAX_PROGRAM_TEXEL_OFFSET);
|
||||
max_transform_feedback_separate_attribs =
|
||||
gl.get_integer(gl::MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS);
|
||||
|
@ -206,9 +206,11 @@ impl GLLimitsDetect for GLLimits {
|
|||
trait GLExt {
|
||||
fn try_get_integer(self, parameter: GLenum) -> Option<u32>;
|
||||
fn try_get_integer64(self, parameter: GLenum) -> Option<u64>;
|
||||
fn try_get_signed_integer(self, parameter: GLenum) -> Option<i32>;
|
||||
fn try_get_float(self, parameter: GLenum) -> Option<f32>;
|
||||
fn get_integer(self, parameter: GLenum) -> u32;
|
||||
fn get_integer64(self, parameter: GLenum) -> u64;
|
||||
fn get_signed_integer(self, parameter: GLenum) -> i32;
|
||||
fn get_float(self, parameter: GLenum) -> f32;
|
||||
}
|
||||
|
||||
|
@ -236,5 +238,12 @@ macro_rules! create_fun {
|
|||
impl<'a> GLExt for &'a Gl {
|
||||
create_fun!(try_get_integer, get_integer, i32, get_integer_v, u32);
|
||||
create_fun!(try_get_integer64, get_integer64, i64, get_integer64_v, u64);
|
||||
create_fun!(
|
||||
try_get_signed_integer,
|
||||
get_signed_integer,
|
||||
i32,
|
||||
get_integer_v,
|
||||
i32
|
||||
);
|
||||
create_fun!(try_get_float, get_float, f32, get_float_v, f32);
|
||||
}
|
||||
|
|
|
@ -1057,7 +1057,7 @@ pub struct GLLimits {
|
|||
pub max_draw_buffers: u32,
|
||||
pub max_color_attachments: u32,
|
||||
pub max_uniform_buffer_bindings: u32,
|
||||
pub min_program_texel_offset: u32,
|
||||
pub min_program_texel_offset: i32,
|
||||
pub max_program_texel_offset: u32,
|
||||
pub max_uniform_block_size: u64,
|
||||
pub max_combined_uniform_blocks: u32,
|
||||
|
|
|
@ -995,6 +995,9 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
|||
constants::MAX_UNIFORM_BLOCK_SIZE => {
|
||||
return DoubleValue(self.base.limits().max_uniform_block_size as f64)
|
||||
},
|
||||
constants::MIN_PROGRAM_TEXEL_OFFSET => {
|
||||
return Int32Value(self.base.limits().min_program_texel_offset)
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
[WebGL test #55: context.getParameter(context.MAX_SAMPLES) should be >= 4. Was 1 (of type number).]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #80: context.getParameter(context.MIN_PROGRAM_TEXEL_OFFSET) is not an instance of Number]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #87: context.getError() should be 0. Was 1280.]
|
||||
expected: FAIL
|
||||
|
||||
[WebGL test #79: context.getParameter(context.MIN_PROGRAM_TEXEL_OFFSET) should be >= -8. Was null (of type object).]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue