- cache the results of hw_FakeFlat for the remainder of the current scene instead of storing this in local variables.
An exception is made for the sprite drawer which needs to call this in the worker thread on some occasions for as-yet unprocessed sectors. This case may not alter the cache to avoid having to add thread synchronization to it. The main reason for this change is that pointers to such manipulated sectors can now be considered static in the renderer. Due to them being short lived local buffers it was not possible to carry them along with the render data for information retrieval.
This commit is contained in:
parent
9a7f570b19
commit
a90655b295
10 changed files with 87 additions and 54 deletions
|
|
@ -53,6 +53,7 @@
|
|||
#include "hwrenderer/postprocessing/hw_shadowmapshader.h"
|
||||
#include "hwrenderer/data/flatvertices.h"
|
||||
#include "hwrenderer/scene/hw_skydome.h"
|
||||
#include "hwrenderer/scene/hw_fakeflat.h"
|
||||
#include "gl/shaders/gl_postprocessshaderinstance.h"
|
||||
#include "gl/textures/gl_samplers.h"
|
||||
#include "hwrenderer/dynlights/hw_lightbuffer.h"
|
||||
|
|
@ -231,6 +232,8 @@ sector_t *FGLRenderer::RenderView(player_t* player)
|
|||
}
|
||||
else
|
||||
{
|
||||
hw_ClearFakeFlat();
|
||||
|
||||
iter_dlightf = iter_dlight = draw_dlight = draw_dlightf = 0;
|
||||
|
||||
checkBenchActive();
|
||||
|
|
@ -302,6 +305,7 @@ void FGLRenderer::BindToFrameBuffer(FMaterial *mat)
|
|||
|
||||
void FGLRenderer::RenderTextureView(FCanvasTexture *tex, AActor *Viewpoint, double FOV)
|
||||
{
|
||||
// This doesn't need to clear the fake flat cache. It can be shared between camera textures and the main view of a scene.
|
||||
FMaterial * gltex = FMaterial::ValidateTexture(tex, false);
|
||||
|
||||
int width = gltex->TextureWidth();
|
||||
|
|
@ -343,7 +347,8 @@ void FGLRenderer::WriteSavePic (player_t *player, FileWriter *file, int width, i
|
|||
// Switch to render buffers dimensioned for the savepic
|
||||
mBuffers = mSaveBuffers;
|
||||
|
||||
P_FindParticleSubsectors(); // make sure that all recently spawned particles have a valid subsector.
|
||||
hw_ClearFakeFlat();
|
||||
P_FindParticleSubsectors(); // make sure that all recently spawned particles have a valid subsector.
|
||||
gl_RenderState.SetVertexBuffer(screen->mVertexData);
|
||||
screen->mVertexData->Reset();
|
||||
screen->mLights->Clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue