Commit 5eaddbd0 by Jamie Madill Committed by Commit Bot

Vulkan: Flag uniforms as dirty when they are updated.

Currently changing uniform values will not always be seen. Bug: angleproject:2392 Bug: angleproject:2403 Change-Id: Ie315a64ad6094f2c23e48e901de2e03e4d98516a Reviewed-on: https://chromium-review.googlesource.com/963296 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
parent 5b64aca8
...@@ -81,12 +81,6 @@ void UpdateDefaultUniformBlock(GLsizei count, ...@@ -81,12 +81,6 @@ void UpdateDefaultUniformBlock(GLsizei count,
const sh::BlockMemberInfo &layoutInfo, const sh::BlockMemberInfo &layoutInfo,
angle::MemoryBuffer *uniformData) angle::MemoryBuffer *uniformData)
{ {
// Assume an offset of -1 means the block is unused.
if (layoutInfo.offset == -1)
{
return;
}
int elementSize = sizeof(T) * componentCount; int elementSize = sizeof(T) * componentCount;
if (layoutInfo.arrayStride == 0 || layoutInfo.arrayStride == elementSize) if (layoutInfo.arrayStride == 0 || layoutInfo.arrayStride == elementSize)
{ {
...@@ -436,8 +430,17 @@ void ProgramVk::setUniformImpl(GLint location, GLsizei count, const T *v, GLenum ...@@ -436,8 +430,17 @@ void ProgramVk::setUniformImpl(GLint location, GLsizei count, const T *v, GLenum
for (auto &uniformBlock : mDefaultUniformBlocks) for (auto &uniformBlock : mDefaultUniformBlocks)
{ {
const sh::BlockMemberInfo &layoutInfo = uniformBlock.uniformLayout[location]; const sh::BlockMemberInfo &layoutInfo = uniformBlock.uniformLayout[location];
// Assume an offset of -1 means the block is unused.
if (layoutInfo.offset == -1)
{
continue;
}
UpdateDefaultUniformBlock(count, linkedUniform.typeInfo->componentCount, v, layoutInfo, UpdateDefaultUniformBlock(count, linkedUniform.typeInfo->componentCount, v, layoutInfo,
&uniformBlock.uniformData); &uniformBlock.uniformData);
uniformBlock.uniformsDirty = true;
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment