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 @@ -214,8 +214,8 @@ impl SpecializedRenderPipeline for FxaaPipeline {
214
214
fragment : Some ( FragmentState {
215
215
shader : FXAA_SHADER_HANDLE . typed ( ) ,
216
216
shader_defs : vec ! [
217
- format!( "EDGE_THRESH_{}" , key. edge_threshold. get_str( ) ) ,
218
- format!( "EDGE_THRESH_MIN_{}" , key. edge_threshold_min. get_str( ) ) ,
217
+ format!( "EDGE_THRESH_{}" , key. edge_threshold. get_str( ) ) . into ( ) ,
218
+ format!( "EDGE_THRESH_MIN_{}" , key. edge_threshold_min. get_str( ) ) . into ( ) ,
219
219
] ,
220
220
entry_point : "fragment" . into ( ) ,
221
221
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 @@ -133,6 +133,12 @@ impl From<&str> for ShaderDefVal {
133
133
}
134
134
}
135
135
136
+ impl From < String > for ShaderDefVal {
137
+ fn from ( key : String ) -> Self {
138
+ ShaderDefVal :: Bool ( key, true )
139
+ }
140
+ }
141
+
136
142
impl ShaderCache {
137
143
fn get (
138
144
& 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