HLSL: Add support for printf().
Translate printf() to what GL_EXT_debug_printf has done. HLSL could define non-constant string variable and we don't have such features in SPIR-V, so just support constant string variable.
This commit is contained in:
11
Test/hlsl.printf.comp
Normal file
11
Test/hlsl.printf.comp
Normal file
@@ -0,0 +1,11 @@
|
||||
const string first = "first string";
|
||||
|
||||
[numthreads(1,1,1)]
|
||||
void main() {
|
||||
printf(first);
|
||||
printf("please print this message.");
|
||||
printf("Variables are: %d %d %.2f", 1u, 2u, 1.5f);
|
||||
printf("Integers are: %d %d %d", 1, 2, 3);
|
||||
printf("More: %d %d %d %d %d %d %d %d %d %d", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user