@@ -106,27 +106,27 @@ void DatasetView::destroy() {
106
106
}
107
107
108
108
void DatasetView::render (VkCommandBuffer command_buffer) {
109
- if (!this ->visible || !this ->dataset ) {
110
- return ;
111
- }
112
-
113
- const bool dataset_loaded = this ->dataset ->loaded ();
114
- if (dataset_loaded) {
115
- if (this ->descriptor_sets .size () == 0 ) {
116
- this ->allocate_descriptor_sets ();
117
- }
118
-
119
- Constants c{
120
- .minimum = this ->min ,
121
- .difference = this ->max - this ->min ,
122
- .depth = static_cast <float >(this ->z_slice - 1 ) / (this ->dataset ->data ->dimensions .z - 1 ),
123
- .channel_count = this ->dataset ->data ->channel_count ,
124
- };
125
-
126
- this ->pipeline_layout ->bind (command_buffer, this ->descriptor_sets [this ->t_slice - 1 ]);
127
- vkCmdPushConstants (command_buffer, this ->pipeline_layout ->get (), VK_SHADER_STAGE_FRAGMENT_BIT, 0 , sizeof (Constants), &c);
128
- this ->quad ->bind_draw (command_buffer);
129
- }
109
+ // if (!this->visible || !this->dataset) {
110
+ // return;
111
+ // }
112
+
113
+ // const bool dataset_loaded = this->dataset->loaded();
114
+ // if (dataset_loaded) {
115
+ // if (this->descriptor_sets.size() == 0) {
116
+ // this->allocate_descriptor_sets();
117
+ // }
118
+
119
+ // Constants c{
120
+ // .minimum = this->min,
121
+ // .difference = this->max - this->min,
122
+ // .depth = static_cast<float>(this->z_slice - 1) / (this->dataset->data->dimensions.z - 1),
123
+ // .channel_count = this->dataset->data->channel_count,
124
+ // };
125
+
126
+ // this->pipeline_layout->bind(command_buffer, this->descriptor_sets[this->t_slice - 1]);
127
+ // vkCmdPushConstants(command_buffer, this->pipeline_layout->get(), VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(Constants), &c);
128
+ // this->quad->bind_draw(command_buffer);
129
+ // }
130
130
}
131
131
132
132
void DatasetView::imgui () {
@@ -144,48 +144,48 @@ void DatasetView::set_dataset(Dataset::Ptr dataset) {
144
144
}
145
145
146
146
void DatasetView::allocate_descriptor_sets () {
147
- assert (this ->descriptor );
148
- assert (this ->descriptor_pool );
149
- assert (this ->descriptor_sets .size () == 0 );
150
-
151
- const auto num_time_slices = this ->dataset ->data ->dimensions .w ;
152
- this ->descriptor_sets .reserve (num_time_slices);
153
- std::vector<VkWriteDescriptorSet> descriptor_set_writes;
154
- for (unsigned t = 0 ; t < num_time_slices; ++t) {
155
- auto descriptor_set = this ->descriptor ->allocate (this ->descriptor_pool ->get ());
156
- this ->descriptor_sets .push_back (descriptor_set);
157
-
158
- const bool single_channel = this ->dataset ->data ->channel_count == 1 ;
159
-
160
- descriptor_set_writes.push_back (VkWriteDescriptorSet{
161
- .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
162
- .dstSet = descriptor_set,
163
- .dstBinding = 0 ,
164
- .dstArrayElement = 0 ,
165
- .descriptorCount = 1 ,
166
- .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
167
- .pImageInfo = &this ->dataset ->get_image (0 , t).image_info
168
- });
169
- descriptor_set_writes.push_back (VkWriteDescriptorSet{
170
- .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
171
- .dstSet = descriptor_set,
172
- .dstBinding = 0 ,
173
- .dstArrayElement = 1 ,
174
- .descriptorCount = 1 ,
175
- .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
176
- .pImageInfo = &this ->dataset ->get_image (single_channel ? 0 : 1 , t).image_info
177
- });
178
- descriptor_set_writes.push_back (VkWriteDescriptorSet{
179
- .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
180
- .dstSet = descriptor_set,
181
- .dstBinding = 0 ,
182
- .dstArrayElement = 2 ,
183
- .descriptorCount = 1 ,
184
- .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
185
- .pImageInfo = &this ->dataset ->get_image (single_channel ? 0 : 2 , t).image_info
186
- });
187
- }
188
- this ->device ->vkUpdateDescriptorSets (descriptor_set_writes.size (), descriptor_set_writes.data ());
147
+ // assert(this->descriptor);
148
+ // assert(this->descriptor_pool);
149
+ // assert(this->descriptor_sets.size() == 0);
150
+
151
+ // const auto num_time_slices = this->dataset->data->dimensions.w;
152
+ // this->descriptor_sets.reserve(num_time_slices);
153
+ // std::vector<VkWriteDescriptorSet> descriptor_set_writes;
154
+ // for (unsigned t = 0; t < num_time_slices; ++t) {
155
+ // auto descriptor_set = this->descriptor->allocate(this->descriptor_pool->get());
156
+ // this->descriptor_sets.push_back(descriptor_set);
157
+
158
+ // const bool single_channel = this->dataset->data->channel_count == 1;
159
+
160
+ // descriptor_set_writes.push_back(VkWriteDescriptorSet{
161
+ // .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
162
+ // .dstSet = descriptor_set,
163
+ // .dstBinding = 0,
164
+ // .dstArrayElement = 0,
165
+ // .descriptorCount = 1,
166
+ // .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
167
+ // .pImageInfo = &this->dataset->get_image(0, t).image_info
168
+ // });
169
+ // descriptor_set_writes.push_back(VkWriteDescriptorSet{
170
+ // .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
171
+ // .dstSet = descriptor_set,
172
+ // .dstBinding = 0,
173
+ // .dstArrayElement = 1,
174
+ // .descriptorCount = 1,
175
+ // .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
176
+ // .pImageInfo = &this->dataset->get_image(single_channel ? 0 : 1, t).image_info
177
+ // });
178
+ // descriptor_set_writes.push_back(VkWriteDescriptorSet{
179
+ // .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
180
+ // .dstSet = descriptor_set,
181
+ // .dstBinding = 0,
182
+ // .dstArrayElement = 2,
183
+ // .descriptorCount = 1,
184
+ // .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
185
+ // .pImageInfo = &this->dataset->get_image(single_channel ? 0 : 2, t).image_info
186
+ // });
187
+ // }
188
+ // this->device->vkUpdateDescriptorSets(descriptor_set_writes.size(), descriptor_set_writes.data());
189
189
}
190
190
191
191
void DatasetView::free_descriptor_sets () {
0 commit comments