Skip to content

Commit

Permalink
igl | vulkan | Add uniform buffer support to ComputeCommandEncoder::b…
Browse files Browse the repository at this point in the history
…indBuffer function

Reviewed By: pixelperfect3, corporateshark, francoiscoulombe

Differential Revision: D66977569

fbshipit-source-id: a8dc739cceb46e7f9355de0e169654abda9ff110
  • Loading branch information
Yijie Wang (FRLR) authored and facebook-github-bot committed Dec 12, 2024
1 parent 434bac5 commit a8e15fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/igl/vulkan/ComputeCommandEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ void ComputeCommandEncoder::bindBuffer(uint32_t index,

auto* buf = static_cast<igl::vulkan::Buffer*>(buffer);

const bool isStorageBuffer = (buf->getBufferType() & BufferDesc::BufferTypeBits::Storage) != 0;
const bool isUniformBuffer = (buf->getBufferType() & BufferDesc::BufferTypeBits::Uniform) > 0;
const bool isStorageBuffer = (buf->getBufferType() & BufferDesc::BufferTypeBits::Storage) > 0;
const bool isUniformOrStorageBuffer = isUniformBuffer || isStorageBuffer;

if (!isStorageBuffer) {
IGL_DEBUG_ABORT(
"Did you forget to specify igl::BufferDesc::BufferTypeBits::Storage on your buffer?");
if (!IGL_DEBUG_VERIFY(isUniformOrStorageBuffer,
"Did you forget to specify igl::BufferDesc::BufferTypeBits::Storage or "
"BufferDesc::BufferTypeBits::Uniform on your buffer?")) {
return;
}

Expand Down

0 comments on commit a8e15fe

Please sign in to comment.