CustomRenderTexture crash

I have reported a consistent Editor crash that happens when creating a CustomRenderTexture from script and assigning a material to it. Let me know if you experience the same.

OSX 10.12.6. Unity 2017.1.0f3.

Here is a test script that should cause a crash.

using UnityEngine;

public class ScriptedCustomRenderTextureTest : MonoBehaviour
{
    Material _mat;
    CustomRenderTexture _tex;

    void OnEnable()
    {
        Shader shader = Shader.Find("CustomRenderTextureShader");
        _mat = new Material( shader );

        _tex = new CustomRenderTexture( 512, 512 );
        _tex.name = GetType().Name;
        _tex.Create();
        _tex.material = _mat;
    }
      
    void OnDisable()
    {
        _tex.Release();
        Destroy( _tex );
        Destroy( _mat );
    }
}

And the shader. Put it in a Resources folder.

Shader "CustomRenderTextureShader"
{
    SubShader
    {
        Pass
        {
            Name "TEST"

            CGPROGRAM

            #include "UnityCustomRenderTexture.cginc"
            #pragma target 3.0
            #pragma vertex CustomRenderTextureVertexShader
            #pragma fragment frag
          
            float4 frag( v2f_customrendertexture i ) : COLOR
            {
                return float4( i.globalTexcoord.xy, 0, 1 );
            }

            ENDCG
        }
    }
}

The bug has been confirmed by the QA team.

Oh great. I’m getting this too.

Also, not possible to create a CustomRenderTexture in Editor and add as a child of another asset.

Such a shame that these new features aren’t fully tested before being implemented.

I’ve seen a lot of half done features being rolled by UT. I can’t believe they didn’t catch this bug in time. Test test test!

Please report that problem to Unity as well, otherwise we may have to wait longer for a fix.

Still seeing this in 2017.2.0f3 on both OSX and Windows.

Appears fixed in 2017.2.0.p1 !!

what’s the latest on those crashes?