From bc11579dd998224bcb429d88aeb07d49e2217a35 Mon Sep 17 00:00:00 2001 From: Simon Kallweit <64953474+skallweitNV@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:24:01 +0200 Subject: Update slang-rhi (#5187) * update slang-rhi * fix render-test * update slang-rhi --------- Co-authored-by: Yong He --- external/slang-rhi | 2 +- tools/render-test/render-test-main.cpp | 11 +++-------- tools/render-test/shader-renderer-util.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/external/slang-rhi b/external/slang-rhi index 35f123e8f..d0795a9db 160000 --- a/external/slang-rhi +++ b/external/slang-rhi @@ -1 +1 @@ -Subproject commit 35f123e8ff3b287d3befde77fb8e5aaa156f6ab2 +Subproject commit d0795a9db3e82314eb8c00352cc7e9ecb4fdcf8a 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 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(rowPitch / pixelSize); uint32_t height = static_cast(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 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); -- cgit v1.2.3