Skip to content

Commit

Permalink
review: Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Aug 16, 2023
1 parent 967921c commit db4f9cc
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
7 changes: 3 additions & 4 deletions docs/memory_decompression_layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ To force the layer to be enabled for Vulkan applications, you can set the `VK_IN

export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_memory_decompression

To force the layer to be enabled for Vulkan applications, even though the Vulkan implementation supports `VK_NV_memory_decompression` extension, you can
set the `VK_MEMORY_DECOMPRESSION_FORCE_ENABLE` environment variable in the following way:
To force the layer to be enabled for Vulkan applications, even though the Vulkan implementation supports `VK_NV_memory_decompression` extension, you can set the `VK_MEMORY_DECOMPRESSION_FORCE_ENABLE` environment variable in the following way:

**Windows**

Expand Down Expand Up @@ -142,11 +141,11 @@ The easiest way to set a property is from the ADB shell:
To set force enable, which on desktop uses `VK_MEMORY_DECOMPRESSION_FORCE_ENABLE`
set the following property:

debug.vulkan.decompression
debug.vulkan.memory_decompression.force_enable

Which you can set in the following way:

adb shell "setprop debug.vulkan.decompression true"
adb shell "setprop debug.vulkan.memory_decompression.force_enable true"

<br></br>

Expand Down
10 changes: 10 additions & 0 deletions docs/shader_object_layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ To force the layer to be enabled for Vulkan applications, you can set the `VK_IN

export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_shader_object

To force the layer to be enabled for Vulkan applications, even though the Vulkan implementation supports `VK_EXT_shader_object` extension, you can set the `VK_SHADER_OBJECT_FORCE_ENABLE` environment variable in the following way:

**Windows**

set VK_SHADER_OBJECT_FORCE_ENABLE=true

**Linux/MacOS**

export VK_SHADER_OBJECT_FORCE_ENABLE=true

<br>

### Settings Priority
Expand Down
14 changes: 12 additions & 2 deletions docs/synchronization2_layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ To force the layer to be enabled for Vulkan applications, you can set the `VK_IN

export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_synchronization2

To force the layer to be enabled for Vulkan applications, even though the Vulkan implementation supports `VK_KHR_synchronization2` extension, you can set the `VK_SYNCHRONIZATION2_FORCE_ENABLE` environment variable in the following way:

**Windows**

set VK_VK_SYNCHRONIZATION2_FORCE_ENABLE=true

**Linux/MacOS**

export VK_VK_SYNCHRONIZATION2_FORCE_ENABLE=true

<br></br>

### Android
Expand Down Expand Up @@ -125,11 +135,11 @@ The easiest way to set a property is from the ADB shell:
To set force enable, which on desktop uses `VK_SYNC2_FORCE_ENABLE`
set the following property:

debug.sync2_force_enable
debug.vulkan.synchronization2.force_enable

Which you can set in the following way:

adb shell "setprop debug.sync2_force_enable true"
adb shell "setprop debug.vulkan.synchronization2.force_enable true"

<br></br>

Expand Down
23 changes: 23 additions & 0 deletions layers/synchronization2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ static const VkLayerProperties kGlobalLayer = {
static const VkExtensionProperties kDeviceExtension = {VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME,
VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION};

static const char* const kEnvarForceEnableRemoved =
#if defined(__ANDROID__)
"debug.vulkan.sync2.force_enable";
#else
"VK_SYNC2_FORCE_ENABLE";
#endif
static const char* const kEnvarForceEnable =
#if defined(__ANDROID__)
"debug.vulkan.synchronization2.force_enable";
Expand All @@ -58,6 +64,12 @@ static const char* const kLayerSettingsForceEnable = "khronos_synchronization2.f

// TODO: should we try to use the same fields as ValidationLayers, so that list only needs
// to be defined once?
static const char* const kEnvarCustomStypeListRemoved =
#if defined(__ANDROID__)
"debug.vulkan.sync2.custom_stype_list";
#else
"VK_LAYER_SYNC2_CUSTOM_STYPE_LIST";
#endif
static const char* const kEnvarCustomStypeList =
#if defined(__ANDROID__)
"debug.vulkan.synchronization2.custom_stype_list";
Expand All @@ -77,6 +89,11 @@ static void string_tolower(std::string &s) {

static bool GetForceEnable() {
bool result = false;
std::string setting_removed = GetEnvironment(kEnvarForceEnableRemoved);
if (!setting_removed.empty()) {
LOG("%s was renamed into %s, please update your developer environment.\n", kEnvarForceEnableRemoved, kEnvarForceEnable);
}

std::string setting = GetEnvironment(kEnvarForceEnable);
if (setting.empty()) {
setting = GetLayerOption(kLayerSettingsForceEnable);
Expand Down Expand Up @@ -147,6 +164,12 @@ static void SetCustomStypeInfo(std::string raw_id_list, const std::string &delim
}

static void SetupCustomStypes() {
std::string setting_removed = GetEnvironment(kEnvarCustomStypeListRemoved);
if (!setting_removed.empty()) {
LOG("%s was renamed into %s, please update your developer environment.\n", kEnvarCustomStypeListRemoved,
kEnvarCustomStypeList);
}

const std::string kEnvDelim =
#if defined(_WIN32)
";";
Expand Down

0 comments on commit db4f9cc

Please sign in to comment.