Skip to content

Commit dc41516

Browse files
committed
Fixed bugs 3,5,6
1 parent 690c499 commit dc41516

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

examples_tests/22.RaytracedAO/dirty_source/ExtraCrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ constexpr uint32_t kOptiXPixelSize = sizeof(uint16_t)*3u;
2121
core::smart_refctd_ptr<ICPUSpecializedShader> specializedShaderFromFile(IAssetManager* assetManager, const char* path)
2222
{
2323
auto bundle = assetManager->getAsset(path, {});
24-
return core::move_and_static_cast<ICPUSpecializedShader>(*bundle.getContents().begin());
24+
return core::smart_refctd_ptr_static_cast<ICPUSpecializedShader>(*bundle.getContents().begin());
2525
}
2626
core::smart_refctd_ptr<IGPUSpecializedShader> gpuSpecializedShaderFromFile(IAssetManager* assetManager, IVideoDriver* driver, const char* path)
2727
{

include/nbl/asset/IVirtualTexture.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,11 @@ class IVirtualTexture : public core::IReferenceCounted, public IVirtualTextureBa
319319
assert(_pgTabSzxy_log2<=MAX_PAGE_TABLE_EXTENT_LOG2);//otherwise STextureData encoding falls apart
320320
assert(_pgTabLayers<=MAX_PAGE_TABLE_LAYERS);
321321

322+
_pgTabLayers = std::max(_pgTabLayers, 1u);
323+
322324
const uint32_t pgTabSzxy = 1u<<_pgTabSzxy_log2;
323325
typename image_t::SCreationParams params;
324-
params.arrayLayers = std::max(_pgTabLayers, 1u); // page table must always be present
326+
params.arrayLayers = _pgTabLayers; // page table must always be present
325327
params.extent = {pgTabSzxy,pgTabSzxy,1u};
326328
params.format = EF_R16G16_UINT;
327329
params.mipLevels = std::max<int32_t>(static_cast<int32_t>(_maxAllocatableTexSz_log2-_pgSzxy_log2+1u), 1);

include/nbl/builtin/glsl/material_compiler/common.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bool nbl_glsl_MC_op_isBXDForCoatOrBlend(in uint op)
140140
#elif defined(OP_COATING)
141141
return op<=OP_COATING;
142142
#else
143-
return op_isBXDF(op);
143+
return nbl_glsl_MC_op_isBXDF(op);
144144
#endif
145145
}
146146
bool nbl_glsl_MC_op_hasSpecular(in uint op)

src/nbl/asset/CShaderIntrospector.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,16 +698,18 @@ static void introspectStructType(spirv_cross::Compiler& _comp, impl::SShaderMemo
698698
member.count_specID = sc->id;
699699
}
700700
}
701-
else if (mtype.basetype != spirv_cross::SPIRType::Struct) // might have to ignore a few more types than structs
702-
member.arrayStride = core::max(0x1u<<core::findMSB(member.size),16u); // @Crisspl NOT TRUE FOR MATRICES!
701+
else if (mtype.columns > 1u)
702+
member.arrayStride = member.size;
703+
else if (mtype.basetype != spirv_cross::SPIRType::Struct)
704+
member.arrayStride = core::max(0x1u<<core::findMSB(member.size),16u);
703705

704706
if (mtype.basetype == spirv_cross::SPIRType::Struct) //recursive introspection done in DFS manner (and without recursive calls)
705707
_pushStack.push({member.members, mtype, member.offset});
706708
else
707709
{
708710
member.mtxRowCnt = mtype.vecsize;
709711
member.mtxColCnt = mtype.columns;
710-
if (member.mtxColCnt > 1u) // @Crisspl why are you checking columns to get stride? What about row major?
712+
if (member.mtxColCnt > 1u)
711713
member.mtxStride = _comp.type_struct_member_matrix_stride(_parentType, m);
712714
}
713715
}

0 commit comments

Comments
 (0)