Because the following is legal, need the entry point OpEntryPoint GLCompute %main "name_a" OpEntryPoint GLCompute %main "name_b" Assumes shader module contains no spec constants used to set the local size values
| 1634 | // OpEntryPoint GLCompute %main "name_b" |
| 1635 | // Assumes shader module contains no spec constants used to set the local size values |
| 1636 | LocalSize Module::FindLocalSize(const EntryPoint& entrypoint) const { |
| 1637 | LocalSize local_size; |
| 1638 | // "If an object is decorated with the WorkgroupSize decoration, this takes precedence over any LocalSize or LocalSizeId |
| 1639 | // execution mode." |
| 1640 | if (static_data_.has_built_in_workgroup_size) { |
| 1641 | const Instruction* composite_def = FindDef(static_data_.built_in_workgroup_size_id); |
| 1642 | if (composite_def->Opcode() == spv::OpConstantComposite) { |
| 1643 | // VUID-WorkgroupSize-WorkgroupSize-04427 makes sure this is a OpTypeVector of int32 |
| 1644 | local_size.x = GetConstantValueById(composite_def->Word(3)); |
| 1645 | local_size.y = GetConstantValueById(composite_def->Word(4)); |
| 1646 | local_size.z = GetConstantValueById(composite_def->Word(5)); |
| 1647 | return local_size; |
| 1648 | } |
| 1649 | } |
| 1650 | |
| 1651 | if (entrypoint.execution_mode.Has(ExecutionModeSet::local_size_bit)) { |
| 1652 | local_size = entrypoint.execution_mode.local_size; |
| 1653 | } else if (entrypoint.execution_mode.Has(ExecutionModeSet::local_size_id_bit)) { |
| 1654 | // Uses ExecutionModeLocalSizeId so need to resolve ID value |
| 1655 | local_size.x = GetConstantValueById(entrypoint.execution_mode.local_size.x); |
| 1656 | local_size.y = GetConstantValueById(entrypoint.execution_mode.local_size.y); |
| 1657 | local_size.z = GetConstantValueById(entrypoint.execution_mode.local_size.z); |
| 1658 | } |
| 1659 | |
| 1660 | return local_size; |
| 1661 | } |
| 1662 | |
| 1663 | uint32_t Module::CalculateWorkgroupSharedMemory() const { |
| 1664 | uint32_t total_size = 0; |
no test coverage detected