Hash :
0d3ecf46
Author :
Date :
2022-06-24T16:37:17
Vulkan: Multisample Framebuffer Fetch Implement Multisample Framebuffer Fetch. This should fix the deqp failure dEQP.GLES31/functional_blend_equation_advanced_msaa_colorburn Bug: angleproject:7351 Bug: angleproject:3586 Bug: angleproject:6195 Bug: b/234173199 Change-Id: Idd7559dcba3d91e36d8f253f1554fb931a7a6775 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3724165 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// spirv_types.cpp:
// Helper SPIR-V functions.
#include "spirv_types.h"
// SPIR-V tools include for AST validation.
#include <spirv-tools/libspirv.hpp>
namespace angle
{
namespace spirv
{
#if defined(ANGLE_ENABLE_ASSERTS)
namespace
{
void ValidateSpirvMessage(spv_message_level_t level,
const char *source,
const spv_position_t &position,
const char *message)
{
WARN() << "Level" << level << ": " << message;
}
} // anonymous namespace
bool Validate(const Blob &blob)
{
spvtools::SpirvTools spirvTools(SPV_ENV_VULKAN_1_1);
spirvTools.SetMessageConsumer(ValidateSpirvMessage);
bool result = spirvTools.Validate(blob);
if (!result)
{
std::string readableSpirv;
spirvTools.Disassemble(blob, &readableSpirv, 0);
WARN() << "Invalid SPIR-V:\n" << readableSpirv;
}
return result;
}
void Print(const Blob &blob)
{
spvtools::SpirvTools spirvTools(SPV_ENV_VULKAN_1_1);
std::string readableSpirv;
spirvTools.Disassemble(blob, &readableSpirv, 0);
INFO() << "Dissembly SPIRV: " << readableSpirv.c_str();
}
#else // ANGLE_ENABLE_ASSERTS
bool Validate(const Blob &blob)
{
// Placeholder implementation since this is only used inside an ASSERT().
// Return false to indicate an error in case this is ever accidentally used somewhere else.
return false;
}
#endif // ANGLE_ENABLE_ASSERTS
} // namespace spirv
} // namespace angle