Search Unity

kinda new need help

Discussion in 'Shaders' started by theedoghoul, Aug 25, 2019.

  1. theedoghoul

    theedoghoul

    Joined:
    Aug 25, 2019
    Posts:
    1
    im getting an error
    Parse error: syntax error, unexpected TVAL_ID, expecting TOK_SETTEXTURE or '}'
    for my shaders
    Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

    Code (CSharp):
    1. Shader "Custom/Invisible" {
    2.     Properties {
    3.     }
    4.     SubShader {
    5.         Tags { "QUEUE" = "Transparent" }
    6.         Pass {
    7.             Tags { "QUEUE" = "Transparent" }
    8.             ColorMask 0 -1
    9.             ZWrite Off
    10.             Fog {
    11.                 Mode Off
    12.             }
    13.             GpuProgramID 11839
    14.             Program "vp" {
    15.                 SubProgram "d3d11 " {
    16.                     "!!vs_4_0
    17.                    //
    18.                    // Generated by Microsoft (R) D3D Shader Disassembler
    19.                    //
    20.                    //
    21.                    // Input signature:
    22.                    //
    23.                    // Name                 Index   Mask Register SysValue  Format   Used
    24.                    // -------------------- ----- ------ -------- -------- ------- ------
    25.                    // POSITION                 0   xyz         0     NONE   float   xyz
    26.                    // COLOR                    0   xyzw        1     NONE   float   xyzw
    27.                    //
    28.                    //
    29.                    // Output signature:
    30.                    //
    31.                    // Name                 Index   Mask Register SysValue  Format   Used
    32.                    // -------------------- ----- ------ -------- -------- ------- ------
    33.                    // COLOR                    0   xyzw        0     NONE   float   xyzw
    34.                    // SV_POSITION              0   xyzw        1      POS   float   xyzw
    35.                    //
    36.                    vs_4_0
    37.                    dcl_constantbuffer CB0[4], immediateIndexed
    38.                    dcl_constantbuffer CB1[21], immediateIndexed
    39.                    dcl_input v0.xyz
    40.                    dcl_input v1.xyzw
    41.                    dcl_output o0.xyzw
    42.                    dcl_output_siv o1.xyzw, position
    43.                    dcl_temps 2
    44.                    mov_sat o0.xyzw, v1.xyzw
    45.                    mul r0.xyzw, v0.yyyy, cb0[1].xyzw
    46.                    mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
    47.                    mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw
    48.                    add r0.xyzw, r0.xyzw, cb0[3].xyzw
    49.                    mul r1.xyzw, r0.yyyy, cb1[18].xyzw
    50.                    mad r1.xyzw, cb1[17].xyzw, r0.xxxx, r1.xyzw
    51.                    mad r1.xyzw, cb1[19].xyzw, r0.zzzz, r1.xyzw
    52.                    mad o1.xyzw, cb1[20].xyzw, r0.wwww, r1.xyzw
    53.                    ret
    54.                    // Approximately 0 instruction slots used"
    55.                 }
    56.                 SubProgram "d3d11 " {
    57.                     Keywords { "UNITY_SINGLE_PASS_STEREO" }
    58.                     "!!vs_4_0
    59.                    //
    60.                    // Generated by Microsoft (R) D3D Shader Disassembler
    61.                    //
    62.                    //
    63.                    // Input signature:
    64.                    //
    65.                    // Name                 Index   Mask Register SysValue  Format   Used
    66.                    // -------------------- ----- ------ -------- -------- ------- ------
    67.                    // POSITION                 0   xyz         0     NONE   float   xyz
    68.                    // COLOR                    0   xyzw        1     NONE   float   xyzw
    69.                    //
    70.                    //
    71.                    // Output signature:
    72.                    //
    73.                    // Name                 Index   Mask Register SysValue  Format   Used
    74.                    // -------------------- ----- ------ -------- -------- ------- ------
    75.                    // COLOR                    0   xyzw        0     NONE   float   xyzw
    76.                    // SV_POSITION              0   xyzw        1      POS   float   xyzw
    77.                    //
    78.                    vs_4_0
    79.                    dcl_constantbuffer CB0[4], immediateIndexed
    80.                    dcl_constantbuffer CB1[32], dynamicIndexed
    81.                    dcl_constantbuffer CB2[1], immediateIndexed
    82.                    dcl_input v0.xyz
    83.                    dcl_input v1.xyzw
    84.                    dcl_output o0.xyzw
    85.                    dcl_output_siv o1.xyzw, position
    86.                    dcl_temps 3
    87.                    mov_sat o0.xyzw, v1.xyzw
    88.                    mul r0.xyzw, v0.yyyy, cb0[1].xyzw
    89.                    mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
    90.                    mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw
    91.                    add r0.xyzw, r0.xyzw, cb0[3].xyzw
    92.                    ishl r1.x, cb2[0].x, l(2)
    93.                    mul r2.xyzw, r0.yyyy, cb1[r1.x + 25].xyzw
    94.                    mad r2.xyzw, cb1[r1.x + 24].xyzw, r0.xxxx, r2.xyzw
    95.                    mad r2.xyzw, cb1[r1.x + 26].xyzw, r0.zzzz, r2.xyzw
    96.                    mad o1.xyzw, cb1[r1.x + 27].xyzw, r0.wwww, r2.xyzw
    97.                    ret
    98.                    // Approximately 0 instruction slots used"
    99.                 }
    100.             }
    101.             Program "fp" {
    102.                 SubProgram "d3d11 " {
    103.                     "!!ps_4_0
    104.                    //
    105.                    // Generated by Microsoft (R) D3D Shader Disassembler
    106.                    //
    107.                    //
    108.                    // Input signature:
    109.                    //
    110.                    // Name                 Index   Mask Register SysValue  Format   Used
    111.                    // -------------------- ----- ------ -------- -------- ------- ------
    112.                    // COLOR                    0   xyzw        0     NONE   float   xyzw
    113.                    // SV_POSITION              0   xyzw        1      POS   float      
    114.                    //
    115.                    //
    116.                    // Output signature:
    117.                    //
    118.                    // Name                 Index   Mask Register SysValue  Format   Used
    119.                    // -------------------- ----- ------ -------- -------- ------- ------
    120.                    // SV_Target                0   xyzw        0   TARGET   float   xyzw
    121.                    //
    122.                    ps_4_0
    123.                    dcl_input_ps linear v0.xyzw
    124.                    dcl_output o0.xyzw
    125.                    mov o0.xyzw, v0.xyzw
    126.                    ret
    127.                    // Approximately 0 instruction slots used"
    128.                 }
    129.                 SubProgram "d3d11 " {
    130.                     Keywords { "UNITY_SINGLE_PASS_STEREO" }
    131.                     "!!ps_4_0
    132.                    //
    133.                    // Generated by Microsoft (R) D3D Shader Disassembler
    134.                    //
    135.                    //
    136.                    // Input signature:
    137.                    //
    138.                    // Name                 Index   Mask Register SysValue  Format   Used
    139.                    // -------------------- ----- ------ -------- -------- ------- ------
    140.                    // COLOR                    0   xyzw        0     NONE   float   xyzw
    141.                    // SV_POSITION              0   xyzw        1      POS   float      
    142.                    //
    143.                    //
    144.                    // Output signature:
    145.                    //
    146.                    // Name                 Index   Mask Register SysValue  Format   Used
    147.                    // -------------------- ----- ------ -------- -------- ------- ------
    148.                    // SV_Target                0   xyzw        0   TARGET   float   xyzw
    149.                    //
    150.                    ps_4_0
    151.                    dcl_input_ps linear v0.xyzw
    152.                    dcl_output o0.xyzw
    153.                    mov o0.xyzw, v0.xyzw
    154.                    ret
    155.                    // Approximately 0 instruction slots used"
    156.                 }
    157.             }
    158.         }
    159.     }
    160. }
    please help and thank you.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    That's a precomputed shader. Unity no longer supports using precomputed shaders as shader assets, and has not for several years.

    At the same time I’m not really sure what the purpose of this shader is. It is literally invisible and will write nothing. Ignoring what’s in the vertex and fragment shaders, which appears to do the basic transform of the vertex positions into clip space and output the vertex color, it’s using ColorMask 0 and ZWrite Off.

    ColorMask 0 means it won’t output to any color channels, only to the depth & stencil. ZWrite Off means it won’t write to the depth buffer. And the shader has no Stencil settings so it won’t write to the stencil buffer either.

    So, basically it’s a shader that wastes GPU cycles to do absolutely nothing.
     
    KiddUniverse likes this.