Skip to content

Commit b1cb0d8

Browse files
committed
Merge branch 'master' into resizable_cache
2 parents 71d0e98 + ff95b3b commit b1cb0d8

32 files changed

+2504
-103
lines changed

22_CppCompat/CIntrinsicsTester.h

Lines changed: 264 additions & 0 deletions
Large diffs are not rendered by default.

22_CppCompat/CTgmathTester.h

Lines changed: 360 additions & 0 deletions
Large diffs are not rendered by default.

22_CppCompat/ITester.h

Lines changed: 335 additions & 0 deletions
Large diffs are not rendered by default.

22_CppCompat/app_resources/common.hlsl

Lines changed: 425 additions & 4 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//// Copyright (C) 2023-2024 - DevSH Graphics Programming Sp. z O.O.
2+
//// This file is part of the "Nabla Engine".
3+
//// For conditions of distribution and use, see copyright notice in nabla.h
4+
#pragma shader_stage(compute)
5+
6+
#include "common.hlsl"
7+
8+
[[vk::binding(0, 0)]] RWStructuredBuffer<IntrinsicsIntputTestValues> inputTestValues;
9+
[[vk::binding(1, 0)]] RWStructuredBuffer<IntrinsicsTestValues> outputTestValues;
10+
11+
[numthreads(256, 1, 1)]
12+
void main(uint3 invocationID : SV_DispatchThreadID)
13+
{
14+
if(invocationID.x == 0)
15+
outputTestValues[0].fillTestValues(inputTestValues[0]);
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//// Copyright (C) 2023-2024 - DevSH Graphics Programming Sp. z O.O.
2+
//// This file is part of the "Nabla Engine".
3+
//// For conditions of distribution and use, see copyright notice in nabla.h
4+
#pragma shader_stage(compute)
5+
6+
#include "common.hlsl"
7+
8+
[[vk::binding(0, 0)]] RWStructuredBuffer<TgmathIntputTestValues> inputTestValues;
9+
[[vk::binding(1, 0)]] RWStructuredBuffer<TgmathTestValues> outputTestValues;
10+
11+
[numthreads(256, 1, 1)]
12+
void main(uint3 invocationID : SV_DispatchThreadID)
13+
{
14+
if(invocationID.x == 0)
15+
outputTestValues[0].fillTestValues(inputTestValues[0]);
16+
}

22_CppCompat/main.cpp

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "app_resources/common.hlsl"
1313

14+
#include "CTgmathTester.h"
15+
#include "CIntrinsicsTester.h"
1416

1517
using namespace nbl::core;
1618
using namespace nbl::hlsl;
@@ -56,11 +58,31 @@ class CompatibilityTest final : public MonoDeviceApplication, public MonoAssetMa
5658
return false;
5759
if (!asset_base_t::onAppInitialized(std::move(system)))
5860
return false;
59-
61+
62+
ITester::PipelineSetupData pplnSetupData;
63+
pplnSetupData.device = m_device;
64+
pplnSetupData.api = m_api;
65+
pplnSetupData.assetMgr = m_assetMgr;
66+
pplnSetupData.logger = m_logger;
67+
pplnSetupData.physicalDevice = m_physicalDevice;
68+
pplnSetupData.computeFamilyIndex = getComputeQueue()->getFamilyIndex();
69+
70+
{
71+
CTgmathTester tgmathTester;
72+
pplnSetupData.testShaderPath = "app_resources/tgmathTest.comp.hlsl";
73+
tgmathTester.setupPipeline<TgmathIntputTestValues, TgmathTestValues>(pplnSetupData);
74+
tgmathTester.performTests();
75+
}
76+
{
77+
CIntrinsicsTester intrinsicsTester;
78+
pplnSetupData.testShaderPath = "app_resources/intrinsicsTest.comp.hlsl";
79+
intrinsicsTester.setupPipeline<IntrinsicsIntputTestValues, IntrinsicsTestValues>(pplnSetupData);
80+
intrinsicsTester.performTests();
81+
}
82+
6083
m_queue = m_device->getQueue(0, 0);
6184
m_commandPool = m_device->createCommandPool(m_queue->getFamilyIndex(), IGPUCommandPool::CREATE_FLAGS::RESET_COMMAND_BUFFER_BIT);
6285
m_commandPool->createCommandBuffers(IGPUCommandPool::BUFFER_LEVEL::PRIMARY, { &m_cmdbuf,1 }, smart_refctd_ptr(m_logger));
63-
6486

6587
smart_refctd_ptr<IGPUShader> shader;
6688
{
@@ -211,7 +233,6 @@ class CompatibilityTest final : public MonoDeviceApplication, public MonoAssetMa
211233
constexpr auto StartedValue = 0;
212234

213235
smart_refctd_ptr<ISemaphore> progress = m_device->createSemaphore(StartedValue);
214-
215236

216237
m_cmdbuf->reset(IGPUCommandBuffer::RESET_FLAGS::RELEASE_RESOURCES_BIT);
217238
m_cmdbuf->begin(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT);
@@ -562,7 +583,7 @@ void cpu_tests()
562583
auto zero = cross(x,x);
563584
auto lenX2 = dot(x,x);
564585
//auto z_inv = inverse(z); //busted return type conversion
565-
auto mid = lerp(x,x,0.5f);
586+
auto mid = nbl::hlsl::mix(x,x,float32_t3(0.5f));
566587
//auto w = transpose(y); //also busted
567588

568589

@@ -761,8 +782,8 @@ void cpu_tests()
761782
TEST_CMATH(fdim, 2, type) \
762783

763784

764-
TEST_CMATH_FOR_TYPE(float32_t)
765-
TEST_CMATH_FOR_TYPE(float64_t)
785+
//TEST_CMATH_FOR_TYPE(float32_t)
786+
//TEST_CMATH_FOR_TYPE(float64_t)
766787
#endif
767788
std::cout << "cpu tests done\n";
768789
}

28_FFTBloom/app_resources/fft_convolve_ifft.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "fft_mirror_common.hlsl"
2-
#include "nbl/builtin/hlsl/bitreverse.hlsl"
32

43
[[vk::binding(3, 0)]] Texture2DArray<float32_t2> kernelChannels;
54
[[vk::binding(1, 0)]] SamplerState samplerState;

28_FFTBloom/app_resources/kernel_fft_second_axis.hlsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "fft_mirror_common.hlsl"
22
#include "nbl/builtin/hlsl/colorspace/encodeCIEXYZ.hlsl"
3-
#include "nbl/builtin/hlsl/bitreverse.hlsl"
43

54
[[vk::binding(2, 0)]] RWTexture2DArray<float32_t2> kernelChannels;
65

62_CAD/DrawResourcesFiller.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ void DrawResourcesFiller::drawPolyline(const CPolylineBase& polyline, uint32_t p
218218
}
219219
}
220220

221+
// TODO[Erfan]: Makes more sense if parameters are: solidColor + fillPattern + patternColor
221222
void DrawResourcesFiller::drawHatch(
222223
const Hatch& hatch,
223224
const float32_t4& foregroundColor,
@@ -241,6 +242,9 @@ void DrawResourcesFiller::drawHatch(
241242
const HatchFillPattern fillPattern,
242243
SIntendedSubmitInfo& intendedNextSubmit)
243244
{
245+
if (color.a == 0.0f) // not visible
246+
return;
247+
244248
uint32_t textureIdx = InvalidTextureIdx;
245249
if (fillPattern != HatchFillPattern::SOLID_FILL)
246250
{

0 commit comments

Comments
 (0)