GLNonlinearlizeFilter: Replace GLRenderer * with GLRenderer &

This commit is contained in:
yvt 2019-08-08 00:05:55 +09:00
parent ab235fed8e
commit 00fbbe9acd
No known key found for this signature in database
GPG Key ID: 48F2768FA8D07C92
3 changed files with 7 additions and 7 deletions

View File

@ -33,13 +33,13 @@
namespace spades {
namespace draw {
GLNonlinearlizeFilter::GLNonlinearlizeFilter(GLRenderer *renderer) : renderer(renderer) {
lens = renderer->RegisterProgram("Shaders/PostFilters/Nonlinearize.program");
GLNonlinearlizeFilter::GLNonlinearlizeFilter(GLRenderer &renderer) : renderer(renderer) {
lens = renderer.RegisterProgram("Shaders/PostFilters/Nonlinearize.program");
}
GLColorBuffer GLNonlinearlizeFilter::Filter(GLColorBuffer input) {
SPADES_MARK_FUNCTION();
IGLDevice &dev = renderer->GetGLDevice();
IGLDevice &dev = renderer.GetGLDevice();
GLQuadRenderer qr(dev);
static GLProgramAttribute lensPosition("positionAttribute");
@ -55,7 +55,7 @@ namespace spades {
lens->Use();
lensTexture.SetValue(0);
lensGamma.SetValue(1.f / (float)renderer->GetSettings().r_hdrGamma);
lensGamma.SetValue(1.f / (float)renderer.GetSettings().r_hdrGamma);
// composite to the final image
GLColorBuffer output = input.GetManager()->CreateBufferHandle();

View File

@ -27,11 +27,11 @@ namespace spades {
class GLRenderer;
class GLProgram;
class GLNonlinearlizeFilter {
GLRenderer *renderer;
GLRenderer &renderer;
GLProgram *lens;
public:
GLNonlinearlizeFilter(GLRenderer *);
GLNonlinearlizeFilter(GLRenderer &);
GLColorBuffer Filter(GLColorBuffer);
};
} // namespace draw

View File

@ -1005,7 +1005,7 @@ namespace spades {
if (settings.r_hdr) {
GLProfiler::Context p(*profiler, "Gamma Correction");
handle = GLNonlinearlizeFilter(this).Filter(handle);
handle = GLNonlinearlizeFilter(*this).Filter(handle);
}
if (settings.r_colorCorrection) {