diff --git a/src/swrenderer/drawers/r_draw.cpp b/src/swrenderer/drawers/r_draw.cpp index 5c281f8c8..a7d40e63c 100644 --- a/src/swrenderer/drawers/r_draw.cpp +++ b/src/swrenderer/drawers/r_draw.cpp @@ -647,6 +647,7 @@ namespace swrenderer dc_x = x; dc_iscale = iscale; + dc_textureheight = tex->GetHeight(); const FTexture::Span *span; const BYTE *column; diff --git a/tools/drawergen/fixedfunction/drawcolumncodegen.cpp b/tools/drawergen/fixedfunction/drawcolumncodegen.cpp index 6e00528ae..1a4f806bf 100644 --- a/tools/drawergen/fixedfunction/drawcolumncodegen.cpp +++ b/tools/drawergen/fixedfunction/drawcolumncodegen.cpp @@ -81,7 +81,6 @@ void DrawColumnCodegen::Generate(DrawColumnVariant variant, SSAValue args, SSAVa stack_frac.store(texturefrac + iscale * skipped_by_thread(dest_y, thread)); iscale = iscale * thread.num_cores; - one = (1 << 30) / textureheight; SSAIfBlock branch; branch.if_block(is_simple_shade); @@ -97,6 +96,7 @@ void DrawColumnCodegen::LoopShade(DrawColumnVariant variant, bool isSimpleShade) branch.if_block(is_nearest_filter); Loop(variant, isSimpleShade, true); branch.else_block(); + one = (1 << 30) / textureheight; stack_frac.store(stack_frac.load() - (one >> 1)); Loop(variant, isSimpleShade, false); branch.end_block();