summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorSimon Kallweit <64953474+skallweitNV@users.noreply.github.com>2024-09-30 19:24:01 +0200
committerGitHub <noreply@github.com>2024-09-30 10:24:01 -0700
commitbc11579dd998224bcb429d88aeb07d49e2217a35 (patch)
treeff6402940a1e2177407f7051d2375b2bee53adee /tools/render-test
parent59168f41f43d80650f3c02f5a840becead784ebc (diff)
Update slang-rhi (#5187)
* update slang-rhi * fix render-test * update slang-rhi --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/render-test-main.cpp11
-rw-r--r--tools/render-test/shader-renderer-util.cpp8
2 files changed, 7 insertions, 12 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 977cdfa42..5f0e51da3 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -661,7 +661,7 @@ void RenderTestApp::_initializeRenderPass()
depthBufferDesc.size.width = gWindowWidth;
depthBufferDesc.size.height = gWindowHeight;
depthBufferDesc.size.depth = 1;
- depthBufferDesc.numMipLevels = 1;
+ depthBufferDesc.mipLevelCount = 1;
depthBufferDesc.format = Format::D32_FLOAT;
depthBufferDesc.usage = TextureUsage::DepthWrite;
depthBufferDesc.defaultState = ResourceState::DepthWrite;
@@ -675,7 +675,7 @@ void RenderTestApp::_initializeRenderPass()
colorBufferDesc.size.width = gWindowWidth;
colorBufferDesc.size.height = gWindowHeight;
colorBufferDesc.size.depth = 1;
- colorBufferDesc.numMipLevels = 1;
+ colorBufferDesc.mipLevelCount = 1;
colorBufferDesc.format = Format::R8G8B8A8_UNORM;
colorBufferDesc.usage = TextureUsage::RenderTarget;
colorBufferDesc.defaultState = ResourceState::RenderTarget;
@@ -959,8 +959,7 @@ Result RenderTestApp::writeScreen(const String& filename)
{
size_t rowPitch, pixelSize;
ComPtr<ISlangBlob> blob;
- SLANG_RETURN_ON_FAIL(m_device->readTexture(
- m_colorBuffer, ResourceState::RenderTarget, blob.writeRef(), &rowPitch, &pixelSize));
+ 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);
@@ -982,14 +981,10 @@ Result RenderTestApp::update()
colorAttachment.view = m_colorBufferView;
colorAttachment.loadOp = LoadOp::Clear;
colorAttachment.storeOp = StoreOp::Store;
- colorAttachment.initialState = ResourceState::Undefined;
- colorAttachment.finalState = ResourceState::RenderTarget;
RenderPassDepthStencilAttachment depthStencilAttachment = {};
depthStencilAttachment.view = m_depthBufferView;
depthStencilAttachment.depthLoadOp = LoadOp::Clear;
depthStencilAttachment.depthStoreOp = StoreOp::Store;
- depthStencilAttachment.initialState = ResourceState::Undefined;
- depthStencilAttachment.finalState = ResourceState::DepthWrite;
RenderPassDesc renderPass = {};
renderPass.colorAttachments = &colorAttachment;
renderPass.colorAttachmentCount = 1;
diff --git a/tools/render-test/shader-renderer-util.cpp b/tools/render-test/shader-renderer-util.cpp
index 5448979b4..19bbbd2a5 100644
--- a/tools/render-test/shader-renderer-util.cpp
+++ b/tools/render-test/shader-renderer-util.cpp
@@ -73,7 +73,7 @@ inline int calcNumMipLevels(TextureType type, Extents size)
textureDesc.sampleCount = inputDesc.sampleCount;
textureDesc.format = format;
- textureDesc.numMipLevels = texData.m_mipLevels;
+ textureDesc.mipLevelCount = texData.m_mipLevels;
textureDesc.arrayLength = inputDesc.arrayLength > 0 ? inputDesc.arrayLength : 1;
textureDesc.usage = TextureUsage::CopyDestination | TextureUsage::CopySource;
switch (defaultState)
@@ -119,9 +119,9 @@ inline int calcNumMipLevels(TextureType type, Extents size)
}
}
- if (textureDesc.numMipLevels == 0)
+ if (textureDesc.mipLevelCount == 0)
{
- textureDesc.numMipLevels = calcNumMipLevels(textureDesc.type, textureDesc.size);
+ textureDesc.mipLevelCount = calcNumMipLevels(textureDesc.type, textureDesc.size);
}
List<SubresourceData> initSubresources;
@@ -129,7 +129,7 @@ inline int calcNumMipLevels(TextureType type, Extents size)
int subResourceCounter = 0;
for( int a = 0; a < arrayLayerCount; ++a )
{
- for( int m = 0; m < textureDesc.numMipLevels; ++m )
+ for( int m = 0; m < textureDesc.mipLevelCount; ++m )
{
int subResourceIndex = subResourceCounter++;
const int mipWidth = calcMipSize(textureDesc.size.width, m);