mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[spirv] Implement constbReplicant
This commit is contained in:
parent
8b6dd0544e
commit
f5dd509429
@ -377,6 +377,24 @@ namespace dxvk {
|
|||||||
|
|
||||||
return this->constComposite(vectorTypeId, count, args.data());
|
return this->constComposite(vectorTypeId, count, args.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t SpirvModule::constbReplicant(
|
||||||
|
bool replicant,
|
||||||
|
uint32_t count) {
|
||||||
|
uint32_t value = this->constBool(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->defBoolType();
|
||||||
|
uint32_t vectorTypeId = this->defVectorType(scalarTypeId, count);
|
||||||
|
|
||||||
|
return this->constComposite(vectorTypeId, count, args.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t SpirvModule::constComposite(
|
uint32_t SpirvModule::constComposite(
|
||||||
|
@ -170,6 +170,10 @@ namespace dxvk {
|
|||||||
uint32_t constfReplicant(
|
uint32_t constfReplicant(
|
||||||
float replicant,
|
float replicant,
|
||||||
uint32_t count);
|
uint32_t count);
|
||||||
|
|
||||||
|
uint32_t constbReplicant(
|
||||||
|
bool replicant,
|
||||||
|
uint32_t count);
|
||||||
|
|
||||||
uint32_t constComposite(
|
uint32_t constComposite(
|
||||||
uint32_t typeId,
|
uint32_t typeId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user