Merge dpJudas's renderslices branch (#1356)
* Remove threading from the drawers * Fix some r_scene_multithreaded related bugs * Fix some r_scene_multithreaded crashes * Fix fullbright shade bug * Fix truecolor drawer crash * Add debug code for showing the render slices * Fix texture loading race condition and improve performance by only locking the load mutex if data hasn't already been updated for this frame Co-authored-by: Magnus Norddahl <dpjudas@users.noreply.github.com>
This commit is contained in:
parent
c6073d9c9d
commit
a5cba1aba5
29 changed files with 1336 additions and 1987 deletions
|
|
@ -231,7 +231,6 @@ namespace swrenderer
|
|||
{
|
||||
auto vis = this;
|
||||
|
||||
int spacing;
|
||||
uint8_t color = vis->Light.BaseColormap->Maps[vis->startfrac];
|
||||
int yl = vis->y1;
|
||||
int ycount = vis->y2 - yl + 1;
|
||||
|
|
@ -250,33 +249,18 @@ namespace swrenderer
|
|||
uint32_t alpha = fglevel * 256 / FRACUNIT;
|
||||
|
||||
auto viewport = thread->Viewport.get();
|
||||
|
||||
spacing = viewport->RenderTarget->GetPitch();
|
||||
auto drawers = thread->Drawers(viewport);
|
||||
|
||||
uint32_t fracstepx = PARTICLE_TEXTURE_SIZE * FRACUNIT / countbase;
|
||||
uint32_t fracposx = fracstepx / 2;
|
||||
|
||||
RenderTranslucentPass *translucentPass = thread->TranslucentPass.get();
|
||||
|
||||
if (viewport->RenderTarget->IsBgra())
|
||||
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
|
||||
{
|
||||
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
|
||||
{
|
||||
if (translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
||||
continue;
|
||||
uint32_t *dest = (uint32_t*)viewport->GetDest(x, yl);
|
||||
thread->DrawQueue->Push<DrawParticleColumnRGBACommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
|
||||
{
|
||||
if (translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
||||
continue;
|
||||
uint8_t *dest = viewport->GetDest(x, yl);
|
||||
thread->DrawQueue->Push<DrawParticleColumnPalCommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);
|
||||
}
|
||||
if (translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
||||
continue;
|
||||
drawers->DrawParticleColumn(x, yl, ycount, fg, alpha, fracposx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue