|
|
|
@ -223,7 +223,7 @@ private:
|
|
|
|
|
Type type{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
constexpr const char* GetTypeString(Type type) {
|
|
|
|
|
const char* GetTypeString(Type type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case Type::Bool:
|
|
|
|
|
return "bool";
|
|
|
|
@ -243,7 +243,7 @@ constexpr const char* GetTypeString(Type type) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr const char* GetImageTypeDeclaration(Tegra::Shader::ImageType image_type) {
|
|
|
|
|
const char* GetImageTypeDeclaration(Tegra::Shader::ImageType image_type) {
|
|
|
|
|
switch (image_type) {
|
|
|
|
|
case Tegra::Shader::ImageType::Texture1D:
|
|
|
|
|
return "1D";
|
|
|
|
@ -522,13 +522,6 @@ private:
|
|
|
|
|
code.AddNewLine();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DeclareSharedMemory() {
|
|
|
|
|
if (stage != ProgramType::Compute) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
code.AddLine("shared uint {}[];", GetSharedMemory());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DeclareInternalFlags() {
|
|
|
|
|
for (u32 flag = 0; flag < static_cast<u32>(InternalFlag::Amount); flag++) {
|
|
|
|
|
const auto flag_code = static_cast<InternalFlag>(flag);
|
|
|
|
@ -867,9 +860,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (const auto smem = std::get_if<SmemNode>(&*node)) {
|
|
|
|
|
return {
|
|
|
|
|
fmt::format("{}[{} >> 2]", GetSharedMemory(), Visit(smem->GetAddress()).AsUint()),
|
|
|
|
|
Type::Uint};
|
|
|
|
|
return {fmt::format("smem[{} >> 2]", Visit(smem->GetAddress()).AsUint()), Type::Uint};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (const auto internal_flag = std::get_if<InternalFlagNode>(&*node)) {
|
|
|
|
@ -1245,9 +1236,7 @@ private:
|
|
|
|
|
Type::Uint};
|
|
|
|
|
} else if (const auto smem = std::get_if<SmemNode>(&*dest)) {
|
|
|
|
|
ASSERT(stage == ProgramType::Compute);
|
|
|
|
|
target = {
|
|
|
|
|
fmt::format("{}[{} >> 2]", GetSharedMemory(), Visit(smem->GetAddress()).AsUint()),
|
|
|
|
|
Type::Uint};
|
|
|
|
|
target = {fmt::format("smem[{} >> 2]", Visit(smem->GetAddress()).AsUint()), Type::Uint};
|
|
|
|
|
} else if (const auto gmem = std::get_if<GmemNode>(&*dest)) {
|
|
|
|
|
const std::string real = Visit(gmem->GetRealAddress()).AsUint();
|
|
|
|
|
const std::string base = Visit(gmem->GetBaseAddress()).AsUint();
|
|
|
|
@ -2170,10 +2159,6 @@ private:
|
|
|
|
|
return "lmem_" + suffix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string GetSharedMemory() const {
|
|
|
|
|
return fmt::format("smem_{}", suffix);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string GetInternalFlag(InternalFlag flag) const {
|
|
|
|
|
constexpr std::array InternalFlagNames = {"zero_flag", "sign_flag", "carry_flag",
|
|
|
|
|
"overflow_flag"};
|
|
|
|
|