diff options
Diffstat (limited to 'tests/vkray')
| -rw-r--r-- | tests/vkray/anyhit.slang.glsl | 14 | ||||
| -rw-r--r-- | tests/vkray/callable.slang.glsl | 27 | ||||
| -rw-r--r-- | tests/vkray/raygen.slang.glsl | 20 |
3 files changed, 20 insertions, 41 deletions
diff --git a/tests/vkray/anyhit.slang.glsl b/tests/vkray/anyhit.slang.glsl index 9d3584e1f..8255599b9 100644 --- a/tests/vkray/anyhit.slang.glsl +++ b/tests/vkray/anyhit.slang.glsl @@ -1,4 +1,3 @@ -// anyhit.slang.glsl #version 460 #extension GL_EXT_ray_tracing : require layout(row_major) uniform; @@ -12,8 +11,7 @@ layout(binding = 0) layout(std140) uniform _S1 { int mode_0; -} gParams_0; - +}gParams_0; layout(binding = 1) uniform texture2D gParams_alphaMap_0; @@ -24,24 +22,21 @@ struct SphereHitAttributes_0 { vec3 normal_0; }; + hitAttributeEXT SphereHitAttributes_0 _S2; struct ShadowRay_0 { vec4 hitDistance_0; }; + rayPayloadInEXT ShadowRay_0 _S3; void main() { if(gParams_0.mode_0 != 0) { - float val_0 = textureLod( - sampler2D(gParams_alphaMap_0, gParams_sampler_0), - _S2.normal_0.xy, - (0.0)).x; - - if(val_0 > 0.0) + if((textureLod(sampler2D(gParams_alphaMap_0,gParams_sampler_0), (_S2.normal_0.xy), (0.0)).x) > 0.0) { terminateRayEXT;; } @@ -50,7 +45,6 @@ void main() ignoreIntersectionEXT;; } } - return; } diff --git a/tests/vkray/callable.slang.glsl b/tests/vkray/callable.slang.glsl index dd99cc440..871ffcbb7 100644 --- a/tests/vkray/callable.slang.glsl +++ b/tests/vkray/callable.slang.glsl @@ -1,18 +1,12 @@ #version 460 - -#if USE_NV_RT -#extension GL_NV_ray_tracing : require -#define callableDataInEXT callableDataInNV -#define hitAttributeEXT hitAttributeNV -#define ignoreIntersectionEXT ignoreIntersectionNV -#define rayPayloadInEXT rayPayloadInNV -#define terminateRayEXT terminateRayNV -#else #extension GL_EXT_ray_tracing : require -#endif +layout(row_major) uniform; +layout(row_major) buffer; +layout(binding = 0) +uniform texture2D gAlbedoMap_0; -layout(binding = 0) uniform texture2D gAlbedoMap_0; -layout(binding = 1) uniform sampler gSampler_0; +layout(binding = 1) +uniform sampler gSampler_0; struct MaterialPayload_0 { @@ -24,12 +18,7 @@ callableDataInEXT MaterialPayload_0 _S1; void main() { - vec4 _S2 = textureLod( - sampler2D(gAlbedoMap_0,gSampler_0), - _S1.uv_0, - float(0)); - - _S1.albedo_0 = _S2; - + _S1.albedo_0 = (textureLod(sampler2D(gAlbedoMap_0,gSampler_0), (_S1.uv_0), (0.0))); return; } + diff --git a/tests/vkray/raygen.slang.glsl b/tests/vkray/raygen.slang.glsl index 69dc74c53..80a63d5ad 100644 --- a/tests/vkray/raygen.slang.glsl +++ b/tests/vkray/raygen.slang.glsl @@ -10,6 +10,7 @@ uniform sampler sampler_0; layout(binding = 1) uniform texture2D samplerNormal_0; + struct Light_0 { vec4 position_0; @@ -95,23 +96,18 @@ void main() uvec3 _S6 = ((gl_LaunchIDEXT)); float _S7 = float(_S6.y) + 0.5; uvec3 _S8 = ((gl_LaunchSizeEXT)); - vec2 inUV_0 = vec2(_S5, _S7 / float(_S8.y)); - vec4 _S9 = (texture(sampler2D(samplerPosition_0,sampler_0), (inUV_0))); - vec3 P_0 = _S9.xyz; - vec4 _S10 = (texture(sampler2D(samplerNormal_0,sampler_0), (inUV_0))); - vec3 N_0 = _S10.xyz * 2.0 - 1.0; - + vec3 P_0 = (texture(sampler2D(samplerPosition_0,sampler_0), (inUV_0))).xyz; + vec3 N_0 = (texture(sampler2D(samplerNormal_0,sampler_0), (inUV_0))).xyz * 2.0 - 1.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); + float _S9 = 1.0 / (lightDist_0 * lightDist_0); RayDesc_0 ray_0; ray_0.Origin_0 = P_0; ray_0.TMin_0 = 0.00000099999999747524; ray_0.Direction_0 = lightDelta_0; ray_0.TMax_0 = lightDist_0; - ShadowRay_0 shadowRay_0; shadowRay_0.hitDistance_0 = 0.0; TraceRay_0(as_0, 1U, 255U, 0U, 0U, 2U, ray_0, shadowRay_0); @@ -122,14 +118,14 @@ void main() } else { - atten_0 = _S11; + atten_0 = _S9; } 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); vec3 color_3 = color_2 + reflectionRay_0.color_1; - uvec3 _S12 = ((gl_LaunchIDEXT)); - imageStore((outputImage_0), ivec2((uvec2(ivec2(_S12.xy)))), vec4(color_3, 1.0)); + uvec3 _S10 = ((gl_LaunchIDEXT)); + imageStore((outputImage_0), ivec2((uvec2(ivec2(_S10.xy)))), vec4(color_3, 1.0)); return; } + |
