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

Don't forward GL parameter gets for constant limits. #20884

Merged
merged 1 commit into from May 31, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Don't forward GL parameter gets for constant limits.

  • Loading branch information
jdm committed May 31, 2018
commit 76c29f8bd007a3b91acce7d26b04dab28fc4e658

Some generated files are not rendered by default. Learn more.

@@ -20,7 +20,7 @@ gleam = "0.5"
ipc-channel = "0.10"
log = "0.4"
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.16", features = ["serde", "osmesa"]}
offscreen_gl_context = {version = "0.17", features = ["serde", "osmesa"]}
serde_bytes = "0.10"
servo_config = {path = "../config"}
webrender = {git = "https://github.com/servo/webrender"}
@@ -18,7 +18,7 @@ lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
nonzero = {path = "../nonzero"}
offscreen_gl_context = {version = "0.16", features = ["serde"]}
offscreen_gl_context = {version = "0.17", features = ["serde"]}
serde = "1.0"
serde_bytes = "0.10"
servo_config = {path = "../config"}
@@ -619,16 +619,6 @@ parameters! {
FrontFace = gl::FRONT_FACE,
GenerateMipmapHint = gl::GENERATE_MIPMAP_HINT,
GreenBits = gl::GREEN_BITS,
MaxCombinedTextureImageUnits = gl::MAX_COMBINED_TEXTURE_IMAGE_UNITS,
MaxCubeMapTextureSize = gl::MAX_CUBE_MAP_TEXTURE_SIZE,
MaxFragmentUniformVectors = gl::MAX_FRAGMENT_UNIFORM_VECTORS,
MaxRenderbufferSize = gl::MAX_RENDERBUFFER_SIZE,
MaxTextureImageUnits = gl::MAX_TEXTURE_IMAGE_UNITS,
MaxTextureSize = gl::MAX_TEXTURE_SIZE,
MaxVaryingVectors = gl::MAX_VARYING_VECTORS,
MaxVertexAttribs = gl::MAX_VERTEX_ATTRIBS,
MaxVertexTextureImageUnits = gl::MAX_VERTEX_TEXTURE_IMAGE_UNITS,
MaxVertexUniformVectors = gl::MAX_VERTEX_UNIFORM_VECTORS,
PackAlignment = gl::PACK_ALIGNMENT,
RedBits = gl::RED_BITS,
SampleBuffers = gl::SAMPLE_BUFFERS,
@@ -68,7 +68,7 @@ mozjs = { version = "0.6", features = ["promises"]}
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.16", features = ["serde"]}
offscreen_gl_context = {version = "0.17", features = ["serde"]}
parking_lot = "0.5"
phf = "0.7.18"
profile_traits = {path = "../profile_traits"}
@@ -51,7 +51,7 @@ use euclid::Size2D;
use fnv::FnvHashMap;
use half::f16;
use js::jsapi::{JSContext, JSObject, Type};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value, JSVal, NullValue, UndefinedValue};
use js::rust::CustomAutoRooterGuard;
use js::typedarray::ArrayBufferView;
use net_traits::image::base::PixelFormat;
@@ -1337,6 +1337,35 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
_ => {}
}

// Handle any MAX_ parameters by retrieving the limits that were stored
// when this context was created.
let limit = match parameter {
constants::MAX_VERTEX_ATTRIBS =>
Some(self.limits.max_vertex_attribs),
constants::MAX_TEXTURE_SIZE =>
Some(self.limits.max_tex_size),
constants::MAX_CUBE_MAP_TEXTURE_SIZE =>
Some(self.limits.max_cube_map_tex_size),
constants::MAX_COMBINED_TEXTURE_IMAGE_UNITS =>
Some(self.limits.max_combined_texture_image_units),
constants::MAX_FRAGMENT_UNIFORM_VECTORS =>
Some(self.limits.max_fragment_uniform_vectors),
constants::MAX_RENDERBUFFER_SIZE =>
Some(self.limits.max_renderbuffer_size),
constants::MAX_TEXTURE_IMAGE_UNITS =>
Some(self.limits.max_texture_image_units),
constants::MAX_VARYING_VECTORS =>
Some(self.limits.max_varying_vectors),
constants::MAX_VERTEX_TEXTURE_IMAGE_UNITS =>
Some(self.limits.max_vertex_texture_image_units),
constants::MAX_VERTEX_UNIFORM_VECTORS =>
Some(self.limits.max_vertex_uniform_vectors),
_ => None,
};
if let Some(limit) = limit {
return UInt32Value(limit);
}

if !self.extension_manager.is_get_parameter_name_enabled(parameter) {
self.webgl_error(WebGLError::InvalidEnum);
return NullValue();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.