Skip to content

Commit a5a8913

Browse files
show images in the window and in a grid, remove image download because we can do that with Renderdoc python API to extract and check (or gfxreconstruct)
1 parent 0a2c1a2 commit a5a8913

File tree

4 files changed

+173
-102
lines changed

4 files changed

+173
-102
lines changed

24_ColorSpaceTest/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ if(NBL_EMBED_BUILTIN_RESOURCES)
2121
ADD_CUSTOM_BUILTIN_RESOURCES(${_BR_TARGET_} RESOURCES_TO_EMBED "${_SEARCH_DIRECTORIES_}" "${RESOURCE_DIR}" "nbl::this_example::builtin" "${_OUTPUT_DIRECTORY_HEADER_}" "${_OUTPUT_DIRECTORY_SOURCE_}")
2222

2323
LINK_BUILTIN_RESOURCES_TO_TARGET(${EXECUTABLE_NAME} ${_BR_TARGET_})
24-
endif()
24+
endif()

24_ColorSpaceTest/app_resources/present.frag.hlsl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ using namespace nbl::hlsl::ext::FullScreenTriangle;
1010
[[vk::combinedImageSampler]][[vk::binding(0,3)]] Texture2DArray texture;
1111
[[vk::combinedImageSampler]][[vk::binding(0,3)]] SamplerState samplerState;
1212

13+
#include "push_constants.hlsl"
14+
[[vk::push_constant]] push_constants_t pc;
15+
1316
[[vk::location(0)]] float32_t4 main(SVertexAttributes vxAttr) : SV_Target0
1417
{
15-
return texture.SampleLevel(samplerState,float32_t3(vxAttr.uv,0.f),0.0);
18+
const float32_t2 repeatCoord = vxAttr.uv*float32_t2(pc.grid);
19+
const int32_t layer = int32_t(repeatCoord.y)*pc.grid.x+int32_t(repeatCoord.x);
20+
return texture.Sample(samplerState,float32_t3(repeatCoord,layer));
1621
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (C) 2024-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+
5+
struct push_constants_t
6+
{
7+
uint16_t2 grid;
8+
};

0 commit comments

Comments
 (0)