mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[spirv] Implement constuReplicant helper
This commit is contained in:
parent
16cea83325
commit
362a591e5b
@ -416,6 +416,24 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t SpirvModule::constuReplicant(
|
||||||
|
int32_t replicant,
|
||||||
|
uint32_t count) {
|
||||||
|
uint32_t value = this->constu32(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, 0);
|
||||||
|
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,
|
||||||
|
@ -184,6 +184,10 @@ namespace dxvk {
|
|||||||
int32_t replicant,
|
int32_t replicant,
|
||||||
uint32_t count);
|
uint32_t count);
|
||||||
|
|
||||||
|
uint32_t constuReplicant(
|
||||||
|
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