Capture/Replay: Add fixture SetCurrentContextID

This is needed for better context handling

Bug: angleproject:7911
Change-Id: Ieccb0f9660a8d607fe2bcee87b7a9b4ff2e25a50
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4236543
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Trevor Black <vantablack@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
This commit is contained in:
Gert Wollny
2023-02-09 17:48:40 +01:00
committed by Angle LUCI CQ
parent 0e9b8f363d
commit 4448ce5c5f
4 changed files with 19 additions and 2 deletions

View File

@@ -18,7 +18,7 @@
"third_party/OpenGL-Registry/src/xml/wgl.xml":
"eae784bf4d1b983a42af5671b140b7c4",
"util/capture/trace_fixture.h":
"e104737e155564178eb9d961dac7b16e",
"7eebdec11ef0719cf3fb46d6218eae7f",
"util/capture/trace_interpreter_autogen.cpp":
"71212e78fb49324d083956260c874837"
"0f0538c6ff28bc1022b6ab5d34a6ca77"
}

View File

@@ -630,6 +630,11 @@ void CreateContext(GLuint contextID)
gContextMap2[contextID] = context;
}
void SetCurrentContextID(GLuint id)
{
gContextMap2[id] = eglGetCurrentContext();
}
ANGLE_REPLAY_EXPORT PFNEGLCREATEIMAGEPROC r_eglCreateImage;
ANGLE_REPLAY_EXPORT PFNEGLCREATEIMAGEKHRPROC r_eglCreateImageKHR;
ANGLE_REPLAY_EXPORT PFNEGLDESTROYIMAGEPROC r_eglDestroyImage;

View File

@@ -213,6 +213,8 @@ void UpdateTextureID(GLuint id, GLsizei readBufferOffset);
void UpdateTransformFeedbackID(GLuint id, GLsizei readBufferOffset);
void UpdateVertexArrayID(GLuint id, GLsizei readBufferOffset);
void SetCurrentContextID(GLuint id);
void SetFramebufferID(GLuint id);
void SetBufferID(GLuint id);
void SetRenderbufferID(GLuint id);

View File

@@ -6181,6 +6181,11 @@ CallCapture ParseCallCapture(const Token &nameToken,
ParamBuffer params = ParseParameters<decltype(SetBufferID)>(paramTokens, strings);
return CallCapture("SetBufferID", std::move(params));
}
if (strcmp(nameToken, "SetCurrentContextID") == 0)
{
ParamBuffer params = ParseParameters<decltype(SetCurrentContextID)>(paramTokens, strings);
return CallCapture("SetCurrentContextID", std::move(params));
}
if (strcmp(nameToken, "SetFramebufferID") == 0)
{
ParamBuffer params = ParseParameters<decltype(SetFramebufferID)>(paramTokens, strings);
@@ -6508,6 +6513,11 @@ void ReplayCustomFunctionCall(const CallCapture &call, const TraceFunctionMap &c
DispatchCallCapture(SetBufferID, captures);
return;
}
if (call.customFunctionName == "SetCurrentContextID")
{
DispatchCallCapture(SetCurrentContextID, captures);
return;
}
if (call.customFunctionName == "SetFramebufferID")
{
DispatchCallCapture(SetFramebufferID, captures);