The ivybridge crash on this forum actually crashed before reaching the LLVM part (he quoted a crash in DrawColumnHorizRGBACommand, which is plain C++).
Adding a directive that can override the target CPU should be easy - we just need some way to specify a custom string to https://github.com/raa-eruanna/qzdoom/b ... s.cpp#L480
I really hate that I had to add that vectored exception handler because it makes it write drawer errors for 9 out of 10 ZDoom rendering bugs. Usually ZDoom calculates some garbage, then the drawer dies trying to do as instructed. Even though I did add some checks, not all cases are covered because ZDoom loves to pass around pointers. Checking if a pointer is valid and in the right range is a bit tricky when its a texture source.
On the subject of the blue pinky, what's probably going on is that somehow something got alpha in the blue channel. What happens is that ZDoom's renderer picks a rendering style (drawer function). Let's say in this case it picked a solid fill of some sort. That makes ZDoom call R_FillAddColumn_rgba via a call to colfunc.
That function then creates a FillColumnAddLLVMCommand, which inherits from DrawColumnLLVMCommand. The constructor of DrawColumnLLVMCommand copies the solid color to fill with from dc_srccolor_bgra into a srccolor field in the DrawColumnArgs structure. That structure contains all the data passed on to the codegen'ed drawer. For the fill column version, that means it eventually ends up in DrawColumnCodegen::ProcessPixel
Code: Select all
SSAVec4i DrawColumnCodegen::ProcessPixel(SSAInt sample_index, SSAVec4i bgcolor, DrawColumnVariant variant, bool isSimpleShade)
SSAInt alpha, inv_alpha;
alpha = srccolor;
alpha = alpha + (alpha >> 7);
inv_alpha = 256 - alpha;
return blend_add(srccolor, bgcolor, alpha, inv_alpha);
SSAVec4i DrawerCodegen::blend_add(SSAVec4i fg, SSAVec4i bg, SSAInt srcalpha, SSAInt destalpha)
SSAVec4i color = (fg * srcalpha + bg * destalpha) / 256;
return color.insert(3, 255);
So in this case we can see a that it does a normal alpha blend using both color and alpha from the dc_srccolor_bgra variable. Note that in this case, it is probably not using FillAdd for the blue pinkies, unless dc_srccolor_bgra is not being assigned at all and happens to have a left-over blue color in it.
Okay, that was a long description. Hopefully I didn't skip over too many parts or scare you with this. Understanding the full codegen part in one go can be a bit daunting.