-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
4cea48a
commit fea7124
Showing
11 changed files
with
178 additions
and
238 deletions.
There are no files selected for viewing
Submodule Kinc
updated
8 files
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
#include "Compute.h" | ||
|
||
#include <string.h> | ||
|
||
using namespace Kore; | ||
|
||
Graphics4::ComputeShader::ComputeShader(void *source, int length) { | ||
kinc_g4_compute_shader_init(&kincImpl, source, length); | ||
} | ||
|
||
Graphics4::ComputeShader::~ComputeShader() { | ||
kinc_g4_compute_shader_destroy(&kincImpl); | ||
} | ||
|
||
Graphics4::ConstantLocation Graphics4::ComputeShader::getConstantLocation(const char *name) { | ||
Graphics4::ConstantLocation location; | ||
location.kincConstant = kinc_g4_compute_shader_get_constant_location(&kincImpl, name); | ||
return location; | ||
} | ||
|
||
Graphics4::TextureUnit Graphics4::ComputeShader::getTextureUnit(const char *name) { | ||
Graphics4::TextureUnit unit; | ||
unit.kincUnit = kinc_g4_compute_shader_get_texture_unit(&kincImpl, name); | ||
return unit; | ||
} | ||
|
||
#ifdef KORE_OPENGL | ||
Graphics4::ShaderStorageBuffer::ShaderStorageBuffer(int count, Graphics4::VertexData type) { | ||
kinc_shader_storage_buffer_init(&kincImpl, count, (kinc_g4_vertex_data_t)type); | ||
} | ||
|
||
Graphics4::ShaderStorageBuffer::~ShaderStorageBuffer() { | ||
kinc_shader_storage_buffer_destroy(&kincImpl); | ||
} | ||
|
||
int *Graphics4::ShaderStorageBuffer::lock() { | ||
return kinc_shader_storage_buffer_lock(&kincImpl); | ||
} | ||
|
||
void Graphics4::ShaderStorageBuffer::unlock() { | ||
kinc_shader_storage_buffer_unlock(&kincImpl); | ||
} | ||
|
||
int Graphics4::ShaderStorageBuffer::count() { | ||
return kinc_shader_storage_buffer_count(&kincImpl); | ||
} | ||
|
||
void Graphics4::ShaderStorageBuffer::_set() { | ||
kinc_shader_storage_buffer_internal_set(&kincImpl); | ||
} | ||
#endif |
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,38 @@ | ||
#pragma once | ||
|
||
#include <kinc/graphics4/compute.h> | ||
|
||
#ifdef KORE_OPENGL | ||
#include <kinc/backend/graphics4/ShaderStorageBufferImpl.h> | ||
#endif | ||
#include <Kore/Graphics4/Graphics.h> | ||
#include <Kore/Math/Matrix.h> | ||
|
||
namespace Kore { | ||
namespace Graphics4 { | ||
class Texture; | ||
class RenderTarget; | ||
|
||
class ComputeShader { | ||
public: | ||
ComputeShader(void *source, int length); | ||
~ComputeShader(); | ||
ConstantLocation getConstantLocation(const char *name); | ||
TextureUnit getTextureUnit(const char *name); | ||
kinc_g4_compute_shader kincImpl; | ||
}; | ||
|
||
#ifdef KORE_OPENGL | ||
class ShaderStorageBuffer { | ||
public: | ||
ShaderStorageBuffer(int count, Graphics4::VertexData type); | ||
virtual ~ShaderStorageBuffer(); | ||
int *lock(); | ||
void unlock(); | ||
int count(); | ||
void _set(); | ||
kinc_shader_storage_buffer_t kincImpl; | ||
}; | ||
#endif | ||
} | ||
} |
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
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
Oops, something went wrong.