1
0
Fork 0
forked from suyu/suyu

Remove bounding in LD_C

This commit is contained in:
Fernando Sahmkow 2019-04-09 20:02:11 -04:00
parent b81260c65c
commit c9f35d96be

View file

@ -552,8 +552,7 @@ private:
} else if (std::holds_alternative<OperationNode>(*offset)) { } else if (std::holds_alternative<OperationNode>(*offset)) {
// Indirect access // Indirect access
const std::string final_offset = code.GenerateTemporary(); const std::string final_offset = code.GenerateTemporary();
code.AddLine("uint " + final_offset + " = (ftou(" + Visit(offset) + ") / 4) & " + code.AddLine("uint " + final_offset + " = (ftou(" + Visit(offset) + ") / 4);");
std::to_string(MAX_CONSTBUFFER_ELEMENTS - 1) + ';');
return fmt::format("{}[{} / 4][{} % 4]", GetConstBuffer(cbuf->GetIndex()), return fmt::format("{}[{} / 4][{} % 4]", GetConstBuffer(cbuf->GetIndex()),
final_offset, final_offset); final_offset, final_offset);