@@ -287,4 +287,49 @@ UTEST( Device, HashingReflectionMembers )
287287 emptyName.push_back ( m4 );
288288 uint64_t hash7 = vhHashReflectionMembers ( emptyName );
289289 EXPECT_NE ( hash7, 0u );
290+ }
291+
292+ UTEST ( Device, QueryFeatureSupport )
293+ {
294+ if ( !g_testInit )
295+ {
296+ vhInit ( g_testInitQuiet );
297+ g_testInit = true ;
298+ }
299+
300+ // Test basic feature queries that should return deterministic values
301+ EXPECT_TRUE ( vhQueryFeatureSupport ( nvrhi::Feature::ComputeQueue ) ); // Vulkan always has this
302+ // Test any bool is valid for this feature
303+ bool deferredSupport = vhQueryFeatureSupport ( nvrhi::Feature::DeferredCommandLists );
304+ // Just verify it returns a valid bool - don't assume specific support
305+
306+ // Test feature with info struct
307+ nvrhi::VariableRateShadingFeatureInfo vrsInfo = {};
308+ bool vrsSupported = vhQueryFeatureSupport ( nvrhi::Feature::VariableRateShading, &vrsInfo, sizeof (vrsInfo) );
309+ if ( vrsSupported )
310+ {
311+ EXPECT_GT ( vrsInfo.shadingRateImageTileSize , 0 ); // Should have valid tile size if supported
312+ }
313+ }
314+
315+ UTEST ( Device, QueryFormatSupport )
316+ {
317+ if ( !g_testInit )
318+ {
319+ vhInit ( g_testInitQuiet );
320+ g_testInit = true ;
321+ }
322+
323+ // Test common format queries
324+ nvrhi::FormatSupport rgba8Support = vhQueryFormatSupport ( nvrhi::Format::RGBA8_UNORM );
325+ EXPECT_NE ( rgba8Support, nvrhi::FormatSupport::None ); // Common format should be supported
326+ EXPECT_TRUE ( ( rgba8Support & nvrhi::FormatSupport::Texture ) != nvrhi::FormatSupport::None );
327+ EXPECT_TRUE ( ( rgba8Support & nvrhi::FormatSupport::ShaderSample ) != nvrhi::FormatSupport::None );
328+
329+ // Test format support flags
330+ nvrhi::FormatSupport depthSupport = vhQueryFormatSupport ( nvrhi::Format::D24S8 );
331+ EXPECT_TRUE ( ( depthSupport & nvrhi::FormatSupport::DepthStencil ) != nvrhi::FormatSupport::None );
332+
333+ nvrhi::FormatSupport floatSupport = vhQueryFormatSupport ( nvrhi::Format::R32_FLOAT );
334+ EXPECT_TRUE ( ( floatSupport & nvrhi::FormatSupport::ShaderLoad ) != nvrhi::FormatSupport::None );
290335}
0 commit comments