Commit 7c1af2d5 by Jamie Madill Committed by Commit Bot

Capture/Replay: Use GL types for packed types.

Previously we were trying to use the packed enum types for our replay. This wouldn't work as the packed enum types don't exist outside of ANGLE. Bug: angleproject:3611 Change-Id: Id0d5c9f37304b30c204bac9bc7873661b035f918 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754324 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 1d742ce8
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"711fe78fe4838ac5451385275605a69a", "711fe78fe4838ac5451385275605a69a",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"61b57bcf1af62062abbc099c01d2fada", "4f2df44653e2b16f63fca29a14311dd5",
"scripts/gl.xml": "scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708", "b470cb06b06cbbe7adb2c8129ec85708",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
"src/libANGLE/entry_points_enum_autogen.h": "src/libANGLE/entry_points_enum_autogen.h":
"909cf5a69dcfd6131a45fa26e6abff47", "909cf5a69dcfd6131a45fa26e6abff47",
"src/libANGLE/frame_capture_utils_autogen.cpp": "src/libANGLE/frame_capture_utils_autogen.cpp":
"4a8681f3059bd2766bdb64a972ff0289", "2b944324c4ab2c3659addea329394119",
"src/libANGLE/frame_capture_utils_autogen.h": "src/libANGLE/frame_capture_utils_autogen.h":
"b878ba5c9271e1dc3f8c7feee360c2ab", "b878ba5c9271e1dc3f8c7feee360c2ab",
"src/libANGLE/validationES1_autogen.h": "src/libANGLE/validationES1_autogen.h":
......
...@@ -1163,10 +1163,11 @@ def write_capture_source(annotation_with_dash, annotation_no_dash, comment, capt ...@@ -1163,10 +1163,11 @@ def write_capture_source(annotation_with_dash, annotation_no_dash, comment, capt
out.close() out.close()
def get_param_type_type(param_type): def is_packed_enum_param_type(param_type):
return param_type[0:2] != "GL" and "void" not in param_type
if param_type[0:2] != "GL" and "void" not in param_type:
param_type = "gl::" + param_type def get_gl_pointer_type(param_type):
if "ConstPointerPointer" in param_type: if "ConstPointerPointer" in param_type:
return "const " + param_type.replace("ConstPointerPointer", "") + " * const *" return "const " + param_type.replace("ConstPointerPointer", "") + " * const *"
...@@ -1183,6 +1184,27 @@ def get_param_type_type(param_type): ...@@ -1183,6 +1184,27 @@ def get_param_type_type(param_type):
return param_type return param_type
def get_param_type_type(param_type):
if is_packed_enum_param_type(param_type):
param_type = "gl::" + param_type
return get_gl_pointer_type(param_type)
def get_gl_param_type_type(param_type):
if not is_packed_enum_param_type(param_type):
return get_gl_pointer_type(param_type)
else:
base_type = param_type.replace("Pointer", "").replace("Const", "")
if base_type[-2:] == "ID":
replace_type = "GLuint"
else:
replace_type = "GLenum"
param_type = param_type.replace(base_type, replace_type)
return get_gl_pointer_type(param_type)
def get_param_type_union_name(param_type): def get_param_type_union_name(param_type):
return param_type + "Val" return param_type + "Val"
...@@ -1233,7 +1255,7 @@ def write_capture_helper_header(all_param_types): ...@@ -1233,7 +1255,7 @@ def write_capture_helper_header(all_param_types):
def format_param_type_to_string_case(param_type): def format_param_type_to_string_case(param_type):
return template_param_type_to_string_case.format( return template_param_type_to_string_case.format(
enum=param_type, type=get_param_type_type(param_type)) enum=param_type, type=get_gl_param_type_type(param_type))
def write_capture_helper_source(all_param_types): def write_capture_helper_source(all_param_types):
......
...@@ -333,23 +333,23 @@ const char *ParamTypeToString(ParamType paramType) ...@@ -333,23 +333,23 @@ const char *ParamTypeToString(ParamType paramType)
switch (paramType) switch (paramType)
{ {
case ParamType::TAlphaTestFunc: case ParamType::TAlphaTestFunc:
return "gl::AlphaTestFunc"; return "GLenum";
case ParamType::TBufferBinding: case ParamType::TBufferBinding:
return "gl::BufferBinding"; return "GLenum";
case ParamType::TBufferID: case ParamType::TBufferID:
return "gl::BufferID"; return "GLuint";
case ParamType::TBufferIDConstPointer: case ParamType::TBufferIDConstPointer:
return "const gl::BufferID *"; return "const GLuint *";
case ParamType::TBufferIDPointer: case ParamType::TBufferIDPointer:
return "gl::BufferID *"; return "GLuint *";
case ParamType::TBufferUsage: case ParamType::TBufferUsage:
return "gl::BufferUsage"; return "GLenum";
case ParamType::TClientVertexArrayType: case ParamType::TClientVertexArrayType:
return "gl::ClientVertexArrayType"; return "GLenum";
case ParamType::TCullFaceMode: case ParamType::TCullFaceMode:
return "gl::CullFaceMode"; return "GLenum";
case ParamType::TDrawElementsType: case ParamType::TDrawElementsType:
return "gl::DrawElementsType"; return "GLenum";
case ParamType::TGLDEBUGPROC: case ParamType::TGLDEBUGPROC:
return "GLDEBUGPROC"; return "GLDEBUGPROC";
case ParamType::TGLDEBUGPROCKHR: case ParamType::TGLDEBUGPROCKHR:
...@@ -457,51 +457,51 @@ const char *ParamTypeToString(ParamType paramType) ...@@ -457,51 +457,51 @@ const char *ParamTypeToString(ParamType paramType)
case ParamType::TGLvoidConstPointerPointer: case ParamType::TGLvoidConstPointerPointer:
return "const GLvoid * const *"; return "const GLvoid * const *";
case ParamType::TGraphicsResetStatus: case ParamType::TGraphicsResetStatus:
return "gl::GraphicsResetStatus"; return "GLenum";
case ParamType::THandleType: case ParamType::THandleType:
return "gl::HandleType"; return "GLenum";
case ParamType::TLightParameter: case ParamType::TLightParameter:
return "gl::LightParameter"; return "GLenum";
case ParamType::TLogicalOperation: case ParamType::TLogicalOperation:
return "gl::LogicalOperation"; return "GLenum";
case ParamType::TMaterialParameter: case ParamType::TMaterialParameter:
return "gl::MaterialParameter"; return "GLenum";
case ParamType::TMatrixType: case ParamType::TMatrixType:
return "gl::MatrixType"; return "GLenum";
case ParamType::TPointParameter: case ParamType::TPointParameter:
return "gl::PointParameter"; return "GLenum";
case ParamType::TPrimitiveMode: case ParamType::TPrimitiveMode:
return "gl::PrimitiveMode"; return "GLenum";
case ParamType::TProvokingVertexConvention: case ParamType::TProvokingVertexConvention:
return "gl::ProvokingVertexConvention"; return "GLenum";
case ParamType::TQueryType: case ParamType::TQueryType:
return "gl::QueryType"; return "GLenum";
case ParamType::TRenderbufferID: case ParamType::TRenderbufferID:
return "gl::RenderbufferID"; return "GLuint";
case ParamType::TRenderbufferIDConstPointer: case ParamType::TRenderbufferIDConstPointer:
return "const gl::RenderbufferID *"; return "const GLuint *";
case ParamType::TRenderbufferIDPointer: case ParamType::TRenderbufferIDPointer:
return "gl::RenderbufferID *"; return "GLuint *";
case ParamType::TShaderType: case ParamType::TShaderType:
return "gl::ShaderType"; return "GLenum";
case ParamType::TShadingModel: case ParamType::TShadingModel:
return "gl::ShadingModel"; return "GLenum";
case ParamType::TTextureEnvParameter: case ParamType::TTextureEnvParameter:
return "gl::TextureEnvParameter"; return "GLenum";
case ParamType::TTextureEnvTarget: case ParamType::TTextureEnvTarget:
return "gl::TextureEnvTarget"; return "GLenum";
case ParamType::TTextureID: case ParamType::TTextureID:
return "gl::TextureID"; return "GLuint";
case ParamType::TTextureIDConstPointer: case ParamType::TTextureIDConstPointer:
return "const gl::TextureID *"; return "const GLuint *";
case ParamType::TTextureIDPointer: case ParamType::TTextureIDPointer:
return "gl::TextureID *"; return "GLuint *";
case ParamType::TTextureTarget: case ParamType::TTextureTarget:
return "gl::TextureTarget"; return "GLenum";
case ParamType::TTextureType: case ParamType::TTextureType:
return "gl::TextureType"; return "GLenum";
case ParamType::TVertexAttribType: case ParamType::TVertexAttribType:
return "gl::VertexAttribType"; return "GLenum";
case ParamType::TvoidConstPointer: case ParamType::TvoidConstPointer:
return "const void *"; return "const void *";
case ParamType::TvoidConstPointerPointer: case ParamType::TvoidConstPointerPointer:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment