File tree 1 file changed +9
-15
lines changed
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -117,23 +117,17 @@ void CTexture::surface_set(ID3DBaseTexture* surf)
117
117
_RELEASE (srv_all);
118
118
CHK_DX (HW.pDevice ->CreateShaderResourceView (pSurface, &ViewDesc, &srv_all));
119
119
120
+ if (desc.SampleDesc .Count <= 1 )
121
+ ViewDesc.Texture2DArray .ArraySize = desc.ArraySize ;
122
+ else
123
+ ViewDesc.Texture2DMSArray .ArraySize = desc.ArraySize ;
124
+
120
125
srv_per_slice.resize (desc.ArraySize );
121
- for (u32 id = 0 ; id < desc.ArraySize ; ++id)
122
- {
123
- _RELEASE (srv_per_slice[id]);
126
+ for (auto &x : srv_per_slice)
127
+ _RELEASE (x);
128
+
129
+ CHK_DX (HW.pDevice ->CreateShaderResourceView (pSurface, &ViewDesc, srv_per_slice.data ()));
124
130
125
- if (desc.SampleDesc .Count <= 1 )
126
- {
127
- ViewDesc.Texture2DArray .ArraySize = 1 ;
128
- ViewDesc.Texture2DArray .FirstArraySlice = id;
129
- }
130
- else
131
- {
132
- ViewDesc.Texture2DMSArray .ArraySize = 1 ;
133
- ViewDesc.Texture2DMSArray .FirstArraySlice = id;
134
- }
135
- CHK_DX (HW.pDevice ->CreateShaderResourceView (pSurface, &ViewDesc, &srv_per_slice[id]));
136
- }
137
131
set_slice (-1 );
138
132
}
139
133
else
You can’t perform that action at this time.
0 commit comments