Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display format modifiers as hexadecimal values #915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lfrb
Copy link
Contributor

@lfrb lfrb commented Apr 25, 2024

It doesn't make sense to show modifiers as a decimal value and they are easier to parse with the hexadecimal representation.

This add a new API type (Formatted) that is serialized as a Repr value in the trace file. The values are gonna show up properly as long as the newest version of apitrace (with these patches) is used to generate the trace as the human value is embedded in the file.

@jrfonseca
Copy link
Member

I think a new Formatted is overkill. Bitmasks are already dumped as hexadecimals.

Please try an empty Bitmask instead, like:

diff --git a/specs/eglapi.py b/specs/eglapi.py
index 31e51cd9..0888f783 100644
--- a/specs/eglapi.py
+++ b/specs/eglapi.py
@@ -61,6 +61,8 @@ EGLDeviceEXT = Opaque("EGLDeviceEXT")
 
 # EGL_EXT_image_dma_buf_import_modifiers
 EGLuint64KHR = Alias("EGLuint64KHR", UInt64)
+EGLModifier = Bitmask(EGLuint64KHR, [])
+Hex = Bitmask(Int, [])
 
 # EGL_KHR_image_base
 EGLImageKHR = Alias("EGLImageKHR", EGLImage)

The only caveat is that Bitmask assumes the value is unsigned. Hopefully it doesn't matter here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants