Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hydra Storm extComputation] Input BAR is always reset during Sync, causing re-allocation of GL arrays #1083

Closed
moddyz opened this issue Jan 9, 2020 · 1 comment

Comments

@moddyz
Copy link
Contributor

moddyz commented Jan 9, 2020

Description of Issue

In pxr/imaging/hdSt/extComputation.cpp, during HdStExtComputation::Sync, the input buffer array range is always reset, which will result in re-allocation of the GL array buffers for storing the buffer source data.

If the buffer specs of the inputs is the same as the previous state, then it would be more optimal for the runtime to perform the copy of the buffer source data in place without re-allocation.

Steps to Reproduce

  1. Load the following layer in usdview with the renderer set to Storm:
#usda 1.0
(
    endTimeCode = 2
    startTimeCode = 1
    timeCodesPerSecond = 24
)

def SkelRoot "Root" (
    kind = "component"
)
{
    rel skel:skeleton = </Root/Skeleton>
    def Skeleton "Skeleton"
    {
        rel skel:animationSource = <Animation>
        uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )]
        uniform token[] joints = ["joint1"]
        uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )]
        def SkelAnimation "Animation"
        {
            uniform token[] joints = ["joint1"]
            quatf[] rotations.timeSamples = {
                1: [(0.5, 0.5, 0.5, 0.5)],
                2: [(0.99998206, 0, 0, 0.0059874505)],
            }
            half3[] scales.timeSamples = {
                1: [(1, 1, 1)],
                2: [(1, 1, 1)],
            }
            float3[] translations.timeSamples = {
                1: [(0, -1, 0)],
                2: [(0, -1, 0)],
            }
        }
    }
    def Cube "Cube"
    {
        matrix4d primvars:skel:geomBindTransform = ( (0, 0, 0.1, 0), (0.1, 0, 0, 0), (0, 0.1, 0, 0), (1, 0.5, 0.5, 1) )
        int[] primvars:skel:jointIndices = [0] (
            elementSize = 1
            interpolation = "constant"
        )
        float[] primvars:skel:jointWeights = [0.5] (
            elementSize = 1
            interpolation = "constant"
        )
        uniform token[] skel:joints = ["joint1"]
    }
}
  1. In a different terminal, launch gdb and attach to the usdview process.
  2. Set up the following breakpoints in gdb:
(gdb) break hdSt/extComputation.cpp:132
(gdb) commands
>silent
>printf "Resetting Input BAR for <%s>, %lu input sources: %s, %s, %s, %s\n", GetId().GetText(), inputs.size(), inputs[0]->GetName().GetText(), inputs[1]->GetName().GetText(), inputs[2]->GetName().GetText(), inputs[3]->GetName().GetText()
>continue
>end
(gdb) break interleavedMemoryManager.cpp:441
(gdb) commands
>silent
>printf "Re-allocating GL Buffers, %lu totalSize, %lu resources: %s, %s, %s, %s\n", totalSize, GetResources().size(), GetResources()[ 0 ]->first.GetText(), GetResources()[ 1 ]->first.GetText(), GetResources()[ 2 ]->first.GetText(), GetResources()[ 3 ]->first.GetText()
>continue
>end
(gdb) continue
  1. Scrub the timeline in usdview. Every time the frame changes, the following logging will be output from the gdb process:
Resetting Input BAR for </Root/Cube/skinningComputation>, 4 input sources: primWorldToLocal, blendShapeWeights, skinningXforms, skelLocalToWorld
Re-allocating GL Buffers, 352 totalSize, 4 resources: primWorldToLocal, blendShapeWeights, skinningXforms, skelLocalToWorld

System Information (OS, Hardware)

Ubuntu-18.04

Package Versions

usd-19.11

@jilliene
Copy link

Filed as internal issue #USD-5788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants