Top Description Inners Fields Constructors Methods
org.lwjgl.util.shaderc

public Class Shaderc

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to the libshaderc C API of the shaderc library.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Shaderc.Functions

Contains the function pointers loaded from the shaderc SharedLibrary.

Field Summary

Modifier and TypeField and Description
private static final SharedLibrary
public static final int
shaderc_anyhit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_callable_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_closesthit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_compilation_status_compilation_error

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_configuration_error

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_internal_error

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_invalid_assembly

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_invalid_stage

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_null_result_object

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_success

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_transformation_error

Indicate the status of a compilation.

public static final int
shaderc_compilation_status_validation_error

Indicate the status of a compilation.

public static final int
shaderc_compute_shader

shaderc_shader_kind Enum values:

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
shaderc_fragment_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_geometry_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_anyhit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_callable_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_closesthit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_compute_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_anyhit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_callable_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_closesthit_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_compute_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_fragment_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_geometry_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_intersection_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_mesh_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_miss_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_raygen_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_task_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_tess_control_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_tess_evaluation_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_default_vertex_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_fragment_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_geometry_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_infer_from_source

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_intersection_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_mesh_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_miss_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_raygen_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_task_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_tess_control_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_tess_evaluation_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_glsl_vertex_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_include_type_relative

The kinds of include requests.

public static final int
shaderc_include_type_standard

The kinds of include requests.

public static final int
shaderc_intersection_shader

shaderc_shader_kind Enum values:

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
shaderc_limit_max_lights

Resource limits.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
shaderc_limit_max_samples

Resource limits.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
shaderc_mesh_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_miss_shader

shaderc_shader_kind Enum values:

public static final int
public static final int
public static final int
public static final int
shaderc_profile_compatibility

shaderc_profile Enum values:

public static final int
shaderc_profile_core

shaderc_profile Enum values:

public static final int
shaderc_profile_es

shaderc_profile Enum values:

public static final int
shaderc_profile_none

shaderc_profile Enum values:

public static final int
shaderc_raygen_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_source_language_glsl

Source language kind.

public static final int
shaderc_source_language_hlsl

Source language kind.

public static final int
shaderc_spirv_assembly

shaderc_shader_kind Enum values:

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
shaderc_target_env_default

shaderc_target_env Enum values:

public static final int
shaderc_target_env_opengl

shaderc_target_env Enum values:

public static final int
shaderc_target_env_opengl_compat

shaderc_target_env Enum values:

public static final int
shaderc_target_env_vulkan

shaderc_target_env Enum values:

public static final int
shaderc_target_env_webgpu

shaderc_target_env Enum values:

public static final int
shaderc_task_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_tess_control_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_tess_evaluation_shader

shaderc_shader_kind Enum values:

public static final int
shaderc_uniform_kind_buffer

Uniform resource kinds.

public static final int
shaderc_uniform_kind_image

Uniform resource kinds.

public static final int
shaderc_uniform_kind_sampler

Uniform resource kinds.

public static final int
shaderc_uniform_kind_storage_buffer

Uniform resource kinds.

public static final int
shaderc_uniform_kind_texture

Uniform resource kinds.

public static final int
public static final int
shaderc_vertex_shader

shaderc_shader_kind Enum values:

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static SharedLibrary
getLibrary()

Returns the shaderc SharedLibrary.

public static long
nshaderc_assemble_into_spv(long compiler, long source_assembly, long source_assembly_size, long additional_options)

Unsafe version of: assemble_into_spv

public static long
nshaderc_compile_into_preprocessed_text(long compiler, long source_text, long source_text_size, int shader_kind, long input_file_name, long entry_point_name, long additional_options)

Unsafe version of: compile_into_preprocessed_text

public static long
nshaderc_compile_into_spv(long compiler, long source_text, long source_text_size, int shader_kind, long input_file_name, long entry_point_name, long additional_options)

Unsafe version of: compile_into_spv

public static long
nshaderc_compile_into_spv_assembly(long compiler, long source_text, long source_text_size, int shader_kind, long input_file_name, long entry_point_name, long additional_options)

Unsafe version of: compile_into_spv_assembly

public static void
nshaderc_compile_options_add_macro_definition(long options, long name, long name_length, long value, long value_length)

Unsafe version of: compile_options_add_macro_definition

public static void
public static void
nshaderc_compile_options_set_hlsl_register_set_and_binding_for_stage(long options, int shader_kind, long reg, long set, long binding)

Unsafe version of: compile_options_set_hlsl_register_set_and_binding_for_stage

public static void
nshaderc_compile_options_set_include_callbacks(long options, long resolver, long result_releaser, long user_data)

Unsafe version of: compile_options_set_include_callbacks

public static void
nshaderc_get_spv_version(long version, long revision)

Unsafe version of: get_spv_version

public static boolean
nshaderc_parse_version_profile(long str, long version, long profile)

Unsafe version of: parse_version_profile

public static long
nshaderc_result_get_bytes(long result)

Unsafe version of: result_get_bytes

public static long
public static long
shaderc_assemble_into_spv(long compiler, ByteBuffer source_assembly, long additional_options)

Takes an assembly string of the format defined in the SPIRV-Tools project, assembles it into SPIR-V binary and a shaderc_compilation_result_t will be returned to hold the results.

public static long
shaderc_assemble_into_spv(long compiler, CharSequence source_assembly, long additional_options)

Takes an assembly string of the format defined in the SPIRV-Tools project, assembles it into SPIR-V binary and a shaderc_compilation_result_t will be returned to hold the results.

public static long
shaderc_compile_into_preprocessed_text(long compiler, ByteBuffer source_text, int shader_kind, ByteBuffer input_file_name, ByteBuffer entry_point_name, long additional_options)

Like compile_into_spv, but the result contains preprocessed source code instead of a SPIR-V binary module

public static long
shaderc_compile_into_preprocessed_text(long compiler, CharSequence source_text, int shader_kind, CharSequence input_file_name, CharSequence entry_point_name, long additional_options)

Like compile_into_spv, but the result contains preprocessed source code instead of a SPIR-V binary module

public static long
shaderc_compile_into_spv(long compiler, ByteBuffer source_text, int shader_kind, ByteBuffer input_file_name, ByteBuffer entry_point_name, long additional_options)

Takes a GLSL source string and the associated shader kind, input file name, compiles it according to the given additional_options.

public static long
shaderc_compile_into_spv(long compiler, CharSequence source_text, int shader_kind, CharSequence input_file_name, CharSequence entry_point_name, long additional_options)

Takes a GLSL source string and the associated shader kind, input file name, compiles it according to the given additional_options.

public static long
shaderc_compile_into_spv_assembly(long compiler, ByteBuffer source_text, int shader_kind, ByteBuffer input_file_name, ByteBuffer entry_point_name, long additional_options)

Like compile_into_spv, but the result contains SPIR-V assembly text instead of a SPIR-V binary module.

public static long
shaderc_compile_into_spv_assembly(long compiler, CharSequence source_text, int shader_kind, CharSequence input_file_name, CharSequence entry_point_name, long additional_options)

Like compile_into_spv, but the result contains SPIR-V assembly text instead of a SPIR-V binary module.

public static void
shaderc_compile_options_add_macro_definition(long options, ByteBuffer name, ByteBuffer value)

Adds a predefined macro to the compilation options.

public static void
shaderc_compile_options_add_macro_definition(long options, CharSequence name, CharSequence value)

Adds a predefined macro to the compilation options.

public static long
shaderc_compile_options_clone(long options)

Returns a copy of the given shaderc_compile_options_t.

public static long
shaderc_compile_options_initialize()

Returns a default-initialized shaderc_compile_options_t that can be used to modify the functionality of a compiled module.

public static void
shaderc_compile_options_release(long options)

Releases the compilation options.

public static void
shaderc_compile_options_set_auto_bind_uniforms(long options, boolean auto_bind)

Sets whether the compiler should automatically assign bindings to uniforms that aren't already explicitly bound in the shader source.

public static void
shaderc_compile_options_set_auto_combined_image_sampler(long options, boolean upgrade)

Sets whether the compiler should automatically remove sampler variables and convert image variables to combined image-sampler variables.

public static void
shaderc_compile_options_set_auto_map_locations(long options, boolean auto_map)

Sets whether the compiler should automatically assign locations to uniform variables that don't have explicit locations in the shader source.

public static void
shaderc_compile_options_set_binding_base(long options, int kind, int base)

Sets the base binding number used for for a uniform resource type when automatically assigning bindings.

public static void
shaderc_compile_options_set_binding_base_for_stage(long options, int shader_kind, int kind, int base)

Like compile_options_set_binding_base, but only takes effect when compiling a given shader stage.

public static void
shaderc_compile_options_set_forced_version_profile(long options, int version, int profile)

Forces the GLSL language version and profile to a given pair.

public static void
shaderc_compile_options_set_generate_debug_info(long options)

Sets the compiler mode to generate debug information in the output.

public static void
shaderc_compile_options_set_hlsl_16bit_types(long options, boolean enable)

Sets whether 16-bit types are supported in HLSL or not.

public static void
shaderc_compile_options_set_hlsl_functionality1(long options, boolean enable)

Sets whether the compiler should enable extension SPV_GOOGLE_hlsl_functionality1.

public static void
shaderc_compile_options_set_hlsl_io_mapping(long options, boolean hlsl_iomap)

Sets whether the compiler should use HLSL IO mapping rules for bindings.

public static void
shaderc_compile_options_set_hlsl_offsets(long options, boolean hlsl_offsets)

Sets whether the compiler should determine block member offsets using HLSL packing rules instead of standard GLSL rules.

public static void
public static void
public static void
shaderc_compile_options_set_hlsl_register_set_and_binding_for_stage(long options, int shader_kind, ByteBuffer reg, ByteBuffer set, ByteBuffer binding)

Sets a descriptor set and binding for an HLSL register in the given stage.

public static void
shaderc_compile_options_set_hlsl_register_set_and_binding_for_stage(long options, int shader_kind, CharSequence reg, CharSequence set, CharSequence binding)

Sets a descriptor set and binding for an HLSL register in the given stage.

public static void
shaderc_compile_options_set_include_callbacks(long options, ShadercIncludeResolveI resolver, ShadercIncludeResultReleaseI result_releaser, long user_data)

Sets includer callback functions.

public static void
shaderc_compile_options_set_invert_y(long options, boolean enable)

Sets whether the compiler should invert position.Y output in vertex shader.

public static void
shaderc_compile_options_set_limit(long options, int limit, int value)

Sets a resource limit.

public static void
shaderc_compile_options_set_nan_clamp(long options, boolean enable)

Sets whether the compiler generates code for max and min builtins which, if given a NaN operand, will return the other operand.

public static void
shaderc_compile_options_set_optimization_level(long options, int level)

Sets the compiler optimization level to the given level.

public static void
shaderc_compile_options_set_preserve_bindings(long options, boolean preserve_bindings)

Sets whether the compiler should preserve all bindings, even when those bindings are not used.

public static void
shaderc_compile_options_set_source_language(long options, int lang)

Sets the source language.

public static void
shaderc_compile_options_set_suppress_warnings(long options)

Sets the compiler mode to suppress warnings, overriding warnings-as-errors mode.

public static void
shaderc_compile_options_set_target_env(long options, int target, int version)

Sets the target shader environment, affecting which warnings or errors will be issued.

public static void
shaderc_compile_options_set_target_spirv(long options, int version)

Sets the target SPIR-V version.

public static void
shaderc_compile_options_set_warnings_as_errors(long options)

Sets the compiler mode to treat all warnings as errors.

public static long
shaderc_compiler_initialize()

Returns a shaderc_compiler_t that can be used to compile modules.

public static void
shaderc_compiler_release(long compiler)

Releases the resources held by the shaderc_compiler_t.

public static void
shaderc_get_spv_version(IntBuffer version, IntBuffer revision)

Provides the version and revision of the SPIR-V which will be produced

public static boolean
shaderc_parse_version_profile(ByteBuffer str, IntBuffer version, IntBuffer profile)

Parses the version and profile from a given null-terminated string containing both version and profile, like: '450core'.

public static boolean
shaderc_parse_version_profile(CharSequence str, IntBuffer version, IntBuffer profile)

Parses the version and profile from a given null-terminated string containing both version and profile, like: '450core'.

public static ByteBuffer
shaderc_result_get_bytes(long result)

Returns the compilation output data bytes, either SPIR-V binary or char string.

public static ByteBuffer
shaderc_result_get_bytes(long result, long length)

Returns the compilation output data bytes, either SPIR-V binary or char string.

public static int
shaderc_result_get_compilation_status(long result)

Returns the compilation status, indicating whether the compilation succeeded, or failed due to some reasons, like invalid shader stage or compilation errors.

public static String
shaderc_result_get_error_message(long result)

Returns a null-terminated string that contains any error messages generated during the compilation.

public static long
shaderc_result_get_length(long result)

Returns the number of bytes of the compilation output data in the given result object.

public static long
shaderc_result_get_num_errors(long result)

Returns the number of errors generated during the compilation.

public static long
shaderc_result_get_num_warnings(long result)

Returns the number of warnings generated during the compilation.

public static void
shaderc_result_release(long result)

Releases the resources held by the result object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait