mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0028115: Visualization, Ray tracing - Fix crash on NVIDIA GPUs with driver version 373.06 when window is resized
This commit is contained in:
parent
f9f740d6b0
commit
6dd6e5c758
@ -1838,7 +1838,7 @@ Standard_Boolean OpenGl_View::updateRaytraceBuffers (const Standard_Integer
|
|||||||
const Standard_Integer theSizeY,
|
const Standard_Integer theSizeY,
|
||||||
const Handle(OpenGl_Context)& theGlContext)
|
const Handle(OpenGl_Context)& theGlContext)
|
||||||
{
|
{
|
||||||
// Auxiliary buffers are not used.
|
// Auxiliary buffers are not used
|
||||||
if (!myRaytraceParameters.GlobalIllumination && !myRenderParams.IsAntialiasingEnabled)
|
if (!myRaytraceParameters.GlobalIllumination && !myRenderParams.IsAntialiasingEnabled)
|
||||||
{
|
{
|
||||||
myRaytraceFBO1[0]->Release (theGlContext.operator->());
|
myRaytraceFBO1[0]->Release (theGlContext.operator->());
|
||||||
@ -1849,6 +1849,12 @@ Standard_Boolean OpenGl_View::updateRaytraceBuffers (const Standard_Integer
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (myRaytraceFBO1[0]->GetSizeX() != theSizeX
|
||||||
|
|| myRaytraceFBO1[0]->GetSizeY() != theSizeY)
|
||||||
|
{
|
||||||
|
myAccumFrames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
myRaytraceFBO1[0]->InitLazy (theGlContext, theSizeX, theSizeY, GL_RGBA32F, myFboDepthFormat);
|
myRaytraceFBO1[0]->InitLazy (theGlContext, theSizeX, theSizeY, GL_RGBA32F, myFboDepthFormat);
|
||||||
myRaytraceFBO2[0]->InitLazy (theGlContext, theSizeX, theSizeY, GL_RGBA32F, myFboDepthFormat);
|
myRaytraceFBO2[0]->InitLazy (theGlContext, theSizeX, theSizeY, GL_RGBA32F, myFboDepthFormat);
|
||||||
|
|
||||||
@ -1890,6 +1896,10 @@ Standard_Boolean OpenGl_View::updateRaytraceBuffers (const Standard_Integer
|
|||||||
myRaytraceOutputTexture[0]->InitRectangle (theGlContext,
|
myRaytraceOutputTexture[0]->InitRectangle (theGlContext,
|
||||||
theSizeX * 3, theSizeY * 2, OpenGl_TextureFormat::Create<GLfloat, 1>());
|
theSizeX * 3, theSizeY * 2, OpenGl_TextureFormat::Create<GLfloat, 1>());
|
||||||
|
|
||||||
|
// workaround for some NVIDIA drivers
|
||||||
|
myRaytraceVisualErrorTexture->Release (theGlContext.operator->());
|
||||||
|
myRaytraceTileOffsetsTexture->Release (theGlContext.operator->());
|
||||||
|
|
||||||
myRaytraceVisualErrorTexture->Init (theGlContext,
|
myRaytraceVisualErrorTexture->Init (theGlContext,
|
||||||
GL_R32I, GL_RED_INTEGER, GL_INT, myTileSampler.NbTilesX(), myTileSampler.NbTilesY(), Graphic3d_TOT_2D);
|
GL_R32I, GL_RED_INTEGER, GL_INT, myTileSampler.NbTilesX(), myTileSampler.NbTilesY(), Graphic3d_TOT_2D);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user