Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Forks
Kayak UI
Commits
9fbb2577
Unverified
Commit
9fbb2577
authored
2 years ago
by
John
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #143 from Commander-lol/fix/ShaderAlignment
Pad shader structs to 16 bytes
parents
161ed4ba
6f489470
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bevy_kayak_renderer/src/render/unified/pipeline.rs
+23
-4
23 additions, 4 deletions
bevy_kayak_renderer/src/render/unified/pipeline.rs
bevy_kayak_renderer/src/render/unified/shader.wgsl
+4
-0
4 additions, 0 deletions
bevy_kayak_renderer/src/render/unified/shader.wgsl
with
27 additions
and
4 deletions
bevy_kayak_renderer/src/render/unified/pipeline.rs
+
23
−
4
View file @
9fbb2577
...
...
@@ -96,7 +96,7 @@ impl FromWorld for UnifiedPipeline {
has_dynamic_offset
:
true
,
// TODO: change this to ViewUniform::std140_size_static once crevice fixes this!
// Context: https://github.com/LPGhatguy/crevice/issues/29
min_binding_size
:
BufferSize
::
new
(
4
),
min_binding_size
:
BufferSize
::
new
(
16
),
},
count
:
None
,
}],
...
...
@@ -337,6 +337,9 @@ struct QuadVertex {
#[derive(Copy,
Clone,
ShaderType)]
struct
QuadType
{
pub
t
:
i32
,
pub
_padding_1
:
i32
,
pub
_padding_2
:
i32
,
pub
_padding_3
:
i32
,
}
pub
struct
QuadMeta
{
...
...
@@ -376,9 +379,25 @@ pub fn prepare_quads(
sprite_meta
.types_buffer
.clear
();
// sprite_meta.types_buffer.reserve(2, &render_device);
let
quad_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
0
});
let
text_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
1
});
let
image_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
2
});
let
quad_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
0
,
_padding_1
:
0
,
_padding_2
:
0
,
_padding_3
:
0
,
});
let
text_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
1
,
_padding_1
:
0
,
_padding_2
:
0
,
_padding_3
:
0
,
});
let
image_type_offset
=
sprite_meta
.types_buffer
.push
(
QuadType
{
t
:
2
,
_padding_1
:
0
,
_padding_2
:
0
,
_padding_3
:
0
,
});
sprite_meta
.types_buffer
.write_buffer
(
&
render_device
,
&
render_queue
);
...
...
This diff is collapsed.
Click to expand it.
bevy_kayak_renderer/src/render/unified/shader.wgsl
+
4
−
0
View file @
9fbb2577
...
...
@@ -7,7 +7,11 @@ var<uniform> view: View;
struct QuadType {
t: i32,
_padding_1: i32,
_padding_2: i32,
_padding_3: i32,
};
@group(2) @binding(0)
var<uniform> quad_type: QuadType;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment