hk: add norobust test

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
Alyssa Rosenzweig 2024-09-28 20:50:40 -04:00 committed by Marge Bot
parent 0d9ac1299d
commit d959346780
3 changed files with 15 additions and 0 deletions

View file

@ -40,6 +40,7 @@ static const struct debug_named_value hk_perf_options[] = {
{"noborder", HK_PERF_NOBORDER, "Disable custom border colour emulation"},
{"nobarrier", HK_PERF_NOBARRIER,"Ignore pipeline barriers"},
{"batch", HK_PERF_BATCH, "Batch submissions"},
{"norobust", HK_PERF_NOROBUST, "Disable robustness"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
@ -365,6 +366,14 @@ hk_CreateDevice(VkPhysicalDevice physicalDevice,
dev->perftest = debug_get_flags_option("HK_PERFTEST", hk_perf_options, 0);
if (HK_PERF(dev, NOROBUST)) {
dev->vk.enabled_features.robustBufferAccess = false;
dev->vk.enabled_features.robustBufferAccess2 = false;
dev->vk.enabled_features.robustImageAccess = false;
dev->vk.enabled_features.robustImageAccess2 = false;
dev->vk.enabled_features.pipelineRobustness = false;
}
bool succ = agx_open_device(NULL, &dev->dev);
drmFreeDevice(&drm_device);
if (!succ) {

View file

@ -116,6 +116,7 @@ enum hk_perftest {
HK_PERF_NOBORDER = BITFIELD_BIT(1),
HK_PERF_NOBARRIER = BITFIELD_BIT(2),
HK_PERF_BATCH = BITFIELD_BIT(3),
HK_PERF_NOROBUST = BITFIELD_BIT(4),
};
#define HK_PERF(dev, flag) unlikely((dev)->perftest &HK_PERF_##flag)

View file

@ -31,6 +31,7 @@
#include "vk_nir_convert_ycbcr.h"
#include "vk_pipeline.h"
#include "vk_pipeline_layout.h"
#include "vk_shader.h"
#include "vk_shader_module.h"
#include "vk_ycbcr_conversion.h"
@ -581,6 +582,10 @@ hk_lower_nir(struct hk_device *dev, nir_shader *nir,
uint32_t set_layout_count,
struct vk_descriptor_set_layout *const *set_layouts)
{
if (HK_PERF(dev, NOROBUST)) {
rs = &vk_robustness_disabled;
}
const nir_opt_access_options access_options = {
.is_vulkan = true,
};