Browse Source

PR comments

Signed-off-by: Martin Winter <[email protected]>
Martin Winter 1 năm trước cách đây
mục cha
commit
c1808446ea

+ 2 - 6
Gem/Code/Source/MultiGPURPIExampleComponent.cpp

@@ -77,7 +77,7 @@ namespace AtomSampleViewer
         m_originalPipeline = m_scene->GetDefaultRenderPipeline();
         m_scene->RemoveRenderPipeline(m_originalPipeline->GetId());
 
-        // add the checker board pipeline
+        // add the multi-GPU pipeline
         const AZStd::string pipelineName("MultiGPUPipeline");
         AZ::RPI::RenderPipelineDescriptor pipelineDesc;
         pipelineDesc.m_name = pipelineName;
@@ -162,17 +162,13 @@ namespace AtomSampleViewer
     {
         auto meshFeatureProcessor = GetMeshFeatureProcessor();
 
-        /*
-        auto asset = RPI::AssetUtils::LoadAssetByProductPath<RPI::ModelAsset>(BunnyModelFilePath,
-                                                                              RPI::AssetUtils::TraceLevel::Assert); //*/
         auto asset = RPI::AssetUtils::LoadAssetByProductPath<RPI::ModelAsset>(CubeModelFilePath,
                                                                               RPI::AssetUtils::TraceLevel::Assert);
         m_meshHandle = meshFeatureProcessor->AcquireMesh(Render::MeshHandleDescriptor(asset));
 
-        //const Vector3 nonUniformScale{ 12.f, 12.f, 0.1f };
         const Vector3 translation{ 0.f, 0.f, -1.0f };
         Transform transform = Transform::CreateTranslation(translation);
-        meshFeatureProcessor->SetTransform(m_meshHandle, transform);//, nonUniformScale);
+        meshFeatureProcessor->SetTransform(m_meshHandle, transform);
     }
 
     void MultiGPURPIExampleComponent::DefaultWindowCreated()

+ 0 - 5
Gem/Code/Source/RHI/MultiGPUExampleComponent.cpp

@@ -148,13 +148,8 @@ namespace AtomSampleViewer
 
         uint32_t* destination = reinterpret_cast<uint32_t*>(response.m_data);
 
-        //memset(destination, 0x80, request.m_byteCount);
-
         memcpy(destination, source, request.m_byteCount);
 
-        /*for (auto i= 0 ; i < 1920 * 8; i++)
-            destination[i + 1080/2*1920] = 0xFFFFFFFF;*/
-
         m_stagingBufferPoolToCPU->GetDeviceBufferPool(1)->UnmapBuffer(*m_stagingBufferToCPU->GetDeviceBuffer(1));
         m_stagingBufferPoolToGPU->GetDeviceBufferPool(0)->UnmapBuffer(*m_stagingBufferToGPU->GetDeviceBuffer(0));
     }

+ 4 - 0
Gem/Code/Source/RHI/MultiGPUExampleComponent.h

@@ -29,6 +29,10 @@
 
 namespace AtomSampleViewer
 {
+    // MultiGPU RHI example.
+    // Renders a rotating triangle to the screen similar to the TriangleExampleComponent, except, the left half of the screen is rendered by
+    // GPU 0 and the right half by GPU 1, which is then copied to GPU 0 to composite and show the final output on GPU 0.
+    // At least two devices need to be initialized (by passing "--device-count 2") to run this example.
     class MultiGPUExampleComponent final
         : public BasicRHIComponent
     {