TESTGPUMC: only the shader that is really in use must compile
parent
f56e4bc7fb
commit
b0f25100a4
|
@ -60,6 +60,7 @@ void Shader::shutdown() {
|
|||
bool Shader::load(const std::string& name, const std::string& buffer) {
|
||||
core_assert(_initialized);
|
||||
_name = name;
|
||||
Log::info("Load compute shader %s", name.c_str());
|
||||
const std::string& source = getSource(buffer);
|
||||
_program = compute::createProgram(source);
|
||||
if (_program == InvalidId) {
|
||||
|
|
|
@ -89,14 +89,18 @@ core::AppState TestGPUMC::onInit() {
|
|||
}
|
||||
|
||||
_computeShader.addDefine("SIZE", std::to_string(SIZE));
|
||||
_computeShaderBuffer.addDefine("SIZE", std::to_string(SIZE));
|
||||
if (!_computeShader.setup()) {
|
||||
Log::error("Failed to init compute shader for using 3d textures");
|
||||
return core::AppState::InitFailure;
|
||||
if (_writingTo3DTextures) {
|
||||
return core::AppState::InitFailure;
|
||||
}
|
||||
}
|
||||
_computeShaderBuffer.addDefine("SIZE", std::to_string(SIZE));
|
||||
if (!_computeShaderBuffer.setup()) {
|
||||
Log::error("Failed to init compute shader for using buffer");
|
||||
return core::AppState::InitFailure;
|
||||
if (!_writingTo3DTextures) {
|
||||
return core::AppState::InitFailure;
|
||||
}
|
||||
}
|
||||
|
||||
if (_writingTo3DTextures) {
|
||||
|
|
Loading…
Reference in New Issue