Files
Larry Gritz 04d331e439 Transitioning repository to ASWF (#1329)
* Rename CLA files so they no longer say "draft."

* Change CONTRIBUTING.mv to correctly describe the new CLA process,
  remove language related to the old SPI CLAs. Also some touchups to
  README.md.

* Update the project_intake.md to check of various things that we've
  completed.

* Change all references to the old imageworks GitHub URLs to the new
  ASWF ones. (This touches comments at the start of basically every file.)

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-01-25 09:44:09 -08:00

26 lines
682 B
Plaintext

// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
shader test ()
{
int array[5] = { 0, 1, 2, 3, 4 };
printf ("constant index:\n");
printf (" reading:\n");
printf (" array[1] = %d\n", array[1]);
printf (" array[10] = %d\n", array[10]);
printf (" writing:\n");
array[10] = 42;
printf ("variable index:\n");
printf (" reading:\n");
for (int i = 0; i < 6; ++i) {
printf (" array[%d] = %d\n", i, array[i]);
}
printf (" writing:\n");
for (int i = 0; i < 6; ++i) {
array[i] = 84;
}
}