Not sure what i saw that solution somewhere (some one says its used in UnrealTournament), so here it is
We simply offset vertices of weapon model into direction of camera.
Cause some vertices are already very close to camera near clip plane, we sampling depth and multiply our “offset value” by depth, so vertices near camera wouldn’t be moved, which will cause clipping.
Those solution mostly look like trouble free, but i cant guarantee that.
Known problem - shadow of weapon will be distorted, so its better way to make that offset in shader only if we really close to walls or other obstacles.