Class ValidationGpuDevice
java.lang.Object
net.neoforged.neoforge.client.blaze3d.validation.ValidationGpuDevice
- All Implemented Interfaces:
GpuDevice,GpuDeviceExtension
The validation GpuDevice is used to ensure that both mods and backends are complying with the B3D API contract correctly.
Validation done by this class includes:
- Known texture/buffer usage bits
- Known NonExhaustiveEnum values
- Validates RenderPipeline precompilation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GpuDeviceprivate final ValidationCommandEncoderprotected final GpuDeviceUsageValidator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()createBuffer(@Nullable Supplier<String> label, int usage, int size) createBuffer(@Nullable Supplier<String> label, int usage, ByteBuffer data) createTexture(@Nullable String label, int usage, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels) createTexture(@Nullable Supplier<String> label, int usage, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels) createTextureView(GpuTexture texture) createTextureView(GpuTexture texture, int baseMipLevel, int mipLevels) GpuDeviceFeatures enabled during device configuration.intintbooleanprecompilePipeline(RenderPipeline pipeline, @Nullable BiFunction<ResourceLocation, ShaderType, String> shaderSourceProvider) protected ValidationCommandEncoderwrapCommandEncoder(CommandEncoder commandEncoder, GpuDeviceUsageValidator validator) protected ValidationGpuTexturewrapGpuTexture(GpuTexture texture, GpuDeviceUsageValidator validator) protected ValidationGpuTextureViewwrapGpuTextureView(ValidationGpuTexture validationGpuTexture, GpuTextureView gpuTextureView, GpuDeviceUsageValidator validator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mojang.blaze3d.systems.GpuDevice
precompilePipeline
-
Field Details
-
realDevice
-
validator
-
validationCommandEncoder
-
-
Constructor Details
-
ValidationGpuDevice
-
-
Method Details
-
getRealDevice
-
wrapCommandEncoder
protected ValidationCommandEncoder wrapCommandEncoder(CommandEncoder commandEncoder, GpuDeviceUsageValidator validator) -
createCommandEncoder
- Specified by:
createCommandEncoderin interfaceGpuDevice
-
wrapGpuTexture
protected ValidationGpuTexture wrapGpuTexture(GpuTexture texture, GpuDeviceUsageValidator validator) -
createTexture
public GpuTexture createTexture(@Nullable @Nullable Supplier<String> label, int usage, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels) - Specified by:
createTexturein interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable @Nullable String label, int usage, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels) - Specified by:
createTexturein interfaceGpuDevice
-
wrapGpuTextureView
protected ValidationGpuTextureView wrapGpuTextureView(ValidationGpuTexture validationGpuTexture, GpuTextureView gpuTextureView, GpuDeviceUsageValidator validator) -
createTextureView
- Specified by:
createTextureViewin interfaceGpuDevice
-
createTextureView
- Specified by:
createTextureViewin interfaceGpuDevice
-
createBuffer
- Specified by:
createBufferin interfaceGpuDevice
-
createBuffer
public GpuBuffer createBuffer(@Nullable @Nullable Supplier<String> label, int usage, ByteBuffer data) - Specified by:
createBufferin interfaceGpuDevice
-
getImplementationInformation
- Specified by:
getImplementationInformationin interfaceGpuDevice
-
getLastDebugMessages
- Specified by:
getLastDebugMessagesin interfaceGpuDevice
-
isDebuggingEnabled
public boolean isDebuggingEnabled()- Specified by:
isDebuggingEnabledin interfaceGpuDevice
-
getVendor
-
getBackendName
- Specified by:
getBackendNamein interfaceGpuDevice
-
getVersion
- Specified by:
getVersionin interfaceGpuDevice
-
getRenderer
- Specified by:
getRendererin interfaceGpuDevice
-
getMaxTextureSize
public int getMaxTextureSize()- Specified by:
getMaxTextureSizein interfaceGpuDevice
-
getUniformOffsetAlignment
public int getUniformOffsetAlignment()- Specified by:
getUniformOffsetAlignmentin interfaceGpuDevice
-
precompilePipeline
public CompiledRenderPipeline precompilePipeline(RenderPipeline pipeline, @Nullable @Nullable BiFunction<ResourceLocation, ShaderType, String> shaderSourceProvider) - Specified by:
precompilePipelinein interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCachein interfaceGpuDevice
-
getEnabledExtensions
- Specified by:
getEnabledExtensionsin interfaceGpuDevice
-
close
public void close() -
deviceProperties
- Specified by:
devicePropertiesin interfaceGpuDeviceExtension- See Also:
-
enabledFeatures
Description copied from interface:GpuDeviceExtensionGpuDeviceFeatures enabled during device configuration.- Specified by:
enabledFeaturesin interfaceGpuDeviceExtension- See Also:
-