gzdoom-gles/src/r_compiler/llvmdrawers.h

178 lines
5.9 KiB
C
Raw Normal View History

#pragma once
2016-09-30 05:27:25 +00:00
struct WorkerThreadData
{
int32_t core;
int32_t num_cores;
int32_t pass_start_y;
int32_t pass_end_y;
2016-10-07 04:40:29 +00:00
uint32_t *temp;
2016-09-30 05:27:25 +00:00
};
2016-09-29 05:38:33 +00:00
struct DrawWallArgs
{
uint32_t *dest;
const uint32_t *source[4];
const uint32_t *source2[4];
int32_t pitch;
int32_t count;
int32_t dest_y;
uint32_t texturefrac[4];
uint32_t texturefracx[4];
uint32_t iscale[4];
uint32_t textureheight[4];
uint32_t light[4];
uint32_t srcalpha;
uint32_t destalpha;
uint16_t light_alpha;
uint16_t light_red;
uint16_t light_green;
uint16_t light_blue;
uint16_t fade_alpha;
uint16_t fade_red;
uint16_t fade_green;
uint16_t fade_blue;
uint16_t desaturate;
uint32_t flags;
enum Flags
{
simple_shade = 1,
nearest_filter = 2
};
};
2016-09-29 02:01:42 +00:00
struct DrawSpanArgs
{
uint32_t *destorg;
const uint32_t *source;
int32_t destpitch;
int32_t xfrac;
int32_t yfrac;
int32_t xstep;
int32_t ystep;
int32_t x1;
int32_t x2;
int32_t y;
int32_t xbits;
int32_t ybits;
uint32_t light;
uint32_t srcalpha;
uint32_t destalpha;
uint16_t light_alpha;
uint16_t light_red;
uint16_t light_green;
uint16_t light_blue;
uint16_t fade_alpha;
uint16_t fade_red;
uint16_t fade_green;
uint16_t fade_blue;
uint16_t desaturate;
uint32_t flags;
enum Flags
{
simple_shade = 1,
nearest_filter = 2
};
};
2016-10-07 01:38:43 +00:00
struct DrawColumnArgs
{
uint32_t *dest;
const uint8_t *source;
uint8_t *colormap;
uint8_t *translation;
const uint32_t *basecolors;
int32_t pitch;
int32_t count;
int32_t dest_y;
uint32_t iscale;
uint32_t texturefrac;
uint32_t light;
uint32_t color;
uint32_t srccolor;
uint32_t srcalpha;
uint32_t destalpha;
uint16_t light_alpha;
uint16_t light_red;
uint16_t light_green;
uint16_t light_blue;
uint16_t fade_alpha;
uint16_t fade_red;
uint16_t fade_green;
uint16_t fade_blue;
uint16_t desaturate;
uint32_t flags;
enum Flags
{
simple_shade = 1
};
};
class LLVMDrawers
{
public:
virtual ~LLVMDrawers() { }
static void Create();
static void Destroy();
static LLVMDrawers *Instance();
2016-10-07 01:38:43 +00:00
void(*DrawColumn)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnAdd)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnShaded)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnAddClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRevSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
2016-10-07 04:40:29 +00:00
void(*DrawColumnTranslated)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnTlatedAdd)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnAddClampTranslated)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnSubClampTranslated)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
2016-10-07 01:38:43 +00:00
void(*DrawColumnRevSubClampTranslated)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*FillColumn)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*FillColumnAdd)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*FillColumnAddClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*FillColumnSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*FillColumnRevSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
2016-10-07 04:40:29 +00:00
void(*DrawColumnRt1)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1Copy)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1Add)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1Shaded)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1AddClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1SubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt1RevSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4Copy)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4Add)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4Shaded)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4AddClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4SubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
void(*DrawColumnRt4RevSubClamp)(const DrawColumnArgs *, const WorkerThreadData *) = nullptr;
2016-10-07 01:38:43 +00:00
2016-09-29 02:01:42 +00:00
void(*DrawSpan)(const DrawSpanArgs *) = nullptr;
void(*DrawSpanMasked)(const DrawSpanArgs *) = nullptr;
void(*DrawSpanTranslucent)(const DrawSpanArgs *) = nullptr;
void(*DrawSpanMaskedTranslucent)(const DrawSpanArgs *) = nullptr;
void(*DrawSpanAddClamp)(const DrawSpanArgs *) = nullptr;
void(*DrawSpanMaskedAddClamp)(const DrawSpanArgs *) = nullptr;
2016-09-30 05:27:25 +00:00
void(*vlinec1)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*vlinec4)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*mvlinec1)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*mvlinec4)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline1_add)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline4_add)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline1_addclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline4_addclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline1_subclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline4_subclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline1_revsubclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
void(*tmvline4_revsubclamp)(const DrawWallArgs *, const WorkerThreadData *) = nullptr;
2016-09-29 05:38:33 +00:00
private:
static LLVMDrawers *Singleton;
};