Skip to content

Commit d37226e

Browse files
authored
Fix compute_shaders.rst C# code snippets to compile (#7433)
1 parent 47bacc9 commit d37226e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tutorials/shaders/compute_shaders.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ and create a precompiled version of it using this:
185185

186186
// Load GLSL shader
187187
var shaderFile = GD.Load<RDShaderFile>("res://compute_example.glsl");
188-
var shaderBytecode = shaderFile.GetSpirv();
189-
var shader = rd.ShaderCreateFromSpirv(shaderBytecode);
188+
var shaderBytecode = shaderFile.GetSpirV();
189+
var shader = rd.ShaderCreateFromSpirV(shaderBytecode);
190190

191191

192192
Provide input data
@@ -356,11 +356,11 @@ the data and print the results to our console.
356356
.. code-tab:: csharp
357357

358358
// Read back the data from the buffers
359-
var outputBytes = rd.BufferGetData(outputBuffer);
359+
var outputBytes = rd.BufferGetData(buffer);
360360
var output = new float[input.Length];
361361
Buffer.BlockCopy(outputBytes, 0, output, 0, outputBytes.Length);
362-
GD.Print("Input: ", input)
363-
GD.Print("Output: ", output)
362+
GD.Print("Input: ", string.Join(", ", input));
363+
GD.Print("Output: ", string.Join(", ", output));
364364

365365
With that, you have everything you need to get started working with compute
366366
shaders.

0 commit comments

Comments
 (0)