mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-22 07:54:15 +01:00
[spirv] Implement constiReplicant helper
This commit is contained in:
parent
a9db65c8c2
commit
16cea83325
@ -398,6 +398,24 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t SpirvModule::constiReplicant(
|
||||||
|
int32_t replicant,
|
||||||
|
uint32_t count) {
|
||||||
|
uint32_t value = this->consti32(replicant);
|
||||||
|
|
||||||
|
std::array<uint32_t, 4> args = { value, value, value, value };
|
||||||
|
|
||||||
|
// Can't make a scalar composite.
|
||||||
|
if (count == 1)
|
||||||
|
return args[0];
|
||||||
|
|
||||||
|
uint32_t scalarTypeId = this->defIntType(32, 1);
|
||||||
|
uint32_t vectorTypeId = this->defVectorType(scalarTypeId, count);
|
||||||
|
|
||||||
|
return this->constComposite(vectorTypeId, count, args.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t SpirvModule::constComposite(
|
uint32_t SpirvModule::constComposite(
|
||||||
uint32_t typeId,
|
uint32_t typeId,
|
||||||
uint32_t constCount,
|
uint32_t constCount,
|
||||||
|
@ -180,6 +180,10 @@ namespace dxvk {
|
|||||||
bool replicant,
|
bool replicant,
|
||||||
uint32_t count);
|
uint32_t count);
|
||||||
|
|
||||||
|
uint32_t constiReplicant(
|
||||||
|
int32_t replicant,
|
||||||
|
uint32_t count);
|
||||||
|
|
||||||
uint32_t constComposite(
|
uint32_t constComposite(
|
||||||
uint32_t typeId,
|
uint32_t typeId,
|
||||||
uint32_t constCount,
|
uint32_t constCount,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user