Skip to content

Commit c2170b9

Browse files
committed
Clean up code
1 parent 4625911 commit c2170b9

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ packages/
1515
*.aps
1616
*.VC.db
1717
*.VC.opendb
18+
19+
# Visual Studio user config files
1820
*.sdf
1921
*.opensdf
2022
*.suo

examples/08-texture_overlay/texturemod_overlay.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ struct tex_hash
2929
}
3030
};
3131

32-
struct __declspec(uuid("f326a1eb-5062-453e-9852-a787594a977a")) cmd_data
33-
{
34-
std::unordered_set<resource_view, tex_hash> current_texture_list;
35-
};
36-
3732
struct __declspec(uuid("0ce51b56-a973-4104-bcca-945686f50170")) device_data
3833
{
3934
resource green_texture = {};
@@ -48,6 +43,11 @@ struct __declspec(uuid("0ce51b56-a973-4104-bcca-945686f50170")) device_data
4843
float scale = 1.0f;
4944
};
5045

46+
struct __declspec(uuid("f326a1eb-5062-453e-9852-a787594a977a")) command_list_data
47+
{
48+
std::unordered_set<resource_view, tex_hash> current_texture_list;
49+
};
50+
5151
static std::mutex s_mutex;
5252

5353
static void on_init_device(device *device)
@@ -81,11 +81,11 @@ static void on_destroy_device(device *device)
8181
}
8282
static void on_init_cmd_list(command_list *cmd_list)
8383
{
84-
cmd_list->create_private_data<cmd_data>();
84+
cmd_list->create_private_data<command_list_data>();
8585
}
8686
static void on_destroy_cmd_list(command_list *cmd_list)
8787
{
88-
cmd_list->destroy_private_data<cmd_data>();
88+
cmd_list->destroy_private_data<command_list_data>();
8989
}
9090

9191
static void on_init_texture(device *device, const resource_desc &desc, const subresource_data *, resource_usage, resource res)
@@ -145,8 +145,8 @@ static void on_push_descriptors(command_list *cmd_list, shader_stage stages, pip
145145
return;
146146

147147
device *const device = cmd_list->get_device();
148-
auto &data = device->get_private_data<struct device_data>();
149-
auto &cmd_data = cmd_list->get_private_data<struct cmd_data>();
148+
auto &data = device->get_private_data<device_data>();
149+
auto &cmd_data = cmd_list->get_private_data<command_list_data>();
150150

151151
for (uint32_t i = 0; i < update.count; ++i)
152152
{
@@ -198,8 +198,8 @@ static void on_bind_descriptor_sets(command_list *cmd_list, shader_stage stages,
198198
return;
199199

200200
device *const device = cmd_list->get_device();
201-
auto &cmd_data = cmd_list->get_private_data<struct cmd_data>();
202-
auto &descriptor_data = device->get_private_data<struct descriptor_set_tracking>();
201+
auto &cmd_data = cmd_list->get_private_data<command_list_data>();
202+
auto &descriptor_data = device->get_private_data<descriptor_set_tracking>();
203203
assert((&descriptor_data) != nullptr);
204204

205205
for (uint32_t i = 0; i < count; ++i)
@@ -233,14 +233,14 @@ static void on_bind_descriptor_sets(command_list *cmd_list, shader_stage stages,
233233
static void on_execute(command_queue *, command_list *cmd_list)
234234
{
235235
device *const device = cmd_list->get_device();
236-
auto &data = device->get_private_data<struct device_data>();
237-
auto &cmd_data = cmd_list->get_private_data<struct cmd_data>();
236+
auto &data = device->get_private_data<device_data>();
237+
auto &cmd_data = cmd_list->get_private_data<command_list_data>();
238238

239239
data.current_texture_list.insert(cmd_data.current_texture_list.begin(), cmd_data.current_texture_list.end());
240240
cmd_data.current_texture_list.clear();
241241
}
242242

243-
static void on_present(command_queue *queue, swapchain *swapchain, const rect *, const rect *, uint32_t, const rect *)
243+
static void on_present(command_queue *, swapchain *swapchain, const rect *, const rect *, uint32_t, const rect *)
244244
{
245245
device *const device = swapchain->get_device();
246246

setup/Properties/Assembly.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
1616
<!-- Windows 8.1 -->
1717
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
18-
<!-- Windows 10 -->
18+
<!-- Windows 10 and Windows 11 -->
1919
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
2020
</application>
2121
</compatibility>

0 commit comments

Comments
 (0)