• Home
  • Raw
  • Download

Lines Matching +full:cap +full:- +full:std +full:- +full:ext

36 // Post-processing for SPIR-V IR, in internal form, not standard binary form.
50 #include "GLSL.std.450.h"
51 #include "GLSL.ext.KHR.h"
52 #include "GLSL.ext.EXT.h"
53 #include "GLSL.ext.AMD.h"
54 #include "GLSL.ext.NV.h"
55 #include "GLSL.ext.ARM.h"
56 #include "GLSL.ext.QCOM.h"
72 // Do opcode-specific checks in postProcessType()
120 // Look for any 8/16-bit storage capabilities. If there are none, assume that in postProcessType()
125 spv::Capability cap = *it; in postProcessType() local
126 if (cap == spv::CapabilityStorageInputOutput16 || in postProcessType()
127 cap == spv::CapabilityStoragePushConstant16 || in postProcessType()
128 cap == spv::CapabilityStorageUniformBufferBlock16 || in postProcessType()
129 cap == spv::CapabilityStorageUniform16) { in postProcessType()
144 spv::Capability cap = *it; in postProcessType() local
145 if (cap == spv::CapabilityStoragePushConstant8 || in postProcessType()
146 cap == spv::CapabilityUniformAndStorageBuffer8BitAccess || in postProcessType()
147 cap == spv::CapabilityStorageBuffer8BitAccess) { in postProcessType()
244 // index list to compute the misalignment. The pre-existing alignment value in postProcess()
247 // and this function computes the rest from the SPIR-V Offset decorations. in postProcess()
249 if (accessChain->getOpCode() == OpAccessChain) { in postProcess()
250 Instruction *base = module.getInstruction(accessChain->getIdOperand(0)); in postProcess()
252 Id typeId = base->getTypeId(); in postProcess()
254 assert(type->getOpCode() == OpTypePointer); in postProcess()
255 if (type->getImmediateOperand(0) != StorageClassPhysicalStorageBufferEXT) { in postProcess()
259 typeId = type->getIdOperand(1); in postProcess()
266 for (int i = 1; i < accessChain->getNumOperands(); ++i) { in postProcess()
267 Instruction *idx = module.getInstruction(accessChain->getIdOperand(i)); in postProcess()
268 if (type->getOpCode() == OpTypeStruct) { in postProcess()
269 assert(idx->getOpCode() == OpConstant); in postProcess()
270 unsigned int c = idx->getImmediateOperand(0); in postProcess()
272 const auto function = [&](const std::unique_ptr<Instruction>& decoration) { in postProcess()
273 if (decoration.get()->getOpCode() == OpMemberDecorate && in postProcess()
274 decoration.get()->getIdOperand(0) == typeId && in postProcess()
275 decoration.get()->getImmediateOperand(1) == c && in postProcess()
276 (decoration.get()->getImmediateOperand(2) == DecorationOffset || in postProcess()
277 … decoration.get()->getImmediateOperand(2) == DecorationMatrixStride)) { in postProcess()
278 alignment |= decoration.get()->getImmediateOperand(3); in postProcess()
281 std::for_each(decorations.begin(), decorations.end(), function); in postProcess()
283 typeId = type->getIdOperand(c); in postProcess()
285 } else if (type->getOpCode() == OpTypeArray || in postProcess()
286 type->getOpCode() == OpTypeRuntimeArray) { in postProcess()
287 const auto function = [&](const std::unique_ptr<Instruction>& decoration) { in postProcess()
288 if (decoration.get()->getOpCode() == OpDecorate && in postProcess()
289 decoration.get()->getIdOperand(0) == typeId && in postProcess()
290 decoration.get()->getImmediateOperand(1) == DecorationArrayStride) { in postProcess()
291 alignment |= decoration.get()->getImmediateOperand(2); in postProcess()
294 std::for_each(decorations.begin(), decorations.end(), function); in postProcess()
296 typeId = type->getIdOperand(0); in postProcess()
299 // Once we get to any non-aggregate type, we're done. in postProcess()
314 alignment = alignment & ~(alignment & (alignment-1)); in postProcess()
343 std::unordered_set<const Block*> reachableBlocks; in postProcessCFG()
344 std::unordered_map<Block*, Block*> headerForUnreachableContinue; in postProcessCFG()
345 std::unordered_set<Block*> unreachableMerges; in postProcessCFG()
346 std::unordered_set<Id> unreachableDefinitions; in postProcessCFG()
352 Block* entry = f->getEntryBlock(); in postProcessCFG()
360 for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { in postProcessCFG()
363 auto ii = b->getInstructions().cbegin(); in postProcessCFG()
365 for (; ii != b->getInstructions().cend(); ++ii) in postProcessCFG()
366 unreachableDefinitions.insert(ii->get()->getResultId()); in postProcessCFG()
369 … for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii) in postProcessCFG()
370 unreachableDefinitions.insert(ii->get()->getResultId()); in postProcessCFG()
378 (*mergeIter)->rewriteAsCanonicalUnreachableMerge(); in postProcessCFG()
383 Block* continue_target = continueIter->first; in postProcessCFG()
384 Block* header = continueIter->second; in postProcessCFG()
385 continue_target->rewriteAsCanonicalUnreachableContinue(header); in postProcessCFG()
389 decorations.erase(std::remove_if(decorations.begin(), decorations.end(), in postProcessCFG()
390 [&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool { in postProcessCFG()
391 Id decoration_id = I.get()->getIdOperand(0); in postProcessCFG()
399 // Add per-instruction capabilities, extensions, etc., in postProcessFeatures()
406 if (type->getImmediateOperand(0) == (unsigned)StorageClassPhysicalStorageBufferEXT) { in postProcessFeatures()
407 if (containsType(type->getIdOperand(1), OpTypeInt, 8)) { in postProcessFeatures()
411 if (containsType(type->getIdOperand(1), OpTypeInt, 16) || in postProcessFeatures()
412 containsType(type->getIdOperand(1), OpTypeFloat, 16)) { in postProcessFeatures()
419 // process all block-contained instructions in postProcessFeatures()
422 for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) { in postProcessFeatures()
424 for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++) in postProcessFeatures()
425 postProcess(*ii->get()); in postProcessFeatures()
430 … for (auto vi = b->getLocalVariables().cbegin(); vi != b->getLocalVariables().cend(); vi++) { in postProcessFeatures()
431 const Instruction& inst = *vi->get(); in postProcessFeatures()
435 const auto function = [&](const std::unique_ptr<Instruction>& decoration) { in postProcessFeatures()
436 if (decoration.get()->getIdOperand(0) == resultId && in postProcessFeatures()
437 decoration.get()->getOpCode() == OpDecorate && in postProcessFeatures()
438 … (decoration.get()->getImmediateOperand(1) == spv::DecorationAliasedPointerEXT || in postProcessFeatures()
439 … decoration.get()->getImmediateOperand(1) == spv::DecorationRestrictPointerEXT)) { in postProcessFeatures()
443 std::for_each(decorations.begin(), decorations.end(), function); in postProcessFeatures()
452 // If any Vulkan memory model-specific functionality is used, update the in postProcessFeatures()
464 std::vector<Id> workgroup_variables; in postProcessFeatures()
465 for (int i = 0; i < (int)ep->getNumOperands(); i++) { in postProcessFeatures()
466 if (!ep->isIdOperand(i)) in postProcessFeatures()
469 const Id id = ep->getIdOperand(i); in postProcessFeatures()
471 if (instr->getOpCode() != spv::OpVariable) in postProcessFeatures()
474 if (instr->getImmediateOperand(0) == spv::StorageClassWorkgroup) in postProcessFeatures()