-
Notifications
You must be signed in to change notification settings - Fork 286
cuda: Add more formats for texture read/write #7012
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?
Conversation
11b2304
to
6da273d
Compare
/format |
🌈 Formatted, please merge the changes from this PR |
Format code for PR shader-slang#7012
9f3a413
to
cec4975
Compare
/format |
🌈 Formatted, please merge the changes from this PR |
Format code for PR shader-slang#7012
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.
LGTM
@@ -14,6 +14,10 @@ RWTexture1D<float> rwt1D; | |||
RWTexture2D<float> rwt2D; | |||
//TEST_INPUT: RWTexture3D(format=R32Float, size=4, content = one, mipMaps = 1):name rwt3D | |||
RWTexture3D<float> rwt3D; | |||
//TEST_INPUT: RWTexture2D(format=RG32Float, size=4, content = one, mipMaps = 1):name rwt2D_float2 | |||
RWTexture2D<float2> rwt2D_float2; |
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.
you could add float2/float4 versions for 1D and 3D as well to improve coverage even further
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.
@skallweitNV - good suggestion. Added.
0922312
to
855ad87
Compare
prelude/slang-cuda-prelude.h
Outdated
SLANG_FORCE_INLINE SLANG_CUDA_CALL float2 tex2Dfetch_int(CUtexObject texObj, int x, int y) | ||
{ | ||
float result_x, result_y; | ||
float dummy; |
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.
Coding style: we should avoid using offensive terms like dummy here. Consider “placeholder”, “stub”, etc.
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.
Fixed.
} | ||
} | ||
|
||
// CHECK:0 |
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.
Generally avoid results that are 0, because various failures can also result a value being 0.
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.
Fixed.
This PR Fixes #7002 and #7025. Details are as shown below
#7025
#7002
2. Extend subscript operator support to include vectors.