Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
RenfengLiu committed Aug 12, 2024
1 parent 463ae5a commit 50f38f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
10 changes: 0 additions & 10 deletions assets/benchmarks/shaders/Benchmark_RandomNoise.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@

#include "VsOutput.hlsli"

// struct RandomParams
// {
// uint32_t Seed;
// };

// #if defined(__spirv__)
// [[vk::push_constant]]
// #endif
// ConstantBuffer<RandomParams> Random : register(b0);

float random(float2 st, uint32_t seed) {
float underOne = sin(float(seed) + 0.5f);
float2 randomVector = float2(15.0f + underOne, 15.0f - underOne);
Expand Down
8 changes: 4 additions & 4 deletions assets/benchmarks/shaders/Benchmark_VsSimpleQuads.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include "VsOutput.hlsli"

float randomCompute(uint32_t instCount, float4 Position) {
float ret = frac(sin(Position.x) + cos(Position.y));
for (int i = 0; i < instCount; i++) {
ret = frac(sin(ret) + cos(ret));
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 ret;
return frac(Position.z);;
}

VSOutputPos vsmain(float4 Position : POSITION) {
Expand Down
15 changes: 5 additions & 10 deletions benchmarks/graphics_pipeline/GraphicsBenchmarkApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void GraphicsBenchmarkApp::Config(ppx::ApplicationSettings& settings)
#if defined(PPX_BUILD_XR)
// XR specific settings
settings.grfx.pacedFrameRate = 0;
settings.xr.enable = false; // Change this to true to enable the XR mode
settings.xr.enable = true; // Change this to true to enable the XR mode
#endif
settings.standardKnobsDefaultValue.enableMetrics = true;
settings.standardKnobsDefaultValue.overwriteMetricsFile = true;
Expand Down Expand Up @@ -814,10 +814,6 @@ void GraphicsBenchmarkApp::SetupFullscreenQuadsPipelines()
piCreateInfo.sets[0].set = 0;
piCreateInfo.sets[0].pLayout = mFullscreenQuads.descriptorSetLayout;

// piCreateInfo.pushConstants.count = (2 * sizeof(uint32_t) + sizeof(float3)) / 4;
// piCreateInfo.pushConstants.binding = 0;
// piCreateInfo.pushConstants.set = 0;

PPX_CHECKED_CALL(GetDevice()->CreatePipelineInterface(&piCreateInfo, &mQuadsPipelineInterfaces[2]));
}

Expand Down Expand Up @@ -1731,7 +1727,7 @@ void GraphicsBenchmarkApp::RecordCommandBufferFullscreenQuad(PerFrame& frame, si
switch (pFullscreenQuadsType->GetValue()) {
case FullscreenQuadsType::FULLSCREEN_QUADS_TYPE_NOISE: {
uint32_t noiseQuadRandomSeed = (uint32_t)seed;
frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[0], sizeof(uint32_t) / 4, &noiseQuadRandomSeed, sizeof(uint32_t) / 4);
frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[0], sizeof(uint32_t) / sizeof(uint32_t), &noiseQuadRandomSeed, sizeof(uint32_t) / 4);
break;
}
case FullscreenQuadsType::FULLSCREEN_QUADS_TYPE_SOLID_COLOR: {
Expand All @@ -1748,11 +1744,10 @@ void GraphicsBenchmarkApp::RecordCommandBufferFullscreenQuad(PerFrame& frame, si
}
float3 colorValues = pFullscreenQuadsColor->GetValue();
colorValues *= intensity;
uint32_t inst = pKnobVsAluCount->GetValue();
PPX_LOG_INFO("ALU instruction count " << inst);
uint32_t instCount = pKnobVsAluCount->GetValue();

frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[1], sizeof(uint32_t) / 4, &inst, 0);
frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[1], sizeof(float3) / 4, &colorValues, 2 * sizeof(uint32_t) / 4);
frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[1], sizeof(uint32_t) / sizeof(uint32_t), &instCount, 0);
frame.cmd->PushGraphicsConstants(mQuadsPipelineInterfaces[1], sizeof(float3) / sizeof(uint32_t), &colorValues, 2 * sizeof(uint32_t) / sizeof(uint32_t));
break;
}
case FullscreenQuadsType::FULLSCREEN_QUADS_TYPE_TEXTURE:
Expand Down

0 comments on commit 50f38f4

Please sign in to comment.