Skip to content

VL.Stride.Runtime ReleaseGraphicsResources marked internal #713

Description

@antokhio

Is your feature request related to a problem? Please describe.

Hi I was digging mesh generation, and came to

static CustomNodeDesc<TProceduralModel> NewMeshNode<TProceduralModel, TKey>(this IVLNodeDescriptionFactory factory, Func<TProceduralModel, TKey> getKey, string category = "Stride.Models.Meshes", string name = null, ImmutableArray<string> tags = default)

So I attempted to us similar pattern for my process (note this raw unfinished code):

[ProcessNode]
public abstract class BezierSurfacewModelNode<T> : IDisposable
    where T : struct
{
    // ...
   
    protected virtual void Generate()
    {
        var gameProvider = AppHost.Current.Services.GetGameProvider();

        var surface = Surface;
        var tessellation = Tesselation;

        var key = (gameProvider, typeof(BezierSurfaceModel<T>), surface, tessellation);
        var provider = ResourceProvider.NewPooledSystemWide(
            key,
            _ =>
            {
                return gameProvider.Bind(game =>
                {
                    var model = new StrideModel();
                    var generator = new BezierSurfaceModel<T>(surface, tessellation);

                    generator.Generate(game.Services, model);

                    return ResourceProvider.Return(
                        model.Meshes[0],
                        m => m.ReleaseGraphicsResources() // <-- Getting error...
                    );
                });
            }
        );

        var meshHandle = provider.GetHandle();
        _meshDisposable.Disposable = meshHandle;
        Output = meshHandle.Resource;
    }

    // ...

    public void Dispose()
    {
        _meshDisposable.Dispose();
    }
}

So the issue seems to be two methods marked internal:

internal static void ReleaseGraphicsResources(this Mesh mesh)

internal static void ReleaseGraphicsResources(this StrideModel model)

Describe the solution you'd like
I don't think it unsafe to have those methods public.

Describe alternatives you've considered
Currently gonna copy paste to lib code...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions