1
0
forked from mirrors/0ad

Define VkDescriptorType enum only once

Instead of redefining the VkDescriptorType enum for every shader, only
define it once. This avoids unnecessary computation and slightly
increases performance.
This commit is contained in:
Dunedan
2024-10-21 09:02:38 +02:00
parent 5a5d518c28
commit 6eb9a3308a
+7 -7
View File
@@ -52,6 +52,13 @@ STAGE_EXTENSIONS = {
YAML_DIRECTIVE_PATTERN = re.compile(b"^%YAML 1.0\r?\n")
class VkDescriptorType(Enum):
COMBINED_IMAGE_SAMPLER = 1
STORAGE_IMAGE = 3
UNIFORM_BUFFER = 6
STORAGE_BUFFER = 7
def execute(command):
try:
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -200,13 +207,6 @@ def compile_and_reflect(input_mod_path, dependencies, stage, path, out_path, def
add_push_constants(module["push_constants"][0], push_constants)
descriptor_sets = []
if module.get("descriptor_sets"):
class VkDescriptorType(Enum):
COMBINED_IMAGE_SAMPLER = 1
STORAGE_IMAGE = 3
UNIFORM_BUFFER = 6
STORAGE_BUFFER = 7
for descriptor_set in module["descriptor_sets"]:
uniform_set = 1 if use_descriptor_indexing else 0
storage_set = 2