File tree Expand file tree Collapse file tree 6 files changed +15
-9
lines changed
bevy_render/src/render_resource Expand file tree Collapse file tree 6 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -212,8 +212,8 @@ impl SpecializedRenderPipeline for FxaaPipeline {
212
212
fragment : Some ( FragmentState {
213
213
shader : FXAA_SHADER_HANDLE . typed ( ) ,
214
214
shader_defs : vec ! [
215
- format!( "EDGE_THRESH_{}" , key. edge_threshold. get_str( ) ) ,
216
- format!( "EDGE_THRESH_MIN_{}" , key. edge_threshold_min. get_str( ) ) ,
215
+ format!( "EDGE_THRESH_{}" , key. edge_threshold. get_str( ) ) . into ( ) ,
216
+ format!( "EDGE_THRESH_MIN_{}" , key. edge_threshold_min. get_str( ) ) . into ( ) ,
217
217
] ,
218
218
entry_point : "fragment" . into ( ) ,
219
219
targets : vec ! [ Some ( ColorTargetState {
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ impl SpecializedRenderPipeline for TonemappingPipeline {
66
66
fn specialize ( & self , key : Self :: Key ) -> RenderPipelineDescriptor {
67
67
let mut shader_defs = Vec :: new ( ) ;
68
68
if key. deband_dither {
69
- shader_defs. push ( "DEBAND_DITHER" . to_string ( ) ) ;
69
+ shader_defs. push ( "DEBAND_DITHER" . into ( ) ) ;
70
70
}
71
71
RenderPipelineDescriptor {
72
72
label : Some ( "tonemapping pipeline" . into ( ) ) ,
Original file line number Diff line number Diff line change @@ -641,11 +641,11 @@ impl SpecializedMeshPipeline for MeshPipeline {
641
641
}
642
642
643
643
if key. contains ( MeshPipelineKey :: TONEMAP_IN_SHADER ) {
644
- shader_defs. push ( "TONEMAP_IN_SHADER" . to_string ( ) ) ;
644
+ shader_defs. push ( "TONEMAP_IN_SHADER" . into ( ) ) ;
645
645
646
646
// Debanding is tied to tonemapping in the shader, cannot run without it.
647
647
if key. contains ( MeshPipelineKey :: DEBAND_DITHER ) {
648
- shader_defs. push ( "DEBAND_DITHER" . to_string ( ) ) ;
648
+ shader_defs. push ( "DEBAND_DITHER" . into ( ) ) ;
649
649
}
650
650
}
651
651
Original file line number Diff line number Diff line change @@ -129,6 +129,12 @@ impl From<&str> for ShaderDefVal {
129
129
}
130
130
}
131
131
132
+ impl From < String > for ShaderDefVal {
133
+ fn from ( key : String ) -> Self {
134
+ ShaderDefVal :: Bool ( key, true )
135
+ }
136
+ }
137
+
132
138
impl ShaderCache {
133
139
fn get (
134
140
& mut self ,
Original file line number Diff line number Diff line change @@ -376,11 +376,11 @@ impl SpecializedMeshPipeline for Mesh2dPipeline {
376
376
}
377
377
378
378
if key. contains ( Mesh2dPipelineKey :: TONEMAP_IN_SHADER ) {
379
- shader_defs. push ( "TONEMAP_IN_SHADER" . to_string ( ) ) ;
379
+ shader_defs. push ( "TONEMAP_IN_SHADER" . into ( ) ) ;
380
380
381
381
// Debanding is tied to tonemapping in the shader, cannot run without it.
382
382
if key. contains ( Mesh2dPipelineKey :: DEBAND_DITHER ) {
383
- shader_defs. push ( "DEBAND_DITHER" . to_string ( ) ) ;
383
+ shader_defs. push ( "DEBAND_DITHER" . into ( ) ) ;
384
384
}
385
385
}
386
386
Original file line number Diff line number Diff line change @@ -212,11 +212,11 @@ impl SpecializedRenderPipeline for SpritePipeline {
212
212
}
213
213
214
214
if key. contains ( SpritePipelineKey :: TONEMAP_IN_SHADER ) {
215
- shader_defs. push ( "TONEMAP_IN_SHADER" . to_string ( ) ) ;
215
+ shader_defs. push ( "TONEMAP_IN_SHADER" . into ( ) ) ;
216
216
217
217
// Debanding is tied to tonemapping in the shader, cannot run without it.
218
218
if key. contains ( SpritePipelineKey :: DEBAND_DITHER ) {
219
- shader_defs. push ( "DEBAND_DITHER" . to_string ( ) ) ;
219
+ shader_defs. push ( "DEBAND_DITHER" . into ( ) ) ;
220
220
}
221
221
}
222
222
You can’t perform that action at this time.
0 commit comments