diff options
| author | Yong He <yonghe@outlook.com> | 2021-12-06 14:50:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-06 14:50:42 -0800 |
| commit | ef4ee0b2d42b1fe9ce36c67526cf853343d98ea0 (patch) | |
| tree | 15d4c441cb407a4f4d39318f525e471a98ff1d87 /tools | |
| parent | 5cbd61774c6ef2209fa0afc79b1dbbb68514346b (diff) | |
Fix shader-toy example. (#2047)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gfx/d3d12/render-d3d12.cpp | 1 | ||||
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 15 | ||||
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp index 5a0478f68..e8dadfbbb 100644 --- a/tools/gfx/d3d12/render-d3d12.cpp +++ b/tools/gfx/d3d12/render-d3d12.cpp @@ -5967,6 +5967,7 @@ Result D3D12Device::createGraphicsPipelineState(const GraphicsPipelineStateDesc& D3D12_BLEND_DESC& blend = psoDesc.BlendState; blend.IndependentBlendEnable = FALSE; blend.AlphaToCoverageEnable = desc.blend.alphaToCoverageEnable ? TRUE : FALSE; + blend.RenderTarget[0].RenderTargetWriteMask = (uint8_t)RenderTargetWriteMask::EnableAll; for (uint32_t i = 0; i < desc.blend.targetCount; i++) { auto& d3dDesc = blend.RenderTarget[i]; diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index 1fb06b8e7..59f12cb41 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -2741,7 +2741,8 @@ public: for(Index i = 0; i < count; ++i) { auto resourceView = static_cast<TexelBufferResourceViewImpl*>(resourceViews[i].Ptr()); - + if (!resourceView) + continue; VkBufferView bufferView = resourceView->m_view; VkWriteDescriptorSet write = {}; @@ -2770,7 +2771,8 @@ public: { auto texture = slots[i].textureView; auto sampler = slots[i].sampler; - + if (!texture) + continue; VkDescriptorImageInfo imageInfo = {}; imageInfo.imageView = texture->m_view; imageInfo.imageLayout = texture->m_layout; @@ -2802,7 +2804,8 @@ public: { auto accelerationStructure = static_cast<AccelerationStructureImpl*>(resourceViews[i].Ptr()); - + if (!accelerationStructure) + continue; VkWriteDescriptorSetAccelerationStructureKHR writeAS = {}; writeAS.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR; writeAS.accelerationStructureCount = 1; @@ -2831,7 +2834,8 @@ public: for(Index i = 0; i < count; ++i) { auto texture = static_cast<TextureResourceViewImpl*>(resourceViews[i].Ptr()); - + if (!texture) + continue; VkDescriptorImageInfo imageInfo = {}; imageInfo.imageView = texture->m_view; imageInfo.imageLayout = texture->m_layout; @@ -2862,7 +2866,8 @@ public: for(Index i = 0; i < count; ++i) { auto sampler = samplers[i]; - + if (!sampler) + continue; VkDescriptorImageInfo imageInfo = {}; imageInfo.imageView = 0; imageInfo.imageLayout = VK_IMAGE_LAYOUT_GENERAL; diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 1cb25bebb..96d0e4047 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -813,13 +813,13 @@ void RenderTestApp::_initializeAccelerationStructure() IBufferResource::Desc asBufferDesc; asBufferDesc.type = IResource::Type::Buffer; asBufferDesc.defaultState = ResourceState::AccelerationStructure; - asBufferDesc.sizeInBytes = accelerationStructurePrebuildInfo.resultDataMaxSize; + asBufferDesc.sizeInBytes = (size_t)accelerationStructurePrebuildInfo.resultDataMaxSize; m_tlasBuffer = m_device->createBufferResource(asBufferDesc); IBufferResource::Desc scratchBufferDesc; scratchBufferDesc.type = IResource::Type::Buffer; scratchBufferDesc.defaultState = ResourceState::UnorderedAccess; - scratchBufferDesc.sizeInBytes = accelerationStructurePrebuildInfo.scratchDataSize; + scratchBufferDesc.sizeInBytes = (size_t)accelerationStructurePrebuildInfo.scratchDataSize; ComPtr<IBufferResource> scratchBuffer = m_device->createBufferResource(scratchBufferDesc); IAccelerationStructure::CreateDesc createDesc; |
