Add C++ samples to format_all script.

This commit is contained in:
Hans-Kristian Arntzen 2016-05-30 21:34:18 +02:00
Родитель b96c3b002e
Коммит 5bfbe0dc36
4 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -1,6 +1,6 @@
#!/bin/bash
for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h}
for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp
do
echo "Formatting file: $file ..."
clang-format -style=file -i $file

Просмотреть файл

@ -38,7 +38,7 @@ int main()
// Create an instance of the shader interface.
auto *shader = iface->construct();
// Build some input data for our compute shader.
// Build some input data for our compute shader.
#define NUM_WORKGROUPS 4
float a[64 * NUM_WORKGROUPS];
float b[64 * NUM_WORKGROUPS] = {};

Просмотреть файл

@ -38,7 +38,7 @@ int main()
// Create an instance of the shader interface.
auto *shader = iface->construct();
// Build some input data for our compute shader.
// Build some input data for our compute shader.
#define NUM_WORKGROUPS 4
vec4 a[64 * NUM_WORKGROUPS];
vec4 b[64 * NUM_WORKGROUPS];
@ -85,9 +85,7 @@ int main()
// TODO: Implement a test framework that asserts results computed.
for (unsigned i = 0; i < 64 * NUM_WORKGROUPS; i++)
{
fprintf(stderr, "(%.1f, %.1f, %.1f, %.1f) * (%.1f, %.1f, %.1f, %.1f) => (%.1f, %.1f, %.1f, %.1f)\n",
a[i].x, a[i].y, a[i].z, a[i].w,
b[i].x, b[i].y, b[i].z, b[i].w,
c[i].x, c[i].y, c[i].z, c[i].w);
fprintf(stderr, "(%.1f, %.1f, %.1f, %.1f) * (%.1f, %.1f, %.1f, %.1f) => (%.1f, %.1f, %.1f, %.1f)\n", a[i].x,
a[i].y, a[i].z, a[i].w, b[i].x, b[i].y, b[i].z, b[i].w, c[i].x, c[i].y, c[i].z, c[i].w);
}
}

Просмотреть файл

@ -38,7 +38,7 @@ int main()
// Create an instance of the shader interface.
auto *shader = iface->construct();
// Build some input data for our compute shader.
// Build some input data for our compute shader.
#define NUM_WORKGROUPS 4
float a[128 * NUM_WORKGROUPS];
float b[NUM_WORKGROUPS] = {};