@@ -301,30 +301,39 @@ class NBL_API2 IGPUCommandBuffer : public IBackendObject
301
301
bool bindIndexBuffer (const asset::SBufferBinding<const IGPUBuffer>& binding, const asset::E_INDEX_TYPE indexType);
302
302
303
303
// ! dynamic state
304
- inline bool setScissor (const uint32_t first, const uint32_t count, const VkRect2D* const pScissors )
304
+ inline bool setScissor (const uint32_t first, const std::span< const VkRect2D> scissors )
305
305
{
306
+ const uint32_t count = scissors.size ();
306
307
if (invalidDynamic (first,count))
307
308
return false ;
308
309
309
- for (auto i= 0u ; i<count; i++ )
310
+ for (const auto & scissor : scissors )
310
311
{
311
- const auto & scissor = pScissors[i];
312
312
if (scissor.offset .x <0 || scissor.offset .y <0 )
313
313
return false ;
314
- if (pScissors[i] .extent .width >std::numeric_limits<int32_t >::max ()-scissor.offset .x )
314
+ if (scissor .extent .width >std::numeric_limits<int32_t >::max ()-scissor.offset .x )
315
315
return false ;
316
- if (pScissors[i] .extent .height >std::numeric_limits<int32_t >::max ()-scissor.offset .y )
316
+ if (scissor .extent .height >std::numeric_limits<int32_t >::max ()-scissor.offset .y )
317
317
return false ;
318
318
}
319
319
320
- return setScissor_impl (first,count,pScissors );
320
+ return setScissor_impl (first,count,scissors. data () );
321
321
}
322
- inline bool setViewport (const uint32_t first, const uint32_t count, const asset::SViewport * const pViewports )
322
+ [[deprecated]] inline bool setScissor (const uint32_t first, const uint32_t count, const VkRect2D * const pScissors )
323
323
{
324
+ return setScissor (first,{pScissors,count});
325
+ }
326
+ inline bool setViewport (const uint32_t first, const std::span<const asset::SViewport> viewports)
327
+ {
328
+ const uint32_t count = viewports.size ();
324
329
if (invalidDynamic (first,count))
325
330
return false ;
326
331
327
- return setViewport_impl (first,count,pViewports);
332
+ return setViewport_impl (first,count,viewports.data ());
333
+ }
334
+ [[deprecated]] inline bool setViewport (const uint32_t first, const uint32_t count, const asset::SViewport* const pViewports)
335
+ {
336
+ return setViewport (first,{pViewports,count});
328
337
}
329
338
bool setLineWidth (const float width);
330
339
inline bool setDepthBias (const float depthBiasConstantFactor, const float depthBiasClamp, const float depthBiasSlopeFactor)
0 commit comments