-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SPV_GOOGLE_user_type support (#247)
- Loading branch information
1 parent
be73aee
commit 42878ed
Showing
9 changed files
with
561 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// dxc -spirv -fspv-reflect -T lib_6_4 -fspv-target-env=vulkan1.2 | ||
struct MaterialData_t | ||
{ | ||
float4 g_vTest; | ||
float2 g_vTest2; // accessed | ||
float3 g_vTest3; | ||
uint g_tTexture1; // accessed | ||
uint g_tTexture2; | ||
bool g_bTest1; // accessed | ||
bool g_bTest2; | ||
}; | ||
|
||
static MaterialData_t _g_MaterialData; | ||
|
||
ByteAddressBuffer g_MaterialData : register ( t4 , space1 ); | ||
|
||
struct Payload_t | ||
{ | ||
float2 vTest; | ||
bool bTest; | ||
uint tTest; | ||
}; | ||
|
||
struct PayloadShadow_t | ||
{ | ||
float m_flVisibility; | ||
}; | ||
|
||
[ shader ( "closesthit" ) ] | ||
void ClosestHit0 ( inout Payload_t payload , in BuiltInTriangleIntersectionAttributes attrs ) | ||
{ | ||
_g_MaterialData = g_MaterialData.Load<MaterialData_t>( InstanceIndex() ); | ||
|
||
payload.vTest = _g_MaterialData.g_vTest2; | ||
payload.bTest = _g_MaterialData.g_bTest1; | ||
payload.tTest = _g_MaterialData.g_tTexture1; | ||
} | ||
|
||
[ shader ( "anyhit" ) ] | ||
void AnyHit1 ( inout PayloadShadow_t payload , in BuiltInTriangleIntersectionAttributes attrs ) | ||
{ | ||
_g_MaterialData = g_MaterialData.Load<MaterialData_t>( InstanceIndex() ); | ||
|
||
{ | ||
payload . m_flVisibility = 0.0 ; | ||
AcceptHitAndEndSearch ( ) ; | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.