@@ -21,8 +21,8 @@ pub struct Descriptors {
21
21
pub bitmap_samplers : BitmapSamplers ,
22
22
pub bind_layouts : BindLayouts ,
23
23
pub quad : Quad ,
24
- copy_pipeline : Mutex < FnvHashMap < ( u32 , wgpu:: TextureFormat ) , Arc < wgpu:: RenderPipeline > > > ,
25
- copy_srgb_pipeline : Mutex < FnvHashMap < ( u32 , wgpu:: TextureFormat ) , Arc < wgpu:: RenderPipeline > > > ,
24
+ copy_pipeline : Mutex < FnvHashMap < ( u32 , wgpu:: TextureFormat ) , wgpu:: RenderPipeline > > ,
25
+ copy_srgb_pipeline : Mutex < FnvHashMap < ( u32 , wgpu:: TextureFormat ) , wgpu:: RenderPipeline > > ,
26
26
pub shaders : Shaders ,
27
27
pipelines : Mutex < FnvHashMap < ( u32 , wgpu:: TextureFormat ) , Arc < Pipelines > > > ,
28
28
pub filters : Filters ,
@@ -71,7 +71,7 @@ impl Descriptors {
71
71
& self ,
72
72
format : wgpu:: TextureFormat ,
73
73
msaa_sample_count : u32 ,
74
- ) -> Arc < wgpu:: RenderPipeline > {
74
+ ) -> wgpu:: RenderPipeline {
75
75
let mut pipelines = self
76
76
. copy_srgb_pipeline
77
77
. lock ( )
@@ -91,48 +91,46 @@ impl Descriptors {
91
91
] ,
92
92
push_constant_ranges : & [ ] ,
93
93
} ) ;
94
- Arc :: new (
95
- self . device
96
- . create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
97
- label : create_debug_label ! ( "Copy sRGB pipeline" ) . as_deref ( ) ,
98
- layout : Some ( copy_texture_pipeline_layout) ,
99
- vertex : wgpu:: VertexState {
100
- module : & self . shaders . copy_srgb_shader ,
101
- entry_point : Some ( "main_vertex" ) ,
102
- buffers : & VERTEX_BUFFERS_DESCRIPTION_POS ,
103
- compilation_options : Default :: default ( ) ,
104
- } ,
105
- fragment : Some ( wgpu:: FragmentState {
106
- module : & self . shaders . copy_srgb_shader ,
107
- entry_point : Some ( "main_fragment" ) ,
108
- targets : & [ Some ( wgpu:: ColorTargetState {
109
- format,
110
- // All of our blending has been done by now, so we want
111
- // to overwrite the target pixels without any blending
112
- blend : Some ( wgpu:: BlendState :: REPLACE ) ,
113
- write_mask : Default :: default ( ) ,
114
- } ) ] ,
115
- compilation_options : Default :: default ( ) ,
116
- } ) ,
117
- primitive : wgpu:: PrimitiveState {
118
- topology : wgpu:: PrimitiveTopology :: TriangleList ,
119
- strip_index_format : None ,
120
- front_face : wgpu:: FrontFace :: Ccw ,
121
- cull_mode : None ,
122
- polygon_mode : wgpu:: PolygonMode :: default ( ) ,
123
- unclipped_depth : false ,
124
- conservative : false ,
125
- } ,
126
- depth_stencil : None ,
127
- multisample : wgpu:: MultisampleState {
128
- count : msaa_sample_count,
129
- mask : !0 ,
130
- alpha_to_coverage_enabled : false ,
131
- } ,
132
- multiview : None ,
133
- cache : None ,
94
+ self . device
95
+ . create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
96
+ label : create_debug_label ! ( "Copy sRGB pipeline" ) . as_deref ( ) ,
97
+ layout : Some ( copy_texture_pipeline_layout) ,
98
+ vertex : wgpu:: VertexState {
99
+ module : & self . shaders . copy_srgb_shader ,
100
+ entry_point : Some ( "main_vertex" ) ,
101
+ buffers : & VERTEX_BUFFERS_DESCRIPTION_POS ,
102
+ compilation_options : Default :: default ( ) ,
103
+ } ,
104
+ fragment : Some ( wgpu:: FragmentState {
105
+ module : & self . shaders . copy_srgb_shader ,
106
+ entry_point : Some ( "main_fragment" ) ,
107
+ targets : & [ Some ( wgpu:: ColorTargetState {
108
+ format,
109
+ // All of our blending has been done by now, so we want
110
+ // to overwrite the target pixels without any blending
111
+ blend : Some ( wgpu:: BlendState :: REPLACE ) ,
112
+ write_mask : Default :: default ( ) ,
113
+ } ) ] ,
114
+ compilation_options : Default :: default ( ) ,
134
115
} ) ,
135
- )
116
+ primitive : wgpu:: PrimitiveState {
117
+ topology : wgpu:: PrimitiveTopology :: TriangleList ,
118
+ strip_index_format : None ,
119
+ front_face : wgpu:: FrontFace :: Ccw ,
120
+ cull_mode : None ,
121
+ polygon_mode : wgpu:: PolygonMode :: default ( ) ,
122
+ unclipped_depth : false ,
123
+ conservative : false ,
124
+ } ,
125
+ depth_stencil : None ,
126
+ multisample : wgpu:: MultisampleState {
127
+ count : msaa_sample_count,
128
+ mask : !0 ,
129
+ alpha_to_coverage_enabled : false ,
130
+ } ,
131
+ multiview : None ,
132
+ cache : None ,
133
+ } )
136
134
} )
137
135
. clone ( )
138
136
}
@@ -141,7 +139,7 @@ impl Descriptors {
141
139
& self ,
142
140
format : wgpu:: TextureFormat ,
143
141
msaa_sample_count : u32 ,
144
- ) -> Arc < wgpu:: RenderPipeline > {
142
+ ) -> wgpu:: RenderPipeline {
145
143
let mut pipelines = self
146
144
. copy_pipeline
147
145
. lock ( )
@@ -161,48 +159,46 @@ impl Descriptors {
161
159
] ,
162
160
push_constant_ranges : & [ ] ,
163
161
} ) ;
164
- Arc :: new (
165
- self . device
166
- . create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
167
- label : create_debug_label ! ( "Copy pipeline" ) . as_deref ( ) ,
168
- layout : Some ( copy_texture_pipeline_layout) ,
169
- vertex : wgpu:: VertexState {
170
- module : & self . shaders . copy_shader ,
171
- entry_point : Some ( "main_vertex" ) ,
172
- buffers : & VERTEX_BUFFERS_DESCRIPTION_POS ,
173
- compilation_options : Default :: default ( ) ,
174
- } ,
175
- fragment : Some ( wgpu:: FragmentState {
176
- module : & self . shaders . copy_shader ,
177
- entry_point : Some ( "main_fragment" ) ,
178
- targets : & [ Some ( wgpu:: ColorTargetState {
179
- format,
180
- // All of our blending has been done by now, so we want
181
- // to overwrite the target pixels without any blending
182
- blend : Some ( wgpu:: BlendState :: REPLACE ) ,
183
- write_mask : Default :: default ( ) ,
184
- } ) ] ,
185
- compilation_options : Default :: default ( ) ,
186
- } ) ,
187
- primitive : wgpu:: PrimitiveState {
188
- topology : wgpu:: PrimitiveTopology :: TriangleList ,
189
- strip_index_format : None ,
190
- front_face : wgpu:: FrontFace :: Ccw ,
191
- cull_mode : None ,
192
- polygon_mode : wgpu:: PolygonMode :: default ( ) ,
193
- unclipped_depth : false ,
194
- conservative : false ,
195
- } ,
196
- depth_stencil : None ,
197
- multisample : wgpu:: MultisampleState {
198
- count : msaa_sample_count,
199
- mask : !0 ,
200
- alpha_to_coverage_enabled : false ,
201
- } ,
202
- multiview : None ,
203
- cache : None ,
162
+ self . device
163
+ . create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
164
+ label : create_debug_label ! ( "Copy pipeline" ) . as_deref ( ) ,
165
+ layout : Some ( copy_texture_pipeline_layout) ,
166
+ vertex : wgpu:: VertexState {
167
+ module : & self . shaders . copy_shader ,
168
+ entry_point : Some ( "main_vertex" ) ,
169
+ buffers : & VERTEX_BUFFERS_DESCRIPTION_POS ,
170
+ compilation_options : Default :: default ( ) ,
171
+ } ,
172
+ fragment : Some ( wgpu:: FragmentState {
173
+ module : & self . shaders . copy_shader ,
174
+ entry_point : Some ( "main_fragment" ) ,
175
+ targets : & [ Some ( wgpu:: ColorTargetState {
176
+ format,
177
+ // All of our blending has been done by now, so we want
178
+ // to overwrite the target pixels without any blending
179
+ blend : Some ( wgpu:: BlendState :: REPLACE ) ,
180
+ write_mask : Default :: default ( ) ,
181
+ } ) ] ,
182
+ compilation_options : Default :: default ( ) ,
204
183
} ) ,
205
- )
184
+ primitive : wgpu:: PrimitiveState {
185
+ topology : wgpu:: PrimitiveTopology :: TriangleList ,
186
+ strip_index_format : None ,
187
+ front_face : wgpu:: FrontFace :: Ccw ,
188
+ cull_mode : None ,
189
+ polygon_mode : wgpu:: PolygonMode :: default ( ) ,
190
+ unclipped_depth : false ,
191
+ conservative : false ,
192
+ } ,
193
+ depth_stencil : None ,
194
+ multisample : wgpu:: MultisampleState {
195
+ count : msaa_sample_count,
196
+ mask : !0 ,
197
+ alpha_to_coverage_enabled : false ,
198
+ } ,
199
+ multiview : None ,
200
+ cache : None ,
201
+ } )
206
202
} )
207
203
. clone ( )
208
204
}
0 commit comments