| 70 | } |
| 71 | |
| 72 | bool LoopFeature::Install() { |
| 73 | // Must have the export host |
| 74 | auto exportHost = registry->Get<IShaderExportHost>(); |
| 75 | if (!exportHost) { |
| 76 | return false; |
| 77 | } |
| 78 | |
| 79 | // Allocate the shared export |
| 80 | exportID = exportHost->Allocate<LoopTerminationMessage>(); |
| 81 | |
| 82 | // Optional SGUID host |
| 83 | sguidHost = registry->Get<IShaderSGUIDHost>(); |
| 84 | |
| 85 | // Shader data host |
| 86 | shaderDataHost = registry->Get<IShaderDataHost>(); |
| 87 | |
| 88 | // Scheduler |
| 89 | scheduler = registry->Get<IScheduler>(); |
| 90 | |
| 91 | // Allocate termination buffer |
| 92 | terminationBufferID = shaderDataHost->CreateBuffer(ShaderDataBufferInfo{ |
| 93 | .elementCount = kMaxTrackedSubmissions, |
| 94 | .format = Backend::IL::Format::R32UInt |
| 95 | }); |
| 96 | |
| 97 | // Allocate allocation data |
| 98 | terminationAllocationID = shaderDataHost->CreateDescriptorData(ShaderDataDescriptorInfo{ |
| 99 | .dwordCount = 1u |
| 100 | }); |
| 101 | |
| 102 | #if USE_SIGNAL_PROGRAM |
| 103 | // Must have program host |
| 104 | auto programHost = registry->Get<IShaderProgramHost>(); |
| 105 | if (!programHost) { |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | // Create the signal program |
| 110 | signalShaderProgram = registry->New<SignalShaderProgram>(terminationBufferID); |
| 111 | if (!signalShaderProgram->Install()) { |
| 112 | return false; |
| 113 | } |
| 114 | |
| 115 | // Register signaller |
| 116 | signalShaderProgramID = programHost->Register(signalShaderProgram); |
| 117 | #endif // USE_SIGNAL_PROGRAM |
| 118 | |
| 119 | // OK |
| 120 | return true; |
| 121 | } |
| 122 | |
| 123 | bool LoopFeature::PostInstall() { |
| 124 | // Start the heart beat thread |
nothing calls this directly
no test coverage detected