Skip to content

Commit

Permalink
fix: shader OOB access issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Dec 16, 2024
1 parent 9d49bc5 commit b62ea35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shaders/filter_environment.comp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pl_write_face(int iPixel, int iFace, vec3 tColorIn)
tFaceOut3.atPixelData[iPixel] = tColor;
else if (iFace == 4)
tFaceOut4.atPixelData[iPixel] = tColor;
else //if(iFace == 5)
else if(iFace == 5)
tFaceOut5.atPixelData[iPixel] = tColor;
}

Expand Down
7 changes: 5 additions & 2 deletions shaders/panorama_to_cubemap.comp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ main()

const int iSrcpixelIndex = iColumnindex + iRowindex * iWidth;

const vec3 tColor = vec3(tBufferIn.atPixelData[iSrcpixelIndex].r, tBufferIn.atPixelData[iSrcpixelIndex].g, tBufferIn.atPixelData[iSrcpixelIndex].b);
pl_write_face(iCurrentPixel, iFace, tColor);
if(iSrcpixelIndex < iWidth * iHeight)
{
const vec3 tColor = vec3(tBufferIn.atPixelData[iSrcpixelIndex].r, tBufferIn.atPixelData[iSrcpixelIndex].g, tBufferIn.atPixelData[iSrcpixelIndex].b);
pl_write_face(iCurrentPixel, iFace, tColor);
}
}

0 comments on commit b62ea35

Please sign in to comment.