Vulkan: Alias all input textures on the same binding

This commit is contained in:
Dr. Chat
2017-02-13 13:35:53 -06:00
parent 60664d86fc
commit 75b34b83a6
2 changed files with 18 additions and 28 deletions

View File

@@ -214,12 +214,13 @@ void SpirvShaderTranslator::StartTranslation() {
b.makeArrayType(tex_t[2], b.makeUintConstant(32), 0),
b.makeArrayType(tex_t[3], b.makeUintConstant(32), 0)};
// Create 4 texture types, all aliased on the same binding
for (int i = 0; i < 4; i++) {
tex_[i] = b.createVariable(spv::StorageClass::StorageClassUniformConstant,
tex_a_t[i],
xe::format_string("textures%dD", i + 1).c_str());
b.addDecoration(tex_[i], spv::Decoration::DecorationDescriptorSet, 1);
b.addDecoration(tex_[i], spv::Decoration::DecorationBinding, i);
b.addDecoration(tex_[i], spv::Decoration::DecorationBinding, 0);
}
// Interpolators.
@@ -1401,6 +1402,12 @@ void SpirvShaderTranslator::ProcessTextureFetchInstruction(
}
} break;
case FetchOpcode::kSetTextureLod: {
// <lod register> = src1.x
// ... immediately after
// tfetch UseRegisterLOD=true
} break;
default:
// TODO: the rest of these
assert_unhandled_case(instr.opcode);