summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorSimon Kallweit <64953474+skallweitNV@users.noreply.github.com>2025-06-06 16:39:14 +0200
committerGitHub <noreply@github.com>2025-06-06 16:39:14 +0200
commit8abaec701f0637f082e081caa0dd4fa049a00430 (patch)
tree79cb7d6257ecd4fe4f2ace21068d934fd9cff553 /tools/render-test
parent4cfc0f1fd67499847f2fa745cd083ebf0edd8188 (diff)
Update slang-rhi (#7303)
* update slang-rhi * adapt to new slang-rhi API * enable slang-rhi agility sdk * fix handling empty list * disable failing slang-rhi tests * format code * fix slang-rhi-tests ci step * skip running slang-rhi-tests --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/png-serialize-util.cpp5
-rw-r--r--tools/render-test/png-serialize-util.h3
-rw-r--r--tools/render-test/render-test-main.cpp23
3 files changed, 18 insertions, 13 deletions
diff --git a/tools/render-test/png-serialize-util.cpp b/tools/render-test/png-serialize-util.cpp
index 15aaba00b..9dca81ea8 100644
--- a/tools/render-test/png-serialize-util.cpp
+++ b/tools/render-test/png-serialize-util.cpp
@@ -17,10 +17,11 @@ using namespace Slang;
const char* filename,
ISlangBlob* pixels,
uint32_t width,
- uint32_t height)
+ uint32_t height,
+ uint32_t rowPitch)
{
int stbResult =
- stbi_write_png(filename, width, height, 4, pixels->getBufferPointer(), width * 4);
+ stbi_write_png(filename, width, height, 4, pixels->getBufferPointer(), rowPitch);
return stbResult ? SLANG_OK : SLANG_FAIL;
}
diff --git a/tools/render-test/png-serialize-util.h b/tools/render-test/png-serialize-util.h
index 4eb119b30..38e796c3c 100644
--- a/tools/render-test/png-serialize-util.h
+++ b/tools/render-test/png-serialize-util.h
@@ -12,7 +12,8 @@ struct PngSerializeUtil
const char* filename,
ISlangBlob* pixels,
uint32_t width,
- uint32_t height);
+ uint32_t height,
+ uint32_t rowPitch);
};
} // namespace renderer_test
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 48ebbd332..71347e4f9 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -911,11 +911,13 @@ void RenderTestApp::_initializeAccelerationStructure()
void RenderTestApp::setProjectionMatrix(IShaderObject* rootObject)
{
- auto info = m_device->getDeviceInfo();
+ float kIdentity[16] =
+ {1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f};
+ auto info = m_device->getInfo();
ShaderCursor(rootObject)
.getField("Uniforms")
.getDereferenced()
- .setData(info.identityProjectionMatrix, sizeof(float) * 16);
+ .setData(kIdentity, sizeof(kIdentity));
}
void RenderTestApp::finalize()
@@ -972,14 +974,15 @@ Result RenderTestApp::writeBindingOutput(const String& fileName)
Result RenderTestApp::writeScreen(const String& filename)
{
- size_t rowPitch, pixelSize;
+ rhi::SubresourceLayout layout;
ComPtr<ISlangBlob> blob;
- SLANG_RETURN_ON_FAIL(
- m_device->readTexture(m_colorBuffer, blob.writeRef(), &rowPitch, &pixelSize));
- auto bufferSize = blob->getBufferSize();
- uint32_t width = static_cast<uint32_t>(rowPitch / pixelSize);
- uint32_t height = static_cast<uint32_t>(bufferSize / rowPitch);
- return PngSerializeUtil::write(filename.getBuffer(), blob, width, height);
+ SLANG_RETURN_ON_FAIL(m_device->readTexture(m_colorBuffer, 0, 0, blob.writeRef(), &layout));
+ return PngSerializeUtil::write(
+ filename.getBuffer(),
+ blob,
+ layout.size.width,
+ layout.size.height,
+ layout.rowPitch);
}
Result RenderTestApp::update()
@@ -1488,7 +1491,7 @@ static SlangResult _innerMain(
// Print adapter info after device creation but before any other operations
if (options.showAdapterInfo)
{
- auto info = device->getDeviceInfo();
+ auto info = device->getInfo();
auto out = stdWriters->getOut();
out.print("Using graphics adapter: %s\n", info.adapterName);
}