zink/codegen: allow conditional enabling of instance extensions
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11036>
This commit is contained in:
parent
5574868103
commit
bec1e8d3fd
|
@ -137,7 +137,6 @@ zink_create_instance(struct zink_instance_info *instance_info)
|
||||||
%for ext in extensions:
|
%for ext in extensions:
|
||||||
if (!strcmp(extension_props[i].extensionName, ${ext.extension_name_literal()})) {
|
if (!strcmp(extension_props[i].extensionName, ${ext.extension_name_literal()})) {
|
||||||
have_${ext.name_with_vendor()} = true;
|
have_${ext.name_with_vendor()} = true;
|
||||||
extensions[num_extensions++] = ${ext.extension_name_literal()};
|
|
||||||
}
|
}
|
||||||
%endfor
|
%endfor
|
||||||
}
|
}
|
||||||
|
@ -172,7 +171,17 @@ zink_create_instance(struct zink_instance_info *instance_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
%for ext in extensions:
|
%for ext in extensions:
|
||||||
instance_info->have_${ext.name_with_vendor()} = have_${ext.name_with_vendor()};
|
<%
|
||||||
|
conditions = ""
|
||||||
|
if ext.enable_conds:
|
||||||
|
for cond in ext.enable_conds:
|
||||||
|
conditions += "&& (" + cond + ") "
|
||||||
|
conditions = conditions.strip()
|
||||||
|
%>\
|
||||||
|
if (have_${ext.name_with_vendor()} ${conditions}) {
|
||||||
|
instance_info->have_${ext.name_with_vendor()} = have_${ext.name_with_vendor()};
|
||||||
|
extensions[num_extensions++] = ${ext.extension_name_literal()};
|
||||||
|
}
|
||||||
%endfor
|
%endfor
|
||||||
|
|
||||||
%for layer in layers:
|
%for layer in layers:
|
||||||
|
|
Loading…
Reference in New Issue