diff options
| author | Yong He <yonghe@outlook.com> | 2023-05-02 20:29:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-02 20:29:38 -0700 |
| commit | d52376a65f37fcbbb67428b917fd3819436b6dfb (patch) | |
| tree | da25b3c9a00bd003b1970b4a6c4eb38eccf62aa1 /tests/vkray | |
| parent | 55291b0bf6d729fcbaf75a01926da7da8975b8e9 (diff) | |
Various dxc/fxc compatibility fixes. (#2863)
* Various dxc/fxc compatibility fixes.
* Cleanup.
* Fix test cases.
* Fix comments.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/vkray')
| -rw-r--r-- | tests/vkray/anyhit.slang.glsl | 4 | ||||
| -rw-r--r-- | tests/vkray/callable-caller.slang.glsl | 4 | ||||
| -rw-r--r-- | tests/vkray/closesthit.slang.glsl | 4 | ||||
| -rw-r--r-- | tests/vkray/entry-point-params.slang.glsl | 4 | ||||
| -rw-r--r-- | tests/vkray/intersection.slang.glsl | 4 | ||||
| -rw-r--r-- | tests/vkray/raygen.slang.glsl | 9 |
6 files changed, 16 insertions, 13 deletions
diff --git a/tests/vkray/anyhit.slang.glsl b/tests/vkray/anyhit.slang.glsl index 345dd6624..9d3584e1f 100644 --- a/tests/vkray/anyhit.slang.glsl +++ b/tests/vkray/anyhit.slang.glsl @@ -11,7 +11,7 @@ struct Params_0 layout(binding = 0) layout(std140) uniform _S1 { - Params_0 _data; + int mode_0; } gParams_0; layout(binding = 1) @@ -34,7 +34,7 @@ rayPayloadInEXT ShadowRay_0 _S3; void main() { - if(gParams_0._data.mode_0 != 0) + if(gParams_0.mode_0 != 0) { float val_0 = textureLod( sampler2D(gParams_alphaMap_0, gParams_sampler_0), diff --git a/tests/vkray/callable-caller.slang.glsl b/tests/vkray/callable-caller.slang.glsl index 885c78dfa..a42e6eaf3 100644 --- a/tests/vkray/callable-caller.slang.glsl +++ b/tests/vkray/callable-caller.slang.glsl @@ -20,7 +20,7 @@ struct SLANG_ParameterGroup_C_0 layout(binding = 0) layout(std140) uniform _S1 { - SLANG_ParameterGroup_C_0 _data; + uint shaderIndex_0; } C_0; void CallShader_0(uint shaderIndex_1, inout MaterialPayload_0 payload_0) { @@ -42,7 +42,7 @@ void main() vec2 _S3 = vec2(_S2.xy); uvec3 _S4 = ((gl_LaunchSizeNV)); payload_1.uv_0 = _S3 / vec2(_S4.xy); - CallShader_0(C_0._data.shaderIndex_0, payload_1); + CallShader_0(C_0.shaderIndex_0, payload_1); uvec3 _S5 = ((gl_LaunchIDNV)); imageStore((gImage_0), ivec2((_S5.xy)), payload_1.albedo_0); return; diff --git a/tests/vkray/closesthit.slang.glsl b/tests/vkray/closesthit.slang.glsl index b5daef909..6094b3a3d 100644 --- a/tests/vkray/closesthit.slang.glsl +++ b/tests/vkray/closesthit.slang.glsl @@ -23,7 +23,7 @@ struct SLANG_ParameterGroup_ShaderRecord_0 layout(shaderRecordNV) buffer tmp_shaderrecord { - SLANG_ParameterGroup_ShaderRecord_0 _data; + uint shaderRecordID_0; } ShaderRecord_0; layout(std430, binding = 0) readonly buffer tmp_colors @@ -59,7 +59,7 @@ void main() uint tmp_add_1 = tmp_add_0 + tmp_primid; uint tmp_hitkind = gl_HitKindNV; - vec4 color_1 = colors_0._data[tmp_add_1 + tmp_hitkind + ShaderRecord_0._data.shaderRecordID_0]; + vec4 color_1 = colors_0._data[tmp_add_1 + tmp_hitkind + ShaderRecord_0.shaderRecordID_0]; float tmp_hitt = gl_RayTmaxNV; float tmp_tmin = gl_RayTminNV; diff --git a/tests/vkray/entry-point-params.slang.glsl b/tests/vkray/entry-point-params.slang.glsl index f4531ea84..00d2ba630 100644 --- a/tests/vkray/entry-point-params.slang.glsl +++ b/tests/vkray/entry-point-params.slang.glsl @@ -27,12 +27,12 @@ struct EntryPointParams_0 layout(shaderRecordEXT) buffer _S2 { - EntryPointParams_0 _data; + float value_0; } _S3; void main() { uvec3 _S4 = gl_LaunchIDEXT; - buffer_0._data[_S4.x] = _S3._data.value_0; + buffer_0._data[_S4.x] = _S3.value_0; return; } diff --git a/tests/vkray/intersection.slang.glsl b/tests/vkray/intersection.slang.glsl index ac95432dd..1a08401af 100644 --- a/tests/vkray/intersection.slang.glsl +++ b/tests/vkray/intersection.slang.glsl @@ -17,7 +17,7 @@ struct SLANG_ParameterGroup_U_0 layout(binding = 0) layout(std140) uniform _S1 { - SLANG_ParameterGroup_U_0 _data; + Sphere_0 gSphere_0; } U_0; struct RayDesc_0 { @@ -62,7 +62,7 @@ void main() ray_1.TMax_0 = _S6; float tHit_2; SphereHitAttributes_0 attrs_1; - bool _S7 = rayIntersectsSphere_0(ray_1, U_0._data.gSphere_0, tHit_2, attrs_1); + bool _S7 = rayIntersectsSphere_0(ray_1, U_0.gSphere_0, tHit_2, attrs_1); if(_S7) { bool _S8 = ReportHit_0(tHit_2, uint(0), attrs_1); diff --git a/tests/vkray/raygen.slang.glsl b/tests/vkray/raygen.slang.glsl index 8bc9356a2..28bd5956b 100644 --- a/tests/vkray/raygen.slang.glsl +++ b/tests/vkray/raygen.slang.glsl @@ -45,7 +45,10 @@ struct Uniforms_0 layout(binding = 3) layout(std140) uniform _S1 { - Uniforms_0 _data; + Light_0 light_0; + vec4 viewPos_0; + mat4x4 view_0; + mat4x4 model_0; } ubo_0; struct RayDesc_0 { @@ -99,7 +102,7 @@ void main() vec4 _S10 = (texture(sampler2D(samplerNormal_0,sampler_0), (inUV_0))); vec3 N_0 = _S10.xyz * 2.0 - 1.0; - vec3 lightDelta_0 = ubo_0._data.light_0.position_0.xyz - P_0; + vec3 lightDelta_0 = ubo_0.light_0.position_0.xyz - P_0; float lightDist_0 = length(lightDelta_0); vec3 L_0 = normalize(lightDelta_0); float _S11 = 1.0 / (lightDist_0 * lightDist_0); @@ -121,7 +124,7 @@ void main() { atten_0 = _S11; } - vec3 color_2 = ubo_0._data.light_0.color_0.xyz * saturate_0(dot(N_0, L_0)) * atten_0; + vec3 color_2 = ubo_0.light_0.color_0.xyz * saturate_0(dot(N_0, L_0)) * atten_0; ReflectionRay_0 reflectionRay_0; TraceRay_1(as_0, 1U, 255U, 0U, 0U, 2U, ray_0, reflectionRay_0); |
