Esempio n. 1
0
void
debugDumpShader(virt_ptr<const GX2PixelShader> shader)
{
   if (!sDumpShaders.load(std::memory_order_relaxed)) {
      return;
   }

   fmt::memory_buffer out;
   fmt::format_to(out, "GX2PixelShader:\n");
   fmt::format_to(out, "  address: {}\n", shader->data);
   fmt::format_to(out, "  size: {}\n", shader->size);
   fmt::format_to(out, "  mode: {}\n", gx2::to_string(shader->mode));

   formatUniformBlocks(out, shader->uniformBlockCount, shader->uniformBlocks);
   formatUniformVars(out, shader->uniformVarCount, shader->uniformVars);
   formatInitialValues(out, shader->initialValueCount, shader->initialValues);
   formatLoopVars(out, shader->loopVarCount, shader->loopVars);
   formatSamplerVars(out, shader->samplerVarCount, shader->samplerVars);

   debugDumpShader(fmt::format("shader_pixel_{}", shader),
                   std::string_view { out.data(), out.size() },
                   shader);
}
Esempio n. 2
0
void
GX2DebugDumpShader(GX2VertexShader *shader)
{
   if (!config::gx2::dump_shaders) {
      return;
   }

   fmt::MemoryWriter out;
   out << "GX2VertexShader:\n"
      << "  size: " << shader->size << "\n"
      << "  mode: " << GX2EnumAsString(shader->mode) << "\n";

   formatUniformBlocks(out, shader->uniformBlockCount, shader->uniformBlocks);
   formatUniformVars(out, shader->uniformVarCount, shader->uniformVars);
   formatSamplerVars(out, shader->samplerVarCount, shader->samplerVars);

   out << "  initialValueCount: " << shader->initialValueCount << "\n";
   out << "  loopVarCount: " << shader->loopVarCount << "\n";

   GX2DebugDumpShader("shader_vertex_" + GX2PointerAsString(shader),
                      out.str(),
                      shader->data,
                      shader->size);
}