summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render-test-main.cpp
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/render-test-main.cpp
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/render-test-main.cpp')
-rw-r--r--tools/render-test/render-test-main.cpp11
1 files changed, 3 insertions, 8 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;