================================================================================================
| 818 | |
| 819 | // ================================================================================================ |
| 820 | bool KernelBlitManager::createProgram(Device& device) { |
| 821 | if (device.blitProgram() == nullptr) { |
| 822 | if (!device.createBlitProgram()) { |
| 823 | return false; |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | std::vector<amd::Device*> devices; |
| 828 | devices.push_back(&device); |
| 829 | |
| 830 | // Save context and program for this device |
| 831 | context_ = device.blitProgram()->context_; |
| 832 | context_->retain(); |
| 833 | program_ = device.blitProgram()->program_; |
| 834 | program_->retain(); |
| 835 | |
| 836 | bool result = false; |
| 837 | do { |
| 838 | // Create kernel objects for all blits |
| 839 | for (uint i = 0; i < NumBlitKernels(); ++i) { |
| 840 | const amd::Symbol* symbol = program_->findSymbol(BlitName[i]); |
| 841 | if (symbol == nullptr) { |
| 842 | // Not all blit kernels are needed in some setup, so continue with the rest |
| 843 | continue; |
| 844 | } |
| 845 | kernels_[i] = new amd::Kernel(*program_, *symbol, BlitName[i]); |
| 846 | if (kernels_[i] == nullptr) { |
| 847 | break; |
| 848 | } |
| 849 | // Validate blit kernels for the scratch memory usage (pre SI) |
| 850 | if (!device.validateKernel(*kernels_[i], &gpu())) { |
| 851 | break; |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | result = true; |
| 856 | } while (!result); |
| 857 | |
| 858 | return result; |
| 859 | } |
| 860 | |
| 861 | // The following data structures will be used for the view creations. |
| 862 | // Some formats has to be converted before a kernel blit operation |
nothing calls this directly
no test coverage detected