From a8bab6a21d8d19860619f62098545df33db3bca1 Mon Sep 17 00:00:00 2001 From: Shiny Metagross <30511800+ShinyMetagross@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:33:24 -0700 Subject: [PATCH] Intel fix - GZDoom can launch for Intel users - IQMs work for Intel too --- src/common/rendering/hwrenderer/data/hw_bonebuffer.cpp | 5 ++++- wadsrc/static/shaders/glsl/main.vp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/rendering/hwrenderer/data/hw_bonebuffer.cpp b/src/common/rendering/hwrenderer/data/hw_bonebuffer.cpp index 9d465d417a..1cc68ca2fe 100644 --- a/src/common/rendering/hwrenderer/data/hw_bonebuffer.cpp +++ b/src/common/rendering/hwrenderer/data/hw_bonebuffer.cpp @@ -103,8 +103,11 @@ int BoneBuffer::UploadBones(const TArray& 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. - unsigned int offset = (index / mBlockAlign) * mBlockAlign; + if (mBlockAlign > 0) + offset = (index / mBlockAlign) * mBlockAlign; *pOffset = offset * BONE_SIZE; *pSize = mBlockSize * BONE_SIZE; diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index e41152065c..d9ab20fa37 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -169,7 +169,7 @@ void AddWeightedBone(uint boneIndex, float weight, inout vec4 position, inout ve { if (weight != 0.0) { - mat4 transform = bones[uBoneIndexBase + boneIndex]; + mat4 transform = bones[uBoneIndexBase + (int)boneIndex]; mat3 rotation = mat3(transform); position += (transform * aPosition) * weight; normal += (rotation * aNormal.xyz) * weight;