{"action":"created","issue":{"url":"https://api.github.com/repos/KhronosGroup/glslang/issues/464","repository_url":"https://api.github.com/repos/KhronosGroup/glslang","labels_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/464/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/464/comments","events_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/464/events","html_url":"https://github.com/KhronosGroup/glslang/issues/464","id":171074895,"number":464,"title":"HLSL: Does this shader have a mismatched return type and function type?","user":{"login":"dankbaker","id":3113043,"avatar_url":"https://avatars.githubusercontent.com/u/3113043?v=3","gravatar_id":"","url":"https://api.github.com/users/dankbaker","html_url":"https://github.com/dankbaker","followers_url":"https://api.github.com/users/dankbaker/followers","following_url":"https://api.github.com/users/dankbaker/following{/other_user}","gists_url":"https://api.github.com/users/dankbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/dankbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankbaker/subscriptions","organizations_url":"https://api.github.com/users/dankbaker/orgs","repos_url":"https://api.github.com/users/dankbaker/repos","events_url":"https://api.github.com/users/dankbaker/events{/privacy}","received_events_url":"https://api.github.com/users/dankbaker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KhronosGroup/glslang/labels/HLSL","name":"HLSL","color":"0e8a16"},{"url":"https://api.github.com/repos/KhronosGroup/glslang/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-14T19:42:18Z","updated_at":"2016-09-03T02:31:44Z","closed_at":"2016-09-03T02:31:43Z","body":"I had to hack it up to change the language from HLSL to unknown, but I see this message on this SPIRV output;\r\n\r\nSC (ERROR): object: 0x0 type: 0 location: 8648 msgCode: 5: SPIR-V module not valid: OpReturnValue Value <id> '26's type does not match OpFunction's return type\r\n\r\nI don't understand the SPIRV syntax well enough. It looks to me like the function is declared to have a return type of VSOut in lines 10 and 11. Though, is input supposed to list before output?\r\n\r\n```\r\n// Module Version 10000\r\n// Generated by (magic number): 80001\r\n// Id's are bound by 43\r\n\r\n                              Capability Shader\r\n                              Capability SampledBuffer\r\n               1:             ExtInstImport  \"GLSL.std.450\"\r\n                              MemoryModel Logical GLSL450\r\n                              EntryPoint Vertex 4  \"PosShader\"\r\n                              Name 4  \"PosShader\"\r\n                              Name 9  \"VSOut\"\r\n                              MemberName 9(VSOut) 0  \"fPos\"\r\n                              MemberName 9(VSOut) 1  \"fTex\"\r\n                              Name 13  \"ColorShader(struct-VSOut-vf4-vf21;\"\r\n                              Name 12  \"Input\"\r\n                              Name 15  \"Out\"\r\n                              Name 32  \"SS_DEFAULT\"\r\n                              Name 33  \"SS_DEFAULT_CLAMP\"\r\n                              Name 34  \"SS_ANISO\"\r\n                              Name 35  \"SS_ANISO_CLAMP\"\r\n                              Name 36  \"SS_POINT\"\r\n                              Name 37  \"SS_POINT_CLAMP\"\r\n                              Name 41  \"V_Position\"\r\n                              Name 42  \"V_TexCoord\"\r\n                              Decorate 32(SS_DEFAULT) DescriptorSet 0\r\n                              Decorate 32(SS_DEFAULT) Binding 0\r\n                              Decorate 33(SS_DEFAULT_CLAMP) DescriptorSet 0\r\n                              Decorate 33(SS_DEFAULT_CLAMP) Binding 1\r\n                              Decorate 34(SS_ANISO) DescriptorSet 0\r\n                              Decorate 34(SS_ANISO) Binding 2\r\n                              Decorate 35(SS_ANISO_CLAMP) DescriptorSet 0\r\n                              Decorate 35(SS_ANISO_CLAMP) Binding 3\r\n                              Decorate 36(SS_POINT) DescriptorSet 0\r\n                              Decorate 36(SS_POINT) Binding 4\r\n                              Decorate 37(SS_POINT_CLAMP) DescriptorSet 0\r\n                              Decorate 37(SS_POINT_CLAMP) Binding 5\r\n                              Decorate 41(V_Position) DescriptorSet 0\r\n                              Decorate 41(V_Position) Binding 0\r\n                              Decorate 42(V_TexCoord) DescriptorSet 0\r\n                              Decorate 42(V_TexCoord) Binding 1\r\n               2:             TypeVoid\r\n               3:             TypeFunction 2\r\n               6:             TypeFloat 32\r\n               7:             TypeVector 6(float) 4\r\n               8:             TypeVector 6(float) 2\r\n        9(VSOut):             TypeStruct 7(fvec4) 8(fvec2)\r\n              10:             TypePointer Function 9(VSOut)\r\n              11:             TypeFunction 7(fvec4) 10(ptr)\r\n              16:             TypeInt 32 1\r\n              17:     16(int) Constant 0\r\n              18:    6(float) Constant 0\r\n              19:    7(fvec4) ConstantComposite 18 18 18 18\r\n              20:             TypePointer Function 7(fvec4)\r\n              22:     16(int) Constant 1\r\n              23:    8(fvec2) ConstantComposite 18 18\r\n              24:             TypePointer Function 8(fvec2)\r\n              30:             TypeSampler\r\n              31:             TypePointer UniformConstant 30\r\n  32(SS_DEFAULT):     31(ptr) Variable UniformConstant\r\n33(SS_DEFAULT_CLAMP):     31(ptr) Variable UniformConstant\r\n    34(SS_ANISO):     31(ptr) Variable UniformConstant\r\n35(SS_ANISO_CLAMP):     31(ptr) Variable UniformConstant\r\n    36(SS_POINT):     31(ptr) Variable UniformConstant\r\n37(SS_POINT_CLAMP):     31(ptr) Variable UniformConstant\r\n              38:             TypeImage 6(float) Buffer sampled format:Unknown\r\n              39:             TypeSampledImage 38\r\n              40:             TypePointer UniformConstant 39\r\n  41(V_Position):     40(ptr) Variable UniformConstant\r\n  42(V_TexCoord):     40(ptr) Variable UniformConstant\r\n    4(PosShader):           2 Function None 3\r\n               5:             Label\r\n         15(Out):     10(ptr) Variable Function\r\n              21:     20(ptr) AccessChain 15(Out) 17\r\n                              Store 21 19\r\n              25:     24(ptr) AccessChain 15(Out) 22\r\n                              Store 25 23\r\n              26:    9(VSOut) Load 15(Out)\r\n                              ReturnValue 26\r\n                              FunctionEnd\r\n13(ColorShader(struct-VSOut-vf4-vf21;):    7(fvec4) Function None 11\r\n       12(Input):     10(ptr) FunctionParameter\r\n              14:             Label\r\n                              ReturnValue 19\r\n                              FunctionEnd\r\n```\r\n\r\nWhich I created with this simple shader\r\n\r\n```\r\n#pragma warning( disable : 3078 )\r\n #pragma warning( disable : 3571 )\r\n #pragma warning( disable : 3550 )\r\n #pragma warning( disable : 4008 )\r\n \r\nsampler SS_DEFAULT       : register(s0);\r\nsampler SS_DEFAULT_CLAMP : register(s1);\r\nsampler SS_ANISO         : register(s2);\r\nsampler SS_ANISO_CLAMP   : register(s3);\r\nsampler SS_POINT         : register(s4);\r\nsampler SS_POINT_CLAMP   : register(s5);\r\n\r\n//ResourceSet VertexData \r\n    Buffer<float3> V_Position : register(t0);\r\n    Buffer<float2> V_TexCoord : register(t1);\r\n//EndTexture Set\r\n#line  12 \"D:/p4/OxideHaswell/Main/Apps/GraphicsTest/TestShaders.oxsl\"\r\n    // -----------------------------------------------------------------------\r\n    struct VSOut\r\n    {\r\n        float4 fPos    : SV_POSITION;\r\n\t\tfloat2 fTex\t   : TEXCOORD;\r\n    };\r\n\r\n\r\n    // -----------------------------------------------------------------------\r\n    VSOut PosShader( uint VertexID : SV_VertexID )\r\n    {\r\n        VSOut Out;\r\n\t\tOut.fPos = 0;\r\n\t\tOut.fTex = 0;\r\n        return Out;\r\n    }\r\n\r\n\r\n    float4 ColorShader( VSOut Input ) : SV_TARGET0\r\n    {\r\n\t\treturn float4(0,0,0,0);\r\n    }\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/KhronosGroup/glslang/issues/comments/244521713","html_url":"https://github.com/KhronosGroup/glslang/issues/464#issuecomment-244521713","issue_url":"https://api.github.com/repos/KhronosGroup/glslang/issues/464","id":244521713,"user":{"login":"johnkslang","id":5607714,"avatar_url":"https://avatars.githubusercontent.com/u/5607714?v=3","gravatar_id":"","url":"https://api.github.com/users/johnkslang","html_url":"https://github.com/johnkslang","followers_url":"https://api.github.com/users/johnkslang/followers","following_url":"https://api.github.com/users/johnkslang/following{/other_user}","gists_url":"https://api.github.com/users/johnkslang/gists{/gist_id}","starred_url":"https://api.github.com/users/johnkslang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnkslang/subscriptions","organizations_url":"https://api.github.com/users/johnkslang/orgs","repos_url":"https://api.github.com/users/johnkslang/repos","events_url":"https://api.github.com/users/johnkslang/events{/privacy}","received_events_url":"https://api.github.com/users/johnkslang/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T02:31:43Z","updated_at":"2016-09-03T02:31:43Z","body":"This was a duplicate of the problem of entry points being declared void, now fixed."}}
{"actor":{"display_login":"johnkslang"}}