Skip to content

Instantly share code, notes, and snippets.

@Subv
Created June 26, 2015 03:54
Show Gist options
  • Select an option

  • Save Subv/74feaf13965a38ec2422 to your computer and use it in GitHub Desktop.

Select an option

Save Subv/74feaf13965a38ec2422 to your computer and use it in GitHub Desktop.
auto LookupSourceRegister = [&](const SourceRegister& source_reg) -> const float24* {
switch (source_reg.GetRegisterType()) {
case RegisterType::Input:
return state.input_register_table[source_reg.GetIndex()];
case RegisterType::Temporary:
return &state.temporary_registers[source_reg.GetIndex()].x;
case RegisterType::FloatUniform:
return &uniforms.f[source_reg.GetIndex()].x;
default:
return dummy_vec4_float24;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment