2014-07-08 03:11:14 -04:00
|
|
|
#pragma once
|
2014-12-05 21:30:46 -05:00
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
#include "EmberCLPch.h"
|
|
|
|
#include "EmberCLStructs.h"
|
|
|
|
#include "EmberCLFunctions.h"
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// FinalAccumOpenCLKernelCreator class.
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
namespace EmberCLns
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Class for creating the final accumulation code in OpenCL.
|
|
|
|
/// There are many conditionals in the CPU code to create the
|
|
|
|
/// final output image. This class creates many different kernels
|
|
|
|
/// with all conditionals and unnecessary calculations stripped out.
|
|
|
|
/// The conditionals are:
|
|
|
|
/// Early clip/late clip
|
|
|
|
/// Alpha channel, no alpha channel
|
|
|
|
/// Alpha with/without transparency
|
|
|
|
/// </summary>
|
|
|
|
class EMBERCL_API FinalAccumOpenCLKernelCreator
|
|
|
|
{
|
|
|
|
public:
|
2015-08-10 23:10:23 -04:00
|
|
|
FinalAccumOpenCLKernelCreator(bool doublePrecision);
|
2014-12-05 21:30:46 -05:00
|
|
|
|
2015-08-12 21:51:07 -04:00
|
|
|
const string& GammaCorrectionWithAlphaCalcKernel() const;
|
|
|
|
const string& GammaCorrectionWithAlphaCalcEntryPoint() const;
|
2014-07-08 03:11:14 -04:00
|
|
|
|
2015-08-12 21:51:07 -04:00
|
|
|
const string& GammaCorrectionWithoutAlphaCalcKernel() const;
|
|
|
|
const string& GammaCorrectionWithoutAlphaCalcEntryPoint() const;
|
2014-07-08 03:11:14 -04:00
|
|
|
|
2015-08-12 21:51:07 -04:00
|
|
|
const string& FinalAccumEarlyClipKernel() const;
|
|
|
|
const string& FinalAccumEarlyClipEntryPoint() const;
|
|
|
|
const string& FinalAccumEarlyClipWithAlphaCalcWithAlphaAccumKernel() const;
|
|
|
|
const string& FinalAccumEarlyClipWithAlphaCalcWithAlphaAccumEntryPoint() const;
|
|
|
|
const string& FinalAccumEarlyClipWithoutAlphaCalcWithAlphaAccumKernel() const;
|
|
|
|
const string& FinalAccumEarlyClipWithoutAlphaCalcWithAlphaAccumEntryPoint() const;
|
2014-07-08 03:11:14 -04:00
|
|
|
|
2015-08-12 21:51:07 -04:00
|
|
|
const string& FinalAccumLateClipKernel() const;
|
|
|
|
const string& FinalAccumLateClipEntryPoint() const;
|
|
|
|
const string& FinalAccumLateClipWithAlphaCalcWithAlphaAccumKernel() const;
|
|
|
|
const string& FinalAccumLateClipWithAlphaCalcWithAlphaAccumEntryPoint() const;
|
|
|
|
const string& FinalAccumLateClipWithoutAlphaCalcWithAlphaAccumKernel() const;
|
|
|
|
const string& FinalAccumLateClipWithoutAlphaCalcWithAlphaAccumEntryPoint() const;
|
|
|
|
const string& GammaCorrectionEntryPoint(size_t channels, bool transparency) const;
|
|
|
|
const string& GammaCorrectionKernel(size_t channels, bool transparency) const;
|
|
|
|
const string& FinalAccumEntryPoint(bool earlyClip, size_t channels, bool transparency, double& alphaBase, double& alphaScale) const;
|
|
|
|
const string& FinalAccumKernel(bool earlyClip, size_t channels, bool transparency) const;
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
private:
|
2014-10-14 11:53:15 -04:00
|
|
|
string CreateFinalAccumKernelString(bool earlyClip, size_t channels, bool transparency);
|
2014-07-08 03:11:14 -04:00
|
|
|
string CreateGammaCorrectionKernelString(bool alphaCalc);
|
|
|
|
|
|
|
|
string CreateFinalAccumKernelString(bool earlyClip, bool alphaCalc, bool alphaAccum);
|
|
|
|
string CreateGammaCorrectionFunctionString(bool globalBucket, bool alphaCalc, bool alphaAccum, bool finalOut);
|
|
|
|
string CreateCalcNewRgbFunctionString(bool globalBucket);
|
2015-08-12 21:51:07 -04:00
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
string m_GammaCorrectionWithAlphaCalcKernel;
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_GammaCorrectionWithAlphaCalcEntryPoint = "GammaCorrectionWithAlphaCalcKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
string m_GammaCorrectionWithoutAlphaCalcKernel;
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_GammaCorrectionWithoutAlphaCalcEntryPoint = "GammaCorrectionWithoutAlphaCalcKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
string m_FinalAccumEarlyClipKernel;//False, false.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumEarlyClipEntryPoint = "FinalAccumEarlyClipKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
string m_FinalAccumEarlyClipWithAlphaCalcWithAlphaAccumKernel;//True, true.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumEarlyClipWithAlphaCalcWithAlphaAccumEntryPoint = "FinalAccumEarlyClipWithAlphaCalcWithAlphaAccumKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
string m_FinalAccumEarlyClipWithoutAlphaCalcWithAlphaAccumKernel;//False, true.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumEarlyClipWithoutAlphaCalcWithAlphaAccumEntryPoint = "FinalAccumEarlyClipWithoutAlphaCalcWithAlphaAccumKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
|
|
|
|
string m_FinalAccumLateClipKernel;//False, false.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumLateClipEntryPoint = "FinalAccumLateClipKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
string m_FinalAccumLateClipWithAlphaCalcWithAlphaAccumKernel;//True, true.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumLateClipWithAlphaCalcWithAlphaAccumEntryPoint = "FinalAccumLateClipWithAlphaCalcWithAlphaAccumKernel";
|
2014-07-08 03:11:14 -04:00
|
|
|
string m_FinalAccumLateClipWithoutAlphaCalcWithAlphaAccumKernel;//False, true.
|
2016-04-03 21:55:12 -04:00
|
|
|
string m_FinalAccumLateClipWithoutAlphaCalcWithAlphaAccumEntryPoint = "FinalAccumLateClipWithoutAlphaCalcWithAlphaAccumKernel";
|
2015-08-10 23:10:23 -04:00
|
|
|
|
2015-08-12 21:51:07 -04:00
|
|
|
string m_Empty;
|
2015-08-10 23:10:23 -04:00
|
|
|
bool m_DoublePrecision;
|
2014-07-08 03:11:14 -04:00
|
|
|
};
|
2014-12-05 21:30:46 -05:00
|
|
|
}
|