Skip to content

Commit

Permalink
Merge branch 'Vita3K:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored Mar 20, 2024
2 parents 8f1c0ba + cb15157 commit 63de4e2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions vita3k/shader/src/usse_translator_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <shader/usse_translator_types.h>
#include <util/log.h>

#include <map>
#include <optional>

namespace shader::usse {
Expand Down Expand Up @@ -1078,13 +1077,13 @@ void convert_gxp_usse_to_spirv(spv::Builder &b, const SceGxmProgram &program, co
const uint64_t *secondary_program_start = program.secondary_program_start();
const uint64_t *secondary_program_end = program.secondary_program_end();

std::map<ShaderPhase, std::pair<const std::uint64_t *, std::uint64_t>> shader_code;
std::array<std::pair<const std::uint64_t *, std::uint64_t>, (size_t)ShaderPhase::Max> shader_code;

// Collect instructions of Pixel (primary) phase
shader_code[ShaderPhase::Pixel] = std::make_pair(primary_program, primary_program_instr_count);
shader_code[static_cast<size_t>(ShaderPhase::Pixel)] = std::make_pair(primary_program, primary_program_instr_count);

// Collect instructions of Sample rate (secondary) phase
shader_code[ShaderPhase::SampleRate] = std::make_pair(secondary_program_start, secondary_program_end - secondary_program_start);
shader_code[static_cast<size_t>(ShaderPhase::SampleRate)] = std::make_pair(secondary_program_start, secondary_program_end - secondary_program_start);

if (begin_hook_func)
b.createFunctionCall(begin_hook_func, {});
Expand All @@ -1094,7 +1093,7 @@ void convert_gxp_usse_to_spirv(spv::Builder &b, const SceGxmProgram &program, co
usse::USSERecompiler recomp(b, program, features, parameters, utils, end_hook_func, queries, render_info_id);

for (uint32_t phase = 0; phase < static_cast<uint32_t>(ShaderPhase::Max); ++phase) {
const auto cur_phase_code = shader_code[(ShaderPhase)phase];
const auto cur_phase_code = shader_code[phase];

if (cur_phase_code.second != 0) {
if (static_cast<ShaderPhase>(phase) == ShaderPhase::SampleRate) {
Expand Down

0 comments on commit 63de4e2

Please sign in to comment.