forked from google/bigwheels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test case to run number of ALU instructions (google#500)
added a new knob `alu-instruction-count`. The sample can be run with following knobs: "enable-skybox": false, "enable-spheres": false, "enable-metrics": false, "fullscreen-quads-count": 1, "fullscreen-quads-type": "Solid_Color", "fullscreen-quads-single-renderpass": true, "alu-instruction-count": 200
- Loading branch information
1 parent
001de7f
commit 606bc18
Showing
9 changed files
with
109 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef BENCHMARKS_QUAD_HLSLI | ||
#define BENCHMARKS_QUAD_HLSLI | ||
|
||
struct ConfigParams { | ||
uint32_t InstCount; | ||
uint32_t RandomSeed; | ||
float3 ColorValue; | ||
}; | ||
|
||
#if defined(__spirv__) | ||
[[vk::push_constant]] | ||
#endif | ||
ConstantBuffer<ConfigParams> Config : register(b0); | ||
|
||
struct VSOutputPos { | ||
float4 position : SV_POSITION; | ||
}; | ||
|
||
float randomCompute(uint32_t instCount, float4 Position) { | ||
float randNum = frac(float(instCount) * 123.456f); | ||
for (uint32_t i = 0; i < instCount; i++) { | ||
Position.z += Position.x * (1 - randNum) + randNum * Position.y; | ||
} | ||
|
||
return frac(Position.z);; | ||
} | ||
|
||
#endif // BENCHMARKS_QUAD_HLSLI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters