Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 87a452434f42
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b19e7132af93
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 21, 2020

  1. Copy the full SHA
    20f956a View commit details
  2. Copy the full SHA
    b19e713 View commit details
Showing with 10 additions and 72 deletions.
  1. +0 −18 glscopeclient/WaveformArea.cpp
  2. +0 −2 glscopeclient/WaveformArea.h
  3. +0 −46 glscopeclient/WaveformArea_rendering.cpp
  4. +10 −6 glscopeclient/shaders/waveform-compute.glsl
18 changes: 0 additions & 18 deletions glscopeclient/WaveformArea.cpp
Original file line number Diff line number Diff line change
@@ -154,13 +154,6 @@ void WaveformArea::OnRemoveOverlay(ProtocolDecoder* decode)

void WaveformArea::CleanupBufferObjects()
{
for(auto a : m_traceVAOs)
delete a;
m_traceVAOs.clear();

for(auto b : m_traceVBOs)
delete b;
m_traceVBOs.clear();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -449,10 +442,6 @@ void WaveformArea::on_realize()

void WaveformArea::on_unrealize()
{
//TODO: this might leak resources, but not doing it this way seems to cause bugs??
m_traceVBOs.clear();
m_traceVAOs.clear();

m_waveformProgram.Destroy();
m_colormapProgram.Destroy();
m_colormapVAO.Destroy();
@@ -496,13 +485,6 @@ void WaveformArea::InitializeWaveformPass()
exit(1);
}

//ProfileBlock pb("VAO/VBO creation");

m_traceVBOs.push_back(new VertexBuffer);
m_traceVBOs[0]->Bind();
m_traceVAOs.push_back(new VertexArray);
m_traceVAOs[0]->Bind();

//Create the shader stuff
ComputeShader wc;
if(!wc.Load("shaders/waveform-compute.glsl"))
2 changes: 0 additions & 2 deletions glscopeclient/WaveformArea.h
Original file line number Diff line number Diff line change
@@ -230,8 +230,6 @@ class WaveformArea : public Gtk::GLArea
bool PrepareGeometry();
void RenderTrace();
void InitializeWaveformPass();
std::vector<VertexBuffer*> m_traceVBOs;
std::vector<VertexArray*> m_traceVAOs;
glm::mat4 m_projection;
size_t m_waveformLength;
std::vector<float> m_traceBuffer;
46 changes: 0 additions & 46 deletions glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -348,52 +348,6 @@ void WaveformArea::RenderTrace()
m_waveformIndexBuffer.BindBase(3);
m_waveformComputeProgram.DispatchCompute(numGroups, 1, 1);
m_waveformComputeProgram.MemoryBarrier();

//m_waveformTexture

/*
if(m_msaaEnabled)
m_waveformFramebuffer.Bind(GL_FRAMEBUFFER);
else
m_waveformFramebufferResolvedm_waveformFramebufferResolved.Bind(GL_FRAMEBUFFER);
//Configure our shader and projection matrix
m_waveformProgram.Bind();
m_waveformProgram.SetUniform(m_projection, "projection");
m_waveformProgram.SetUniform(m_xoff, "xoff");
m_waveformProgram.SetUniform(1.0, "xscale");
if(IsFFT())
m_waveformProgram.SetUniform(0, "yoff");
else
m_waveformProgram.SetUniform(m_height / 2, "yoff");
m_waveformProgram.SetUniform(1, "yscale");
m_waveformProgram.SetUniform(m_parent->GetTraceAlpha(), "alpha");
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
glEnable(GL_SCISSOR_TEST);
glScissor(0, 0, m_plotRight, m_height);
//Actually draw the waveform
m_traceVAOs[0]->Bind();
glDrawArrays(GL_TRIANGLES, 0, 12*m_waveformLength);
glDisable(GL_SCISSOR_TEST);
//Resolve the multisample framebuffer
if(m_msaaEnabled)
{
m_waveformFramebuffer.Bind(GL_READ_FRAMEBUFFER);
m_waveformFramebufferResolved.Bind(GL_DRAW_FRAMEBUFFER);
glBlitFramebuffer(
0, 0, m_plotRight, m_height,
0, 0, m_plotRight, m_height,
GL_COLOR_BUFFER_BIT,
GL_NEAREST);
}
*/
}

void WaveformArea::RenderCairoUnderlays()
16 changes: 10 additions & 6 deletions glscopeclient/shaders/waveform-compute.glsl
Original file line number Diff line number Diff line change
@@ -58,13 +58,14 @@ void main()
for(uint y=0; y<windowHeight; y++)
g_workingBuffer[y] = 0;

//Loop over pixels of interest
//Loop over the waveform, starting at the leftmost point that overlaps this column
uint istart = xind[gl_GlobalInvocationID.x];
vec2 left = vec2(data[istart].x, data[istart].voltage);
vec2 right;
for(uint i=istart; i<(memDepth-1); i++)
{
//Fetch coordinates of the current and upcoming sample
vec2 left = vec2(data[i].x, data[i].voltage);
vec2 right = vec2(data[i+1].x, data[i+1].voltage);
right = vec2(data[i+1].x, data[i+1].voltage);
float dx_inverse = 1.0 / (right.x - left.x);

//To start, assume we're drawing the entire segment
@@ -81,13 +82,16 @@ void main()
int ymin = int(min(starty, endy));
int ymax = int(max(starty, endy));

//If the current point is right of us, stop
if(left.x > x+1)
break;

//If the upcoming point is still left of us, we're not there yet
if(right.x < x)
continue;

//If the current point is right of us, stop
if(left.x > x+1)
break;
//Push current point down the pipeline
left = right;

//Fill in the space between min and max for this segment
for(int y=ymin; y <= ymax; y++)