|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
| 15 | +#include <chrono> |
| 16 | + |
15 | 17 | #include "application_sandbox/sample_application_framework/sample_application.h"
|
| 18 | +#include "mathfu/matrix.h" |
| 19 | +#include "mathfu/vector.h" |
16 | 20 | #include "support/entry/entry.h"
|
17 | 21 | #include "vulkan_helpers/buffer_frame_data.h"
|
18 | 22 | #include "vulkan_helpers/helper_functions.h"
|
19 | 23 | #include "vulkan_helpers/vulkan_application.h"
|
20 | 24 | #include "vulkan_helpers/vulkan_model.h"
|
21 | 25 |
|
22 |
| -#include <chrono> |
23 |
| -#include "mathfu/matrix.h" |
24 |
| -#include "mathfu/vector.h" |
25 |
| - |
26 | 26 | using Mat44 = mathfu::Matrix<float, 4, 4>;
|
27 | 27 | using Vector4 = mathfu::Vector<float, 4>;
|
28 | 28 | using Vector3 = mathfu::Vector<float, 3>;
|
@@ -54,19 +54,19 @@ class WriteTimestampSample
|
54 | 54 | WriteTimestampSample(const entry::EntryData* data,
|
55 | 55 | const VkPhysicalDeviceFeatures& requested_features)
|
56 | 56 | : data_(data),
|
57 |
| - Sample<WriteTimestampFrameData>(data->allocator(), data, 1, 512, 1, |
58 |
| - 1, sample_application::SampleOptions() |
59 |
| - .EnableDepthBuffer() |
60 |
| - .EnableMultisampling(), |
| 57 | + Sample<WriteTimestampFrameData>(data->allocator(), data, 1, 512, 1, 1, |
| 58 | + sample_application::SampleOptions() |
| 59 | + .EnableDepthBuffer() |
| 60 | + .EnableMultisampling(), |
61 | 61 | requested_features),
|
62 | 62 | torus_(data->allocator(), data->logger(), torus_data),
|
63 | 63 | grey_scale_(0u),
|
64 | 64 | num_frames_(0u) {
|
65 | 65 | // Check the timestamp valid bits for the render queue
|
66 | 66 | uint32_t queue_family_index = app()->render_queue().index();
|
67 |
| - auto queue_family_properties = vulkan::GetQueueFamilyProperties( |
68 |
| - data->allocator(), app()->instance(), |
69 |
| - app()->device().physical_device()); |
| 67 | + auto queue_family_properties = |
| 68 | + vulkan::GetQueueFamilyProperties(data->allocator(), app()->instance(), |
| 69 | + app()->device().physical_device()); |
70 | 70 | timestamp_valid_bits_ =
|
71 | 71 | queue_family_properties[queue_family_index].timestampValidBits;
|
72 | 72 | }
|
@@ -111,11 +111,11 @@ class WriteTimestampSample
|
111 | 111 | };
|
112 | 112 |
|
113 | 113 | pipeline_layout_ = containers::make_unique<vulkan::PipelineLayout>(
|
114 |
| - data_->allocator(), |
115 |
| - app()->CreatePipelineLayout({{ |
116 |
| - torus_descriptor_set_layouts_[0], torus_descriptor_set_layouts_[1], |
117 |
| - torus_descriptor_set_layouts_[2], |
118 |
| - }})); |
| 114 | + data_->allocator(), app()->CreatePipelineLayout({{ |
| 115 | + torus_descriptor_set_layouts_[0], |
| 116 | + torus_descriptor_set_layouts_[1], |
| 117 | + torus_descriptor_set_layouts_[2], |
| 118 | + }})); |
119 | 119 |
|
120 | 120 | VkAttachmentReference depth_attachment = {
|
121 | 121 | 0, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL};
|
@@ -163,9 +163,8 @@ class WriteTimestampSample
|
163 | 163 | ));
|
164 | 164 |
|
165 | 165 | torus_pipeline_ = containers::make_unique<vulkan::VulkanGraphicsPipeline>(
|
166 |
| - data_->allocator(), |
167 |
| - app()->CreateGraphicsPipeline(pipeline_layout_.get(), |
168 |
| - render_pass_.get(), 0)); |
| 166 | + data_->allocator(), app()->CreateGraphicsPipeline( |
| 167 | + pipeline_layout_.get(), render_pass_.get(), 0)); |
169 | 168 | torus_pipeline_->AddShader(VK_SHADER_STAGE_VERTEX_BIT, "main",
|
170 | 169 | torus_vertex_shader);
|
171 | 170 | torus_pipeline_->AddShader(VK_SHADER_STAGE_FRAGMENT_BIT, "main",
|
@@ -239,10 +238,10 @@ class WriteTimestampSample
|
239 | 238 | frame_data->torus_descriptor_set_ =
|
240 | 239 | containers::make_unique<vulkan::DescriptorSet>(
|
241 | 240 | data_->allocator(), app()->AllocateDescriptorSet({
|
242 |
| - torus_descriptor_set_layouts_[0], |
243 |
| - torus_descriptor_set_layouts_[1], |
244 |
| - torus_descriptor_set_layouts_[2], |
245 |
| - })); |
| 241 | + torus_descriptor_set_layouts_[0], |
| 242 | + torus_descriptor_set_layouts_[1], |
| 243 | + torus_descriptor_set_layouts_[2], |
| 244 | + })); |
246 | 245 |
|
247 | 246 | VkDescriptorBufferInfo buffer_infos[2] = {
|
248 | 247 | {
|
|
0 commit comments