File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,10 @@ struct Material
270
270
PackedProps &= ~UVSelectorShiftedMask;
271
271
PackedProps |= (static_cast <Uint32>(Selector) & UVSelectorMask) << UVSelectorShift;
272
272
}
273
+ int GetUVSelector () const
274
+ {
275
+ return static_cast <int >((PackedProps >> UVSelectorShift) & UVSelectorMask) - 1 ;
276
+ }
273
277
274
278
static_assert (TEXTURE_ADDRESS_WRAP == 1 , " TEXTURE_ADDRESS_WRAP must be 1" );
275
279
static_assert (TEXTURE_ADDRESS_MIRROR == 2 , " TEXTURE_ADDRESS_MIRROR must be 2" );
@@ -286,6 +290,14 @@ struct Material
286
290
PackedProps &= ~WrapVShiftedMask;
287
291
PackedProps |= (((std::max)(static_cast <Uint32>(AddressMode), 1u ) - 1u ) & WrapVMask) << WrapVShift;
288
292
}
293
+ TEXTURE_ADDRESS_MODE GetWrapUMode () const
294
+ {
295
+ return static_cast <TEXTURE_ADDRESS_MODE>(((PackedProps >> WrapUShift) & WrapUMask) + 1u );
296
+ }
297
+ TEXTURE_ADDRESS_MODE GetWrapVMode () const
298
+ {
299
+ return static_cast <TEXTURE_ADDRESS_MODE>(((PackedProps >> WrapVShift) & WrapVMask) + 1u );
300
+ }
289
301
};
290
302
static_assert (sizeof (TextureShaderAttribs) % 16 == 0 , " TextureShaderAttribs struct must be 16-byte aligned" );
291
303
You can’t perform that action at this time.
0 commit comments