Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz

Differential Revision: https://phabricator.services.mozilla.com/D174197
This commit is contained in:
Kelsey Gilbert
2023-03-31 18:48:20 +00:00
parent 617cd2fcfa
commit 9d47482195
21 changed files with 171 additions and 0 deletions

View File

@@ -2000,6 +2000,11 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname,
retval.set(JS::NumberValue(state.mPixelUnpackState.colorspaceConversion));
return;
case dom::WEBGL_provoking_vertex_Binding::PROVOKING_VERTEX_WEBGL:
if (!IsExtensionEnabled(WebGLExtensionID::WEBGL_provoking_vertex)) break;
retval.set(JS::NumberValue(UnderlyingValue(state.mProvokingVertex)));
return;
// -
// Array returns
@@ -5664,6 +5669,18 @@ void ClientWebGLContext::GetSupportedProfilesASTC(
}
}
void ClientWebGLContext::ProvokingVertex(const GLenum rawMode) const {
const FuncScope funcScope(*this, "provokingVertex");
if (IsContextLost()) return;
const auto mode = webgl::AsEnumCase<webgl::ProvokingVertex>(rawMode);
if (!mode) return;
Run<RPROC(ProvokingVertex)>(*mode);
funcScope.mKeepNotLostOrNull->state.mProvokingVertex = *mode;
}
// -
bool ClientWebGLContext::ShouldResistFingerprinting() const {