Commit bbfbea9d by Manh Nguyen Committed by Commit Bot

Invalid calls' pointer params are no longer captured

Changes call capture methods generation so that invalid calls no longer capture pointer params. Bug: angleproject:4817 Change-Id: I2d83d4d3334da8ba34925f80aed2de859a10fae5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2346749 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent f9de2e20
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"776bf87905f92e8bc21abfceb2ccf723", "776bf87905f92e8bc21abfceb2ccf723",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"e12540094b7f57778de97b05c16d2e28", "a324715209392c00e7b7dcf978d8be8b",
"scripts/gl.xml": "scripts/gl.xml":
"e74a595068cbdd6064300be1e71b7cc9", "e74a595068cbdd6064300be1e71b7cc9",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
...@@ -66,27 +66,27 @@ ...@@ -66,27 +66,27 @@
"src/libANGLE/Context_gles_ext_autogen.h": "src/libANGLE/Context_gles_ext_autogen.h":
"803fd99c6dd45aeeac2245c5e72f6407", "803fd99c6dd45aeeac2245c5e72f6407",
"src/libANGLE/capture_gles_1_0_autogen.cpp": "src/libANGLE/capture_gles_1_0_autogen.cpp":
"96fc0f501e2e696ab911dad8b400dfb2", "1ee3e4aceb1afa9585aa458c600665a9",
"src/libANGLE/capture_gles_1_0_autogen.h": "src/libANGLE/capture_gles_1_0_autogen.h":
"546173090c85ad28a580ca76cd117484", "546173090c85ad28a580ca76cd117484",
"src/libANGLE/capture_gles_2_0_autogen.cpp": "src/libANGLE/capture_gles_2_0_autogen.cpp":
"9e47542f50b29581f5fcaf5a69f6b518", "d512df459dbc2e61f26c2ebb5330eba8",
"src/libANGLE/capture_gles_2_0_autogen.h": "src/libANGLE/capture_gles_2_0_autogen.h":
"6985d5e3d0126bc8e02dd982267a904f", "6985d5e3d0126bc8e02dd982267a904f",
"src/libANGLE/capture_gles_3_0_autogen.cpp": "src/libANGLE/capture_gles_3_0_autogen.cpp":
"a12c9470569b9d1d63ab0b8be910055f", "6447ab4c579f717a25f86ce3815e49c3",
"src/libANGLE/capture_gles_3_0_autogen.h": "src/libANGLE/capture_gles_3_0_autogen.h":
"b963fec070e0becdcf4af69216cd1c7b", "b963fec070e0becdcf4af69216cd1c7b",
"src/libANGLE/capture_gles_3_1_autogen.cpp": "src/libANGLE/capture_gles_3_1_autogen.cpp":
"c7c4ee0fcebc9bd19f8f4a498f935ac1", "3cd86e846ed49e68f149805a0ddfea8d",
"src/libANGLE/capture_gles_3_1_autogen.h": "src/libANGLE/capture_gles_3_1_autogen.h":
"3d363f4de97b47ecff61e29939dcf11a", "3d363f4de97b47ecff61e29939dcf11a",
"src/libANGLE/capture_gles_3_2_autogen.cpp": "src/libANGLE/capture_gles_3_2_autogen.cpp":
"e0eced5b0e039ee7f800878b9a1c18ee", "5b761dc394b15edeb077fa31faacf083",
"src/libANGLE/capture_gles_3_2_autogen.h": "src/libANGLE/capture_gles_3_2_autogen.h":
"3d8f561944c8e5c06c7c9e68559ff364", "3d8f561944c8e5c06c7c9e68559ff364",
"src/libANGLE/capture_gles_ext_autogen.cpp": "src/libANGLE/capture_gles_ext_autogen.cpp":
"8175da2b610b2efd4cd0618b8891ddea", "a392c54277ac3f609ea31095fe690287",
"src/libANGLE/capture_gles_ext_autogen.h": "src/libANGLE/capture_gles_ext_autogen.h":
"39ba68d335d2a9b1227229c644d8acd1", "39ba68d335d2a9b1227229c644d8acd1",
"src/libANGLE/entry_points_enum_autogen.cpp": "src/libANGLE/entry_points_enum_autogen.cpp":
......
...@@ -338,10 +338,19 @@ template_parameter_capture_value = """paramBuffer.addValueParam("{name}", ParamT ...@@ -338,10 +338,19 @@ template_parameter_capture_value = """paramBuffer.addValueParam("{name}", ParamT
template_parameter_capture_gl_enum = """paramBuffer.addEnumParam("{name}", GLenumGroup::{group}, ParamType::T{type}, {name});""" template_parameter_capture_gl_enum = """paramBuffer.addEnumParam("{name}", GLenumGroup::{group}, ParamType::T{type}, {name});"""
template_parameter_capture_pointer = """ template_parameter_capture_pointer = """
ParamCapture {name}Param("{name}", ParamType::T{type}); if (isCallValid)
InitParamValue(ParamType::T{type}, {name}, &{name}Param.value); {{
{capture_name}({params}, &{name}Param); ParamCapture {name}Param("{name}", ParamType::T{type});
paramBuffer.addParam(std::move({name}Param)); InitParamValue(ParamType::T{type}, {name}, &{name}Param.value);
{capture_name}({params}, &{name}Param);
paramBuffer.addParam(std::move({name}Param));
}}
else
{{
ParamCapture {name}Param("{name}", ParamType::T{type});
InitParamValue(ParamType::T{type}, static_cast<{cast_type}>(nullptr), &{name}Param.value);
paramBuffer.addParam(std::move({name}Param));
}}
""" """
template_parameter_capture_pointer_func = """void {name}({params});""" template_parameter_capture_pointer_func = """void {name}({params});"""
...@@ -674,7 +683,6 @@ template_param_type_to_resource_id_type_case = """ case ParamType::T{enum ...@@ -674,7 +683,6 @@ template_param_type_to_resource_id_type_case = """ case ParamType::T{enum
template_resource_id_type_name_case = """ case ResourceIDType::{resource_id_type}: template_resource_id_type_name_case = """ case ResourceIDType::{resource_id_type}:
return "{resource_id_type}";""" return "{resource_id_type}";"""
def script_relative(path): def script_relative(path):
return os.path.join(os.path.dirname(sys.argv[0]), path) return os.path.join(os.path.dirname(sys.argv[0]), path)
...@@ -909,27 +917,31 @@ def format_capture_method(command, cmd_name, proto, params, all_param_types, cap ...@@ -909,27 +917,31 @@ def format_capture_method(command, cmd_name, proto, params, all_param_types, cap
param_name = just_the_name_packed(param, packed_gl_enums) param_name = just_the_name_packed(param, packed_gl_enums)
param_type = just_the_type_packed(param, packed_gl_enums).strip() param_type = just_the_type_packed(param, packed_gl_enums).strip()
pointer_count = param_type.count("*") pointer_count = param_type.count("*")
param_type = get_capture_param_type_name(param_type) capture_param_type = get_capture_param_type_name(param_type)
if pointer_count > 0: if pointer_count > 0:
params = params_just_name params = params_just_name
capture_name = "Capture%s_%s" % (cmd_name[2:], param_name) capture_name = "Capture%s_%s" % (cmd_name[2:], param_name)
capture = template_parameter_capture_pointer.format( capture = template_parameter_capture_pointer.format(
name=param_name, type=param_type, capture_name=capture_name, params=params) name=param_name,
type=capture_param_type,
capture_name=capture_name,
params=params,
cast_type=param_type)
capture_pointer_func = template_parameter_capture_pointer_func.format( capture_pointer_func = template_parameter_capture_pointer_func.format(
name=capture_name, params=params_with_type + ", angle::ParamCapture *paramCapture") name=capture_name, params=params_with_type + ", angle::ParamCapture *paramCapture")
capture_pointer_funcs += [capture_pointer_func] capture_pointer_funcs += [capture_pointer_func]
elif param_type in ('GLenum', 'GLbitfield'): elif capture_param_type in ('GLenum', 'GLbitfield'):
gl_enum_group = find_gl_enum_group_in_command(command, param_name) gl_enum_group = find_gl_enum_group_in_command(command, param_name)
capture = template_parameter_capture_gl_enum.format( capture = template_parameter_capture_gl_enum.format(
name=param_name, type=param_type, group=gl_enum_group) name=param_name, type=capture_param_type, group=gl_enum_group)
else: else:
capture = template_parameter_capture_value.format(name=param_name, type=param_type) capture = template_parameter_capture_value.format(
name=param_name, type=capture_param_type)
all_param_types.add(param_type) all_param_types.add(capture_param_type)
parameter_captures += [capture] parameter_captures += [capture]
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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