summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------external/slang-rhi0
-rw-r--r--tools/render-test/render-test-main.cpp11
-rw-r--r--tools/render-test/shader-renderer-util.cpp8
3 files changed, 7 insertions, 12 deletions
diff --git a/external/slang-rhi b/external/slang-rhi
-Subproject 35f123e8ff3b287d3befde77fb8e5aaa156f6ab
+Subproject d0795a9db3e82314eb8c00352cc7e9ecb4fdcf8
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);