Skip to content

Commit 742d85e

Browse files
committed
Ballot bit count WIP, removed test code
1 parent 6e7d6d6 commit 742d85e

File tree

1 file changed

+3
-5
lines changed
  • examples_tests/49.ArithmeticBallotUnitTest

1 file changed

+3
-5
lines changed

examples_tests/49.ArithmeticBallotUnitTest/main.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ bool validateResults(video::IVideoDriver* driver, const uint32_t workgroupSize,
109109
for (uint32_t localInvocationIndex=0u; localInvocationIndex<workgroupSize; localInvocationIndex++)
110110
if (tmp[localInvocationIndex]!=dataFromBuffer[workgroupOffset+localInvocationIndex])
111111
{
112-
auto correctRes = dataFromBuffer[workgroupOffset + localInvocationIndex];
113112
os::Printer::log("Failed test #" + std::to_string(workgroupSize) + " (" + Arithmetic::name + ")", ELL_ERROR);
114113
success = false;
115-
//break;
114+
break;
116115
}
117116
}
118117
delete[] tmp;
@@ -127,7 +126,7 @@ bool validateResults(video::IVideoDriver* driver, const uint32_t workgroupSize,
127126
template<class Arithmetic>
128127
bool runTest(video::IVideoDriver* driver, video::IGPUComputePipeline* pipeline, const video::IGPUDescriptorSet* ds, const uint32_t workgroupSize, core::smart_refctd_ptr<IGPUBuffer> buffer)
129128
{
130-
if (pipeline == nullptr) assert(false); //com
129+
if (pipeline == nullptr) return false; //code could not be compiled
131130
driver->bindComputePipeline(pipeline);
132131
driver->bindDescriptorSets(video::EPBP_COMPUTE,pipeline->getLayout(),0u,1u,&ds,nullptr);
133132
const uint32_t workgroupCount = BUFFER_DWORD_COUNT/workgroupSize;
@@ -201,12 +200,11 @@ int main()
201200
};
202201
constexpr auto kTestTypeCount = sizeof(shaderGLSL)/sizeof(GLSLCodeWithWorkgroup);
203202

204-
205203
auto getGPUShader = [&](GLSLCodeWithWorkgroup glsl, uint32_t wg_count)
206204
{
207205
auto alteredGLSL = glsl.glsl.replace(glsl.workgroup_definition_position, 4, std::to_string(wg_count));
208206
auto shaderUnspecialized = core::make_smart_refctd_ptr<asset::ICPUShader>(alteredGLSL.data());
209-
asset::ISpecializedShader::SInfo specinfo(nullptr, nullptr, "main", IGPUSpecializedShader::ESS_COMPUTE,"../file.comp");
207+
asset::ISpecializedShader::SInfo specinfo(nullptr, nullptr, "main", IGPUSpecializedShader::ESS_COMPUTE, "../file.comp");
210208
auto cs = core::make_smart_refctd_ptr<asset::ICPUSpecializedShader>(std::move(shaderUnspecialized), std::move(specinfo));
211209
auto cs_rawptr = cs.get();
212210
core::smart_refctd_ptr<IGPUSpecializedShader> shader = driver->getGPUObjectsFromAssets(&cs_rawptr, &cs_rawptr + 1)->front();

0 commit comments

Comments
 (0)