@@ -245,10 +245,7 @@ void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
245
245
}
246
246
247
247
const auto & resourceTexture = batch._textures .get (batch._params [paramOffset + 0 ]._uint );
248
- Sampler sampler;
249
- if (resourceTexture) {
250
- sampler = batch._samplers .get (batch._params [paramOffset + 2 ]._uint );
251
- }
248
+ const Sampler& sampler = batch._samplers .get (batch._params [paramOffset + 2 ]._uint );
252
249
bindResourceTexture (slot, resourceTexture, sampler);
253
250
}
254
251
@@ -278,9 +275,10 @@ void GLBackend::do_setResourceFramebufferSwapChainTexture(const Batch& batch, si
278
275
}
279
276
auto index = batch._params [paramOffset + 2 ]._uint ;
280
277
auto renderBufferSlot = batch._params [paramOffset + 3 ]._uint ;
278
+ const Sampler& sampler = batch._samplers .get (batch._params [paramOffset + 4 ]._uint );
279
+
281
280
const auto & resourceFramebuffer = swapChain->get (index );
282
281
const auto & resourceTexture = resourceFramebuffer->getRenderBuffer (renderBufferSlot);
283
- Sampler sampler = batch._samplers .get (batch._params [paramOffset + 4 ]._uint );
284
282
setResourceTexture (slot, resourceTexture, sampler);
285
283
}
286
284
@@ -325,11 +323,7 @@ void GLBackend::do_setResourceTextureTable(const Batch& batch, size_t paramOffse
325
323
const auto & textures = textureTable.getTextures ();
326
324
for (GLuint slot = 0 ; slot < textures.size (); ++slot) {
327
325
const auto & texture = textures[slot];
328
-
329
- Sampler sampler;
330
- if (texture) {
331
- sampler = batch._samplers .get (batch._params [paramOffset + 2 + (samplerIndex++)]._uint );
332
- }
326
+ const Sampler& sampler = batch._samplers .get (batch._params [paramOffset + 2 + (samplerIndex++)]._uint );
333
327
334
328
bindResourceTexture (slot + startSlot, texture, sampler);
335
329
}
0 commit comments