qzdoom-gpl/src/r_compiler/fixedfunction/drawcolumncodegen.h

72 lines
1.6 KiB
C
Raw Normal View History

#pragma once
#include "drawercodegen.h"
enum class DrawColumnVariant
{
2016-10-07 01:38:43 +00:00
Fill,
FillAdd,
FillAddClamp,
FillSubClamp,
FillRevSubClamp,
2016-10-07 04:40:29 +00:00
DrawCopy,
2016-10-07 01:38:43 +00:00
Draw,
DrawAdd,
DrawTranslated,
DrawTlatedAdd,
DrawShaded,
DrawAddClamp,
DrawAddClampTranslated,
DrawSubClamp,
DrawSubClampTranslated,
DrawRevSubClamp,
DrawRevSubClampTranslated
};
2016-10-07 04:40:29 +00:00
enum class DrawColumnMethod
{
Normal,
Rt1,
Rt4
};
class DrawColumnCodegen : public DrawerCodegen
{
public:
2016-10-07 04:40:29 +00:00
void Generate(DrawColumnVariant variant, DrawColumnMethod method, SSAValue args, SSAValue thread_data);
2016-10-07 01:38:43 +00:00
private:
2016-10-07 04:40:29 +00:00
void Loop(DrawColumnVariant variant, DrawColumnMethod method, bool isSimpleShade);
SSAVec4i ProcessPixel(SSAInt sample_index, SSAVec4i bgcolor, DrawColumnVariant variant, bool isSimpleShade);
SSAVec4i ProcessPixelPal(SSAInt sample_index, SSAVec4i bgcolor, DrawColumnVariant variant, bool isSimpleShade);
SSAVec4i Sample(SSAInt frac);
2016-10-07 01:38:43 +00:00
SSAInt ColormapSample(SSAInt frac);
SSAVec4i TranslateSample(SSAInt frac);
SSAInt TranslateSamplePal(SSAInt frac);
SSAVec4i Shade(SSAVec4i fgcolor, bool isSimpleShade);
SSAVec4i ShadePal(SSAInt palIndex, bool isSimpleShade);
bool IsPaletteInput(DrawColumnVariant variant);
2016-10-07 01:38:43 +00:00
SSAStack<SSAInt> stack_index, stack_frac;
SSAUBytePtr dest;
SSAUBytePtr source;
SSAUBytePtr colormap;
SSAUBytePtr translation;
SSAUBytePtr basecolors;
SSAInt pitch;
SSAInt count;
SSAInt dest_y;
SSAInt iscale;
SSAInt texturefrac;
SSAInt light;
SSAVec4i color;
SSAVec4i srccolor;
SSAInt srcalpha;
SSAInt destalpha;
SSABool is_simple_shade;
SSAShadeConstants shade_constants;
SSAWorkerThread thread;
};