2017-06-19 21:13:26 +00:00
|
|
|
cbuffer buf1 {
|
2016-07-25 22:05:33 +00:00
|
|
|
float4 v1;
|
2017-06-19 21:41:11 +00:00
|
|
|
}; // extraneous ;
|
2016-07-25 22:05:33 +00:00
|
|
|
|
2017-06-19 21:13:26 +00:00
|
|
|
tbuffer buf2 {
|
2016-07-25 22:05:33 +00:00
|
|
|
float4 v2;
|
2017-06-19 21:41:11 +00:00
|
|
|
}; // extraneous ;
|
2016-07-25 22:05:33 +00:00
|
|
|
|
2017-06-19 21:13:26 +00:00
|
|
|
cbuffer cbufName {
|
|
|
|
float4 v3 : packoffset(c0);
|
|
|
|
int i3 : packoffset(c1.y);
|
2017-06-19 21:41:11 +00:00
|
|
|
}
|
2016-07-25 22:05:33 +00:00
|
|
|
|
2017-06-19 21:13:26 +00:00
|
|
|
tbuffer tbufName : register(t8) {
|
2016-07-25 22:05:33 +00:00
|
|
|
float4 v4 : packoffset(c1);
|
2016-07-29 19:03:05 +00:00
|
|
|
int i4 : packoffset(c3);
|
|
|
|
float f1 : packoffset(c3.w);
|
|
|
|
float f3 : packoffset(c4.x);
|
|
|
|
float f4 : packoffset(c4.y);
|
|
|
|
float f5 : packoffset(c4.z);
|
|
|
|
float f6 : packoffset(c);
|
2017-06-19 21:13:26 +00:00
|
|
|
float f7 : packoffset(c8);
|
|
|
|
float3x4 m1 : packoffset(c7);
|
|
|
|
row_major float3x4 m2 : packoffset(c11);
|
|
|
|
column_major float3x4 m3 : packoffset(c15);
|
|
|
|
float3x4 m4 : packoffset(c19);
|
2017-06-19 21:41:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float foo() // float looks like identifier, but can't be part of tbuffer
|
|
|
|
{
|
|
|
|
return 1.0;
|
|
|
|
}
|
2016-07-25 22:05:33 +00:00
|
|
|
|
2018-01-02 18:27:54 +00:00
|
|
|
struct id {
|
|
|
|
float4 a;
|
|
|
|
};
|
|
|
|
|
|
|
|
cbuffer cbufName2 {
|
|
|
|
float4 v24;
|
|
|
|
}
|
|
|
|
|
|
|
|
id PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0 // id looks like id for cbuffer name, but can't be
|
2016-07-25 22:05:33 +00:00
|
|
|
{
|
2018-01-02 18:27:54 +00:00
|
|
|
id ret;
|
|
|
|
ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo();
|
|
|
|
return ret;
|
2016-07-25 22:05:33 +00:00
|
|
|
}
|