-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use cmdDrawIndexedIndirect instead of normal draw
- Loading branch information
Showing
4 changed files
with
209 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec2 fragTexCoord; | ||
layout(location = 0) in vec3 fragTexCoord; | ||
|
||
layout(location = 0) out vec4 outColor; | ||
|
||
layout(binding = 1) uniform sampler2D texSampler; | ||
// TODO: array of normal samplers instead using indexed descriptor sets | ||
layout(binding = 0) uniform sampler2D texSampler; | ||
|
||
void main() { | ||
outColor = texture(texSampler, fragTexCoord); | ||
outColor = texture(texSampler, fragTexCoord.xy); | ||
} |
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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#version 450 | ||
|
||
layout(binding = 0) uniform UniformBufferObject { | ||
mat4 transform; | ||
} ubo; | ||
|
||
//push constants block | ||
// Push constants block | ||
layout(push_constant) uniform push_constants | ||
{ | ||
mat4 projection_view; | ||
} camera; | ||
|
||
// Vertex attributes | ||
layout(location = 0) in vec3 inPosition; | ||
layout(location = 1) in vec2 inTexCoord; | ||
|
||
layout(location = 0) out vec2 fragTexCoord; | ||
// Instanced attributes | ||
layout(location = 2) in int instanceTexIndex; | ||
layout(location = 3) in mat4 instanceTransform; | ||
|
||
layout(location = 0) out vec3 fragTexCoord; | ||
|
||
void main() { | ||
gl_Position = camera.projection_view * ubo.transform * vec4(inPosition, 1.0); | ||
fragTexCoord = inTexCoord; | ||
gl_Position = camera.projection_view * instanceTransform * vec4(inPosition, 1.0); | ||
fragTexCoord = vec3(inTexCoord, instanceTexIndex); | ||
} |
Oops, something went wrong.