Git Product home page Git Product logo

Comments (5)

ggerganov avatar ggerganov commented on July 20, 2024

Can you clarify?

The compression is used here:
https://github.com/ggerganov/imgui-ws/blob/master/src/imgui-ws.cpp#L343-L351

from imgui-ws.

Eragon-Brisingr avatar Eragon-Brisingr commented on July 20, 2024

Can you clarify?

The compression is used here: https://github.com/ggerganov/imgui-ws/blob/master/src/imgui-ws.cpp#L343-L351

But dataRead.drawListsDiff can not find any read reference. And i cancel calculate diff imgui-ws seem render right.

// calculate diff
m_drawListsDiff.clear();
m_drawListsDiff.resize(nCmdLists);
for (uint32_t iList = 0; iList < nCmdLists; ++iList) {
auto & bufferCur = m_drawListsCur[iList];
auto & bufferDiff = m_drawListsDiff[iList];
bufferDiff.clear();
int32_t type = 1; // Run-Length Encoding
if (iList >= m_drawListsPrev.size() || m_drawListsPrev[iList].size() != bufferCur.size()) {
type = 0; // Full update
}
std::copy((char *)(&type), (char *)(&type) + sizeof(type), std::back_inserter(bufferDiff));
if (type == 0) {
std::copy(bufferCur.begin(), bufferCur.end(), std::back_inserter(bufferDiff));
} else if (type == 1) {
auto & bufferPrev = m_drawListsPrev[iList];
uint32_t a = 0;
uint32_t b = 0;
uint32_t c = 0;
uint32_t n = 0;
for (int i = 0; i < (int) bufferCur.size(); i += 4) {
std::memcpy((char *)(&a), bufferPrev.data() + i, sizeof(uint32_t));
std::memcpy((char *)(&b), bufferCur.data() + i, sizeof(uint32_t));
a = a ^ b;
if (a == c) {
++n;
} else {
if (n > 0) {
std::copy((char *)(&n), (char *)(&n) + sizeof(uint32_t), std::back_inserter(bufferDiff));
std::copy((char *)(&c), (char *)(&c) + sizeof(uint32_t), std::back_inserter(bufferDiff));
}
n = 1;
c = a;
}
}
if (bufferCur.size() % 4 != 0) {
a = 0;
b = 0;
uint32_t i = (bufferCur.size()/4)*4;
uint32_t k = bufferCur.size() - i;
std::memcpy((char *)(&a), bufferPrev.data() + i, k);
std::memcpy((char *)(&b), bufferCur.data() + i, k);
a = a ^ b;
if (a == c) {
++n;
} else {
std::copy((char *)(&n), (char *)(&n) + sizeof(uint32_t), std::back_inserter(bufferDiff));
std::copy((char *)(&c), (char *)(&c) + sizeof(uint32_t), std::back_inserter(bufferDiff));
n = 1;
c = a;
}
}
std::copy((char *)(&n), (char *)(&n) + sizeof(uint32_t), std::back_inserter(bufferDiff));
std::copy((char *)(&c), (char *)(&c) + sizeof(uint32_t), std::back_inserter(bufferDiff));
}
}
return true;

from imgui-ws.

Eragon-Brisingr avatar Eragon-Brisingr commented on July 20, 2024

image

when draw many shape, Incppect::update cost too much time.

from imgui-ws.

ggerganov avatar ggerganov commented on July 20, 2024

Probably, the compression is not efficient for your scene.

If it is possible, you can try to record your session and we can analyze the data to see what is the problem. To record a session, check the record-sdl2 tool. Basically, you need to grab the Session class from here and use it to save your frames to a file. The file will be probably big, but if you could send it to me somehow, I can try to improve the compression algorithm to perform better in your case. You can also run the compressor-benchmark tool to get some information about the compression rate and performance for you scene.

from imgui-ws.

Eragon-Brisingr avatar Eragon-Brisingr commented on July 20, 2024

ImGui_WS性能
Maybe is stl debug too slow, I try unreal engine development settings, the performance is can accept.

from imgui-ws.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.