From 46594c9636fe2ba293231bb5494bf05b24de3caf Mon Sep 17 00:00:00 2001 From: Manh Nguyen Date: Thu, 11 Jun 2020 15:20:10 -0400 Subject: [PATCH] Fill in missing GL methods for TextureTest Bug: angleproject:4732 Change-Id: Ic475e29b6ca641029243712115d6a578a48c85f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241624 Commit-Queue: Manh Nguyen Reviewed-by: Jamie Madill Reviewed-by: Cody Northrop --- src/libANGLE/FrameCapture.h | 15 +++++++++++++++ src/libANGLE/capture_gles_2_0_params.cpp | 15 ++++++++------- src/libANGLE/capture_gles_3_0_params.cpp | 10 ++++++---- src/libANGLE/capture_gles_3_2_params.cpp | 22 ++++++++++++++-------- src/libANGLE/capture_gles_ext_params.cpp | 21 +++++++++++++-------- 5 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/libANGLE/FrameCapture.h b/src/libANGLE/FrameCapture.h index 455c00883..92df183af 100644 --- a/src/libANGLE/FrameCapture.h +++ b/src/libANGLE/FrameCapture.h @@ -496,4 +496,19 @@ void WriteParamValueReplay(std::ostream &os, const CallCapture &call, T value) } } // namespace angle +template +void CaptureTextureAndSamplerParameter_params(GLenum pname, + const T *param, + angle::ParamCapture *paramCapture) +{ + if (pname == GL_TEXTURE_BORDER_COLOR) + { + CaptureMemory(param, sizeof(T) * 4, paramCapture); + } + else + { + CaptureMemory(param, sizeof(T), paramCapture); + } +} + #endif // LIBANGLE_FRAME_CAPTURE_H_ diff --git a/src/libANGLE/capture_gles_2_0_params.cpp b/src/libANGLE/capture_gles_2_0_params.cpp index f43915ee5..677a0716b 100644 --- a/src/libANGLE/capture_gles_2_0_params.cpp +++ b/src/libANGLE/capture_gles_2_0_params.cpp @@ -515,7 +515,9 @@ void CaptureGetTexParameterfv_params(const State &glState, GLfloat *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + // page 190 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + // TEXTURE_BORDER_COLOR: 4 floats, ints, uints + paramCapture->readBufferSizeBytes = sizeof(GLfloat) * 4; } void CaptureGetTexParameteriv_params(const State &glState, @@ -525,10 +527,9 @@ void CaptureGetTexParameteriv_params(const State &glState, GLint *params, ParamCapture *paramCapture) { - if (params) - { - paramCapture->readBufferSizeBytes = sizeof(GLint); - } + // page 190 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + // TEXTURE_BORDER_COLOR: 4 floats, ints, uints + paramCapture->readBufferSizeBytes = sizeof(GLint) * 4; } void CaptureGetUniformLocation_name(const State &glState, @@ -714,7 +715,7 @@ void CaptureTexParameterfv_params(const State &glState, const GLfloat *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, params, paramCapture); } void CaptureTexParameteriv_params(const State &glState, @@ -724,7 +725,7 @@ void CaptureTexParameteriv_params(const State &glState, const GLint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, params, paramCapture); } void CaptureTexSubImage2D_pixels(const State &glState, diff --git a/src/libANGLE/capture_gles_3_0_params.cpp b/src/libANGLE/capture_gles_3_0_params.cpp index a31303b46..0359e2dc8 100644 --- a/src/libANGLE/capture_gles_3_0_params.cpp +++ b/src/libANGLE/capture_gles_3_0_params.cpp @@ -433,7 +433,8 @@ void CaptureGetSamplerParameterfv_params(const State &glState, GLfloat *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + // page 458 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + paramCapture->readBufferSizeBytes = 4 * sizeof(GLfloat); } void CaptureGetSamplerParameteriv_params(const State &glState, @@ -443,7 +444,8 @@ void CaptureGetSamplerParameteriv_params(const State &glState, GLint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + // page 458 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + paramCapture->readBufferSizeBytes = 4 * sizeof(GLint); } void CaptureGetSynciv_length(const State &glState, @@ -642,7 +644,7 @@ void CaptureSamplerParameterfv_param(const State &glState, const GLfloat *param, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, param, paramCapture); } void CaptureSamplerParameteriv_param(const State &glState, @@ -652,7 +654,7 @@ void CaptureSamplerParameteriv_param(const State &glState, const GLint *param, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, param, paramCapture); } void CaptureTexImage3D_pixels(const State &glState, diff --git a/src/libANGLE/capture_gles_3_2_params.cpp b/src/libANGLE/capture_gles_3_2_params.cpp index 6a391a72c..a5c5c468f 100644 --- a/src/libANGLE/capture_gles_3_2_params.cpp +++ b/src/libANGLE/capture_gles_3_2_params.cpp @@ -250,7 +250,8 @@ void CaptureGetSamplerParameterIiv_params(const State &glState, GLint *params, ParamCapture *paramsParam) { - UNIMPLEMENTED(); + // page 458 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + paramsParam->readBufferSizeBytes = sizeof(GLint) * 4; } void CaptureGetSamplerParameterIuiv_params(const State &glState, @@ -260,7 +261,8 @@ void CaptureGetSamplerParameterIuiv_params(const State &glState, GLuint *params, ParamCapture *paramsParam) { - UNIMPLEMENTED(); + // page 458 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + paramsParam->readBufferSizeBytes = sizeof(GLuint) * 4; } void CaptureGetTexParameterIiv_params(const State &glState, @@ -270,7 +272,9 @@ void CaptureGetTexParameterIiv_params(const State &glState, GLint *params, ParamCapture *paramsParam) { - UNIMPLEMENTED(); + // page 192 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + // TEXTURE_BORDER_COLOR: 4 floats, ints, uints + paramsParam->readBufferSizeBytes = sizeof(GLint) * 4; } void CaptureGetTexParameterIuiv_params(const State &glState, @@ -280,7 +284,9 @@ void CaptureGetTexParameterIuiv_params(const State &glState, GLuint *params, ParamCapture *paramsParam) { - UNIMPLEMENTED(); + // page 192 https://www.khronos.org/registry/OpenGL/specs/es/3.2/es_spec_3.2.pdf + // TEXTURE_BORDER_COLOR: 4 floats, ints, uints + paramsParam->readBufferSizeBytes = sizeof(GLuint) * 4; } void CaptureGetnUniformfv_params(const State &glState, @@ -380,7 +386,7 @@ void CaptureSamplerParameterIiv_param(const State &glState, const GLint *param, ParamCapture *paramParam) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, param, paramParam); } void CaptureSamplerParameterIuiv_param(const State &glState, @@ -390,7 +396,7 @@ void CaptureSamplerParameterIuiv_param(const State &glState, const GLuint *param, ParamCapture *paramParam) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, param, paramParam); } void CaptureTexParameterIiv_params(const State &glState, @@ -400,7 +406,7 @@ void CaptureTexParameterIiv_params(const State &glState, const GLint *params, ParamCapture *paramParam) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, params, paramParam); } void CaptureTexParameterIuiv_params(const State &glState, @@ -410,7 +416,7 @@ void CaptureTexParameterIuiv_params(const State &glState, const GLuint *params, ParamCapture *paramParam) { - UNIMPLEMENTED(); + CaptureTextureAndSamplerParameter_params(pname, params, paramParam); } } // namespace gl diff --git a/src/libANGLE/capture_gles_ext_params.cpp b/src/libANGLE/capture_gles_ext_params.cpp index 2de95a0a4..e867c992e 100644 --- a/src/libANGLE/capture_gles_ext_params.cpp +++ b/src/libANGLE/capture_gles_ext_params.cpp @@ -10,6 +10,7 @@ #include "libANGLE/capture_gles_2_0_autogen.h" #include "libANGLE/capture_gles_3_0_autogen.h" +#include "libANGLE/capture_gles_3_2_autogen.h" using namespace angle; @@ -3143,7 +3144,8 @@ void CaptureGetSamplerParameterIivOES_params(const State &glState, GLint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureGetSamplerParameterIiv_params(glState, isCallValid, sampler, pname, params, + paramCapture); } void CaptureGetSamplerParameterIuivOES_params(const State &glState, @@ -3153,7 +3155,8 @@ void CaptureGetSamplerParameterIuivOES_params(const State &glState, GLuint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureGetSamplerParameterIuiv_params(glState, isCallValid, sampler, pname, params, + paramCapture); } void CaptureGetTexParameterIivOES_params(const State &glState, @@ -3163,7 +3166,8 @@ void CaptureGetTexParameterIivOES_params(const State &glState, GLint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureGetTexParameterIiv_params(glState, isCallValid, targetPacked, pname, params, + paramCapture); } void CaptureGetTexParameterIuivOES_params(const State &glState, @@ -3173,7 +3177,8 @@ void CaptureGetTexParameterIuivOES_params(const State &glState, GLuint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureGetTexParameterIuiv_params(glState, isCallValid, targetPacked, pname, params, + paramCapture); } void CaptureSamplerParameterIivOES_param(const State &glState, @@ -3183,7 +3188,7 @@ void CaptureSamplerParameterIivOES_param(const State &glState, const GLint *param, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureSamplerParameterIiv_param(glState, isCallValid, sampler, pname, param, paramCapture); } void CaptureSamplerParameterIuivOES_param(const State &glState, @@ -3193,7 +3198,7 @@ void CaptureSamplerParameterIuivOES_param(const State &glState, const GLuint *param, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureSamplerParameterIuiv_param(glState, isCallValid, sampler, pname, param, paramCapture); } void CaptureTexParameterIivOES_params(const State &glState, @@ -3203,7 +3208,7 @@ void CaptureTexParameterIivOES_params(const State &glState, const GLint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTexParameterIiv_params(glState, isCallValid, targetPacked, pname, params, paramCapture); } void CaptureTexParameterIuivOES_params(const State &glState, @@ -3213,7 +3218,7 @@ void CaptureTexParameterIuivOES_params(const State &glState, const GLuint *params, ParamCapture *paramCapture) { - UNIMPLEMENTED(); + CaptureTexParameterIuiv_params(glState, isCallValid, targetPacked, pname, params, paramCapture); } void CaptureGetTexGenfvOES_params(const State &glState,