Skip to content

Commit 0bf6a66

Browse files
Markdown emphasis corrections (shader-slang#5588)
* Add markdown formatting to extras/formatting.sh * Correct formatting in markdown * Warn on unrecognized argument in formatting script * Print all diffs in formatting script * Correct markdown emph formatting * Don't format markdown by default --------- Co-authored-by: Yong He <yonghe@outlook.com>
1 parent a50de6b commit 0bf6a66

10 files changed

+385
-354
lines changed

CONTRIBUTION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Here are a few highlights
243243
1. Don't use the STL containers, iostreams, or the built-in C++ RTTI system.
244244
1. Don't use the C++ variants of C headers (e.g., use `<stdio.h>` instead of `<cstdio>`).
245245
1. Don't use exceptions for non-fatal errors (and even then support a build flag to opt out of exceptions).
246-
1. Types should use UpperCamelCase, values should use lowerCamelCase, and macros should use SCREAMING_SNAKE_CASE with a prefix `SLANG_`.
246+
1. Types should use UpperCamelCase, values should use lowerCamelCase, and macros should use `SCREAMING_SNAKE_CASE` with a prefix `SLANG_`.
247247
1. Global variables should have a `g` prefix, non-const static class members can have an `s` prefix, constant data (in the sense of static const) should have a `k` prefix, and an `m_` prefix on member variables and a `_` prefix on member functions are allowed.
248248
1. Prefixes based on types (e.g., p for pointers) should never be used.
249249
1. In function parameter lists, an `in`, `out`, or `io` prefix can be added to a parameter name to indicate whether a pointer/reference/buffer is intended to be used for input, output, or both input and output.

docs/64bit-type-support.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Overview
2020

2121
The Slang language supports 64 bit built in types. Such as
2222

23-
* double
24-
* uint64_t
25-
* int64_t
23+
* `double`
24+
* `uint64_t`
25+
* `int64_t`
2626

2727
This also applies to vector and matrix versions of these types.
2828

@@ -125,8 +125,8 @@ D3D12 | FXC/DXBC | No | No | 2
125125

126126
2) uint64_t support requires https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/hlsl-shader-model-6-0-features-for-direct3d-12, so DXBC is not a target.
127127

128-
The intrinsics available on uint64_t type are `abs`, `min`, `max`, `clamp` and `countbits`.
129-
The intrinsics available on uint64_t type are `abs`, `min`, `max` and `clamp`.
128+
The intrinsics available on `uint64_t` type are `abs`, `min`, `max`, `clamp` and `countbits`.
129+
The intrinsics available on `uint64_t` type are `abs`, `min`, `max` and `clamp`.
130130

131131
GLSL
132132
====

docs/cpu-target.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ SLANG_HOST_CPP_SOURCE, ///< C++ code for `host` style
5252

5353
Using the `-target` command line option
5454

55-
* C_SOURCE: c
56-
* CPP_SOURCE: cpp,c++,cxx
57-
* HOST_CPP_SOURCE: host-cpp,host-c++,host-cxx
55+
* `C_SOURCE`: c
56+
* `CPP_SOURCE`: cpp,c++,cxx
57+
* `HOST_CPP_SOURCE`: host-cpp,host-c++,host-cxx
5858

5959
Note! Output of C source is not currently supported.
6060

@@ -70,11 +70,11 @@ SLANG_OBJECT_CODE, ///< Object code that can be used for later link
7070

7171
Using the `-target` command line option
7272

73-
* EXECUTABLE: exe, executable
74-
* SHADER_SHARED_LIBRARY: sharedlib, sharedlibrary, dll
75-
* SHADER_HOST_CALLABLE: callable, host-callable
76-
* OBJECT_CODE: object-conde
77-
* HOST_HOST_CALLABLE: host-host-callable
73+
* `EXECUTABLE`: exe, executable
74+
* `SHADER_SHARED_LIBRARY`: sharedlib, sharedlibrary, dll
75+
* `SHADER_HOST_CALLABLE`: callable, host-callable
76+
* `OBJECT_CODE`: object-conde
77+
* `HOST_HOST_CALLABLE`: host-host-callable
7878

7979
Using `host-callable` types from the the command line, other than to test such code compile and can be loaded for host execution.
8080

docs/cuda-target.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ If this fails - the prelude include of `cuda_fp16.h` will most likely fail on NV
256256

257257
CUDA has the `__half` and `__half2` types defined in `cuda_fp16.h`. The `__half2` can produce results just as quickly as doing the same operation on `__half` - in essence for some operations `__half2` is [SIMD](https://en.wikipedia.org/wiki/SIMD) like. The half implementation in Slang tries to take advantage of this optimization.
258258

259-
Since Slang supports up to 4 wide vectors Slang has to build on CUDAs half support. The types _`_half3` and `__half4` are implemented in `slang-cuda-prelude.h` for this reason. It is worth noting that `__half3` is made up of a `__half2` and a `__half`. As `__half2` is 4 byte aligned, this means `__half3` is actually 8 bytes, rather than 6 bytes that might be expected.
259+
Since Slang supports up to 4 wide vectors Slang has to build on CUDAs half support. The types `__half3` and `__half4` are implemented in `slang-cuda-prelude.h` for this reason. It is worth noting that `__half3` is made up of a `__half2` and a `__half`. As `__half2` is 4 byte aligned, this means `__half3` is actually 8 bytes, rather than 6 bytes that might be expected.
260260

261261
One area where this optimization isn't fully used is in comparisons - as in effect Slang treats all the vector/matrix half comparisons as if they are scalar. This could be perhaps be improved on in the future. Doing so would require using features that are not directly available in the CUDA headers.
262262

@@ -265,7 +265,7 @@ Wave Intrinsics
265265

266266
There is broad support for [HLSL Wave intrinsics](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/hlsl-shader-model-6-0-features-for-direct3d-12), including support for [SM 6.5 intrinsics](https://microsoft.github.io/DirectX-Specs/d3d/HLSL_ShaderModel6_5.html).
267267

268-
Most Wave intrinsics will work with vector, matrix or scalar types of typical built in types - uint, int, float, double, uint64_t, int64_t.
268+
Most Wave intrinsics will work with vector, matrix or scalar types of typical built in types - `uint`, `int`, `float`, `double`, `uint64_t`, `int64_t`.
269269

270270
The support is provided via both the Slang core module as well as the Slang CUDA prelude found in 'prelude/slang-cuda-prelude.h'. Many Wave intrinsics are not directly applicable within CUDA which supplies a more low level mechanisms. The implementation of most Wave functions work most optimally if a 'Wave' where all lanes are used. If all lanes from index 0 to pow2(n) -1 are used (which is also true if all lanes are used) a binary reduction is typically applied. If this is not the case the implementation fallsback on a slow path which is linear in the number of active lanes, and so is typically significantly less performant.
271271

docs/design/experimental.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Adding Experimental Interfaces
3131

3232
When the above recommendations cannot be followed, as with features that are expected to be iterated on or are regarded as temporary, there are additional recommendations.
3333

34-
Interfaces that are expected to change must be marked "_Experimental" in their class name and in their UUID name.
34+
Interfaces that are expected to change must be marked `_Experimental` in their class name and in their UUID name.
3535

3636
For example,
3737

0 commit comments

Comments
 (0)