diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 4631fe754..48179271b 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -296,6 +296,22 @@ namespace dxvk { return this->constComposite(vectorTypeId, args.size(), args.data()); } + + uint32_t SpirvModule::constvec3f32( + float x, + float y, + float z) { + std::array args = {{ + this->constf32(x), this->constf32(y), + this->constf32(z), + }}; + + uint32_t scalarTypeId = this->defFloatType(32); + uint32_t vectorTypeId = this->defVectorType(scalarTypeId, 3); + + return this->constComposite(vectorTypeId, args.size(), args.data()); + } + uint32_t SpirvModule::constvec4f32( float x, diff --git a/src/spirv/spirv_module.h b/src/spirv/spirv_module.h index 13c2a49a0..a72a772e7 100644 --- a/src/spirv/spirv_module.h +++ b/src/spirv/spirv_module.h @@ -143,7 +143,12 @@ namespace dxvk { uint32_t y, uint32_t z, uint32_t w); - + + uint32_t constvec3f32( + float x, + float y, + float z); + uint32_t constvec4f32( float x, float y,