|
1 | 1 | /* |
2 | | - * Copyright 2019-2025 Diligent Graphics LLC |
| 2 | + * Copyright 2019-2026 Diligent Graphics LLC |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -135,8 +135,24 @@ bool PSOSerializer<Mode>::SerializeCreateInfo( |
135 | 135 | return false; |
136 | 136 | } |
137 | 137 |
|
| 138 | + // Serialize specialization constants |
| 139 | + if (!Ser.SerializeArray(Allocator, CreateInfo.pSpecializationConstants, CreateInfo.NumSpecializationConstants, |
| 140 | + [](Serializer<Mode>& Ser, |
| 141 | + ConstQual<SpecializationConstant>& SpecConst) // |
| 142 | + { |
| 143 | + if (!Ser(SpecConst.Name, |
| 144 | + SpecConst.ShaderStages, |
| 145 | + SpecConst.Size)) |
| 146 | + return false; |
| 147 | + |
| 148 | + size_t DataSize = SpecConst.Size; |
| 149 | + return Ser.SerializeBytes(SpecConst.pData, DataSize); |
| 150 | + })) |
| 151 | + return false; |
| 152 | + |
138 | 153 | ASSERT_SIZEOF64(ShaderResourceVariableDesc, 16, "Did you add a new member to ShaderResourceVariableDesc? Please add serialization here."); |
139 | | - ASSERT_SIZEOF64(PipelineStateCreateInfo, 96, "Did you add a new member to PipelineStateCreateInfo? Please add serialization here."); |
| 154 | + ASSERT_SIZEOF64(SpecializationConstant, 24, "Did you add a new member to SpecializationConstant? Please add serialization here."); |
| 155 | + ASSERT_SIZEOF64(PipelineStateCreateInfo, 112, "Did you add a new member to PipelineStateCreateInfo? Please add serialization here."); |
140 | 156 |
|
141 | 157 | return true; |
142 | 158 | } |
|
0 commit comments