- move PrepareTexture out of the inner drawer loops

This commit is contained in:
Magnus Norddahl 2017-03-15 02:59:33 +01:00
parent 64bdc8c495
commit 80f9c81e36
8 changed files with 8 additions and 6 deletions

View File

@ -292,6 +292,7 @@ namespace swrenderer
// draw the columns one at a time
if (visible)
{
Thread->PrepareTexture(tex);
for (int x = x1; x < x2; ++x)
{
if (cameraLight->FixedColormap() == nullptr && cameraLight->FixedLightLevel() < 0)

View File

@ -163,6 +163,9 @@ namespace swrenderer
drawerargs.SetLight(&NormalLight, 0, 0);
}
Thread->PrepareTexture(frontskytex);
Thread->PrepareTexture(backskytex);
DrawSky(pl);
}

View File

@ -301,6 +301,7 @@ namespace swrenderer
if (visible)
{
thread->PrepareTexture(WallSpriteTile);
while (x < x2)
{
if (calclighting)

View File

@ -628,6 +628,7 @@ namespace swrenderer
short *mceilingclip = zeroarray;
fixed_t frac = startfrac;
thread->PrepareTexture(pic);
for (int x = x1; x < x2; x++)
{
drawerargs.DrawMaskedColumn(thread, x, iscale, pic, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false);

View File

@ -343,6 +343,7 @@ namespace swrenderer
{
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
thread->PrepareTexture(tex);
while (x < x2)
{
if (!translucentPass->ClipSpriteColumnWithPortals(x, vis))

View File

@ -232,6 +232,7 @@ namespace swrenderer
{
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
thread->PrepareTexture(WallSpriteTile);
while (x < x2)
{
if (calclighting)

View File

@ -36,7 +36,6 @@ namespace swrenderer
void SkyDrawerArgs::SetFrontTexture(RenderThread *thread, FTexture *texture, uint32_t column)
{
thread->PrepareTexture(texture);
if (thread->Viewport->RenderTarget->IsBgra())
{
dc_source = (const uint8_t *)texture->GetColumnBgra(column, nullptr);
@ -51,7 +50,6 @@ namespace swrenderer
void SkyDrawerArgs::SetBackTexture(RenderThread *thread, FTexture *texture, uint32_t column)
{
thread->PrepareTexture(texture);
if (texture == nullptr)
{
dc_source2 = nullptr;

View File

@ -62,8 +62,6 @@ namespace swrenderer
dc_iscale = iscale;
dc_textureheight = tex->GetHeight();
thread->PrepareTexture(tex);
const FTexture::Span *span;
const uint8_t *column;
if (viewport->RenderTarget->IsBgra() && !drawer_needs_pal_input)
@ -134,8 +132,6 @@ namespace swrenderer
dc_x = x;
dc_iscale = iscale;
thread->PrepareTexture(tex);
// Normalize to 0-1 range:
double uv_stepd = FIXED2DBL(dc_iscale);
double v_step = uv_stepd / tex->GetHeight();