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 GpuDevice
private final ValidationCommandEncoder
protected final GpuDeviceUsageValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
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.int
int
boolean
precompilePipeline
(RenderPipeline pipeline, @Nullable BiFunction<ResourceLocation, ShaderType, String> shaderSourceProvider) protected ValidationCommandEncoder
wrapCommandEncoder
(CommandEncoder commandEncoder, GpuDeviceUsageValidator validator) protected ValidationGpuTexture
wrapGpuTexture
(GpuTexture texture, GpuDeviceUsageValidator validator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
createCommandEncoder
in 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:
createTexture
in interfaceGpuDevice
-
createTexture
public GpuTexture createTexture(@Nullable @Nullable String label, int usage, TextureFormat format, int width, int height, int depthOrLayers, int mipLevels) - Specified by:
createTexture
in interfaceGpuDevice
-
createTextureView
- Specified by:
createTextureView
in interfaceGpuDevice
-
createTextureView
- Specified by:
createTextureView
in interfaceGpuDevice
-
createBuffer
- Specified by:
createBuffer
in interfaceGpuDevice
-
createBuffer
public GpuBuffer createBuffer(@Nullable @Nullable Supplier<String> label, int usage, ByteBuffer data) - Specified by:
createBuffer
in interfaceGpuDevice
-
getImplementationInformation
- Specified by:
getImplementationInformation
in interfaceGpuDevice
-
getLastDebugMessages
- Specified by:
getLastDebugMessages
in interfaceGpuDevice
-
isDebuggingEnabled
public boolean isDebuggingEnabled()- Specified by:
isDebuggingEnabled
in interfaceGpuDevice
-
getVendor
-
getBackendName
- Specified by:
getBackendName
in interfaceGpuDevice
-
getVersion
- Specified by:
getVersion
in interfaceGpuDevice
-
getRenderer
- Specified by:
getRenderer
in interfaceGpuDevice
-
getMaxTextureSize
public int getMaxTextureSize()- Specified by:
getMaxTextureSize
in interfaceGpuDevice
-
getUniformOffsetAlignment
public int getUniformOffsetAlignment()- Specified by:
getUniformOffsetAlignment
in interfaceGpuDevice
-
precompilePipeline
public CompiledRenderPipeline precompilePipeline(RenderPipeline pipeline, @Nullable @Nullable BiFunction<ResourceLocation, ShaderType, String> shaderSourceProvider) - Specified by:
precompilePipeline
in interfaceGpuDevice
-
clearPipelineCache
public void clearPipelineCache()- Specified by:
clearPipelineCache
in interfaceGpuDevice
-
getEnabledExtensions
- Specified by:
getEnabledExtensions
in interfaceGpuDevice
-
close
public void close() -
deviceProperties
- Specified by:
deviceProperties
in interfaceGpuDeviceExtension
- See Also:
-
enabledFeatures
Description copied from interface:GpuDeviceExtension
GpuDeviceFeatures enabled during device configuration.- Specified by:
enabledFeatures
in interfaceGpuDeviceExtension
- See Also:
-