@@ -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-
3732struct __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+
5151static std::mutex s_mutex;
5252
5353static void on_init_device (device *device)
@@ -81,11 +81,11 @@ static void on_destroy_device(device *device)
8181}
8282static 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}
8686static 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
9191static 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,
233233static 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
0 commit comments