-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06a3cab
commit 38bc2f2
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Backends/Graphics5/G5onG4/Sources/kinc/backend/graphics5/compute.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <kinc/graphics5/compute.h> | ||
#include <kinc/math/core.h> | ||
|
||
#include <assert.h> | ||
|
||
void kinc_g5_compute_shader_init(kinc_g5_compute_shader *shader, void *source, int length) { | ||
kinc_g4_compute_shader_init(&shader->impl.g4, source, length); | ||
} | ||
|
||
void kinc_g5_compute_shader_destroy(kinc_g5_compute_shader *shader) { | ||
kinc_g4_compute_shader_destroy(&shader->impl.g4); | ||
} | ||
|
||
kinc_g5_constant_location_t kinc_g5_compute_shader_get_constant_location(kinc_g5_compute_shader *shader, const char *name) { | ||
kinc_g5_constant_location_t location = {0}; | ||
location.impl.location = kinc_g4_compute_shader_get_constant_location(&shader->impl.g4, name); | ||
return location; | ||
} | ||
|
||
kinc_g5_texture_unit_t kinc_g5_compute_shader_get_texture_unit(kinc_g5_compute_shader *shader, const char *name) { | ||
kinc_g5_texture_unit_t g5_unit = {0}; | ||
kinc_g4_texture_unit_t g4_unit = kinc_g4_compute_shader_get_texture_unit(&shader->impl.g4, name); | ||
assert(KINC_G4_SHADER_TYPE_COUNT == KINC_G5_SHADER_TYPE_COUNT); | ||
for (int i = 0; i < KINC_G4_SHADER_TYPE_COUNT; ++i) { | ||
g5_unit.stages[i] = g4_unit.stages[i]; | ||
} | ||
return g5_unit; | ||
} |
7 changes: 7 additions & 0 deletions
7
Backends/Graphics5/G5onG4/Sources/kinc/backend/graphics5/compute.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include <kinc/graphics4/compute.h> | ||
|
||
typedef struct kinc_g5_compute_shader_impl { | ||
kinc_g4_compute_shader g4; | ||
} kinc_g5_compute_shader_impl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters