mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
Fixed crash on Intel cards with less than 64 uniform block align
- This should fix the crash with Intel cards. Sprite blinking appears to not occur either
This commit is contained in:
parent
1835362a0c
commit
25a8199a74
1 changed files with 2 additions and 5 deletions
|
@ -47,7 +47,7 @@ BoneBuffer::BoneBuffer(int pipelineNbr) : mPipelineNbr(pipelineNbr)
|
|||
{
|
||||
mBufferType = false;
|
||||
mBlockSize = screen->maxuniformblock / BONE_SIZE;
|
||||
mBlockAlign = screen->uniformblockalignment / BONE_SIZE;
|
||||
mBlockAlign = screen->uniformblockalignment < 64 ? 1 : screen->uniformblockalignment / BONE_SIZE;
|
||||
mMaxUploadSize = (mBlockSize - mBlockAlign);
|
||||
}
|
||||
|
||||
|
@ -103,11 +103,8 @@ int BoneBuffer::UploadBones(const TArray<VSMatrix>& bones)
|
|||
|
||||
int BoneBuffer::GetBinding(unsigned int index, size_t* pOffset, size_t* pSize)
|
||||
{
|
||||
unsigned int offset = index;
|
||||
|
||||
// this function will only get called if a uniform buffer is used. For a shader storage buffer we only need to bind the buffer once at the start.
|
||||
if (mBlockAlign > 0)
|
||||
offset = (index / mBlockAlign) * mBlockAlign;
|
||||
unsigned int offset = (index / mBlockAlign) * mBlockAlign;
|
||||
|
||||
*pOffset = offset * BONE_SIZE;
|
||||
*pSize = mBlockSize * BONE_SIZE;
|
||||
|
|
Loading…
Reference in a new issue