Module: wine
Branch: master
Commit: d49cbc7f148d4fdca5f96681e241c13a65c242b6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d49cbc7f148d4fdca5f96681…
Author: Georg Lehmann <dadschoorse(a)gmail.com>
Date: Fri Mar 5 14:32:45 2021 +0100
winevulkan: Generate constants for 64bit flags.
Fixes one of the issue related to the changes for VK_KHR_synchronization2.
Signed-off-by: Georg Lehmann <dadschoorse(a)gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook(a)nvidia.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winevulkan/make_vulkan | 55 ++++++++++++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 20 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index d3bf8906efc..1d739c12cae 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -357,8 +357,11 @@ class VkDefine(object):
class VkEnum(object):
- def __init__(self, name, alias=None):
+ def __init__(self, name, bitwidth, alias=None):
+ if not bitwidth in [32, 64]:
+ LOGGER.error("unknown bitwidth {0} for {1}".format(bitwidth, name))
self.name = name
+ self.bitwidth = bitwidth
self.values = [] if alias == None else alias.values
self.required = False
self.alias = alias
@@ -367,7 +370,7 @@ class VkEnum(object):
@staticmethod
def from_alias(enum, alias):
name = enum.attrib.get("name")
- aliasee = VkEnum(name, alias=alias)
+ aliasee = VkEnum(name, alias.bitwidth, alias=alias)
alias.add_aliased_by(aliasee)
return aliasee
@@ -375,7 +378,8 @@ class VkEnum(object):
@staticmethod
def from_xml(enum):
name = enum.attrib.get("name")
- result = VkEnum(name)
+ bitwidth = int(enum.attrib.get("bitwidth", "32"))
+ result = VkEnum(name, bitwidth)
for v in enum.findall("enum"):
value_name = v.attrib.get("name")
@@ -390,28 +394,29 @@ class VkEnum(object):
# bitmask
result.create_bitpos(value_name, int(v.attrib.get("bitpos")))
- # vulkan.h contains a *_MAX_ENUM value set to 32-bit at the time of writing,
- # which is to prepare for extensions as they can add values and hence affect
- # the size definition.
- max_name = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2', name).upper() + "_MAX_ENUM"
- result.create_value(max_name, "0x7fffffff")
+ if bitwidth == 32:
+ # vulkan.h contains a *_MAX_ENUM value set to 32-bit at the time of writing,
+ # which is to prepare for extensions as they can add values and hence affect
+ # the size definition.
+ max_name = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2', name).upper() + "_MAX_ENUM"
+ result.create_value(max_name, "0x7fffffff")
return result
def create_alias(self, name, alias_name):
""" Create an aliased value for this enum """
- self.add(VkEnumValue(name, alias=alias_name))
+ self.add(VkEnumValue(name, self.bitwidth, alias=alias_name))
def create_value(self, name, value):
""" Create a new value for this enum """
# Some values are in hex form. We want to preserve the hex representation
# at least when we convert back to a string. Internally we want to use int.
hex = "0x" in value
- self.add(VkEnumValue(name, value=int(value, 0), hex=hex))
+ self.add(VkEnumValue(name, self.bitwidth, value=int(value, 0), hex=hex))
def create_bitpos(self, name, pos):
""" Create a new bitmask value for this enum """
- self.add(VkEnumValue(name, value=(1 << pos), hex=True))
+ self.add(VkEnumValue(name, self.bitwidth, value=(1 << pos), hex=True))
def add(self, value):
""" Add a value to enum. """
@@ -432,13 +437,20 @@ class VkEnum(object):
if self.is_alias():
return ""
- text = "typedef enum {0}\n{{\n".format(self.name)
+ default_value = 0x7ffffffe if self.bitwidth == 32 else 0xfffffffffffffffe
# Print values sorted, values can have been added in a random order.
- values = sorted(self.values, key=lambda value: value.value if value.value is not None else 0x7ffffffe)
- for value in values:
- text += " {0},\n".format(value.definition())
- text += "}} {0};\n".format(self.name)
+ values = sorted(self.values, key=lambda value: value.value if value.value is not None else default_value)
+
+ if self.bitwidth == 32:
+ text = "typedef enum {0}\n{{\n".format(self.name)
+ for value in values:
+ text += " {0},\n".format(value.definition())
+ text += "}} {0};\n".format(self.name)
+ elif self.bitwidth == 64:
+ text = "typedef VkFlags64 {0};\n\n".format(self.name)
+ for value in values:
+ text += "static const {0} {1};\n".format(self.name, value.definition())
for aliasee in self.aliased_by:
text += "typedef {0} {1};\n".format(self.name, aliasee.name)
@@ -454,28 +466,31 @@ class VkEnum(object):
class VkEnumValue(object):
- def __init__(self, name, value=None, hex=False, alias=None):
+ def __init__(self, name, bitwidth, value=None, hex=False, alias=None):
self.name = name
+ self.bitwidth = bitwidth
self.value = value
self.hex = hex
self.alias = alias
def __repr__(self):
+ postfix = "ull" if self.bitwidth == 64 else ""
if self.is_alias():
return "{0}={1}".format(self.name, self.alias)
- return "{0}={1}".format(self.name, self.value)
+ return "{0}={1}{2}".format(self.name, self.value, postfix)
def definition(self):
""" Convert to text definition e.g. VK_FOO = 1 """
+ postfix = "ull" if self.bitwidth == 64 else ""
if self.is_alias():
return "{0} = {1}".format(self.name, self.alias)
# Hex is commonly used for FlagBits and sometimes within
# a non-FlagBits enum for a bitmask value as well.
if self.hex:
- return "{0} = 0x{1:08x}".format(self.name, self.value)
+ return "{0} = 0x{1:08x}{2}".format(self.name, self.value, postfix)
else:
- return "{0} = {1}".format(self.name, self.value)
+ return "{0} = {1}{2}".format(self.name, self.value, postfix)
def is_alias(self):
return self.alias is not None
Module: wine
Branch: master
Commit: 3a359feb85154c29df947efe798369c158854fb4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3a359feb85154c29df947efe…
Author: Georg Lehmann <dadschoorse(a)gmail.com>
Date: Fri Mar 5 14:32:44 2021 +0100
winevulkan: Rework VkEnumValue creation.
Makes future changes to VkEnumValue easier by deduplicating creation logic.
Signed-off-by: Georg Lehmann <dadschoorse(a)gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook(a)nvidia.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winevulkan/make_vulkan | 49 +++++++++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index 1243f211b5e..d3bf8906efc 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -357,9 +357,9 @@ class VkDefine(object):
class VkEnum(object):
- def __init__(self, name, values, alias=None):
+ def __init__(self, name, alias=None):
self.name = name
- self.values = values
+ self.values = [] if alias == None else alias.values
self.required = False
self.alias = alias
self.aliased_by = []
@@ -367,7 +367,7 @@ class VkEnum(object):
@staticmethod
def from_alias(enum, alias):
name = enum.attrib.get("name")
- aliasee = VkEnum(name, alias.values, alias=alias)
+ aliasee = VkEnum(name, alias=alias)
alias.add_aliased_by(aliasee)
return aliasee
@@ -375,34 +375,43 @@ class VkEnum(object):
@staticmethod
def from_xml(enum):
name = enum.attrib.get("name")
- values = []
+ result = VkEnum(name)
for v in enum.findall("enum"):
+ value_name = v.attrib.get("name")
# Value is either a value or a bitpos, only one can exist.
value = v.attrib.get("value")
alias_name = v.attrib.get("alias")
if alias_name:
- alias = next(x for x in values if x.name == alias_name)
- values.append(VkEnumValue(v.attrib.get("name"), value=alias.value, hex=alias.hex))
+ result.create_alias(value_name, alias_name)
elif value:
- # Some values are in hex form. We want to preserve the hex representation
- # at least when we convert back to a string. Internally we want to use int.
- if "0x" in value:
- values.append(VkEnumValue(v.attrib.get("name"), value=int(value, 0), hex=True))
- else:
- values.append(VkEnumValue(v.attrib.get("name"), value=int(value, 0)))
+ result.create_value(value_name, value)
else:
# bitmask
- value = 1 << int(v.attrib.get("bitpos"))
- values.append(VkEnumValue(v.attrib.get("name"), value=value, hex=True))
+ result.create_bitpos(value_name, int(v.attrib.get("bitpos")))
# vulkan.h contains a *_MAX_ENUM value set to 32-bit at the time of writing,
# which is to prepare for extensions as they can add values and hence affect
# the size definition.
max_name = re.sub(r'([0-9a-z_])([A-Z0-9])',r'\1_\2', name).upper() + "_MAX_ENUM"
- values.append(VkEnumValue(max_name, value=0x7fffffff, hex=True))
+ result.create_value(max_name, "0x7fffffff")
+
+ return result
+
+ def create_alias(self, name, alias_name):
+ """ Create an aliased value for this enum """
+ self.add(VkEnumValue(name, alias=alias_name))
+
+ def create_value(self, name, value):
+ """ Create a new value for this enum """
+ # Some values are in hex form. We want to preserve the hex representation
+ # at least when we convert back to a string. Internally we want to use int.
+ hex = "0x" in value
+ self.add(VkEnumValue(name, value=int(value, 0), hex=hex))
- return VkEnum(name, values)
+ def create_bitpos(self, name, pos):
+ """ Create a new bitmask value for this enum """
+ self.add(VkEnumValue(name, value=(1 << pos), hex=True))
def add(self, value):
""" Add a value to enum. """
@@ -2874,7 +2883,7 @@ class VkRegistry(object):
if "bitpos" in enum_elem.keys():
# We need to add an extra value to an existing enum type.
# E.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG to VkFormatFeatureFlagBits.
- enum.add(VkEnumValue(enum_elem.attrib["name"], value=(1 << int(enum_elem.attrib["bitpos"])), hex=True))
+ enum.create_bitpos(enum_elem.attrib["name"], int(enum_elem.attrib["bitpos"]))
elif "offset" in enum_elem.keys():
# Extensions promoted to Core, have the extension number as part
@@ -2891,12 +2900,12 @@ class VkRegistry(object):
if direction is not None:
value = -value
- enum.add(VkEnumValue(enum_elem.attrib["name"], value=value))
+ enum.create_value(enum_elem.attrib["name"], str(value))
elif "value" in enum_elem.keys():
- enum.add(VkEnumValue(enum_elem.attrib["name"], value=int(enum_elem.attrib["value"])))
+ enum.create_value(enum_elem.attrib["name"], enum_elem.attrib["value"])
elif "alias" in enum_elem.keys():
- enum.add(VkEnumValue(enum_elem.attrib["name"], alias=enum_elem.attrib["alias"]))
+ enum.create_alias(enum_elem.attrib["name"], enum_elem.attrib["alias"])
elif "value" in enum_elem.keys():
# Constants are not aliased, no need to add them here, they'll get added later on.
Module: tools
Branch: master
Commit: c4d02668c9e46a4063055b5e9b5be1cd1d1aa7f1
URL: https://source.winehq.org/git/tools.git/?a=commit;h=c4d02668c9e46a4063055b5…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 8 13:40:51 2021 +0100
testbot/PatchUtils: Fix the module name for directories containing dots.
Wine forces dlls that contain dots in their names to be implemented in
a folder ending in '.dll'. But the module name and test executables
don't have this extra 'extension' and thus deriving them from the
patched filename requires special treatment.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/PatchUtils.pm | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index aeb8743..37b1b77 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -44,6 +44,20 @@ use WineTestBot::Utils;
# Source repository maintenance
#
+sub _Dir2ModuleName($$)
+{
+ my ($Root, $Dir) = @_;
+
+ # Add a .exe extension to program directory names, but not if they already
+ # contain some other extension.
+ return "$Dir.exe" if ($Root eq "programs" and $Dir !~ /\./);
+
+ # Dll directory names can normally be used as is, except if a '.dll'
+ # extension was added because they contain dots.
+ $Dir =~ s/\.dll$//;
+ return $Dir;
+}
+
=pod
=over 12
@@ -107,7 +121,7 @@ sub _LoadWineFiles()
my ($Root, $Module, $File) = ($1, $2, $3);
next if ($File eq "testlist.c");
next if ($File !~ /\.(?:c|spec)$/);
- $Module .= ".exe" if ($Root eq "programs" and $Module !~ /\./);
+ $Module = _Dir2ModuleName($Root, $Module);
$_TestList->{$Module}->{$File} = 1;
}
}
@@ -177,8 +191,7 @@ sub _CreateTestInfo($$$)
{
my ($Impacts, $Root, $Dir) = @_;
- # Don't add an extension to programs that have one already
- my $Module = ($Root eq "programs" and $Dir !~ /\./) ? "$Dir.exe" : $Dir;
+ my $Module = _Dir2ModuleName($Root, $Dir);
$Impacts->{BuildModules}->{$Module} = 1;
$Impacts->{IsWinePatch} = 1;
Module: tools
Branch: master
Commit: e2940cb5dae99a8528628df512640588443ea189
URL: https://source.winehq.org/git/tools.git/?a=commit;h=e2940cb5dae99a8528628df…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Mar 8 01:50:29 2021 +0100
testbot/web: Remove a duplicate </tbody> on the Stats page.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/Stats.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl
index 4a70cb0..bf7f9ba 100644
--- a/testbot/web/Stats.pl
+++ b/testbot/web/Stats.pl
@@ -429,7 +429,7 @@ sub GenerateFooter($)
print "<p>The errors section shows how many <b>Timeouts</b> occurred, that is how many tasks failed to complete within the allotted time; how many failed due to a <b>TestBot error</b>; and how many had to be rerun due to a <b>Transient error</b> such as a network connection issue.</p>\n";
print "</td></tr></tbody>\n";
- print "</tbody></table></div>\n";
+ print "</table></div>\n";
print "<p class='GeneralFooterText'>Generated in ", Elapsed($self->{start}), " s</p>\n";
print "</div>\n";
}