@@ -29,11 +29,6 @@ struct tex_hash
29
29
}
30
30
};
31
31
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
-
37
32
struct __declspec (uuid(" 0ce51b56-a973-4104-bcca-945686f50170" )) device_data
38
33
{
39
34
resource green_texture = {};
@@ -48,6 +43,11 @@ struct __declspec(uuid("0ce51b56-a973-4104-bcca-945686f50170")) device_data
48
43
float scale = 1 .0f ;
49
44
};
50
45
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
+
51
51
static std::mutex s_mutex;
52
52
53
53
static void on_init_device (device *device)
@@ -81,11 +81,11 @@ static void on_destroy_device(device *device)
81
81
}
82
82
static void on_init_cmd_list (command_list *cmd_list)
83
83
{
84
- cmd_list->create_private_data <cmd_data >();
84
+ cmd_list->create_private_data <command_list_data >();
85
85
}
86
86
static void on_destroy_cmd_list (command_list *cmd_list)
87
87
{
88
- cmd_list->destroy_private_data <cmd_data >();
88
+ cmd_list->destroy_private_data <command_list_data >();
89
89
}
90
90
91
91
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
145
145
return ;
146
146
147
147
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 >();
150
150
151
151
for (uint32_t i = 0 ; i < update.count ; ++i)
152
152
{
@@ -198,8 +198,8 @@ static void on_bind_descriptor_sets(command_list *cmd_list, shader_stage stages,
198
198
return ;
199
199
200
200
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>();
203
203
assert ((&descriptor_data) != nullptr );
204
204
205
205
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,
233
233
static void on_execute (command_queue *, command_list *cmd_list)
234
234
{
235
235
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 >();
238
238
239
239
data.current_texture_list .insert (cmd_data.current_texture_list .begin (), cmd_data.current_texture_list .end ());
240
240
cmd_data.current_texture_list .clear ();
241
241
}
242
242
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 *)
244
244
{
245
245
device *const device = swapchain->get_device ();
246
246
0 commit comments