[Misc] (All): Run format_code.sh

This commit is contained in:
BZLZHH
2025-10-02 15:11:38 +08:00
parent 69fe996e15
commit ee971306ca
26 changed files with 1355 additions and 1492 deletions
@@ -92,11 +92,11 @@ static void BM_CompileVertexShader(benchmark::State& state) {
GLuint vs = CreateShader(GL_VERTEX_SHADER);
ShaderSource(vs, 1, &vsSrc, NULL);
CompileShader(vs);
// Cleanup
DeleteShader(vs);
}
// Set the counter for Compiles/Second
state.counters["VS_Compiles/Second"] = state.iterations();
state.counters["VS_Bytes/Second"] = state.iterations() * vsLen;
@@ -117,11 +117,11 @@ static void BM_CompileFragmentShader(benchmark::State& state) {
GLuint fs = CreateShader(GL_FRAGMENT_SHADER);
ShaderSource(fs, 1, &fsSrc, NULL);
CompileShader(fs);
// Cleanup
DeleteShader(fs);
}
// Set the counter for Compiles/Second
state.counters["FS_Compiles/Second"] = state.iterations();
state.counters["FS_Bytes/Second"] = state.iterations() * fsLen;
@@ -142,17 +142,17 @@ static void BM_CompileBothShaders(benchmark::State& state) {
GLuint vs = CreateShader(GL_VERTEX_SHADER);
ShaderSource(vs, 1, &vsSrc, NULL);
CompileShader(vs);
// Create and compile fragment shader
GLuint fs = CreateShader(GL_FRAGMENT_SHADER);
ShaderSource(fs, 1, &fsSrc, NULL);
CompileShader(fs);
// Cleanup
DeleteShader(vs);
DeleteShader(fs);
}
// Set the counter for Compiles/Second
state.counters["VS_Compiles/Second"] = state.iterations();
state.counters["FS_Compiles/Second"] = state.iterations();
@@ -227,7 +227,6 @@ static void BM_CompileAndLink(benchmark::State& state) {
DeleteShader(fs);
}
// Set the counter for Compiles/Second
state.counters["VS_Compiles/Second"] = state.iterations();
state.counters["FS_Compiles/Second"] = state.iterations();
+4 -7
View File
@@ -10,11 +10,9 @@ static void Sanity_VectorResize(benchmark::State& state) {
v[i] = i;
}
}
state.SetBytesProcessed(int64_t(state.iterations()) *
int64_t(state.range(0)));
state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
}
BENCHMARK(Sanity_VectorResize)->Arg(2<<5)->Arg(2<<10)->Arg(2<<20);
BENCHMARK(Sanity_VectorResize)->Arg(2 << 5)->Arg(2 << 10)->Arg(2 << 20);
static void Sanity_memcpy(benchmark::State& state) {
char* src = new char[state.range(0)];
@@ -22,11 +20,10 @@ static void Sanity_memcpy(benchmark::State& state) {
memset(src, 'x', state.range(0));
for (auto _ : state)
memcpy(dst, src, state.range(0));
state.SetBytesProcessed(int64_t(state.iterations()) *
int64_t(state.range(0)));
state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
delete[] src;
delete[] dst;
}
BENCHMARK(Sanity_memcpy)->Range(8, 8<<10);
BENCHMARK(Sanity_memcpy)->Range(8, 8 << 10);
BENCHMARK_MAIN();