• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cbuffer buf1 {
2    float4 v1;
3}; // extraneous ;
4
5tbuffer buf2 {
6    float4 v2;
7}; // extraneous ;
8
9cbuffer cbufName {
10    float4 v3 : packoffset(c0);
11    int i3    : packoffset(c1.y);
12}
13
14tbuffer tbufName : register(t8) {
15    float4 v4 : packoffset(c1);
16    int i4    : packoffset(c3);
17    float f1  : packoffset(c3.w);
18    float f3  : packoffset(c4.x);
19    float f4  : packoffset(c4.y);
20    float f5  : packoffset(c4.z);
21    float f6  : packoffset(c);
22    float f7  : packoffset(c8);
23                 float3x4 m1 : packoffset(c7);
24       row_major float3x4 m2 : packoffset(c11);
25    column_major float3x4 m3 : packoffset(c15);
26                 float3x4 m4 : packoffset(c19);
27}
28
29float foo() // float looks like identifier, but can't be part of tbuffer
30{
31    return 1.0;
32}
33
34struct id {
35    float4 a;
36};
37
38cbuffer cbufName2 {
39    float4 v24;
40}
41
42id PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0  // id looks like id for cbuffer name, but can't be
43{
44    id ret;
45    ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo();
46    return ret;
47}
48