mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
Simplify aliasing-exception logic in entry point generation
Bug: angleproject:8224 Change-Id: Ic54c233ab3d8a0f9a1ac803804aea770c6f7cc07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4672145 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
committed by
Angle LUCI CQ
parent
51320fab57
commit
04c0cc8d59
@@ -6,7 +6,7 @@
|
||||
"scripts/entry_point_packed_gl_enums.json":
|
||||
"1c6b036918aabb9822a638fbf33f87f4",
|
||||
"scripts/generate_entry_points.py":
|
||||
"70e56ce5dd5023380871defc054d0871",
|
||||
"d03d190bd9fa8342c7b5d42e52d86f34",
|
||||
"scripts/gl_angle_ext.xml":
|
||||
"49a0bf469d6f44c532098ef3a9fd087f",
|
||||
"scripts/registry_xml.py":
|
||||
|
||||
@@ -32,20 +32,18 @@ NO_EVENT_MARKER_EXCEPTIONS_LIST = sorted([
|
||||
"glInsertEventMarkerEXT",
|
||||
])
|
||||
|
||||
# glRenderbufferStorageMultisampleEXT aliases glRenderbufferStorageMultisample on desktop GL, and is
|
||||
# marked as such in the registry. However, that is not correct for GLES where this entry point
|
||||
# comes from GL_EXT_multisampled_render_to_texture which is never promoted to core GLES.
|
||||
ALIASING_EXCEPTIONS = [
|
||||
'glRenderbufferStorageMultisampleEXT',
|
||||
# glRenderbufferStorageMultisampleEXT aliases
|
||||
# glRenderbufferStorageMultisample on desktop GL, and is marked as such in
|
||||
# the registry. However, that is not correct for GLES where this entry
|
||||
# point comes from GL_EXT_multisampled_render_to_texture which is never
|
||||
# promoted to core GLES.
|
||||
'renderbufferStorageMultisampleEXT',
|
||||
'RenderbufferStorageMultisampleEXT',
|
||||
# Other entry points where the extension behavior is not identical to core
|
||||
# behavior.
|
||||
'drawArraysInstancedBaseInstanceANGLE',
|
||||
'DrawArraysInstancedBaseInstanceANGLE',
|
||||
'drawElementsInstancedBaseVertexBaseInstanceANGLE',
|
||||
'DrawElementsInstancedBaseVertexBaseInstanceANGLE',
|
||||
'glLogicOpANGLE',
|
||||
'logicOpANGLE',
|
||||
'LogicOpANGLE',
|
||||
]
|
||||
|
||||
# These are the entry points which potentially are used first by an application
|
||||
@@ -1562,6 +1560,11 @@ CAPTURE_BLOCKLIST = ['eglGetProcAddress']
|
||||
|
||||
|
||||
def is_aliasing_excepted(api, cmd_name):
|
||||
# For simplicity, strip the prefix gl and lower the case of the first
|
||||
# letter. This makes sure that all variants of the cmd_name that reach
|
||||
# here end up looking similar for the sake of looking up in ALIASING_EXCEPTIONS
|
||||
cmd_name = cmd_name[2:] if cmd_name.startswith('gl') else cmd_name
|
||||
cmd_name = cmd_name[0].lower() + cmd_name[1:]
|
||||
return api == apis.GLES and cmd_name in ALIASING_EXCEPTIONS
|
||||
|
||||
|
||||
@@ -1781,15 +1784,19 @@ def get_constext_lost_error_generator(cmd_name):
|
||||
return "GenerateContextLostErrorOnCurrentGlobalContext();"
|
||||
|
||||
|
||||
def strip_suffix_always(api, name):
|
||||
for suffix in registry_xml.strip_suffixes:
|
||||
if name.endswith(suffix):
|
||||
name = name[0:-len(suffix)]
|
||||
return name
|
||||
|
||||
|
||||
def strip_suffix(api, name):
|
||||
# For commands where aliasing is excepted, keep the suffix
|
||||
if is_aliasing_excepted(api, name):
|
||||
return name
|
||||
|
||||
for suffix in registry_xml.strip_suffixes:
|
||||
if name.endswith(suffix):
|
||||
name = name[0:-len(suffix)]
|
||||
return name
|
||||
return strip_suffix_always(api, name)
|
||||
|
||||
|
||||
def find_gl_enum_group_in_command(command_node, param_name):
|
||||
@@ -1807,7 +1814,7 @@ def find_gl_enum_group_in_command(command_node, param_name):
|
||||
|
||||
def get_packed_enums(api, cmd_packed_gl_enums, cmd_name, packed_param_types, params):
|
||||
# Always strip the suffix when querying packed enums.
|
||||
result = cmd_packed_gl_enums.get(strip_suffix(api, cmd_name), {})
|
||||
result = cmd_packed_gl_enums.get(strip_suffix_always(api, cmd_name), {})
|
||||
for param in params:
|
||||
param_type = just_the_type(param)
|
||||
if param_type in packed_param_types:
|
||||
|
||||
Reference in New Issue
Block a user