| 41 | namespace spirv { |
| 42 | |
| 43 | void DecorationBase::Add(uint32_t decoration, uint32_t value) { |
| 44 | switch (decoration) { |
| 45 | case spv::DecorationLocation: |
| 46 | location = value; |
| 47 | break; |
| 48 | case spv::DecorationPatch: |
| 49 | flags |= patch_bit; |
| 50 | break; |
| 51 | case spv::DecorationBlock: |
| 52 | flags |= block_bit; |
| 53 | break; |
| 54 | case spv::DecorationBufferBlock: |
| 55 | flags |= buffer_block_bit; |
| 56 | break; |
| 57 | case spv::DecorationComponent: |
| 58 | component = value; |
| 59 | break; |
| 60 | case spv::DecorationIndex: |
| 61 | index = value; |
| 62 | break; |
| 63 | case spv::DecorationNonWritable: |
| 64 | flags |= nonwritable_bit; |
| 65 | break; |
| 66 | case spv::DecorationBuiltIn: |
| 67 | assert(built_in == kInvalidBuiltIn); // being over written - not valid |
| 68 | built_in = (spv::BuiltIn)value; |
| 69 | break; |
| 70 | case spv::DecorationNonReadable: |
| 71 | flags |= nonreadable_bit; |
| 72 | break; |
| 73 | case spv::DecorationPerVertexKHR: // VK_KHR_fragment_shader_barycentric |
| 74 | flags |= per_vertex_bit; |
| 75 | break; |
| 76 | case spv::DecorationPassthroughNV: // VK_NV_geometry_shader_passthrough |
| 77 | flags |= passthrough_bit; |
| 78 | break; |
| 79 | case spv::DecorationAliased: |
| 80 | flags |= aliased_bit; |
| 81 | break; |
| 82 | case spv::DecorationPerTaskNV: // VK_NV_mesh_shader |
| 83 | flags |= per_task_nv; |
| 84 | break; |
| 85 | case spv::DecorationPerPrimitiveEXT: // VK_EXT_mesh_shader |
| 86 | flags |= per_primitive_ext; |
| 87 | break; |
| 88 | case spv::DecorationOffset: |
| 89 | offset = value; |
| 90 | break; |
| 91 | default: |
| 92 | break; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void DecorationBase::AddId(uint32_t decoration, uint32_t id) { |
| 97 | switch (decoration) { |
no test coverage detected