Skip to content

Commit

Permalink
Fix the array layer count
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 27, 2024
1 parent 063910c commit 3cbbc45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions TextureArray/Sources/shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ static const int height = 600;

static bool first_update = true;

static float time(void) {
#ifdef SCREENSHOT
return 0.3f;
#else
return (float)kinc_time();
#endif
}

static void update(void *data) {
kinc_matrix3x3_t matrix = kinc_matrix3x3_rotation_z((float)kinc_time());
kinc_matrix3x3_t matrix = kinc_matrix3x3_rotation_z(time());

constants_type *constants_data = constants_type_buffer_lock(&constants);
constants_data->mvp = matrix;
Expand Down Expand Up @@ -146,7 +154,7 @@ int kickstart(int argc, char **argv) {
assert(image_data != NULL);

kinc_image_t image;
kinc_image_init_from_file(&image, image_data, "parrot.png");
kinc_image_init_from_file(&image, image_data, "parrot2.png");
kinc_image_destroy(&image);

uint32_t stride = kope_g5_device_align_texture_row_bytes(&device, 250 * 4) / 4;
Expand Down Expand Up @@ -229,7 +237,8 @@ int kickstart(int argc, char **argv) {
parameters.tex.texture = &texture;
parameters.tex.base_mip_level = 0;
parameters.tex.mip_level_count = 1;
parameters.tex.array_layer_count = 1;
parameters.tex.base_array_layer = 0;
parameters.tex.array_layer_count = 2;
parameters.sam = &sampler;
kong_create_everything_set(&device, &parameters, &everything);
}
Expand Down
Binary file modified TextureArray/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3cbbc45

Please sign in to comment.