Skip to content

Commit

Permalink
CL/VK: Program build_status & mCallback fixes
Browse files Browse the repository at this point in the history
Was missing saving the build_status in
the program export/binary to disk.

Also, missing dereference for mCallback.

Bug: angleproject:8435
Change-Id: I77f070f5bc1c40454d625abcf13c1a4b70c465b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5406613
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Austin Annestrand <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
  • Loading branch information
annestrand authored and Angle LUCI CQ committed Apr 2, 2024
1 parent bb70f5d commit ff03a7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/libANGLE/CLProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ Program::Program(Context &context,
{
// This program has to be retained until the notify callback is called.
retain();
mCallback = CallbackData(pfnNotify, userData);
*mCallback = CallbackData(pfnNotify, userData);
}
else
{
mCallback = CallbackData();
*mCallback = CallbackData();
}
ANGLE_CL_IMPL_TRY(context.getImpl().linkProgram(*this, mDevices, options, inputPrograms,
pfnNotify != nullptr ? this : nullptr, &mImpl));
Expand Down
10 changes: 6 additions & 4 deletions src/libANGLE/renderer/vulkan/CLProgramVk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ angle::Result CLProgramVk::init(const size_t *lengths,
}
ANGLE_CL_RETURN_ERROR(CL_INVALID_BINARY);
}
else if (binaryHeader->headerVersion < LatestSupportedBinaryVersion)
else if (binaryHeader->headerVersion < kBinaryVersion)
{
ERR() << "Binary version not compatible with runtime!";
if (binaryStatus)
Expand Down Expand Up @@ -330,7 +330,8 @@ angle::Result CLProgramVk::init(const size_t *lengths,

// Add device binary to program
DeviceProgramData deviceBinary;
deviceBinary.binaryType = binaryHeader->binaryType;
deviceBinary.binaryType = binaryHeader->binaryType;
deviceBinary.buildStatus = binaryHeader->buildStatus;
switch (deviceBinary.binaryType)
{
case CL_PROGRAM_BINARY_TYPE_EXECUTABLE:
Expand Down Expand Up @@ -512,8 +513,9 @@ angle::Result CLProgramVk::getInfo(cl::ProgramInfo name,
deviceProgram.second.binaryType == CL_PROGRAM_BINARY_TYPE_EXECUTABLE
? deviceProgram.second.binary.size() * sizeof(uint32_t)
: deviceProgram.second.IR.size();
ProgramBinaryOutputHeader header{.headerVersion = LatestSupportedBinaryVersion,
.binaryType = deviceProgram.second.binaryType};
ProgramBinaryOutputHeader header{.headerVersion = kBinaryVersion,
.binaryType = deviceProgram.second.binaryType,
.buildStatus = deviceProgram.second.buildStatus};

if (outputBins != nullptr)
{
Expand Down
5 changes: 3 additions & 2 deletions src/libANGLE/renderer/vulkan/CLProgramVk.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ class CLProgramVk : public CLProgramImpl
};

// Output binary structure (for CL_PROGRAM_BINARIES query)
static constexpr uint32_t kBinaryVersion = 2;
struct ProgramBinaryOutputHeader
{
uint32_t headerVersion{1};
uint32_t headerVersion{kBinaryVersion};
cl_program_binary_type binaryType{CL_PROGRAM_BINARY_TYPE_NONE};
cl_build_status buildStatus{CL_BUILD_NONE};
};
static constexpr uint32_t LatestSupportedBinaryVersion = 1;

struct ScopedClspvContext : angle::NonCopyable
{
Expand Down

0 comments on commit ff03a7b

Please sign in to comment.