-
Notifications
You must be signed in to change notification settings - Fork 18
Fix DXC warnings in example and test shaders #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ struct Intersector | |
| objectID.id = object_handle_type::INVALID_ID; | ||
|
|
||
| // prodedural shapes | ||
| NBL_UNROLL for (int i = 0; i < scene_type::SphereCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::SphereCount; i++) | ||
| { | ||
|
Comment on lines
+48
to
49
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. beware DXC is a piece of crap only int32_t induction variables unroll, better static cast |
||
| float t = scene.getSphere(i).intersect(ray.origin, ray.direction); | ||
|
|
||
|
|
@@ -58,7 +58,7 @@ struct Intersector | |
| objectID.shapeType = PST_SPHERE; | ||
| } | ||
| } | ||
| NBL_UNROLL for (int i = 0; i < scene_type::TriangleCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::TriangleCount; i++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
| { | ||
| float t = scene.getTriangle(i).intersect(ray.origin, ray.direction); | ||
|
|
||
|
|
@@ -71,7 +71,7 @@ struct Intersector | |
| objectID.shapeType = PST_TRIANGLE; | ||
| } | ||
| } | ||
| NBL_UNROLL for (int i = 0; i < scene_type::RectangleCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::RectangleCount; i++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
| { | ||
| float t = scene.getRectangle(i).intersect(ray.origin, ray.direction); | ||
|
|
||
|
|
@@ -99,23 +99,23 @@ struct Intersector | |
| static scalar_type traceShadowRay(NBL_CONST_REF_ARG(scene_type) scene, NBL_REF_ARG(ray_type) ray, NBL_CONST_REF_ARG(object_handle_type) objectID) | ||
| { | ||
| // prodedural shapes | ||
| NBL_UNROLL for (int i = 0; i < scene_type::SphereCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::SphereCount; i++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and so on |
||
| { | ||
| float t = scene.getSphere(i).intersect(ray.origin, ray.direction); | ||
| bool closerIntersection = t > 0.0 && t < ray.intersectionT; | ||
|
|
||
| if (closerIntersection) | ||
| return 0.0; | ||
| } | ||
| NBL_UNROLL for (int i = 0; i < scene_type::TriangleCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::TriangleCount; i++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and so on |
||
| { | ||
| float t = scene.getTriangle(i).intersect(ray.origin, ray.direction); | ||
| bool closerIntersection = t > 0.0 && t < ray.intersectionT; | ||
|
|
||
| if (closerIntersection) | ||
| return 0.0; | ||
| } | ||
| NBL_UNROLL for (int i = 0; i < scene_type::RectangleCount; i++) | ||
| NBL_UNROLL for (uint32_t i = 0; i < scene_type::RectangleCount; i++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and so on |
||
| { | ||
| float t = scene.getRectangle(i).intersect(ray.origin, ray.direction); | ||
| bool closerIntersection = t > 0.0 && t < ray.intersectionT; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ struct SCascadeAccessor | |
| SCascadeAccessor retval; | ||
| uint32_t imgWidth, imgHeight, layers; | ||
| cascade.GetDimensions(imgWidth, imgHeight, layers); | ||
| retval.cascadeImageDimension = int16_t2(imgWidth, imgHeight); | ||
| retval.cascadeImageDimension = int16_t2(_static_cast<int16_t>(imgWidth), _static_cast<int16_t>(imgHeight)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar question as for the |
||
| return retval; | ||
| } | ||
|
|
||
|
|
@@ -60,7 +60,7 @@ void resolve(uint32_t3 threadID : SV_DispatchThreadID) | |
| SResolveAccessorAdaptorType accessor = { SCascadeAccessor::create() }; | ||
| SResolverType resolve = SResolverType::create(pc.resolveParameters); | ||
|
|
||
| float32_t3 color = resolve(accessor, uint16_t2(coords.x, coords.y)); | ||
| float32_t3 color = resolve(accessor, uint16_t2(_static_cast<uint16_t>(coords.x), _static_cast<uint16_t>(coords.y))); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
|
|
||
| outImage[uint3(coords.x, coords.y, 0)] = float32_t4(color, 1.0f); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_static_cast<float16_t3>(float32_t3(X,Y,Z))didn't work?