Skip to content

Commit

Permalink
Try to fix the Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
godlikepanos committed Jun 9, 2024
1 parent 30dd292 commit f8b3556
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions AnKi/Gr/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@ U32 computeMaxMipmapCount2d(U32 w, U32 h, U32 minSizeOfLastMip = 1);
U32 computeMaxMipmapCount3d(U32 w, U32 h, U32 d, U32 minSizeOfLastMip = 1);

/// Visit a SPIR-V binary.
template<template<typename> typename TArray, typename TFunc>
static void visitSpirv(TArray<U32> spv, TFunc func)
template<typename TArray, typename TFunc>
static void visitSpirv(TArray spv, TFunc func)
{
ANKI_ASSERT(spv.getSize() > 5);

Expand All @@ -1115,7 +1115,7 @@ static void visitSpirv(TArray<U32> spv, TFunc func)
const U32 instructionCount = *it >> 16u;
const U32 opcode = *it & 0xFFFFu;

TArray<U32> instructions(it + 1, instructionCount - 1);
TArray instructions(it + 1, instructionCount - 1);

func(opcode, instructions);

Expand Down
6 changes: 3 additions & 3 deletions AnKi/Gr/Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ class TextureSubresourceDescriptor

private:
constexpr TextureSubresourceDescriptor(U32 mip, U32 face, U32 layer, Bool allSurfs, DepthStencilAspectBit aspect)
: m_mipmap(mip)
, m_face(face)
, m_layer(layer)
: m_mipmap(mip & ((1u << 5u) - 1u))
, m_face(face & ((1u << 3u) - 1u))
, m_layer(layer & ((1u << 24u) - 1u))
, m_allSurfacesOrVolumes(allSurfs)
, m_depthStencilAspect(aspect)
{
Expand Down
2 changes: 1 addition & 1 deletion AnKi/Gr/Vulkan/VkShaderProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void ShaderProgramImpl::rewriteSpirv(ShaderReflectionDescriptorRelated& refl, Gr
outSpv.resize(inSpirv.getSize());
memcpy(outSpv.getBegin(), inSpirv.getBegin(), inSpirv.getSizeInBytes());

visitSpirv<WeakArray>(WeakArray<U32>(outSpv), [&](U32 cmd, WeakArray<U32> instructions) {
visitSpirv(WeakArray<U32>(outSpv), [&](U32 cmd, WeakArray<U32> instructions) {
if(cmd == spv::OpDecorate && instructions[1] == spv::DecorationBinding
&& instructions[2] >= kDxcVkBindingShifts[0][HlslResourceType::kFirst]
&& instructions[2] < kDxcVkBindingShifts[kMaxDescriptorSets - 1][HlslResourceType::kCount - 1])
Expand Down
14 changes: 7 additions & 7 deletions AnKi/ShaderCompiler/ShaderCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ Error doReflectionSpirv(ConstWeakArray<U8> spirv, ShaderType type, ShaderReflect
// Discards?
if(type == ShaderType::kFragment)
{
visitSpirv<ConstWeakArray>(ConstWeakArray<U32>(reinterpret_cast<const U32*>(&spirv[0]), spirv.getSize() / sizeof(U32)),
[&](U32 cmd, [[maybe_unused]] ConstWeakArray<U32> instructions) {
if(cmd == spv::OpKill)
{
refl.m_fragment.m_discards = true;
}
});
visitSpirv(ConstWeakArray<U32>(reinterpret_cast<const U32*>(&spirv[0]), spirv.getSize() / sizeof(U32)),
[&](U32 cmd, [[maybe_unused]] ConstWeakArray<U32> instructions) {
if(cmd == spv::OpKill)
{
refl.m_fragment.m_discards = true;
}
});
}

return Error::kNone;
Expand Down

0 comments on commit f8b3556

Please sign in to comment.