Support gl_BackColor attribute
This commit is contained in:
parent
3c8c17be4d
commit
b04c7b6343
3 changed files with 33 additions and 0 deletions
|
@ -1286,6 +1286,14 @@ void EmitContext::DefineInputs(const IR::Program& program) {
|
|||
Decorate(id, spv::Decoration::Location, location);
|
||||
input_front_color = id;
|
||||
}
|
||||
if (loads.AnyComponent(IR::Attribute::ColorBackDiffuseR)) {
|
||||
const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location);
|
||||
previous_unused_location = location;
|
||||
used_locations.set(location);
|
||||
const Id id{DefineInput(*this, F32[4], true)};
|
||||
Decorate(id, spv::Decoration::Location, location);
|
||||
input_back_color = id;
|
||||
}
|
||||
for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
|
||||
if (loads.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
|
||||
const size_t location =
|
||||
|
@ -1363,6 +1371,14 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
|
|||
Decorate(id, spv::Decoration::Location, static_cast<u32>(location));
|
||||
output_front_color = id;
|
||||
}
|
||||
if (info.stores.AnyComponent(IR::Attribute::ColorBackDiffuseR)) {
|
||||
const size_t location = FindNextUnusedLocation(used_locations, previous_unused_location);
|
||||
previous_unused_location = location;
|
||||
used_locations.set(location);
|
||||
const Id id{DefineOutput(*this, F32[4], invocations)};
|
||||
Decorate(id, spv::Decoration::Location, static_cast<u32>(location));
|
||||
output_back_color = id;
|
||||
}
|
||||
for (size_t index = 0; index < NUM_FIXEDFNCTEXTURE; ++index) {
|
||||
if (info.stores.AnyComponent(IR::Attribute::FixedFncTexture0S + index * 4)) {
|
||||
const size_t location =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue