dzn: Add a debug option to enable experimental shader models

This allows us to run with unsigned shaders

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27160>
This commit is contained in:
Jesse Natalie
2023-05-03 13:21:29 -07:00
committed by Marge Bot
parent 90bf4b630b
commit ebcab145cf
4 changed files with 9 additions and 5 deletions

View File

@@ -186,6 +186,7 @@ static const struct debug_control dzn_debug_options[] = {
{ "redirects", DZN_DEBUG_REDIRECTS },
{ "bindless", DZN_DEBUG_BINDLESS },
{ "nobindless", DZN_DEBUG_NO_BINDLESS },
{ "experimental", DZN_DEBUG_EXPERIMENTAL },
{ NULL, 0 }
};
@@ -1806,8 +1807,10 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo,
bool missing_validator = false;
#ifdef _WIN32
instance->dxil_validator = dxil_create_validator(NULL);
missing_validator = !instance->dxil_validator;
if ((instance->debug_flags & DZN_DEBUG_EXPERIMENTAL) == 0) {
instance->dxil_validator = dxil_create_validator(NULL);
missing_validator = !instance->dxil_validator;
}
#endif
if (missing_validator) {

View File

@@ -79,7 +79,7 @@ dzn_meta_compile_shader(struct dzn_device *device, nir_shader *nir,
if ((instance->debug_flags & DZN_DEBUG_DXIL) &&
(instance->debug_flags & DZN_DEBUG_INTERNAL) &&
!res) {
!res && !(instance->debug_flags & DZN_DEBUG_EXPERIMENTAL)) {
fprintf(stderr,
"== VALIDATION ERROR =============================================\n"
"%s\n"
@@ -87,7 +87,7 @@ dzn_meta_compile_shader(struct dzn_device *device, nir_shader *nir,
err ? err : "unknown");
ralloc_free(err);
}
assert(res);
assert(res || (instance->debug_flags & DZN_DEBUG_EXPERIMENTAL));
#endif
void *data;

View File

@@ -450,7 +450,7 @@ dzn_pipeline_compile_shader(struct dzn_device *device,
}
}
if (!res) {
if (!res && !(instance->debug_flags & DZN_DEBUG_EXPERIMENTAL)) {
if (err) {
mesa_loge(
"== VALIDATION ERROR =============================================\n"

View File

@@ -1246,6 +1246,7 @@ enum dzn_debug_flags {
DZN_DEBUG_REDIRECTS = 1 << 9,
DZN_DEBUG_BINDLESS = 1 << 10,
DZN_DEBUG_NO_BINDLESS = 1 << 11,
DZN_DEBUG_EXPERIMENTAL = 1 << 12,
};
struct dzn_instance {