paysages3d/src/render/software/CanvasPixelShader.h
Michaël Lemaire 7c7b6043c5 Improved render progress.
A bug was also fixed where some canvas pixels were shaded twice,
leading to a performance loss.
2015-08-23 20:22:37 +02:00

38 lines
957 B
C++

#ifndef CANVASPIXELSHADER_H
#define CANVASPIXELSHADER_H
#include "software_global.h"
#include "ParallelWorker.h"
namespace paysages {
namespace software {
/**
* @brief Parallel worker that can work on canvas portion to resolve pixel colors.
*
* This is used after the rasterization phase to compute pixel colors from the fragments stored in them.
*
* This worker will be set to work on a given chunk of a canvas portion.
*/
class CanvasPixelShader: public ParallelWorker
{
public:
CanvasPixelShader(const SoftwareCanvasRenderer &renderer, CanvasPortion *portion, RenderProgress *progress, int chunk_size, int sub_chunk_size, int chunks_x, int chunks_y);
virtual void processParallelUnit(int unit) override;
private:
const SoftwareCanvasRenderer &renderer;
CanvasPortion *portion;
RenderProgress *progress;
int chunk_size;
int sub_chunk_size;
int chunks_x;
int chunks_y;
};
}
}
#endif // CANVASPIXELSHADER_H