-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ios build iOS: add Info.plist generator [core/module] fix static linked module impl [core] impl query cpu usage [rhi/mtl] add display link to metal view [core/string] add hash function for String [ios] add notification to loop the renderer [rhi/mtl] correct ios pixel format on metal layer remove interfaces update ios plist_gen [rhi/mtl] update metal rhi [render] add font renderer #38 [vk] upload texture directly with linear tiling option [android] fix build error caused by freetype [and] fix android compilation [vk] load device procs at runtime [vk] fix memory leaks [render] add font shaders [vk] refactor [vk] fix bugs [vk] refactor finished fix include path in core headers [rhi/mtl] make format of render target consistent with fragment shader output [rhi/mtl] disable arc [rhi] replace `VertexInputLayout` with `VertexInputState` unify shader binding across vk and mtl [tools] add visualstudio visualizer [unittest]add hlsl shader for triangle unit test [rhi] add hlsl shader test case [vk/hlsl] fix hlsl textured cube sample [vk/hlsl] merge image & sampler combination [rhi/unittest] add compute particles unit test [core/unittest] update core unit test [vk] update vk function entry initializer [ktl/sp] fix dual-free error of ref count instance #42 [vk] refactored vulkan resource [interface] update RHI [win] add vs2017 support [ktl] add sharedptr ref count tracker #43 fix clang build error caused by 'typedef uint64 VkObject..'
- Loading branch information
Showing
232 changed files
with
6,926 additions
and
4,105 deletions.
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
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,8 @@ | ||
#version 430 | ||
layout (location = 0) in vec2 inCoord; | ||
layout (location = 0) out vec4 outFragColor; | ||
uniform sampler2D fontTex; | ||
void main() | ||
{ | ||
outFragColor = texture(fontTex, inCoord); | ||
} |
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,13 @@ | ||
#version 430 | ||
layout (location = 0) in vec3 inPos; | ||
layout (location = 1) in vec2 inCoord; | ||
layout (location = 0) out vec2 outCoord; | ||
out gl_PerVertex | ||
{ | ||
vec4 gl_Position; | ||
}; | ||
void main() | ||
{ | ||
outCoord = inCoord; | ||
gl_Position = vec4(inPos, 1.0); | ||
} |
Binary file not shown.
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
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,95 @@ | ||
#define USE_GLSL 0 | ||
|
||
#if USE_GLSL | ||
|
||
#version 430 | ||
|
||
layout (std140, binding = 0) uniform attractor_block | ||
{ | ||
vec4 attractor[64]; // xyz = position, w = mass | ||
}; | ||
|
||
layout (local_size_x = 1024) in; | ||
|
||
layout (rgba32f, binding = 0) uniform imageBuffer velocity_buffer; | ||
layout (rgba32f, binding = 1) uniform imageBuffer position_buffer; | ||
|
||
uniform float dt = 1.0; | ||
|
||
void main(void) | ||
{ | ||
vec4 vel = imageLoad(velocity_buffer, int(gl_GlobalInvocationID.x)); | ||
vec4 pos = imageLoad(position_buffer, int(gl_GlobalInvocationID.x)); | ||
|
||
int i; | ||
|
||
pos.xyz += vel.xyz * dt; | ||
pos.w -= 0.0001 * dt; | ||
|
||
for (i = 0; i < 4; i++) | ||
{ | ||
vec3 dist = (attractor[i].xyz - pos.xyz); | ||
vel.xyz += dt * dt * attractor[i].w * normalize(dist) / (dot(dist, dist) + 10.0); | ||
} | ||
|
||
if (pos.w <= 0.0) | ||
{ | ||
pos.xyz = -pos.xyz * 0.01; | ||
vel.xyz *= 0.01; | ||
pos.w += 1.0f; | ||
} | ||
|
||
imageStore(position_buffer, int(gl_GlobalInvocationID.x), pos); | ||
imageStore(velocity_buffer, int(gl_GlobalInvocationID.x), vel); | ||
} | ||
|
||
#else | ||
|
||
#define blocksize 64 | ||
|
||
groupshared float4 attractor[blocksize]; | ||
|
||
cbuffer cbCS : register(b0) | ||
{ | ||
float dt; | ||
}; | ||
|
||
//RWStructuredBuffer<float4> velocity_buffer : register(u0); // UAV | ||
//RWStructuredBuffer<float4> position_buffer : register(u1); // UAV | ||
|
||
RWTexture1D <float4> velocity_buffer : register(t0); | ||
RWTexture1D <float4> position_buffer : register(t1); | ||
|
||
[numthreads(1024, 1, 1)] | ||
void main( | ||
uint3 Gid : SV_GroupID, | ||
uint3 DTid : SV_DispatchThreadID, | ||
uint3 GTid : SV_GroupThreadID, | ||
uint GI : SV_GroupIndex) | ||
{ | ||
float4 vel = velocity_buffer.Load(DTid.x); | ||
float4 pos = position_buffer.Load(DTid.x); | ||
|
||
int i; | ||
|
||
pos.xyz += vel.xyz * dt; | ||
pos.w -= 0.0001 * dt; | ||
|
||
for (i = 0; i < 4; i++) | ||
{ | ||
float3 dist = (attractor[i].xyz - pos.xyz); | ||
vel.xyz += dt * dt * attractor[i].w * normalize(dist) / (dot(dist, dist) + 10.0); | ||
} | ||
|
||
if (pos.w <= 0.0) | ||
{ | ||
pos.xyz = -pos.xyz * 0.01; | ||
vel.xyz *= 0.01; | ||
pos.w += 1.0f; | ||
} | ||
|
||
position_buffer[DTid.x] = pos; | ||
velocity_buffer[DTid.x] = vel; | ||
} | ||
|
||
#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,25 @@ | ||
#define USE_GLSL 0 | ||
|
||
#if USE_GLSL | ||
|
||
#version 430 | ||
layout (location = 0) out vec4 color; | ||
in float intensity; | ||
void main(void) | ||
{ | ||
color = mix(vec4(0.0f, 0.2f, 1.0f, 1.0f), vec4(0.2f, 0.05f, 0.0f, 1.0f), intensity); | ||
} | ||
|
||
#else | ||
|
||
struct PS_IN | ||
{ | ||
float intensity : INTENSITY; | ||
}; | ||
|
||
float4 main(PS_IN ps_in) : SV_Target | ||
{ | ||
return lerp(float4(0.0f, 0.2f, 1.0f, 1.0f), float4(0.2f, 0.05f, 0.0f, 1.0f), ps_in.intensity); | ||
} | ||
|
||
#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,41 @@ | ||
#define USE_GLSL 0 | ||
|
||
#if USE_GLSL | ||
|
||
#version 430 | ||
in vec4 vert; | ||
uniform mat4 mvp; | ||
out float intensity; | ||
void main(void) | ||
{ | ||
intensity = vert.w; | ||
gl_Position = mvp * vec4(vert.xyz, 1.0); | ||
} | ||
|
||
#else | ||
|
||
struct VS_IN | ||
{ | ||
float4 vert : POSITION; | ||
}; | ||
|
||
cbuffer mat : register(b0) | ||
{ | ||
row_major matrix mvp; | ||
}; | ||
|
||
struct VS_OUT | ||
{ | ||
float4 outPos : SV_POSITION; | ||
float intensity : INTENSITY; | ||
}; | ||
|
||
VS_OUT main(VS_IN vs_in) | ||
{ | ||
VS_OUT vs_out; | ||
vs_out.outPos = mvp * float4(vs_in.vert.xyz, 1.0); | ||
vs_out.intensity = vs_in.vert.w; | ||
return vs_out; | ||
} | ||
|
||
#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
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,2 @@ | ||
|
||
The "stdint.h" header is copied from llvm-3.5 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.