fix an issue that depth config is not applied to OpenGL program

This commit is contained in:
falsycat 2022-10-31 13:12:16 +09:00
parent 4de72c20af
commit 08fcda65ca
2 changed files with 9 additions and 3 deletions

View File

@ -153,7 +153,7 @@ nf7::Future<std::shared_ptr<Obj<Obj_ProgramMeta>>> Obj_ProgramMeta::Create(
}
nf7::Future<std::shared_ptr<Obj<Obj_ProgramMeta>>>::Promise pro {ctx};
apro.future().Chain(nf7::Env::kGL, ctx, pro, [ctx, shs = std::move(shs)](auto&) {
apro.future().Chain(nf7::Env::kGL, ctx, pro, [*this, ctx, shs = std::move(shs)](auto&) {
// check all shaders
for (auto& sh : shs) { sh.value(); }
@ -173,7 +173,7 @@ nf7::Future<std::shared_ptr<Obj<Obj_ProgramMeta>>> Obj_ProgramMeta::Create(
GLint status;
glGetProgramiv(id, GL_LINK_STATUS, &status);
if (status == GL_TRUE) {
return std::make_shared<Obj<Obj_ProgramMeta>>(ctx, id, gl::Program::Meta {});
return std::make_shared<Obj<Obj_ProgramMeta>>(ctx, id, *this);
} else {
GLint len;
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &len);

View File

@ -867,7 +867,13 @@ struct Program {
p.watch->Watch(fid);
shaders.push_back(fid);
}
return Product::Meta().Create(p.ctx, shaders);
Product::Meta meta;
if (depth_) {
meta.depth.emplace(*depth_);
}
return meta.Create(p.ctx, shaders);
} catch (nf7::Exception&) {
return {std::current_exception()};
}