mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-17 21:48:22 +02:00
dzn: use drirc_gen
WSI options are already NULL, so they are never used. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41881>
This commit is contained in:
parent
0dd9b61c80
commit
dbbd251b6f
5 changed files with 78 additions and 43 deletions
|
|
@ -39,7 +39,7 @@
|
|||
#include "util/mesa-blake3.h"
|
||||
#include "util/u_dl.h"
|
||||
|
||||
#include "util/driconf.h"
|
||||
#include "dzn_drirc.h"
|
||||
|
||||
#include "glsl_types.h"
|
||||
|
||||
|
|
@ -248,8 +248,8 @@ dzn_instance_destroy(struct dzn_instance *instance, const VkAllocationCallbacks
|
|||
if (instance->d3d12_mod)
|
||||
util_dl_close(instance->d3d12_mod);
|
||||
|
||||
driDestroyOptionCache(&instance->dri_options);
|
||||
driDestroyOptionInfo(&instance->available_dri_options);
|
||||
driDestroyOptionCache(&instance->drirc.options);
|
||||
driDestroyOptionInfo(&instance->drirc.available_options);
|
||||
|
||||
vk_free2(vk_default_allocator(), alloc, instance);
|
||||
}
|
||||
|
|
@ -667,7 +667,7 @@ dzn_physical_device_get_features(const struct dzn_physical_device *pdev,
|
|||
|
||||
bool support_descriptor_indexing = pdev->shader_model >= D3D_SHADER_MODEL_6_6 &&
|
||||
!(instance->debug_flags & DZN_DEBUG_NO_BINDLESS);
|
||||
bool support_8bit = driQueryOptionb(&instance->dri_options, "dzn_enable_8bit_loads_stores") &&
|
||||
bool support_8bit = instance->drirc.debug.enable_8bit_loads_stores &&
|
||||
pdev->options4.Native16BitShaderOpsSupported;
|
||||
|
||||
*features = (struct vk_features) {
|
||||
|
|
@ -686,7 +686,7 @@ dzn_physical_device_get_features(const struct dzn_physical_device *pdev,
|
|||
.depthBiasClamp = true,
|
||||
.fillModeNonSolid = true,
|
||||
.depthBounds = pdev->options2.DepthBoundsTestSupported,
|
||||
.wideLines = driQueryOptionb(&instance->dri_options, "dzn_claim_wide_lines"),
|
||||
.wideLines = instance->drirc.debug.claim_wide_lines,
|
||||
.largePoints = false,
|
||||
.alphaToOne = false,
|
||||
.multiViewport = false,
|
||||
|
|
@ -1165,7 +1165,7 @@ dzn_physical_device_create(struct vk_instance *instance,
|
|||
pdev->options3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED;
|
||||
|
||||
dzn_physical_device_get_extensions(pdev);
|
||||
if (driQueryOptionb(&dzn_instance->dri_options, "dzn_enable_8bit_loads_stores") &&
|
||||
if (dzn_instance->drirc.debug.enable_8bit_loads_stores &&
|
||||
pdev->options4.Native16BitShaderOpsSupported)
|
||||
pdev->vk.supported_extensions.KHR_8bit_storage = true;
|
||||
if (dzn_instance->debug_flags & DZN_DEBUG_NO_BINDLESS)
|
||||
|
|
@ -1763,28 +1763,17 @@ dzn_enumerate_physical_devices(struct vk_instance *instance)
|
|||
return result;
|
||||
}
|
||||
|
||||
static const driOptionDescription dzn_dri_options[] = {
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_DZN_CLAIM_WIDE_LINES(false)
|
||||
DRI_CONF_DZN_ENABLE_8BIT_LOADS_STORES(false)
|
||||
DRI_CONF_DZN_DISABLE(false)
|
||||
DRI_CONF_VK_WSI_FORCE_SWAPCHAIN_TO_CURRENT_EXTENT(false)
|
||||
DRI_CONF_SECTION_END
|
||||
};
|
||||
|
||||
static void
|
||||
dzn_init_dri_config(struct dzn_instance *instance)
|
||||
{
|
||||
driParseOptionInfo(&instance->available_dri_options, dzn_dri_options,
|
||||
ARRAY_SIZE(dzn_dri_options));
|
||||
driParseConfigFiles(&instance->dri_options, &instance->available_dri_options,
|
||||
&(driConfigFileParseParams) {
|
||||
.driverName = "dzn",
|
||||
.applicationName = instance->vk.app_info.app_name,
|
||||
.applicationVersion = instance->vk.app_info.app_version,
|
||||
.engineName = instance->vk.app_info.engine_name,
|
||||
.engineVersion = instance->vk.app_info.engine_version,
|
||||
});
|
||||
dzn_parse_dri_options(&instance->drirc,
|
||||
&(driConfigFileParseParams) {
|
||||
.driverName = "dzn",
|
||||
.applicationName = instance->vk.app_info.app_name,
|
||||
.applicationVersion = instance->vk.app_info.app_version,
|
||||
.engineName = instance->vk.app_info.engine_name,
|
||||
.engineVersion = instance->vk.app_info.engine_version,
|
||||
});
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
|
@ -1874,7 +1863,7 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo,
|
|||
instance->sync_binary_type = vk_sync_binary_get_type(&dzn_sync_type);
|
||||
dzn_init_dri_config(instance);
|
||||
|
||||
if (driQueryOptionb(&instance->dri_options, "dzn_disable")) {
|
||||
if (instance->drirc.debug.disable) {
|
||||
dzn_instance_destroy(instance, pAllocator);
|
||||
return vk_errorf(NULL, VK_ERROR_INITIALIZATION_FAILED, "dzn_disable set, failing instance creation");
|
||||
}
|
||||
|
|
|
|||
47
src/microsoft/vulkan/dzn_drirc_gen.py
Normal file
47
src/microsoft/vulkan/dzn_drirc_gen.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
|
||||
def declare_options():
|
||||
import drirc_gen
|
||||
|
||||
B = drirc_gen.DrircBool
|
||||
|
||||
debug_options = [
|
||||
B("dzn_claim_wide_lines", False,
|
||||
"Claim wide line support",
|
||||
c_name="claim_wide_lines"),
|
||||
B("dzn_enable_8bit_loads_stores", False,
|
||||
"Enable VK_KHR_8bit_loads_stores",
|
||||
c_name="enable_8bit_loads_stores"),
|
||||
B("dzn_disable", False,
|
||||
"Fail instance creation",
|
||||
c_name="disable"),
|
||||
]
|
||||
|
||||
return [drirc_gen.DrircSection("Debugging", debug_options, c_name="debug")]
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-p', '--import-path', required=True)
|
||||
parser.add_argument('--drirc-src', required=True)
|
||||
parser.add_argument('--drirc-hdr', required=True)
|
||||
parser.add_argument('--validate', required=True)
|
||||
args = parser.parse_args()
|
||||
|
||||
sys.path.insert(0, args.import_path)
|
||||
import drirc_gen
|
||||
|
||||
options = declare_options()
|
||||
|
||||
drirc_gen.drirc_validate([args.validate], options)
|
||||
|
||||
drirc_gen.drirc_generate(args.drirc_src, args.drirc_hdr, "dzn", options)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
#include "util/hash_table.h"
|
||||
#include "util/u_dynarray.h"
|
||||
#include "util/log.h"
|
||||
#include "util/xmlconfig.h"
|
||||
#include "dzn_drirc.h"
|
||||
|
||||
#include "shader_enums.h"
|
||||
|
||||
|
|
@ -1273,8 +1273,7 @@ struct dzn_instance {
|
|||
|
||||
struct vk_sync_binary_type sync_binary_type;
|
||||
|
||||
struct driOptionCache dri_options;
|
||||
struct driOptionCache available_dri_options;
|
||||
struct dzn_drirc drirc;
|
||||
};
|
||||
|
||||
struct dzn_event {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,19 @@ dzn_entrypoints = custom_target(
|
|||
depend_files : vk_entrypoints_gen_depend_files,
|
||||
)
|
||||
|
||||
dzn_drirc = custom_target(
|
||||
'dzn_drirc',
|
||||
input : [files('dzn_drirc_gen.py'), drirc_gen, join_paths(dir_source_root, 'src/util/00-dzn-defaults.conf')],
|
||||
output : ['dzn_drirc.c', 'dzn_drirc.h'],
|
||||
command : [
|
||||
prog_python, '@INPUT0@',
|
||||
'--import-path', join_paths(dir_source_root, 'src/util'),
|
||||
'--drirc-src', '@OUTPUT0@',
|
||||
'--drirc-hdr', '@OUTPUT1@',
|
||||
'--validate', '@INPUT2@',
|
||||
],
|
||||
)
|
||||
|
||||
libdzn_files = files(
|
||||
'dzn_cmd_buffer.c',
|
||||
'dzn_descriptor_set.c',
|
||||
|
|
@ -61,7 +74,7 @@ endif
|
|||
|
||||
libvulkan_dzn = shared_library(
|
||||
'vulkan_dzn',
|
||||
[libdzn_files, dzn_entrypoints, sha1_h],
|
||||
[libdzn_files, dzn_entrypoints, dzn_drirc, sha1_h],
|
||||
vs_module_defs : vulkan_api_def,
|
||||
include_directories : [inc_include, inc_src, inc_util],
|
||||
dependencies : [dzn_deps, idep_vulkan_wsi, idep_xmlconfig],
|
||||
|
|
|
|||
|
|
@ -643,19 +643,6 @@
|
|||
DRI_CONF_OPT_B(anv_sample_mask_out_opengl_behaviour, def, \
|
||||
"Ignore sample mask out when having single sampled target")
|
||||
|
||||
/**
|
||||
* \brief DZN specific configuration options
|
||||
*/
|
||||
|
||||
#define DRI_CONF_DZN_CLAIM_WIDE_LINES(def) \
|
||||
DRI_CONF_OPT_B(dzn_claim_wide_lines, def, "Claim wide line support")
|
||||
|
||||
#define DRI_CONF_DZN_ENABLE_8BIT_LOADS_STORES(def) \
|
||||
DRI_CONF_OPT_B(dzn_enable_8bit_loads_stores, def, "Enable VK_KHR_8bit_loads_stores")
|
||||
|
||||
#define DRI_CONF_DZN_DISABLE(def) \
|
||||
DRI_CONF_OPT_B(dzn_disable, def, "Fail instance creation")
|
||||
|
||||
/**
|
||||
* \brief NVK specific configuration options
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue