[spirv] Add constvec2f32 helper

We should probably replace this with a proper template at some point.
This commit is contained in:
Philip Rebohle 2019-04-29 13:47:15 +02:00
parent b14ad7b30c
commit 8f5338b1d1
2 changed files with 18 additions and 0 deletions

View File

@ -297,6 +297,20 @@ namespace dxvk {
}
uint32_t SpirvModule::constvec2f32(
float x,
float y) {
std::array<uint32_t, 2> args = {{
this->constf32(x), this->constf32(y),
}};
uint32_t scalarTypeId = this->defFloatType(32);
uint32_t vectorTypeId = this->defVectorType(scalarTypeId, 2);
return this->constComposite(vectorTypeId, args.size(), args.data());
}
uint32_t SpirvModule::constvec3f32(
float x,
float y,

View File

@ -144,6 +144,10 @@ namespace dxvk {
uint32_t z,
uint32_t w);
uint32_t constvec2f32(
float x,
float y);
uint32_t constvec3f32(
float x,
float y,