Implement most of the unsupported parameters in gl.getParameter()

Fixes #20536.
Fixes #20537.
Fixes #20538.
Fixes #20544.
Fixes #20545.
Fixes #20546.
Fixes #20548.
Fixes #20549.
Fixes #20551.
This commit is contained in:
Anthony Ramine 2018-05-09 16:23:09 +02:00
parent d4df55b417
commit 3e510ec008
6 changed files with 67 additions and 321 deletions

View file

@ -272,10 +272,12 @@ pub enum WebGLCommand {
DeleteVertexArray(WebGLVertexArrayId),
BindVertexArray(Option<WebGLVertexArrayId>),
GetParameterBool(ParameterBool, WebGLSender<bool>),
GetParameterBool4(ParameterBool4, WebGLSender<[bool; 4]>),
GetParameterInt(ParameterInt, WebGLSender<i32>),
GetParameterInt4(ParameterInt4, WebGLSender<[i32; 4]>),
GetParameterFloat(ParameterFloat, WebGLSender<f32>),
GetParameterFloat2(ParameterFloat2, WebGLSender<[f32; 2]>),
GetParameterFloat4(ParameterFloat4, WebGLSender<[f32; 4]>),
GetProgramParameterBool(WebGLProgramId, ProgramParameterBool, WebGLSender<bool>),
GetProgramParameterInt(WebGLProgramId, ProgramParameterInt, WebGLSender<i32>),
GetShaderParameterBool(WebGLShaderId, ShaderParameterBool, WebGLSender<bool>),
@ -535,10 +537,12 @@ impl fmt::Debug for WebGLCommand {
DeleteVertexArray(..) => "DeleteVertexArray",
BindVertexArray(..) => "BindVertexArray",
GetParameterBool(..) => "GetParameterBool",
GetParameterBool4(..) => "GetParameterBool4",
GetParameterInt(..) => "GetParameterInt",
GetParameterInt4(..) => "GetParameterInt4",
GetParameterFloat(..) => "GetParameterFloat",
GetParameterFloat2(..) => "GetParameterFloat2",
GetParameterFloat4(..) => "GetParameterFloat4",
GetProgramParameterBool(..) => "GetProgramParameterBool",
GetProgramParameterInt(..) => "GetProgramParameterInt",
GetShaderParameterBool(..) => "GetShaderParameterBool",
@ -592,8 +596,12 @@ parameters! {
Dither = gl::DITHER,
PolygonOffsetFill = gl::POLYGON_OFFSET_FILL,
SampleCoverageInvert = gl::SAMPLE_COVERAGE_INVERT,
ScissorTest = gl::SCISSOR_TEST,
StencilTest = gl::STENCIL_TEST,
}),
Bool4(ParameterBool4 {
ColorWritemask = gl::COLOR_WRITEMASK,
}),
Int(ParameterInt {
ActiveTexture = gl::ACTIVE_TEXTURE,
AlphaBits = gl::ALPHA_BITS,
@ -607,15 +615,20 @@ parameters! {
CullFaceMode = gl::CULL_FACE_MODE,
DepthBits = gl::DEPTH_BITS,
DepthFunc = gl::DEPTH_FUNC,
FragmentShaderDerivativeHint = gl::FRAGMENT_SHADER_DERIVATIVE_HINT,
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,
@ -638,9 +651,9 @@ parameters! {
StencilWritemask = gl::STENCIL_WRITEMASK,
SubpixelBits = gl::SUBPIXEL_BITS,
UnpackAlignment = gl::UNPACK_ALIGNMENT,
FragmentShaderDerivativeHint = gl::FRAGMENT_SHADER_DERIVATIVE_HINT,
}),
Int4(ParameterInt4 {
ScissorBox = gl::SCISSOR_BOX,
Viewport = gl::VIEWPORT,
}),
Float(ParameterFloat {
@ -653,6 +666,11 @@ parameters! {
Float2(ParameterFloat2 {
AliasedPointSizeRange = gl::ALIASED_POINT_SIZE_RANGE,
AliasedLineWidthRange = gl::ALIASED_LINE_WIDTH_RANGE,
DepthRange = gl::DEPTH_RANGE,
}),
Float4(ParameterFloat4 {
BlendColor = gl::BLEND_COLOR,
ColorClearValue = gl::COLOR_CLEAR_VALUE,
}),
}
}