Skip to content

Commit 8073f7c

Browse files
vkconfig: Add generated lib layer settings for vulkan.hpp
1 parent dcbd02e commit 8073f7c

24 files changed

Lines changed: 1089 additions & 61 deletions

vkconfig_core/configurator.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,11 @@ bool Configurator::Generate(GenerateSettingsMode mode, const Path& output_path)
395395
case GENERATE_SETTINGS_CMD: {
396396
result = ::GenerateSettingsEnv(*this, EXPORT_ENV_CMD, output_path);
397397
} break;
398-
case GENERATE_SETTINGS_HPP: {
399-
result = ::GenerateSettingsCode(*this, output_path);
398+
case GENERATE_SETTINGS_HPP_VULKAN_H: {
399+
result = ::GenerateSettingsCode(*this, EXPORT_HPP_VULKAN_H, output_path);
400+
} break;
401+
case GENERATE_SETTINGS_HPP_VULKAN_HPP: {
402+
result = ::GenerateSettingsCode(*this, EXPORT_HPP_VULKAN_HPP, output_path);
400403
} break;
401404
}
402405

vkconfig_core/configurator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ enum EnabledUI {
4747
};
4848

4949
enum ExportEnvMode { EXPORT_ENV_BASH = 0, EXPORT_ENV_CMD };
50+
enum ExportHppMode { EXPORT_HPP_VULKAN_H = 0, EXPORT_HPP_VULKAN_HPP };
5051

5152
struct LayersSettings {
5253
std::string configuration_name;

vkconfig_core/generate_layers_settings_hpp.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <QTextStream>
2424

25-
bool GenerateSettingsCode(Configurator& configurator, const Path& export_path) {
25+
bool GenerateSettingsCode(Configurator& configurator, ExportHppMode mode, const Path& export_path) {
2626
QFile file(export_path.AbsolutePath().c_str());
2727

2828
const bool result_layers_file = file.open(QIODevice::WriteOnly | QIODevice::Text);
@@ -368,10 +368,11 @@ bool GenerateSettingsCode(Configurator& configurator, const Path& export_path) {
368368

369369
if (IsArray(setting->type)) {
370370
stream << format(
371-
"\t\t\t{\"%s\", \"%s\", %s, static_cast<uint32_t>(this->%s.%s_info.size()), &this->%s.%s_info[0]},\n",
371+
"\t\t\t{\"%s\", \"%s\", %s, static_cast<uint32_t>(this->%s.%s_info.size()), this->%s.%s_info.empty() "
372+
"? nullptr : &this->%s.%s_info[0]},\n",
372373
parameter.key.c_str(), setting->key.c_str(), ::GetLayerSettingTypeString(setting->type),
373374
::GetCodeData(parameter.key).c_str(), setting->key.c_str(), ::GetCodeData(parameter.key).c_str(),
374-
setting->key.c_str())
375+
setting->key.c_str(), ::GetCodeData(parameter.key).c_str(), setting->key.c_str())
375376
.c_str();
376377
} else if (IsString(setting->type)) {
377378
stream << format("\t\t\t{\"%s\", \"%s\", %s, 1, this->%s.%s.c_str()},\n", parameter.key.c_str(),

vkconfig_core/generate_layers_settings_hpp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
#include "configurator.h"
2424

25-
bool GenerateSettingsCode(Configurator& configurator, const Path& export_path);
25+
bool GenerateSettingsCode(Configurator& configurator, ExportHppMode mode, const Path& export_path);

vkconfig_core/setting_flags.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ std::string SettingDataEnum::Export(ExportMode export_mode) const {
140140

141141
const std::string& value_name = ::GetSettingValueName(this->meta->layer_key, this->key, value.key);
142142

143-
result +=
144-
format("static %s %s = \"%s\";\n", ::GetCodeTypeString(this->type), value_name.c_str(), value.key.c_str());
143+
result += format("[[maybe_unused]] static %s %s = \"%s\";\n", ::GetCodeTypeString(this->type), value_name.c_str(),
144+
value.key.c_str());
145145
}
146146

147147
if (!this->meta->enum_values.empty()) {

vkconfig_core/test/generated/VK_LAYER_LUNARG_reference_1_2_1.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:: See the License for the specific language governing permissions and
1414
:: limitations under the License.
1515
::
16-
:: This code was generated by Vulkan Configurator 3.4.2
16+
:: This code was generated by Vulkan Configurator 3.4.3
1717

1818

1919
:: reference layer

vkconfig_core/test/generated/VK_LAYER_LUNARG_reference_1_2_1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#! See the License for the specific language governing permissions and
1414
#! limitations under the License.
1515
#!
16-
#! This code was generated by Vulkan Configurator 3.4.2
16+
#! This code was generated by Vulkan Configurator 3.4.3
1717

1818

1919
#! reference layer

vkconfig_core/test/generated/VK_LAYER_LUNARG_reference_1_2_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
# This code was generated by Vulkan Configurator 3.4.2
16+
# This code was generated by Vulkan Configurator 3.4.3
1717

1818
# reference layer
1919
# ==========================================

vkconfig_core/test/generated/VK_LAYER_LUNARG_reference_1_2_1.code renamed to vkconfig_core/test/generated/VK_LAYER_LUNARG_reference_1_2_1.vulkan_h_code

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*
17-
* This code was generated by Vulkan Configurator 3.4.2
17+
* This code was generated by Vulkan Configurator 3.4.3
1818
*/
1919

2020
#pragma once
@@ -27,13 +27,13 @@
2727
struct LayerSettings;
2828

2929
// Possible values for `VK_LAYER_LUNARG_reference_1_2_1` layer `enum_required_only` setting:
30-
static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE0 = "value0";
31-
static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE1 = "value1";
32-
static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE2 = "value2";
30+
[[maybe_unused]] static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE0 = "value0";
31+
[[maybe_unused]] static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE1 = "value1";
32+
[[maybe_unused]] static const char* VL_REFERENCE_1_2_1_ENUM_REQUIRED_ONLY_VALUE2 = "value2";
3333

3434
// Possible values for `VK_LAYER_LUNARG_reference_1_2_1` layer `enum_with_optional` setting:
35-
static const char* VL_REFERENCE_1_2_1_ENUM_WITH_OPTIONAL_VALUE1 = "value1";
36-
static const char* VL_REFERENCE_1_2_1_ENUM_WITH_OPTIONAL_VALUE2 = "value2";
35+
[[maybe_unused]] static const char* VL_REFERENCE_1_2_1_ENUM_WITH_OPTIONAL_VALUE1 = "value1";
36+
[[maybe_unused]] static const char* VL_REFERENCE_1_2_1_ENUM_WITH_OPTIONAL_VALUE2 = "value2";
3737

3838
// Possible values for VK_LAYER_LUNARG_reference_1_2_1 layer flags_required_only setting:
3939
static const char* VL_REFERENCE_1_2_1_FLAGS_REQUIRED_ONLY_FLAG0 = "flag0";

0 commit comments

Comments
 (0)