Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wine/vkd3d
  • stefan/vkd3d
  • cmccarthy/vkd3d
  • giomasce/vkd3d
  • fcasas/vkd3d
  • jactry/vkd3d
  • ReDress/vkd3d
  • mstorsjo/vkd3d
  • huw/vkd3d
  • julliard/vkd3d
  • bshanks/vkd3d
  • zfigura/vkd3d
  • hverbeet/vkd3d
  • DarkShadow44/vkd3d
  • nsivov/vkd3d
  • dhary686/vkd3d
  • Mystral/vkd3d
  • maljaf/vkd3d
  • smcv/vkd3d
  • flibitijibibo/vkd3d
  • q4a/vkd3d
  • jsikorski/vkd3d
  • alesliehughes/vkd3d-alesliehughes
  • vitorhnn/vkd3d
  • agusev/vkd3d
  • etang-cw/vkd3d
  • petrathekat/vkd3d
  • simon.mr995/vkd3d
  • sgwaki/vkd3d
  • jacek/vkd3d
  • fweimer/vkd3d
  • Clara/vkd3d
  • disini/vkd3d
  • antenabr2/vkd3d
  • gilvbp/vkd3d
  • yshui/vkd3d
  • shaunren/vkd3d
  • jennetsaryyewa96/vkd3d
  • Jamesattay/vkd3d
  • zacemmneeto77/vkd3d
  • GermanAizek/vkd3d
  • opespinach/vkd3d
  • ruslanboyka201/vkd3d
  • navi/vkd3d
  • Feifan/vkd3d
  • yashmhmdly172/vkd3d
  • Sec32fun32/vkd3d
  • ritalat/vkd3d
  • ivyl/vkd3d
  • baikaishiuc/vkd3d
  • austin987/vkd3d
  • TornadoCookie/vkd3d
52 results
Show changes
Commits on Source (1283)
The vkd3d team is proud to announce that release 1.13 of vkd3d, the Direct3D
The vkd3d team is proud to announce that release 1.15 of vkd3d, the Direct3D
to Vulkan translation library, is now available.
This release contains improvements that are listed in the release notes below.
The main highlights are:
- Basic loop unrolling support in the HLSL compiler.
- Effects compiler support for several version 4.0+ state objects.
- Much more complete support for tessellation shaders in the HLSL compiler.
- Improved function overload resolution in the HLSL compiler.
- Miscellaneous bug fixes.
The source is available from the following location:
<https://dl.winehq.org/vkd3d/source/vkd3d-1.13.tar.xz>
<https://dl.winehq.org/vkd3d/source/vkd3d-1.15.tar.xz>
The current source can also be pulled directly from the git repository:
......@@ -19,399 +19,488 @@ The current source can also be pulled directly from the git repository:
Vkd3d is available thanks to the work of multiple people. See the file AUTHORS
for the complete list.
# What's new in vkd3d 1.13
# What's new in vkd3d 1.15
### libvkd3d
- The ID3D12CommandList6 interface is supported.
- Block-compressed textures can be created with unaligned dimensions. This
corresponds to
D3D12_FEATURE_D3D12_OPTIONS8.UnalignedBlockTexturesSupported.
- Some minor issues pointed out by the Vulkan validation layers have been
addressed. These are not known to affect applications in practice, but
should make libvkd3d slightly more well-behaved.
- New interfaces:
- vkd3d_queue_signal_on_cpu() allows a Direct3D 12 fence to be signalled
when all preceding work on a Direct3D 12 command queue has been submitted
to the corresponding Vulkan queue.
### libvkd3d-shader
- New features for the HLSL source type:
- Basic loop unrolling support. Some of the more complicated cases like
loops containing conditional jumps are still unsupported.
- Initialisation values for global variables, function parameters, and
annotation variables are parsed and stored in output formats supporting
them.
- Shader model 5.1 register spaces are supported when using the
corresponding target profiles, as well as shader model 5.1 reflection
data.
- Register reservations support expressions as offsets. For example:
‘float f : register(c0[1 + 1 * 2]);’
- The tex1D(), tex2D(), tex3D(), and texCUBE() intrinsic function variants
with explicit derivatives are supported.
- ‘InputPatch’ and ‘OutputPatch’ tessellation shader objects. This was the
main feature required by most tessellation shaders that was still missing,
and tessellation shaders should be considered generally usable now.
- Unrolling of loops containing conditional jumps.
- Improved function overload resolution. Previously the compiler was unable
to decide between multiple function overloads with the same number of
parameters.
- The parser is able to continue parsing in a larger number of error cases.
This allows more issues in the input to be reported during a single
compilaton attempt.
- The following intrinsic functions are supported:
- asint()
- f16tof32()
- faceforward()
- GetRenderTargetSampleCount()
- rcp()
- tex2Dbias()
- tex1Dgrad(), tex2Dgrad(), tex3Dgrad(), and texCUBEgrad()
- The sin() and cos() intrinsic functions are supported in shader model
1-3 profiles. These were already supported in shader model 4+ profiles.
- The following features specific to effects target profiles:
- Types supported in version 4.0+:
- BlendState
- ComputeShader, DomainShader, GeometryShader, and HullShader
- DepthStencilState
- RasterizerState
- State application functions implemented for version 4.0+ effects:
- OMSetRenderTargets()
- SetBlendState()
- SetComputeShader(), SetDomainShader(), SetGeometryShader(),
SetHullShader(), SetPixelShader(), and SetVertexShader()
- SetDepthStencilState()
- SetRasterizerState()
- String types. These are mainly used for annotations.
- Annotations on global variables.
- Support for the ‘Texture’ field of the ‘SamplerState’ type.
- Support for NULL values.
- Stores to swizzled matrix variables.
- The ‘unsigned’ type modifier is supported. (For example,
‘unsigned int’.) Note that ‘uint’ and related types were already
supported.
- ‘ConstantBuffer<>’ types.
- The ‘SV_Coverage’ output semantic for fragment shaders.
- GatherCmp()
- GatherCmpAlpha(), GatherCmpBlue(), GatherCmpGreen(), and GatherCmpRed()
- InterlockedAdd(), InterlockedAnd(), InterlockedCompareExchange(),
InterlockedCompareStore(), InterlockedExchange(), InterlockedMax(),
InterlockedMin(), InterlockedOr(), and InterlockedXor()
- isinf()
- Separate resource and sampler support for shader model 1-3 target
profiles.
- Casts on the left hand side of assignments.
- Reassociation and redistribution of constants in binary expressions, to
facilitate constant folding.
- Packing of interstage I/O variables with the ‘SV_IsFrontFace’,
‘SV_PrimitiveID’, ‘SV_RenderTargetArrayIndex’, ‘SV_SampleIndex’, and
‘SV_ViewPortArrayIndex’ semantics matches d3dcompiler/fxc more closely.
- Parser support for the ‘LineStream’, ‘PointStream’, and ‘TriangleStream’
Stream-Output objects.
- The experimental DXIL source type supports quad group operations.
- A number of instructions have been implemented for the experimental MSL
target. Although more and more shaders are starting to work, support is
still fairly limited. For example, shader resource views and unordered
access views are still entirely unsupported.
- The Direct3D shader model 2-3 ‘texldb’ instruction is correctly disassembled
when outputting Direct3D shader assembly.
- Shader code generation for fixed-function fog. Like the existing shader code
generation for other fixed-function features, this is mainly relevant for
executing shader model 1-3 sources in modern target environments like
Vulkan.
- New interfaces:
- The vkd3d_shader_parameter_info structure extends the
vkd3d_shader_compile_info structure, and can be used to specify shader
parameters. This is a more generic version of the shader parameter
interface for SPIR-V targets in struct vkd3d_shader_spirv_target_info.
- The VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32 enumeration value specifies
that a shader parameter contains 32-bit floating-point data.
- The VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_FUNC shader parameter
specifies the alpha test function.
- The VKD3D_SHADER_PARAMETER_NAME_ALPHA_TEST_REF shader parameter
specifies the alpha test reference value.
- The VKD3D_SHADER_PARAMETER_NAME_FLAT_INTERPOLATION shader parameter
specifies the interpolation mode for colour inputs in Direct3D shader
model 1-3 fragment shaders.
- The VKD3D_SHADER_PARAMETER_TYPE_BUFFER enumeration value specifies that
the value of a shader parameter is provided at run-time through a buffer
resource.
- The ‘fx’ parser can parse binary effects containing inline shader blobs.
### Changes since vkd3d 1.12:
```
Anna (navi) Figueiredo Gomes (6):
vkd3d-shader/ir: Periodically flush buffers when tracing blocks.
Add a .editorconfig file.
vkd3d: Use D3D12_SHADER_VISIBILITY_ALL for 32-bit root constants when using vk_heaps.
vkd3d-shader/spirv: Avoid decorating variables multiple times with NonReadable.
vkd3d-shader/spirv: Use unique SPIR-V variables for descriptors where visibility differs.
vkd3d-shader/spirv: Avoid decorating variables multiple times with Coherent.
- Internal validator support for validating I/O signatures, as well as I/O
source and destination parameters. The validator is enabled by the
‘force_validation’ option, specified through the VKD3D_SHADER_CONFIG
environment variable.
Atharva Nimbalkar (2):
vkd3d-shader/glsl: Implement VKD3DSIH_MOV.
vkd3d-shader/glsl: Implement support for VKD3DSPR_TEMP registers.
- Internal validator support for validating the number of indices used with a
register, as well as basic bounds checking for static indices.
Conor McCarthy (16):
vkd3d-shader/dxil: Implement DX intrinsic QuadOp.
vkd3d-shader/spirv: Implement the QUAD_READ_ACROSS_* instructions.
vkd3d-shader/dxil: Implement DX intrinsic QuadReadLaneAt.
vkd3d-shader/spirv: Implement the QUAD_READ_LANE_AT instruction.
tests/d3d12: Check for unaligned block texture support in test_create_committed_resource().
vkd3d: Allow block compressed textures to have unaligned width and height.
tests/d3d12: Test a null vertex buffer 'views' pointer on multiple slots.
vkd3d: Interpret a null vertex buffer 'views' pointer as a null buffer.
tests/shader-runner: Set the correct flag and format for raw UAVs.
tests/shader-runner: Create a new runner object for the shader model 6 tests.
vkd3d: Create a descriptor pool for static samplers when Vulkan-backed heaps are used.
tests: Add a test for clearing a large buffer UAV.
vkd3d: Limit the workgroup X count for buffer UAV clears to the supported max.
vkd3d: Add support for the ID3D12CommandList6 interface.
vkd3d-shader/spirv: Free the spirv parameter info.
vkd3d: Free descriptor range information on error paths in d3d12_root_signature_info_from_desc(). (Valgrind)
- New interfaces:
- The vkd3d_shader_scan_hull_shader_tessellation_info structure extends the
vkd3d_shader_compile_info structure, and can be used to retrieve the
output primitive type and partitioning mode used by a hull shader. This
information is particularly useful for specifying
vkd3d_shader_spirv_domain_shader_target_info structures when targetting
SPIR-V in OpenGL environments.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_FRAGMENT_MODE shader parameter
specifies the kind of fog to generate in a fragment shader.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_COLOUR shader parameter
specifies the fog colour.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_END shader parameter
specifies the ‘end’ parameter used for linear fog generation.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_SCALE shader parameter
specifies the ‘scale’ parameter used for fog generation.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_SOURCE shader parameter
specifies the kind of fog coordinate to output from a pre-rasterisation
shader.
### vkd3d-compiler
- The new ‘dxbc-fx’ source type specifies an effect binary embedded in a DXBC
container. This is a convenience feature;
‘vkd3d-compiler -x dxbc-fx blob.dxbc’ is equivalent to
‘vkd3d-dxbc -x t:FX10 blob.dxbc | vkd3d-compiler -x fx’.
Elizabeth Figura (39):
vkd3d-shader/hlsl: Add a hlsl_fixme() for 5.1 resource arrays.
vkd3d-shader/hlsl: Put constant buffers into the extern_resources struct.
vkd3d-shader: Write SM5.1 register indices.
vkd3d-shader/hlsl: Allocate register spaces for constant buffers.
vkd3d-shader/hlsl: Allocate register spaces for objects.
vkd3d-shader: Write SM5.1 register spaces.
vkd3d-shader/hlsl: Write SM5.1 binding reflection data.
tests: Add reflection tests for register space.
vkd3d-shader/hlsl: Always initialize $$ when parsing modifiers from an arbitrary string.
tests: Stop probing all pixels when drawing a uniform colour.
tests: Run combined-samplers.shader_test on sm1 as well.
tests: Add another combined sampler test.
vkd3d-shader/hlsl: Respect the coords writemask in write_sm1_resource_load().
vkd3d-shader/hlsl: Only allocate the aligned size for uniforms.
vkd3d-shader/hlsl: Separate an "array" rule.
vkd3d-shader/d3dbc: Use enum vkd3d_shader_register_type in struct sm1_instruction.
tests/shader_runner: Use resource->width instead of resource->size for buffer width.
tests/shader_runner: Factor out a resource_desc structure.
tests: Implement multisampling in the Vulkan renderer.
tests: Implement multisampling in the GL renderer.
vkd3d-shader/hlsl: Implement the GetRenderTargetSampleCount() intrinsic.
vkd3d-shader/hlsl: Implement output SV_Coverage.
vkd3d-shader: Introduce struct vkd3d_shader_parameter_info and struct vkd3d_shader_parameter1.
include: Document shader parameters.
vkd3d-shader/spirv: Support passing shader parameters through uniform buffers.
tests: Add a test for the vkd3d_shader_parameter APIs.
vkd3d-shader/spirv: Respect VKD3D_SHADER_CONDITIONAL_OP_Z when discard has a bool argument.
vkd3d-shader: Allow controlling alpha test through vkd3d-shader parameters.
tests: Offset the viewport by 0.5 when running d3dbc shaders.
tests: Factor out a set_default_target() helper.
tests: Test alpha test.
vkd3d-shader/spirv: Allocate output_info after normalization.
vkd3d-shader: Factor out a vsir_program_get_parameter() helper.
vkd3d-shader/spirv: Pass a vkd3d_data_type to spirv_compiler_emit_shader_parameter().
vkd3d-shader: Do not make the alpha test ref parameter VSIR_DIMENSION_VEC4.
vkd3d-shader: Use the program parameters in spirv_compiler_alloc_spec_constant_id().
vkd3d-shader: Allow controlling d3d color shade mode through vkd3d-shader parameters.
tests: Test shade mode.
vkd3d-shader: Use an extended version of vkd3d_shader_immediate_constant in vkd3d_shader_parameter1.
### Changes since vkd3d 1.14:
```
Anna (navi) Figueiredo Gomes (6):
vkd3d-shader/hlsl: Implement cast from bool to int for SM1.
tests/hlsl: Add GatherCmp() tests.
vkd3d-shader/hlsl: Implement the GatherCmp() methods.
tests/shader_runner: Add a "mesa<23.3" tag.
tests/hlsl: Add mixed argument size tests.
vkd3d-shader/hlsl: Consider conversions across all parameters in function_compare().
Francisco Casas (52):
vkd3d-shader/hlsl: Record default values for uniforms and constant buffers.
vkd3d-shader/hlsl: Initialize default values with braceless initializers.
tests: Test default values using reflection.
vkd3d-shader/tpf: Write default values for SM4.
vkd3d-shader/d3dbc: Write default values for SM1.
tests: Test matrix default value initializers.
vkd3d-shader/hlsl: Fix numeric register offset for matrix components.
vkd3d-shader/hlsl: Reorder default values for matrices for SM4.
tests: Test register reservations on unused variables.
vkd3d-shader/hlsl: Only error out on bind_count register reservation overlaps for SM1.
vkd3d-shader/d3dbc: Split hlsl_sm1_write().
vkd3d-shader/hlsl: Generate CTAB outside d3dbc_compile().
vkd3d-shader/d3dbc: Introduce struct d3dbc_compiler.
vkd3d-shader/d3dbc: Use program->shader_version instead of ctx->profile.
vkd3d-shader/d3dbc: Don't require a hlsl_semantic to get register and usage.
vkd3d-shader/d3dbc: Use vsir_program I/O signatures to write dcls.
vkd3d-shader/d3dbc: Don't write inconsequential MOVs.
vkd3d-shader/hlsl: Free array sizes on function parameters (Valgrind).
tests: Separate the valid stateblock function names test from the string arg test.
vkd3d-shader/hlsl: Parse function call syntax on state blocks.
tests: Test whether valid state block function names are case-sensitive.
vkd3d-shader/hlsl: Validate state block function calls.
vkd3d-shader/hlsl: Add missing src1 and src2 constants to sincos on SM2.
tests: Test string escape sequences.
vkd3d-shader/hlsl: Parse string constants.
vkd3d-shader/hlsl: Parse string escape sequences.
vkd3d-shader/hlsl: Parse string type.
tests: Add missing double precission require directives.
tests: Report tests skipped because of missing capabilities.
tests/shader-runner: Add missing trace for wave_ops caps.
tests: Introduce VKD3D_TEST_DETAILED for the test driver.
vkd3d-shader/hlsl: Avoid dereferencing rel_offset if it is NULL.
tests: Add additional non-constant array indexing tests.
vkd3d-shader/hlsl: Lower non-constant array loads for SM1.
vkd3d-shader/hlsl: Remove SM1 fixme for matrix writemasks.
vkd3d-shader/hlsl: Lower non-constant row_major matrix loads for SM1.
tests: Add additional string tests.
vkd3d-shader/hlsl: Parse string default values.
vkd3d-shader/hlsl: Skip writing string default values.
vkd3d-shader/hlsl: Always work with the extern resource's component type.
vkd3d-shader: Avoid div by zero on assert in vkd3d_calloc() (ubsan).
tests: Add additional tests for function calls in state block rhs.
tests: Test shader compilation within function definitions.
tests: Test compile syntax on effects.
tests: Test shader compilation within braces.
tests: Test shader compilation with default values.
tests/shader_runner: Require explicit formats for UAV resources.
tests/shader_runner: Move parse_format() up.
tests/shader_runner: Replace spaces with dashes in format names.
tests/shader_runner: Don't skip shader compilation on missing caps.
tests/shader_runner: Explicitly require UAV load support.
tests/test-driver: Avoid double space when printing details.
Conor McCarthy (29):
vkd3d: Store only a single vkd3d descriptor type in each Vulkan descriptor set.
vkd3d: Introduce struct vkd3d_vk_descriptor_pool_array.
vkd3d: Introduce vkd3d_vk_descriptor_pool_array_push_array().
vkd3d: Introduce vkd3d_vk_descriptor_pool_array_push().
vkd3d: Introduce vkd3d_vk_descriptor_pool_array_pop().
vkd3d: Introduce vkd3d_vk_descriptor_pool_array_destroy_pools().
vkd3d: Create separate descriptor pools for each vkd3d descriptor type.
vkd3d: Create descriptor pools of geometrically increasing size.
tests/hlsl: Add float64 wave op tests.
tests/hlsl: Add uint64 wave op tests.
tests/hlsl: Add int64 wave op tests.
vkd3d-shader/dxil: Implement DX intrinsic EvalSampleIndex.
vkd3d-shader/dxil: Implement DX intrinsic EvalCentroid.
vkd3d: Return the correct depth/stencil plane format from GetCopyableFootprints().
vkd3d: Return correctly aligned depth/stencil sizes from GetCopyableFootprints().
vkd3d: Do not require the ALLOW_DEPTH_STENCIL flag for depth/stencil formats in GetCopyableFootprints().
tests/hlsl: Add a test for SV_RenderTargetArrayIndex.
vkd3d-shader/dxil: Handle SV_RenderTargetArrayIndex.
tests/hlsl: Pass a profile string instead of a shader type to dxc_compiler_compile_shader().
tests/hlsl: Add some arithmetic uint16 shader tests.
tests/hlsl: Add more arithmetic uint16 tests.
tests/hlsl: Add arithmetic int16 tests.
tests/hlsl: Add arithmetic float16 tests.
tests/hlsl: Add a numeric types 16-bit test.
tests/hlsl: Add constant buffer 16-bit tests.
tests/hlsl: Add GetDimensions() 16-bit tests.
tests/hlsl: Add typed buffer UAV 16-bit tests.
tests/hlsl: Add a raw buffer UAV 16-bit test.
tests/hlsl: Add structured buffer UAV 16-bit tests.
Giovanni Mascellani (57):
tests: Mark some root signature unbounded range failures as todo on MoltenVK.
vkd3d: Do not request VK_EXT_debug_marker if debug is disabled.
vkd3d: Enable VK_KHR_portability_subset if available.
vkd3d: Do not synchronize with the geometry shader stage if it's not enabled.
ci: Assume an Apple Silicon-based environment for the macOS CI job.
tests: Skip sampling cube textures on Qualcomm.
tests: Transition resources to PIXEL_SHADER_RESOURCE in test_sample_c_lz().
tests: Check that depth/stencil formats are supported before using them.
vkd3d: Do not synchronize with the tessellation shader stages if they're not enabled.
tests: Improve feedback when enabling d3d12 debug layers.
tests: Enable the d3d12 debug layer message callbacks.
tests: Support using the Agility SDK in the crosstests.
vkd3d: Propagate a failure in d3d12_descriptor_heap_init().
tests: Define WIDL macros in utils.h.
vkd3d: Allocate temporary arrays on the stack in d3d12_command_list_update_push_descriptors().
tests: Pad the constant buffer in test_update_compute_descriptor_tables() to 256 bytes.
tests: Terminate the Agility SDK path with a slash.
vkd3d: Document how to install "Graphics Tools" to use the Agility SDK.
vkd3d: Rebuild the vkd3d_physical_device_info chain before creating the device.
vkd3d: Remove the temporary pointers in vkd3d_physical_device_info_init().
vkd3d: Propagate errors out of d3d12_root_signature_append_vk_binding().
vkd3d: Disable WARN_ON() when VKD3D_NO_DEBUG_MESSAGES is defined.
vkd3d: Disable FIXME_ONCE() when VKD3D_NO_DEBUG_MESSAGES is defined.
vkd3d: Allow disabling ERR() by defining VKD3D_NO_ERROR_MESSAGES.
vkd3d: Introduce debug severity MESSAGE.
vkd3d: Introduce a softer form of assertion.
vkd3d: Allow aborting on ERR().
vkd3d: Emit an ERR() when reaching unreachable code.
ci: Abort on assertions on the CI.
tests: Test register conflicts in a root signature.
vkd3d: Replace assert() with VKD3D_ASSERT() in command.c.
vkd3d: Replace assert() with VKD3D_ASSERT() in resource.c.
vkd3d: Replace assert() with VKD3D_ASSERT() in state.c.
vkd3d: Replace assert() with VKD3D_ASSERT() in utils.c.
vkd3d: Replace assert() with VKD3D_ASSERT() in vkd3d_private.h.
vkd3d-common: Remove an assertion in vkd3d_dbg_printf().
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in checksum.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in d3d_asm.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in d3dbc.c
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in dxbc.c.
tests: Mark a couple of tests as working on recent NVIDIA GPUs.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in dxil.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in fx.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in hlsl_codegen.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in hlsl_constant_ops.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in hlsl.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in hlsl.h.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in hlsl.y.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in ir.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in preproc.h.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in preproc.l.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in preproc.y.
vkd3d: Check the entire root signature for register conflicts.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in spirv.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in tpf.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in vkd3d_shader_main.c.
vkd3d-shader: Replace assert() with VKD3D_ASSERT() in vkd3d_shader_private.h.
Elizabeth Figura (65):
vkd3d-shader/spirv: Handle SSA registers in spirv_compiler_get_register_info().
vkd3d-shader/ir: Allow controlling fog through parameters.
vkd3d-shader/ir: Add a couple of traces for signature remapping.
vkd3d-shader/ir: Allow controlling the fog source through a parameter.
vkd3d-shader/ir: Implement exponential fog.
vkd3d-shader/hlsl: Do not abort when modifying a const expression.
vkd3d-shader/hlsl: Do not abort parsing when invalid modifiers are used.
vkd3d-shader/hlsl: Move the numeric type check to add_constructor().
vkd3d-shader/hlsl: Return an error expression when a function is used as a variable.
vkd3d-shader/hlsl: Translate invalid implicit-size arrays to an error type.
vkd3d-shader/d3dbc: Omit unnecessary instruction maximum versions.
vkd3d-shader/d3dbc: Mark some more instructions as version-limited.
vkd3d-shader: Fix the disassembly names of IFC and BREAKC.
vkd3d-shader: Correct the disassembly for POSITIONT.
tests: Add a reflection test for shader model 4.0.
vkd3d-shader/hlsl: Remove unused expr ops.
vkd3d-shader/ir: Always initialise "*control_point_count" in vsir_signature_from_register_type().
vkd3d-shader/hlsl: Document matrix swizzles.
vkd3d-shader/hlsl: Use a structure for matrix swizzles.
vkd3d-shader/hlsl: Use swizzle helpers in more places.
vkd3d-shader/hlsl: Store swizzles in vsir format.
tests/shader_runner: Use is_todo instead of separate shader states.
tests/shader_runner: Use a separate variable for shader type.
tests/shader_runner: Don't bother distinguishing directive substrings.
vkd3d-shader/d3dbc: Use struct vkd3d_shader_dst_param instead of struct sm1_dst_register.
vkd3d-shader/d3dbc: Use struct vkd3d_shader_src_param instead of struct sm1_src_register.
vkd3d-shader/d3dbc: Use struct vkd3d_shader_instruction instead of struct sm1_instruction.
tests/shader_runner: Record HLSL todo/fail state for each shader model.
tests/shader_runner: Test HLSL compilation in a separate pass.
tests/shader_runner: Test versions where the compilation result changes.
tests: Use fail(sm<5) instead of [require] for uav-atomics.
vkd3d-shader/spirv: Correctly implement DTOF.
vkd3d-shader/spirv: Correctly implement DTOI.
vkd3d-shader/spirv: Correctly implement DTOU.
tests/d3d12: Make the dtof test a bit more interesting.
vkd3d-shader: Explicitly translate between d3dbc and vsir register types.
vkd3d-shader/d3dbc: Normalize to a single VKD3DSPR_CONST register set when reading.
vkd3d-shader/d3d-asm: Define register names in a table.
vkd3d-shader/ir: Separate VKD3DSPR_ADDR and VKD3DSPR_TEXTURE.
vkd3d-shader/ir: Separate VKD3DSPR_OUTPUT and VKD3DSPR_TEXCRDOUT.
vkd3d-shader/d3dbc: Introduce d3dbc_parse_register().
vkd3d-shader/hlsl: Avoid some uses of the default case when switching over hlsl_base_type.
vkd3d-shader/d3dbc: Do not access the type dimensions for non-numeric types.
vkd3d-shader/hlsl: Move the "dimx" and "dimy" fields to the type-specific union.
tests: Adjust angle-unit.shader_test to pass with 1.x.
tests: Adjust arithmetic-float.shader_test to pass with 1.x.
tests: Adjust arithmetic-float-uniform.shader_test to pass with 1.x.
tests: Adjust arithmetic-int.shader_test to pass with 1.x.
tests: Adjust array-parameters.shader_test to pass with 1.x.
tests: Adjust array-size-expr.shader_test to pass with 1.x.
tests: Adjust abs.shader_test to pass with 1.x.
tests: Add another unrolling test.
vkd3d-shader/hlsl: Implement broadcasts in constant folding.
vkd3d-utils: Fix matrix packing precedence in D3DCompile2VKD3D().
vkd3d-shader/hlsl: Use the casted value in exp().
tests: Add some stress tests for scope and variable definition.
vkd3d-shader/hlsl: Do not define a separate scope for function parameters.
vkd3d-shader/hlsl: Factor out the error message into hlsl_add_var().
vkd3d-shader/hlsl: Do not abort on variable redefinition.
vkd3d-shader/hlsl: Handle error instructions in add_shader_compilation().
vkd3d-shader/hlsl: Add an add_switch() helper.
vkd3d-shader/hlsl: Handle error instructions in add_switch().
vkd3d-shader/hlsl: Pass the block to add_zero_mipmap_level().
vkd3d-shader/hlsl: Use a block in prepend_input_var_copy().
vkd3d-shader/hlsl: Use a block in hlsl_normalize_binary_exprs().
Henri Verbeet (9):
vkd3d-shader/ir: Rename the "handler_idx" field of struct vkd3d_shader_instruction to "opcode".
vkd3d: Always use UINT views to clear UAVs with integer formats.
vkd3d-shader/ir: Remove VKD3DSIH_DCL instructions.
vkd3d-shader/ir: Remove VKD3DSIH_DCL_SAMPLER instructions.
vkd3d-common: Replace assert() with VKD3D_ASSERT().
vkd3d-shader/fx: Replace assert() with VKD3D_ASSERT().
vkd3d: Do not include assert.h.
build: Actually run bitwise-assignment.shader_test.
vkd3d-shader/spirv: Decorate non-array descriptor variables as well.
Feifan He (46):
vkd3d-shader/msl: Implement VKD3DSIH_ADD.
vkd3d-shader/msl: Implement support for VKD3DSPR_IMMCONST registers.
vkd3d-shader/msl: Implement support for VKD3DSPSM_ABS modifiers.
vkd3d-shader/msl: Implement VKD3DSIH_AND.
vkd3d-shader/msl: Implement VKD3DSIH_NEU.
vkd3d-shader/msl: Implement support for VSIR_DIMENSION_VEC4 immediate constants.
vkd3d-shader/msl: Implement VKD3DSIH_MUL.
vkd3d-shader/msl: Implement VKD3DSIH_INE.
vkd3d-shader/msl: Implement VKD3DSIH_OR.
vkd3d-shader/msl: Implement VKD3DSIH_DIV.
vkd3d-shader/msl: Implement support for VKD3DSPSM_NEG modifiers.
vkd3d-shader/msl: Implement VKD3DSIH_GEO.
vkd3d-shader/msl: Implement VKD3DSIH_FRC.
vkd3d-shader/msl: Implement VKD3DSIH_MOVC.
vkd3d-shader/msl: Implement VKD3DSIH_ITOF.
vkd3d-shader/msl: Implement VKD3DSIH_FTOI.
vkd3d-shader/msl: Implement VKD3DSIH_UTOF.
vkd3d-shader/msl: Implement VKD3DSIH_FTOU.
vkd3d-shader/msl: Implement VKD3DSIH_ROUND_PI.
vkd3d-shader/msl: Implement VKD3DSIH_ROUND_Z.
tests/shader_runner_metal: Implement depth texture and state.
tests/shader_runner_metal: Implement clears.
vkd3d-shader/msl: Implement support for the VKD3DSPR_DEPTHOUT register.
vkd3d-shader/msl: Implement VKD3DSIH_DP3.
vkd3d-shader/msl: Implement VKD3DSIH_DP4.
vkd3d-shader/msl: Implement VKD3DSIH_DP2.
vkd3d-shader/msl: Implement VKD3DSIH_SQRT.
vkd3d-shader/msl: Handle the VKD3DSIM_LINEAR interpolation modifier on inputs.
vkd3d-shader/msl: Implement VKD3DSIH_IEQ.
vkd3d-shader/msl: Implement VKD3DSIH_EXP.
vkd3d-shader/msl: Implement VKD3DSIH_LTO.
vkd3d-shader/msl: Implement VKD3DSIH_ROUND_NI.
vkd3d-shader/msl: Implement VKD3DSIH_IF and VKD3DSIH_ENDIF.
vkd3d-shader/msl: Implement VKD3DSIH_ROUND_NE.
vkd3d-shader/msl: Handle SV_IS_FRONT_FACE inputs.
vkd3d-shader/msl: Implement VKD3DSIH_LOG.
vkd3d-shader/msl: Implement VKD3DSIH_MAX.
vkd3d-shader/msl: Implement VKD3DSIH_MIN.
vkd3d-shader/msl: Implement VKD3DSIH_RSQ.
vkd3d-shader/msl: Implement VKD3DSIH_NOT.
vkd3d-shader/msl: Implement VKD3DSIH_ELSE.
vkd3d-shader/msl: Implement support for VKD3DSPDM_SATURATE modifiers.
vkd3d-shader/msl: Implement VKD3DSIH_MAD.
vkd3d-shader/msl: Implement VKD3DSIH_ISHL.
vkd3d-shader/msl: Implement VKD3DSIH_ISHR.
vkd3d-shader/msl: Implement VKD3DSIH_USHR.
Nikolay Sivov (66):
vkd3d-shader/hlsl: Handle "unsigned int" type.
tests: Add some basic tests for ConstantBuffer type.
tests: Add a few tests for the NULL value.
vkd3d-shader/fx: Do not write shared buffers block when not compiling as a child effect.
vkd3d-shader/hlsl: Implement tex2Dbias().
vkd3d-shader/asm: Output 'bias' flag for 'texld'.
vkd3d-shader/d3dbc: Write load instruction for tex2Dbias().
vkd3d-shader/hlsl: Store original semantic name.
vkd3d-shader/fx: Use original full semantic name.
vkd3d-shader/fx: Set EXPLICIT_BIND_POINT flag for packoffset() reservations as well.
vkd3d-shader/fx: Fix variable buffer offset value.
vkd3d-shader/hlsl: Add support for ConstantBuffer<> type.
vkd3d-shader/fx: Cast state block field values to target type.
vkd3d-shader/fx: Add support for writing DepthStencilState objects.
vkd3d-shader/hlsl: Add RasterizerState type.
vkd3d-shader/fx: Add support for writing RasterizerState objects.
vkd3d-shader: Implement tex*() functions variants with gradient arguments.
vkd3d-shader/hlsl: Implement tex*grad() functions.
vkd3d-shader/fx: Fix structure type data written for fx_4.
vkd3d-shader/fx: Write default numeric values.
vkd3d-shader/fx: Fix packed size for fx_4+ types.
vkd3d-shader/fx: Preserve parsing order of initializer components.
vkd3d-shader/fx: Add missing fields for structure types on fx_5_0.
vkd3d-shader/hlsl: Do not crash on initialization of a redefined variable.
vkd3d-shader/hlsl: Set default values for annotations variables.
vkd3d-shader/fx: Write annotations for fx_4+ profiles.
tests: Add some fx profiles tests for structure types containing objects.
vkd3d-shader: Disallow object structure fields for fx profiles.
vkd3d-shader/fx: Do not output empty strings for missing semantics for fx_2_0.
vkd3d-shader/hlsl: Allow annotations on global variables.
vkd3d-shader/fx: Correct empty pass check.
vkd3d-shader/fx: Set total pass count for fx_2_0.
vkd3d-shader/fx: Correct one of the object counters in the fx_2_0 header.
vkd3d-shader/fx: Decompose function-style state assignments to individual states.
vkd3d-shader/fx: Handle SetRasterizerState().
vkd3d-shader/hlsl: Add parser support for ComputeShader, DomainShader, and HullShader types.
vkd3d-shader/fx: Fix state block entry array shifting when decomposing.
vkd3d-shader/fx: Add support for SetDomainShader(), SetComputeShader(), and SetHullShader() states.
vkd3d-shader/fx: Handle "Texture" field of the sampler state objects.
vkd3d-shader/fx: Use more descriptive names for FX-specific types.
vkd3d-shader/fx: Add an array size field to the states description table.
vkd3d-shader/fx: Add support for the OMSetRenderTargets() state.
vkd3d-shader/hlsl: Add parser support for GeometryShader type.
vkd3d-shader/fx: Check destination array index when checking for duplicate state entries.
vkd3d-shader/hlsl: Add parser support for BlendState type.
vkd3d-shader/fx: Enable writing BlendState variables.
vkd3d-shader/fx: Run full set of constants passes on state block entries values.
vkd3d-shader/fx: Handle states of a BlendState object.
vkd3d-shader/fx: Explicitly handle bool values in state entries.
vkd3d-shader/fx: Turn assignments to arrays to element assignments for certain states.
vkd3d-shader/hlsl: Check MS texture declaration without sample count only for used variables.
vkd3d-shader/hlsl: Handle NULL constants.
vkd3d-shader/hlsl: Add a test for assigning to DSV and RTV variables.
vkd3d-shader/hlsl: Tokenize 'String' the same as 'string'.
vkd3d-shader/hlsl: Treat "string" type name as case-insensitive.
vkd3d-shader/fx: Enable writing string objects for fx_4+.
vkd3d-shader/fx: Support string annotations for fx_4+.
vkd3d-shader/fx: Handle SetBlendState().
vkd3d-shader/fx: Handle SetPixelShader() and SetVertexShader().
vkd3d-shader/hlsl: Adjust NULL type properties to make it usable in transformations.
vkd3d-shader/fx: Support NULL constants for object fields.
vkd3d-shader/fx: Resolve NULL values for SamplerState.Texture field.
vkd3d: Fix a few typos in the comments.
vkd3d-shader/glsl: Fix a typo in a few messages.
include: Fix a few typos in the IDL files.
vkd3d-shader/fx: Fix the matrix type class for fx_2_0.
Francisco Casas (55):
vkd3d-shader/tpf: Remove HLSL_IR_SWIZZLE handling.
vkd3d-shader/hlsl: Store SM4 stores in the vsir program.
vkd3d-shader/hlsl: Store SM4 loads in the vsir program.
vkd3d-shader/hlsl: Store SM4 resource stores in the vsir program.
tests: Test signature reflection for PRIMID, RTINDEX and VPINDEX.
vkd3d-shader/hlsl: Add special allocation rules for PRIMID, RTINDEX, and VPINDEX.
tests: Test allocation rules for FFACE and SAMPLE.
vkd3d-shader/hlsl: Add special allocation rules for FFACE and SAMPLE.
vkd3d-shader/hlsl: Store SM4 HLSL_RESOURCE_LOADs in the vsir program.
vkd3d-shader/hlsl: Store SM4 HLSL_RESOURCE_SAMPLEs in the vsir program.
vkd3d-shader/hlsl: Store SM4 HLSL_RESOURCE_GATHERs in the vsir program.
vkd3d-shader/hlsl: Store SM4 HLSL_RESOURCE_SAMPLE_INFOs in the vsir program.
vkd3d-shader/hlsl: Store SM4 HLSL_RESOURCE_RESINFOs in the vsir program.
vkd3d-shader/hlsl: Store SM4 jumps in the vsir program.
vkd3d-shader/tpf: Apply extra bits to all conditional ops.
vkd3d-shader/hlsl: Migrate SM4 control flow instructions to the vsir program.
vkd3d-shader/hlsl: Remove hlsl_ir_vsir_instruction_ref, again.
vkd3d-shader/dxbc: Parse the SFI0 ROV requirement.
vkd3d-shader/hlsl: Store ROV feature requirement in the vsir_program.
vkd3d-shader/hlsl: Store the global flags in the vsir program.
vkd3d-shader/hlsl: Store SM4 sampler declarations in the vsir program.
vkd3d-shader/hlsl: Store SM4 texture declarations in the vsir program.
tests: Add additional sampler allocation tests for SM1.
tests: Test sampler array allocation.
vkd3d-shader/hlsl: Lower separated samplers for SM1.
vkd3d-shader/hlsl: Support combined samplers from texture arrays.
vkd3d-shader/hlsl: Allocate samplers by decreasing bind count in SM1.
vkd3d-shader/hlsl: Allow lowering separate sampler arrays on deref offset 0.
vkd3d-shader/hlsl: Store SM4 constant buffer declarations in vsir program.
vkd3d-shader/hlsl: Generate RDEF outside tpf_compile().
vkd3d-shader/hlsl: Generate CTAB outside sm1_generate_vsir().
vkd3d-shader/hlsl: Store hull and domain shader properties in vsir_program.
vkd3d-shader/tpf: Remove hlsl_ctx from tpf_compiler.
vkd3d-shader/hlsl: Lower sample lods for SM1.
vkd3d-shader/ir: Properly lower texldb.
tests/hlsl: Test tex2Dproj().
vkd3d-shader/ir: Properly lower texldp.
vkd3d-shader: Avoid passing NULL to memcpy(). (ubsan)
vkd3d-shader: Avoid passing NULL to qsort(). (ubsan)
vkd3d-shader: Avoid passing NULL to memset(). (ubsan)
vkd3d-shader: Avoid left shifting signed integers. (ubsan)
tests: Test SampleGrad() on ps_3_0.
vkd3d-shader/hlsl: Lower separate SampleGrad() for SM1.
vkd3d-shader/hlsl: Don't lower separate samples with texel offsets.
tests: Test casting negative floats to int.
vkd3d-shader/hlsl: Properly lower casts to int for negative numbers.
vkd3d-shader/hlsl: Specialize lowering SM1 casts to int for vertex shaders.
tests/hlsl: Add lhs cast tests.
tests/hlsl: Test partial assignments due to lhs casts.
tests/hlsl: Add more function cast tests.
vkd3d-shader/hlsl: Delay lowering complex casts until after parse time.
vkd3d-shader/hlsl: Support non-size-changing lhs casts.
vkd3d-shader/hlsl: Don't count cast to param type on IN as part of OUT var's lhs.
vkd3d-shader/hlsl: Don't forbid first base type cast on var assignments.
tests/shader_runner: Pass the correct buffer size to swprintf() in dxc_compiler_compile_shader().
Petrichor Park (5):
vkd3d-shader/hlsl: Implement the faceforward() intrinsic.
vkd3d-shader/hlsl: Implement tests for the rcp() intrinsic.
vkd3d-shader/hlsl: Implement the rcp() intrinisic.
vkd3d-shader/tpf: Implmenent HLSL_OP1_RCP.
vkd3d-shader/hlsl: Factor out add_binary_expr() and use it for assignment operators.
Giovanni Mascellani (87):
vkd3d-shader/ir: Validate the semantic index for tessellation system values.
vkd3d-shader/ir: Check that semantic indices for tessellation system values are not duplicated.
vkd3d-shader/ir: Keep track of the tessellator domain in struct vsir_program.
vkd3d-shader/ir: Validate tessellation system values for the given tessellator domain.
vkd3d-shader/ir: Check that tessellation system values only appear in the patch constant signature.
vkd3d-shader/ir: Validate index count for PRIMID registers.
vkd3d-shader/ir: Validate index count for OUTPOINTID registers.
vkd3d-shader/ir: Validate index count for FORKINSTID registers.
vkd3d-shader/ir: Validate index count for JOININSTID registers.
vkd3d-shader/ir: Validate index count for TESSCOORD registers.
vkd3d-shader/ir: Validate index count for THREADID registers.
vkd3d-shader/ir: Validate index count for THREADGROUPID registers.
vkd3d-shader/ir: Validate index count for LOCALTHREADID registers.
vkd3d-shader/ir: Validate index count for LOCALTHREADINDEX registers.
vkd3d-shader/ir: Check that all tessellation system values appear in the patch constant signature.
vkd3d-shader/ir: Check that tessellation system value registers are consecutive.
vkd3d-shader/ir: Validate index count for COVERAGE registers.
vkd3d-shader/ir: Validate index count for SAMPLEMASK registers.
vkd3d-shader/ir: Validate index count for GSINSTID registers.
vkd3d-shader/ir: Validate index count for WAVELANECOUNT registers.
vkd3d-shader/ir: Validate index count for WAVELANEINDEX registers.
vkd3d-shader/ir: Validate index count for OUTSTENCILREF registers.
vkd3d-shader/dxil: Emit register SAMPLEMASK for output sysval SV_Coverage.
vkd3d-shader/ir: Validate the register type for DCL_INPUT instructions.
vkd3d-shader/ir: Validate the register type for DCL_INPUT_SIV instructions.
vkd3d-shader/ir: Validate the register type for DCL_INPUT_SGV instructions.
vkd3d-shader/ir: Validate the register type for DCL_INPUT_PS instructions.
vkd3d-shader/ir: Validate the register type for DCL_INPUT_PS_SIV instructions.
vkd3d-shader/ir: Validate the register type for DCL_INPUT_PS_SGV instructions.
vkd3d-shader/ir: Validate the register type for DCL_OUTPUT instructions.
vkd3d-shader/ir: Validate the register type for DCL_OUTPUT_SIV instructions.
vkd3d-shader/ir: Synthesize the default control point phase in the HS control point I/O normaliser.
vkd3d-shader/ir: Evaluate OUTCONTROLPOINT usage in the patch constant phase directly.
tests: Use plain skip() when skipping a test in the shader runner.
tests: Print the file name instead of the test name in test logs.
vkd3d-shader/spirv: Merge emitting input and output registers.
vkd3d-shader/ir: Encode I/O declarations in vsir_program.
vkd3d-shader/ir: Remove I/O declarations before I/O normalisation.
vkd3d-shader/ir: Remove I/O declarations before normalising hull shader control point I/O.
vkd3d-shader/ir: Remove I/O declarations before flattening hull shader phases.
vkd3d-shader/ir: Merge removing I/O declarations in the general instruction lowering pass.
vkd3d-shader/ir: Validate the control point index when it is statically known.
vkd3d: Do not use more than a few million descriptors in Vulkan heap set layouts.
vkd3d-shader/ir: Validate the array index when it is statically known.
vkd3d-shader/ir: Validate the register type for registers used as relative addresses.
vkd3d-shader/ir: Introduce a helper function to determine the signature for a register type.
vkd3d-shader/ir: Validate the DCL_INDEX_RANGE instruction.
vkd3d-shader/ir: Check that DCL_INDEX_RANGE ranges do not overlap with unrelated signature elements.
vkd3d-shader/spirv: Introduce a SPIR-V parser.
vkd3d-shader/spirv: Parse the SPIR-V magic number.
vkd3d-shader/spirv: Parse the SPIR-V version number.
vkd3d-shader/spirv: Parse the SPIR-V generator magic number.
vkd3d-shader/spirv: Parse the SPIR-V id bound.
vkd3d-shader/spirv: Parse the SPIR-V instruction schema.
vkd3d-shader/ir: Check that the DCL_INDEX_RANGE effective mask stabilizes after one iteration.
vkd3d-shader/ir: Check that signature element masks are left-aligned with in a DCL_INDEX_RANGE.
vkd3d-shader/ir: Validate the register index and count for signature elements.
vkd3d-shader/ir: Validate the signature element stream index.
vkd3d-shader/ir: Validate the signature element register index, for some sysvals.
vkd3d-shader/ir: Check that signature elements do not conflict with each other.
vkd3d-shader/ir: Give more meaningful names to I/O normalisation levels.
vkd3d-shader/d3dbc: Normalise I/O register write masks when not disassembling.
vkd3d-shader/ir: Represent information about I/O registers with a table.
vkd3d-shader/ir: Validate INPUT destination parameters using a uniform helper.
vkd3d-shader/ir: Validate PATCHCONST destination parameters using a uniform helper.
vkd3d-shader/ir: Validate OUTPUT destination parameters.
vkd3d-shader/ir: Validate INCONTROLPOINT destination parameters.
vkd3d-shader/ir: Validate OUTCONTROLPOINT destination parameters.
vkd3d-shader/ir: Remove a redundant assignment.
vkd3d-shader/ir: Simplify shader_register_normalise_arrayed_addressing().
tests/hlsl: Add tests for the EvaluateAttribute*() intrinsics.
tests/hlsl: Add some clip/cull distance tests.
vkd3d-shader/ir: Disallow array signature elements for normalisation levels < SM6.
vkd3d-shader/ir: Validate OUTPUT source parameters using a uniform helper.
vkd3d-shader/ir: Validate PATCHCONST source parameters using a uniform helper.
vkd3d-shader/ir: Validate INPUT source parameters.
vkd3d-shader/ir: Validate INCONTROLPOINT source parameters.
vkd3d-shader/ir: Validate OUTCONTROLPOINT source parameters.
vkd3d: Log the requested feature levels for D3D12_FEATURE_FEATURE_LEVELS.
vkd3d: Describe DXGI_UNKNOWN as having one plane.
vkd3d: Only call d3d12_fence_garbage_collect_vk_semaphores_locked() when using binary semaphores.
vkd3d: Release queued fences when stopping the fence worker.
vkd3d: Support signalling a fence once all outstanding work is submitted to Vulkan.
vkd3d: Explicitly call the appropriate waiting function in the fence worker.
vkd3d-shader/spirv: Interpret the write mask as a destination swizzle for double comparison operations.
vkd3d-common: Write a thread id in the log on macOS too.
ci: Explicitly install SPIRV-Tools in the macOS CI environment.
Shaun Ren (6):
vkd3d-shader/ir: Lower SM1 SINCOS to SM4 SINCOS.
vkd3d-shader/hlsl: Implement sin/cos for SM1.
vkd3d-shader/d3dbc: Implement HLSL_OP3_MAD for SM1.
vkd3d-shader/hlsl: Allocate registers for HLSL_OP1_{COS,SIN}_REDUCED with the required writemasks.
vkd3d-shader/d3dbc: Implement HLSL_OP1_{COS,SIN}_REDUCED for SM1.
vkd3d-shader/hlsl: Support default values for function parameters.
Henri Verbeet (31):
tests: Get rid of some redundant "glsl" todo's.
vkd3d-shader/hlsl: Use hlsl_error() instead of hlsl_fixme() for ambiguous function calls.
vkd3d-shader/hlsl: Introduce hlsl_dump_type().
vkd3d-shader/hlsl: Introduce hlsl_dump_ir_function_decl().
vkd3d-shader/hlsl: Output the candidates for ambiguous function calls.
vkd3d: Introduce d3d12_descriptor_set_layout_init().
vkd3d-shader/spirv: Parse SPIR-V instructions.
vkd3d: Drop smaller pools in d3d12_command_allocator_reset_descriptor_pool_array().
tests: Add yet more overload resolution tests.
vkd3d-shader/hlsl: Prefer overload candidates without component count narrowing.
vkd3d-shader/hlsl: Prefer overload candidates with matching component type classes.
vkd3d-shader/hlsl: Prefer overload candidates with matching component types.
vkd3d-shader/hlsl: Prefer overload candidates without component type narrowing.
vkd3d-shader/hlsl: Prefer overload candidates without component count widening.
vkd3d-shader/d3dbc: Separate writing the comment bytecode from write_sm1_uniforms().
vkd3d-shader/hlsl: Move CTAB generation to hlsl_codegen.c.
tests/shader_runner: Ignore the "backcompat" option for shader model 5.1+.
vkd3d-shader/hlsl: Make sm4_get_interpolation_mode() static.
vkd3d-shader/hlsl: Move sm4_get_extern_resources() to hlsl_codegen.c.
vkd3d-shader/hlsl: Move sm4_free_extern_resources() to hlsl_codegen.c.
tests/shader_runner: Do not use skip() for shader model requirements.
vkd3d-shader/hlsl: Move RDEF generation to hlsl_codegen.c.
demos: Use the assembler to embed HLSL sources.
vkd3d-shader/msl: Get rid of a stray vkd3d_string_buffer_printf() in the VEC4 UINT immediate constant handling.
vkd3d: Avoid freeing the input signature twice on error paths in d3d12_pipeline_state_init_graphics().
vkd3d-compiler: Store the target type as a struct target_type_info pointer.
vkd3d-compiler: Store the source type as a struct source_type_info pointer.
vkd3d-compiler: Introduce "dxbc-fx" as a source type.
include: Add vkd3d_shader_scan_hull_shader_tessellation_info to the list of chained compilation structures.
include: Add missing VKD3D_FORCE_32_BIT_ENUM enum elements.
vkd3d-shader/ir: Remove vForkInstanceId and vJoinInstanceId declarations in vsir_program_flatten_hull_shader_phases().
Stefan Dösinger (2):
include: Get rid of the RB_FOR_EACH* macros.
vkd3d: Pass a proper struct shader_cache_key * to rb_put() in vkd3d_shader_cache_add_entry().
Nikolay Sivov (5):
vkd3d-shader/hlsl: Add parser support for stream-output object types.
vkd3d-shader/fx: Implement parsing inline shader blobs.
vkd3d-shader/fx: Remove newlines from the parser error messages.
vkd3d-compiler: Support fx_4_0 sources embedded in DXBC containers.
vkd3d-shader/hlsl: Implement the isinf() intrinsic.
Victor Chiletto (20):
tests: Add more register reservations tests.
vkd3d-shader/hlsl: Support expressions as register offsets.
vkd3d-shader/hlsl: Pass a pointer to struct hlsl_reg_reservation in parse_reservation_index.
vkd3d-shader/hlsl: Ignore bracket offsets for 'b' register types prior to SM 5.1.
vkd3d-shader/hlsl: Do not immediately fail parsing for malformed 'b' register reservations.
vkd3d-shader/hlsl: Validate cbuffer register allocations.
vkd3d-shader/hlsl: Reserve register slots for unused buffers.
tests: Add reflection tests for register expressions.
vkd3d-shader/d3dbc: Fix implicit enum conversion warning.
tests/hlsl: Add a test for dynamically indexed multisampled texture loads.
vkd3d-shader/hlsl: Use a switch in validate_static_object_references().
vkd3d-shader/hlsl: Defer bounds checks to after copy propagation.
vkd3d-shader/hlsl: Pull evaluate_static_expression_as_uint() upwards.
vkd3d-shader/hlsl: Parse loop and unroll loop attributes.
vkd3d-shader/hlsl: Allow cloned blocks to contain external references.
vkd3d-shader/hlsl: Implement loop unrolling.
tests/hlsl: Test loop unrolling edge cases.
vkd3d-shader/hlsl: Implement the asint() intrinsic.
vkd3d-shader/hlsl: Push a new scope when compiling internal functions.
vkd3d-shader/hlsl: Implement f16tof32 intrinsic.
Shaun Ren (43):
vkd3d-shader/dxil: Allow zero domain input control point count.
vkd3d-shader: Implement scanning hull shader tessellation information.
tests/shader_runner_vulkan: Enable patch list topology support.
tests/shader_runner_gl: Implement tessellation support.
vkd3d-shader/hlsl: Implement normalization of binary expressions.
vkd3d-shader/hlsl: Collect together terms with constant coefficients.
tests/shader_runner_vulkan: Check if create_shader_stage() fails in create_compute_pipeline().
tests/shader_runner_gl: Add "opengl" tag.
tests/shader_runner_gl: Bind buffer UAVs for compute shaders.
tests/hlsl: Add a test for UAV InterlockedCompareExchange().
tests/hlsl: Add tests to check the types of the value arguments of atomic ops.
tests/hlsl: Add tests to check the void return type of atomic ops.
tests/hlsl: Add tests for valid destination types of atomic operations.
vkd3d-shader/hlsl: Implement the InterlockedAdd() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedAnd() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedCompareExchange() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedCompareStore() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedExchange() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedMax() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedMin() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedOr() intrinsic.
vkd3d-shader/hlsl: Implement the InterlockedXor() intrinsic.
vkd3d-shader/spirv: Emit the tessellator domain for domain shaders.
vkd3d-shader/hlsl: Forbid declaring parameters as both out and const.
tests: Test invalid out const parameters.
vkd3d-shader/d3d-asm: Print vocp registers with subscript.
vkd3d-shader/hlsl: Forbid declaring const variables with no initializer.
tests/hlsl: Test invalid const variables with no initializer.
vkd3d-shader/hlsl: Parse InputPatch and OutputPatch objects.
vkd3d-shader/hlsl: Validate and record InputPatch/OutputPatch types.
tests/hlsl: Test the syntax of InputPatch/OutputPatch variables.
tests/hlsl: Test passthrough hull shader control point function.
tests/hlsl: Test hull shader control point function output parameters.
tests/hlsl: Test OutputPatch usage in patch constant functions.
vkd3d-shader/hlsl: Add an "is_patch_constant_func" field to struct hlsl_ctx.
vkd3d-shader/hlsl: Implement input semantic variable copies for patch variables.
vkd3d-shader/tpf: Improve readability of compat mapping in sm4_sysval_semantic_from_semantic_name().
vkd3d-shader/hlsl: Generate vsir signature entries for patch variables.
vkd3d-shader/hlsl: Declare semantics for patch variables in vsir.
vkd3d-shader/hlsl: Allocate semantic registers for patch variables.
tests/shader_runner: Support the negation of tag matches.
vkd3d-shader/hlsl: Generate vsir registers from patch variable derefs.
tests: Test signature reflection for patch inputs in hull/domain shaders.
Yuxuan Shui (2):
tests: Pass the correct buffer size to vsnprintf() in vkd3d_test_push_context().
vkd3d-shader/hlsl: Implement storing to a swizzled matrix.
Victor Chiletto (10):
tests: Add more function overloading tests.
vkd3d-shader/hlsl: Explicitly track the copy propagation state stack.
vkd3d-shader/hlsl: Allow copy propagation to be stopped early.
vkd3d-shader/hlsl: Constant fold casts to boolean.
vkd3d-shader/hlsl: Run copy propagation incrementally during loop unrolling.
vkd3d-shader/hlsl: Do not clone the entire program for loop unrolling.
vkd3d-shader/hlsl: Remove loop_unrolling_find_unrollable_loop().
vkd3d-shader/hlsl: Partially defer continue resolution.
vkd3d-shader/hlsl: Unroll loops with conditional jumps.
vkd3d-shader/hlsl: Drop the _ir_ infix from enum hlsl_loop_unroll_type.
```
......@@ -4,6 +4,7 @@ Alistair Leslie-Hughes
Andrew Eikum
Andrey Gusev
Anna (navi) Figueiredo Gomes
Arkadiusz Hiler
Atharva Nimbalkar
Biswapriyo Nath
Brendan Shanks
......@@ -15,6 +16,7 @@ Elizabeth Figura
Ethan Lee
Evan Tang
Fabian Maurer
Feifan He
Florian Weimer
Francisco Casas
Francois Gouget
......
Copyright 2016-2024 the Vkd3d project authors (see the file AUTHORS for a
Copyright 2016-2025 the Vkd3d project authors (see the file AUTHORS for a
complete list)
Vkd3d is free software; you can redistribute it and/or modify it under
......
# What's new in vkd3d 1.15 (19 February 2025)
### libvkd3d
- New interfaces:
- vkd3d_queue_signal_on_cpu() allows a Direct3D 12 fence to be signalled
when all preceding work on a Direct3D 12 command queue has been submitted
to the corresponding Vulkan queue.
### libvkd3d-shader
- New features for the HLSL source type:
- ‘InputPatch’ and ‘OutputPatch’ tessellation shader objects. This was the
main feature required by most tessellation shaders that was still missing,
and tessellation shaders should be considered generally usable now.
- Unrolling of loops containing conditional jumps.
- Improved function overload resolution. Previously the compiler was unable
to decide between multiple function overloads with the same number of
parameters.
- The parser is able to continue parsing in a larger number of error cases.
This allows more issues in the input to be reported during a single
compilaton attempt.
- The following intrinsic functions are supported:
- GatherCmp()
- GatherCmpAlpha(), GatherCmpBlue(), GatherCmpGreen(), and GatherCmpRed()
- InterlockedAdd(), InterlockedAnd(), InterlockedCompareExchange(),
InterlockedCompareStore(), InterlockedExchange(), InterlockedMax(),
InterlockedMin(), InterlockedOr(), and InterlockedXor()
- isinf()
- Separate resource and sampler support for shader model 1-3 target
profiles.
- Casts on the left hand side of assignments.
- Reassociation and redistribution of constants in binary expressions, to
facilitate constant folding.
- Packing of interstage I/O variables with the ‘SV_IsFrontFace’,
‘SV_PrimitiveID’, ‘SV_RenderTargetArrayIndex’, ‘SV_SampleIndex’, and
‘SV_ViewPortArrayIndex’ semantics matches d3dcompiler/fxc more closely.
- Parser support for the ‘LineStream’, ‘PointStream’, and ‘TriangleStream’
Stream-Output objects.
- A number of instructions have been implemented for the experimental MSL
target. Although more and more shaders are starting to work, support is
still fairly limited. For example, shader resource views and unordered
access views are still entirely unsupported.
- Shader code generation for fixed-function fog. Like the existing shader code
generation for other fixed-function features, this is mainly relevant for
executing shader model 1-3 sources in modern target environments like
Vulkan.
- The ‘fx’ parser can parse binary effects containing inline shader blobs.
- Internal validator support for validating I/O signatures, as well as I/O
source and destination parameters. The validator is enabled by the
‘force_validation’ option, specified through the VKD3D_SHADER_CONFIG
environment variable.
- Internal validator support for validating the number of indices used with a
register, as well as basic bounds checking for static indices.
- New interfaces:
- The vkd3d_shader_scan_hull_shader_tessellation_info structure extends the
vkd3d_shader_compile_info structure, and can be used to retrieve the
output primitive type and partitioning mode used by a hull shader. This
information is particularly useful for specifying
vkd3d_shader_spirv_domain_shader_target_info structures when targetting
SPIR-V in OpenGL environments.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_FRAGMENT_MODE shader parameter
specifies the kind of fog to generate in a fragment shader.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_COLOUR shader parameter
specifies the fog colour.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_END shader parameter
specifies the ‘end’ parameter used for linear fog generation.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_SCALE shader parameter
specifies the ‘scale’ parameter used for fog generation.
- The VKD3D_SHADER_PARAMETER_NAME_FOG_SOURCE shader parameter
specifies the kind of fog coordinate to output from a pre-rasterisation
shader.
### vkd3d-compiler
- The new ‘dxbc-fx’ source type specifies an effect binary embedded in a DXBC
container. This is a convenience feature;
‘vkd3d-compiler -x dxbc-fx blob.dxbc’ is equivalent to
‘vkd3d-dxbc -x t:FX10 blob.dxbc | vkd3d-compiler -x fx’.
# What's new in vkd3d 1.14 (21 November 2024)
### libvkd3d
- Depth bounds can be changed dynamically using the OMSetDepthBounds() method
of the ID3D12GraphicsCommandList1 interface.
- The new VKD3D_CAPS_OVERRIDE environment variable can be used to override the
value of capabilities like the maximum feature level and resource binding
tier reported to applications.
### libvkd3d-shader
- New features for the HLSL source type:
- Interstage I/O variable packing matches d3dcompiler/fxc more closely.
- The following intrinsic functions are supported:
- dst()
- f32tof16()
- mad()
- modf()
- sincos()
- ‘discard’ support for shader model 1-3 target profiles.
- The ‘SV_SampleIndex’ input semantic for fragment shaders.
- The ‘SV_GroupIndex’ input semantic for compute shaders.
- The ‘earlydepthstencil’ function attribute.
- Constant folding of expressions like ‘x && c’ and ‘x || c’, where ‘c’ is a
constant.
- Preprocessor support for namespaces in macro identifiers. I.e., syntax
like ‘#define NAME1::NAME2::NAME3 1’ works as intended now.
- Structure inheritance. Multiple inheritance is not supported.
- Register assignments for unused constant buffers are allowed to overlap
register assignments for used constant buffers.
- Instruction count reflection data for shader model 4+ target profiles.
This data is contained in the ‘STAT’ DXBC section, and can be queried with
the GetDesc() method of the ID3D11ShaderReflection and
ID3D12ShaderReflection interfaces. Note that the ID3D12ShaderReflection
implementation provided by vkd3d-utils does not currently correctly report
this information.
- ‘unorm’ and ‘snorm’ resource format modifiers. For example,
‘Texture2D<unorm float4> t;’
- Parser support for ‘ByteAddressBuffer’ resources, as well as their
Load()/Load2()/Load3()/Load4() methods.
- Parser support for ‘RWByteAddressBuffer’ resources, as well as their
Store()/Store2()/Store3()/Store4() methods.
- Parser support for the ‘compile’ keyword, as well as the CompileShader()
and ConstructGSWithSO() intrinsic functions. Actual compilation of
embedded shaders is not implemented yet, but parser support is sufficient
for allowing compilation of HLSL sources containing this syntax to succeed
when targetting shader target profiles like ‘vs_5_0’ or ‘ps_5_0’.
- Initial support for tessellation shaders. Only the most trivial shaders
are supported in this release. Perhaps most notably, both ‘InputPatch’ and
‘OutputPatch’ are not implemented yet.
- The new ‘fx’ source type can be used in combination with the ‘d3d-asm’
target type to disassemble binary effects.
- More complete support for fx_2_0 binary effect output, including support for
annotations, default values, as well as object initialiser data used for e.g.
string, texture, and shader objects.
- A significant number of instructions have been implemented for the
experimental GLSL target. The GLSL output currently targets version 4.40
without extensions, but the intention is to make this configurable in a
future release of vkd3d.
- Experimental support for Metal Shading Language (MSL) output, enabled by
building vkd3d with the ‘-DVKD3D_SHADER_UNSUPPORTED_MSL’ preprocessor
option. The current release is only able to compile the most basic shaders
when targetting MSL. Being an experimental feature, both the ABI and API may
change in future releases; the feature may even go away completely.
Nevertheless, we hope our users find this feature useful, and welcome
feedback and contributions.
- Shader code generation for various legacy fixed-function features, including
clip planes, point sizes, and point sprites. This is mainly relevant for
executing shader model 1-3 sources in modern target environments like
Vulkan, because those target environments do not implement equivalent
fixed-function features.
- The amount of shader validation done by the internal validator has been
greatly extended. The validator is enabled by the ‘force_validation’ option,
specified through the VKD3D_SHADER_CONFIG environment variable.
- New interfaces:
- The VKD3D_SHADER_COMPILE_OPTION_DOUBLE_AS_FLOAT_ALIAS flag specifies that
the ‘double’ type behaves as an alias for the ‘float’ type in HLSL sources
with shader model 1-3 target profiles.
- The VKD3D_SHADER_PARAMETER_DATA_TYPE_FLOAT32_VEC4 enumeration value
specifies that a shader parameter contains a 4-dimensional vector of
32-bit floating-point data.
- The VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_MASK shader parameter specifies
which clip planes are enabled.
- The VKD3D_SHADER_PARAMETER_NAME_CLIP_PLANE_[0-7] shader parameters specify
the corresponding clip planes.
- The VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE shader parameter specifies the
point size to output when the source shader does not explicitly output a
point size.
- The VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE_MIN shader parameter specifies
the minimum point size to clamp point size outputs to.
- The VKD3D_SHADER_PARAMETER_NAME_POINT_SIZE_MAX shader parameter specifies
the maximum point size to clamp point size outputs to.
- The VKD3D_SHADER_PARAMETER_NAME_POINT_SPRITE shader parameter specifies
whether texture coordinate inputs in fragment shaders should be replaced
with point coordinates.
- The VKD3D_SHADER_SOURCE_FX source type specifies binary Direct3D effects.
- The VKD3D_SHADER_TARGET_MSL target type specifies Metal Shading Language
shaders.
### libvkd3d-utils
- The GetDesc() method of the ID3D12ShaderReflection interface returned by
D3DReflect() returns shader version information.
- New interfaces:
- D3DCompile2VKD3D() is a variant of D3DCompile2() that allows targeting the
behaviour of a specific d3dcompiler version.
### vkd3d-compiler
- The ‘--alias-double-as-float’ option specifies that the ‘double’ type
behaves as an alias for the ‘float’ type in HLSL sources with shader model
1-3 target profiles.
- The ‘fx’ source type specifies binary Direct3D effects.
- The ‘msl’ target type specifies Metal Shading Language shaders.
# What's new in vkd3d 1.13 (29 August 2024)
### libvkd3d
......
......@@ -10,6 +10,7 @@ OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_STATIC = YES
QUIET = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_INCOMPLETE_DOC = NO
LATEX_BATCHMODE = YES
INPUT = @srcdir@/include/vkd3d.h \
......
......@@ -2,6 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = @VKD3D_CFLAGS@
AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include/private
AM_LDFLAGS = -no-undefined
VKD3D_PERL = $(PERL) -w
widl_headers = \
include/vkd3d_d3d12.h \
......@@ -50,7 +51,6 @@ vkd3d_shader_tests = \
tests/hlsl/all.shader_test \
tests/hlsl/alpha-test.shader_test \
tests/hlsl/angle-unit.shader_test \
tests/hlsl/annotations.shader_test \
tests/hlsl/any.shader_test \
tests/hlsl/arithmetic-float-uniform.shader_test \
tests/hlsl/arithmetic-float.shader_test \
......@@ -81,25 +81,35 @@ vkd3d_shader_tests = \
tests/hlsl/ceil.shader_test \
tests/hlsl/cf-cond-types.shader_test \
tests/hlsl/clamp.shader_test \
tests/hlsl/clip-distance.shader_test \
tests/hlsl/clip-cull-distance.shader_test \
tests/hlsl/clip-planes.shader_test \
tests/hlsl/clip.shader_test \
tests/hlsl/combined-samplers.shader_test \
tests/hlsl/comma.shader_test \
tests/hlsl/compute.shader_test \
tests/hlsl/conditional.shader_test \
tests/hlsl/const.shader_test \
tests/hlsl/constructgswithso.shader_test \
tests/hlsl/coverage.shader_test \
tests/hlsl/cross.shader_test \
tests/hlsl/d3dcolor-to-ubyte4.shader_test \
tests/hlsl/ddxddy.shader_test \
tests/hlsl/default-values.shader_test \
tests/hlsl/depth-bounds.shader_test \
tests/hlsl/depth-out.shader_test \
tests/hlsl/determinant.shader_test \
tests/hlsl/discard.shader_test \
tests/hlsl/distance.shader_test \
tests/hlsl/dot.shader_test \
tests/hlsl/duplicate-modifiers.shader_test \
tests/hlsl/early-depth-stencil.shader_test \
tests/hlsl/effect-annotations-fx_2.shader_test \
tests/hlsl/effect-annotations-fx_4.shader_test \
tests/hlsl/effect-assignments-fx_5.shader_test \
tests/hlsl/effect-compile.shader_test \
tests/hlsl/effect-initial-values-fx_2.shader_test \
tests/hlsl/effect-initial-values-fx_4.shader_test \
tests/hlsl/effect-pass-states-fx_4.shader_test \
tests/hlsl/effect-pass-states-fx_5.shader_test \
tests/hlsl/effect-shader-objects-fx_2.shader_test \
tests/hlsl/effect-shader-objects-fx_5.shader_test \
......@@ -110,10 +120,14 @@ vkd3d_shader_tests = \
tests/hlsl/effect-variables-fx_4.shader_test \
tests/hlsl/effect-variables-fx_5.shader_test \
tests/hlsl/entry-point-semantics.shader_test \
tests/hlsl/eval-attrib.shader_test \
tests/hlsl/exp.shader_test \
tests/hlsl/expr-indexing.shader_test \
tests/hlsl/f16tof32.shader_test \
tests/hlsl/f32tof16.shader_test \
tests/hlsl/faceforward.shader_test \
tests/hlsl/fog.shader_test \
tests/hlsl/ffp-point-size.shader_test \
tests/hlsl/float-comparison.shader_test \
tests/hlsl/floor.shader_test \
tests/hlsl/fmod.shader_test \
......@@ -125,8 +139,10 @@ vkd3d_shader_tests = \
tests/hlsl/function.shader_test \
tests/hlsl/fwidth.shader_test \
tests/hlsl/fxgroup-syntax.shader_test \
tests/hlsl/gather-cmp.shader_test \
tests/hlsl/gather-offset.shader_test \
tests/hlsl/gather.shader_test \
tests/hlsl/geometry-shader-syntax.shader_test \
tests/hlsl/geometry.shader_test \
tests/hlsl/get-sample-pos.shader_test \
tests/hlsl/getdimensions.shader_test \
......@@ -146,13 +162,18 @@ vkd3d_shader_tests = \
tests/hlsl/initializer-static-array.shader_test \
tests/hlsl/initializer-struct.shader_test \
tests/hlsl/instance-id.shader_test \
tests/hlsl/interface-packing.shader_test \
tests/hlsl/intrinsic-override.shader_test \
tests/hlsl/invalid.shader_test \
tests/hlsl/inverse-trig.shader_test \
tests/hlsl/is-front-face.shader_test \
tests/hlsl/isinf.shader_test \
tests/hlsl/ldexp.shader_test \
tests/hlsl/length-property.shader_test \
tests/hlsl/length.shader_test \
tests/hlsl/lerp.shader_test \
tests/hlsl/lhs-cast.shader_test \
tests/hlsl/lhs-partial-assignment.shader_test \
tests/hlsl/lit.shader_test \
tests/hlsl/load-level.shader_test \
tests/hlsl/log.shader_test \
......@@ -166,6 +187,7 @@ vkd3d_shader_tests = \
tests/hlsl/matrix-semantics.shader_test \
tests/hlsl/max-min.shader_test \
tests/hlsl/minimum-precision.shader_test \
tests/hlsl/modf.shader_test \
tests/hlsl/mul.shader_test \
tests/hlsl/multiple-rt.shader_test \
tests/hlsl/nested-arrays.shader_test \
......@@ -179,6 +201,9 @@ vkd3d_shader_tests = \
tests/hlsl/object-field-offsets.shader_test \
tests/hlsl/object-parameters.shader_test \
tests/hlsl/object-references.shader_test \
tests/hlsl/patch-syntax.shader_test \
tests/hlsl/pixel-position.shader_test \
tests/hlsl/point-sprite.shader_test \
tests/hlsl/pointer-cast.shader_test \
tests/hlsl/pow.shader_test \
tests/hlsl/precise-modifier.shader_test \
......@@ -193,27 +218,35 @@ vkd3d_shader_tests = \
tests/hlsl/return-implicit-conversion.shader_test \
tests/hlsl/return.shader_test \
tests/hlsl/round.shader_test \
tests/hlsl/rt-array-index.shader_test \
tests/hlsl/rt-format-mismatch.shader_test \
tests/hlsl/rt-get-sample-info.shader_test \
tests/hlsl/sample-bias.shader_test \
tests/hlsl/sample-cmp.shader_test \
tests/hlsl/sample-grad.shader_test \
tests/hlsl/sample-level.shader_test \
tests/hlsl/sampler-offset.shader_test \
tests/hlsl/sampler-state.shader_test \
tests/hlsl/sampler.shader_test \
tests/hlsl/saturate.shader_test \
tests/hlsl/scope.shader_test \
tests/hlsl/shade-mode.shader_test \
tests/hlsl/shader-interstage-interface.shader_test \
tests/hlsl/shader-point-size.shader_test \
tests/hlsl/shape.shader_test \
tests/hlsl/side-effects.shader_test \
tests/hlsl/sign.shader_test \
tests/hlsl/single-numeric-initializer.shader_test \
tests/hlsl/sm1-const-allocation.shader_test \
tests/hlsl/sm1-const-folding.shader_test \
tests/hlsl/sm1-interstage-interface.shader_test \
tests/hlsl/sm6-ternary.shader_test \
tests/hlsl/sm6-uav-rwtexture.shader_test \
tests/hlsl/smoothstep.shader_test \
tests/hlsl/sqrt.shader_test \
tests/hlsl/srv-buffers.shader_test \
tests/hlsl/srv-byteaddressbuffer.shader_test \
tests/hlsl/srv-structuredbuffer.shader_test \
tests/hlsl/state-block-function-syntax.shader_test \
tests/hlsl/state-block-syntax.shader_test \
tests/hlsl/static-initializer.shader_test \
......@@ -222,12 +255,14 @@ vkd3d_shader_tests = \
tests/hlsl/strings.shader_test \
tests/hlsl/struct-array.shader_test \
tests/hlsl/struct-assignment.shader_test \
tests/hlsl/struct-inheritance.shader_test \
tests/hlsl/struct-semantics.shader_test \
tests/hlsl/switch.shader_test \
tests/hlsl/swizzle-constant-prop.shader_test \
tests/hlsl/swizzle-matrix.shader_test \
tests/hlsl/swizzles.shader_test \
tests/hlsl/ternary.shader_test \
tests/hlsl/tessellation-patch-vars.shader_test \
tests/hlsl/tessellation.shader_test \
tests/hlsl/texture-load-offset.shader_test \
tests/hlsl/texture-load-typed.shader_test \
......@@ -249,6 +284,8 @@ vkd3d_shader_tests = \
tests/hlsl/unbounded-array-5.1.shader_test \
tests/hlsl/uniform-parameters.shader_test \
tests/hlsl/uniform-semantics.shader_test \
tests/hlsl/uninitialized-varyings.shader_test \
tests/hlsl/unorm-snorm.shader_test \
tests/hlsl/unroll.shader_test \
tests/hlsl/unsigned.shader_test \
tests/hlsl/vector-indexing-uniform.shader_test \
......@@ -275,7 +312,8 @@ vkd3d_test_headers = \
tests/dxcompiler.h \
tests/shader_runner.h \
tests/utils.h \
tests/vulkan_procs.h
tests/vulkan_procs.h \
tests/vulkan_utils.h
vkd3d_demos = \
demos/vkd3d-gears \
......@@ -283,10 +321,12 @@ vkd3d_demos = \
vkd3d_demos_headers = \
demos/demo.h \
demos/demo_vkd3d.h \
demos/demo_win32.h \
demos/demo_xcb.h
BUILT_SOURCES = $(widl_headers) \
include/private/spirv_grammar.h \
include/private/vkd3d_version.h
noinst_LTLIBRARIES = libvkd3d-common.la
......@@ -345,6 +385,7 @@ nodist_libvkd3d_shader_la_SOURCES = $(vkd3d_shader_yyfiles)
libvkd3d_shader_la_SOURCES = \
include/private/list.h \
include/private/rbtree.h \
include/private/spirv_grammar.h \
include/private/vkd3d_common.h \
include/private/vkd3d_memory.h \
include/vkd3d_shader.h \
......@@ -360,6 +401,7 @@ libvkd3d_shader_la_SOURCES = \
libs/vkd3d-shader/hlsl_codegen.c \
libs/vkd3d-shader/hlsl_constant_ops.c \
libs/vkd3d-shader/ir.c \
libs/vkd3d-shader/msl.c \
libs/vkd3d-shader/preproc.h \
libs/vkd3d-shader/spirv.c \
libs/vkd3d-shader/tpf.c \
......@@ -367,7 +409,7 @@ libvkd3d_shader_la_SOURCES = \
libs/vkd3d-shader/vkd3d_shader_main.c \
libs/vkd3d-shader/vkd3d_shader_private.h
libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SHADER_SOURCE -I$(srcdir)/libs/vkd3d-shader @SPIRV_TOOLS_CFLAGS@
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 12:0:11
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 14:0:13
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@ -lm
if HAVE_LD_VERSION_SCRIPT
libvkd3d_shader_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-shader/vkd3d_shader.map
......@@ -402,7 +444,7 @@ libvkd3d_la_SOURCES = \
libs/vkd3d/vkd3d_shaders.h \
libs/vkd3d/vulkan_procs.h
libvkd3d_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_SOURCE
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 14:0:13
libvkd3d_la_LDFLAGS = $(AM_LDFLAGS) -version-info 16:0:15
libvkd3d_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la @DL_LIBS@ @PTHREAD_LIBS@
if HAVE_LD_VERSION_SCRIPT
libvkd3d_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d/vkd3d.map
......@@ -415,7 +457,7 @@ libvkd3d_utils_la_SOURCES = \
libs/vkd3d-utils/vkd3d_utils_main.c \
libs/vkd3d-utils/vkd3d_utils_private.h
libvkd3d_utils_la_CFLAGS = $(AM_CFLAGS) -DLIBVKD3D_UTILS_SOURCE
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 6:2:5
libvkd3d_utils_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:1:6
libvkd3d_utils_la_LIBADD = libvkd3d-common.la libvkd3d-shader.la libvkd3d.la @PTHREAD_LIBS@
if HAVE_LD_VERSION_SCRIPT
libvkd3d_utils_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libs/vkd3d-utils/vkd3d_utils.map
......@@ -447,15 +489,20 @@ LDADD = libvkd3d.la libvkd3d-shader.la libvkd3d-utils.la
AM_DEFAULT_SOURCE_EXT = .c
TEST_EXTENSIONS = .shader_test
TEST_CPPFLAGS = -I$(builddir)/tests
if BUILD_TESTS
check_PROGRAMS = $(vkd3d_tests) $(vkd3d_cross_tests) tests/shader_runner
dist_check_SCRIPTS = tests/test-driver.sh
TESTS = $(vkd3d_tests) $(vkd3d_cross_tests) $(vkd3d_shader_tests)
tests_d3d12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @DL_LIBS@
tests_d3d12_invalid_usage_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_d3d12_invalid_usage_LDADD = $(LDADD) @DL_LIBS@
tests_hlsl_d3d12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@
tests_shader_runner_CFLAGS = $(AM_CFLAGS) -I$(builddir)/tests @OPENGL_CFLAGS@
tests_shader_runner_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_shader_runner_CFLAGS = $(AM_CFLAGS) @OPENGL_CFLAGS@
tests_shader_runner_LDADD = $(LDADD) @OPENGL_LIBS@ @DL_LIBS@
tests_shader_runner_SOURCES = \
tests/shader_runner.c \
......@@ -464,9 +511,18 @@ tests_shader_runner_SOURCES = \
tests/shader_runner_d3d12.c \
tests/shader_runner_gl.c \
tests/shader_runner_vulkan.c
if HAVE_METAL
tests_shader_runner_OBJCFLAGS = $(AM_CFLAGS)
tests_shader_runner_SOURCES += tests/shader_runner_metal.m
tests_shader_runner_LINK = $(OBJCLINK) -framework Foundation -framework Metal
else
tests_shader_runner_LINK = $(LINK)
endif
tests_vkd3d_api_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_vkd3d_api_LDADD = libvkd3d.la @DL_LIBS@
tests_vkd3d_shader_api_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
tests_vkd3d_shader_api_CFLAGS = $(AM_CFLAGS) @OPENGL_CFLAGS@
tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la @OPENGL_LIBS@
tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la @OPENGL_LIBS@ @DL_LIBS@
SHADER_TEST_LOG_COMPILER = tests/shader_runner
SHADER_TEST_LOG_DRIVER = $(srcdir)/tests/test-driver.sh
endif
......@@ -475,16 +531,18 @@ EXTRA_DIST += $(vkd3d_shader_tests)
if BUILD_DEMOS
DEMOS_LDADD = $(LDADD) libvkd3d-shader.la @DL_LIBS@ @DEMO_LIBS@
DEMOS_CFLAGS = $(AM_CFLAGS) @DEMO_CFLAGS@
DEMOS_CFLAGS = $(AM_CFLAGS) @DEMO_CFLAGS@ -Wa,-I$(srcdir)/demos
bin_PROGRAMS += $(vkd3d_demos)
demos_vkd3d_gears_SOURCES = demos/gears.c demos/gears_hlsl.h
demos_vkd3d_gears_SOURCES = demos/gears.c demos/gears.hlsl
demos_vkd3d_gears_CFLAGS = $(DEMOS_CFLAGS)
demos_vkd3d_gears_LDADD = $(DEMOS_LDADD) -lm
demos/vkd3d_gears-gears.$(OBJEXT): demos/gears.hlsl
demos_vkd3d_triangle_SOURCES = demos/triangle.c demos/triangle_hlsl.h
demos_vkd3d_triangle_SOURCES = demos/triangle.c demos/triangle.hlsl
demos_vkd3d_triangle_CFLAGS = $(DEMOS_CFLAGS)
demos_vkd3d_triangle_LDADD = $(DEMOS_LDADD)
demos/vkd3d_triangle-triangle.$(OBJEXT): demos/triangle.hlsl
endif
noinst_HEADERS = $(vkd3d_test_headers) $(vkd3d_demos_headers)
......@@ -529,6 +587,15 @@ libvkd3d.pc: $(srcdir)/libs/vkd3d/libvkd3d.pc.in Makefile
-e 's![@]PACKAGE_VERSION[@]!$(PACKAGE_VERSION)!g' \
$< > $@
VKD3D_V_PERL = $(vkd3d_v_perl_@AM_V@)
vkd3d_v_perl_ = $(vkd3d_v_perl_@AM_DEFAULT_V@)
vkd3d_v_perl_0 = @echo " PERL " $@;
vkd3d_v_perl_1 =
include/private/spirv_grammar.h: libs/vkd3d-shader/make_spirv include/private/spirv.core.grammar.json
@$(MKDIR_P) $(@D)
$(VKD3D_V_PERL)$(VKD3D_PERL) $^ > $@.tmp && mv $@.tmp $@
include/private/vkd3d_version.h: dummy-vkd3d-version
@$(MKDIR_P) include/private
version=`(GIT_DIR=$(top_srcdir)/.git git rev-parse --short HEAD 2>/dev/null || echo '') \
......@@ -537,7 +604,7 @@ include/private/vkd3d_version.h: dummy-vkd3d-version
&& (echo $$version | cmp -s - $@) \
|| echo $$version >$@ || ($(RM) $@ && exit 1)
.SILENT: include/private/vkd3d_version.h
CLEANFILES += include/private/vkd3d_version.h
CLEANFILES += include/private/spirv_grammar.h include/private/vkd3d_version.h
.PHONY: dummy-vkd3d-version
dummy-vkd3d-version:
......@@ -545,7 +612,7 @@ dummy-vkd3d-version:
## Cross-compile tests
cross_implibs = crosslibs/d3d12
CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include -I$(builddir)/tests
CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} \
CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} -Wa,-I$(srcdir)/demos \
-D_WIN32_WINNT=0x0600 -D__USE_MINGW_ANSI_STDIO=0 -DVKD3D_CROSSTEST=1
EXTRA_DIST += $(cross_implibs:=.cross32.def) $(cross_implibs:=.cross64.def)
EXTRA_DIST += tests/driver.c tests/shader_runner_d3d11.c tests/shader_runner_d3d9.c
......@@ -569,6 +636,8 @@ CROSS32_EXEFILES += $(vkd3d_cross_tests:=.cross32.exe)
endif
if BUILD_DEMOS
CROSS32_EXEFILES += $(vkd3d_demos:demos/vkd3d-%=demos/%.cross32.exe)
demos/gears.cross32.exe: demos/gears.hlsl
demos/triangle.cross32.exe: demos/triangle.hlsl
endif
CROSS32_FILES = $(CROSS32_EXEFILES)
......@@ -616,6 +685,8 @@ CROSS64_EXEFILES += $(vkd3d_cross_tests:=.cross64.exe)
endif
if BUILD_DEMOS
CROSS64_EXEFILES += $(vkd3d_demos:demos/vkd3d-%=demos/%.cross64.exe)
demos/gears.cross64.exe: demos/gears.hlsl
demos/triangle.cross64.exe: demos/triangle.hlsl
endif
CROSS64_FILES = $(CROSS64_EXEFILES)
......
......@@ -9,7 +9,8 @@ similar, but not identical, to Direct3D 12.
Building vkd3d
==============
Vkd3d depends on SPIRV-Headers and Vulkan-Headers (>= 1.3.228).
Vkd3d depends on SPIRV-Headers and Vulkan-Headers (>= 1.3.228), as well as Perl
and libjson-perl.
Vkd3d generates some of its headers from IDL files. If you are using the
release tarballs, then these headers are pre-generated and are included. If
......@@ -19,10 +20,20 @@ available or is not recent (>= 3.21), then you can build Wine with `make
tools/widl/widl' to avoid building all of Wine. You can then point vkd3d's
configure at that widl binary with `WIDL="/path/to/widl"'.
For release builds, you may want to define NDEBUG. If you do not need debug log
messages, you may also consider VKD3D_NO_TRACE_MESSAGES and
VKD3D_NO_DEBUG_MESSAGES. For example, you can pass `CPPFLAGS="-DNDEBUG
-DVKD3D_NO_TRACE_MESSAGES"' to configure.
For release builds, you may want to disable debug log messages defining
preprocessor macros VKD3D_NO_TRACE_MESSAGES and VKD3D_NO_DEBUG_MESSAGES.
See the `Preprocessor definitions' section below for more details.
================
Developing vkd3d
================
Development of vkd3d happens on the Wine GitLab instance
(https://gitlab.winehq.org/wine/vkd3d/). Contributors are encouraged
to submit their patches using the merge request tool.
Each merge request is automatically tested with the GitLab CI
system. See gitlab/README in the Git tree for more details.
===========
Using vkd3d
......@@ -39,8 +50,8 @@ Environment variables
=====================
Most of the environment variables used by vkd3d are for debugging purposes. The
environment variables are not considered a part of API and might be changed or
removed in the future versions of vkd3d.
environment variables are not considered a stable interface and might be changed
or removed in future versions of vkd3d.
Some of debug variables are lists of elements. Elements must be separated by
commas or semicolons.
......@@ -65,6 +76,14 @@ commas or semicolons.
* VKD3D_DISABLE_EXTENSIONS - a list of Vulkan extensions that libvkd3d should
not use even if available.
* VKD3D_CAPS_OVERRIDE - a list of Direct3D 12 capabilities for which the
default value detected by vkd3d should be overridden, in the form
`capability1=value1,capability2=value2'. This doesn't change the vkd3d
behaviour, only the information reported to the application. The following
capabilities can currently be overridden:
* feature_level (allowed values: 11.0, 11.1, 12.0, 12.1, 12.2)
* resource_binding_tier (allowed values: 1, 2, 3)
* VKD3D_SHADER_CONFIG - a list of options that change the behavior of
libvkd3d-shader.
* force_validation - Enable (additional) validation of libvkd3d-shader's
......@@ -105,16 +124,46 @@ code for adding DXBC checksums, so the official release should be installed
from:
https://github.com/microsoft/DirectXShaderCompiler/releases
================
Developing vkd3d
================
Development of vkd3d happens on the Wine GitLab instance
(https://gitlab.winehq.org/wine/vkd3d/). Contributors are encouraged
to submit their patches using the merge request tool.
Each merge request is automatically tested with the GitLab CI
system. See gitlab/README in the Git tree for more details.
========================
Preprocessor definitions
========================
A number of preprocessor definitions can be used at compilation time to control
the behaviour of the generated binary. You can pass something like
`CPPFLAGS="-DVKD3D_VAR1 -DVKD3D_VAR2"' to the configure script. The preprocessor
variables are not considered a stable interface and might be changed or removed
in future versions of vkd3d.
* VKD3D_NO_TRACE_MESSAGES - do not emit trace messages in the debug log; this
can be useful in release builds to reduce the size of the binary and make it
slightly faster.
* VKD3D_NO_DEBUG_MESSAGES - do not emit warn and fixme messages in the debug
log; this will further optimise the binary, but may omit messages that could
help debug problems with vkd3d.
* VKD3D_NO_ERROR_MESSAGES - do not emit error messages; this will optimise the
binary even more, but may omit very important messages, so it is not
recommended in most circumstances.
* VKD3D_ABORT_ON_ERR - abort the process as soon as an error message is
emitted; this can be useful for developers to make error conditions as
conspicuous as possible.
* VKD3D_SHADER_UNSUPPORTED_GLSL - enable GLSL (GL Shading Language) support in
vkd3d-shader, which is disabled by default because it is not considered ready
for release yet. Please note that this feature is not currently supported,
and it might change in a non-compatible way before it is released.
* VKD3D_SHADER_UNSUPPORTED_MSL - enable MSL (Metal Shading Language) support in
vkd3d-shader, which is disabled by default because it is not considered ready
for release yet. Please note that this feature is not currently supported,
and it might change in a non-compatible way before it is released.
* VKD3D_SHADER_UNSUPPORTED_SPIRV_PARSER - enable SPIR-V parser support in
vkd3d-shader, which is disabled by default because it is not considered ready
for release yet. Please note that this feature is not currently supported,
and it might change in a non-compatible way before it is released.
============================
Testing with the Agility SDK
......
AC_PREREQ([2.69])
AC_INIT([vkd3d],[1.13])
AC_INIT([vkd3d],[1.15])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(include/config.h)
AC_ARG_VAR([PERL], [The Perl 5 language interpreter])
AC_ARG_VAR([WIDL], [widl IDL compiler])
AC_ARG_VAR([CROSSCC32], [32-bit Windows cross compiler])
AC_ARG_VAR([CROSSCC64], [64-bit Windows cross compiler])
AC_ARG_WITH([metal], AS_HELP_STRING([--with-metal], [Build with the Metal library (default: test)]))
AC_ARG_WITH([ncurses], AS_HELP_STRING([--with-ncurses], [Build with the ncurses library (default: test)]))
AC_ARG_WITH([opengl], AS_HELP_STRING([--with-opengl], [Build with the OpenGL library (default: test)]))
AC_ARG_WITH([spirv-tools], AS_HELP_STRING([--with-spirv-tools],
......@@ -31,6 +33,11 @@ AC_PROG_MKDIR_P
VKD3D_PROG_WIDL(3, 21)
AS_IF([test "x$WIDL" = "xno"], [AC_MSG_WARN([widl is required to build header files.])])
AC_CHECK_PROGS([PERL], [perl], [none])
AS_IF([test "$PERL" = "none"], [AC_MSG_ERROR([no suitable perl found. Please install the 'perl-base' package.])])
VKD3D_CHECK_PERL_MODULE([JSON],
[AC_MSG_ERROR([perl module 'JSON' not found. Please install the 'libjson-perl' package.])])
AC_CHECK_PROGS([FLEX], [flex], [none])
AS_IF([test "$FLEX" = "none"], [AC_MSG_ERROR([no suitable flex found. Please install the 'flex' package.])])
AC_ARG_VAR([LFLAGS], [extra flags for flex])
......@@ -134,6 +141,16 @@ AS_IF([test "x$SONAME_LIBDXCOMPILER" = "x"],
[VKD3D_CHECK_SONAME([dxcompiler], [DxcCreateInstance], [HAVE_DXCOMPILER=yes], [HAVE_DXCOMPILER=no], [$DXCOMPILER_LIBS])],
[AC_DEFINE_UNQUOTED([SONAME_LIBDXCOMPILER],["$SONAME_LIBDXCOMPILER"],[Define to the shared object name of the dxcompiler library.])])
AS_IF([test "x$with_metal" != "xno"],
[AC_MSG_CHECKING([for Metal])]
[AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#include <Metal/Metal.h>])],
[AC_MSG_RESULT([yes])
AC_PROG_OBJC
AC_DEFINE([HAVE_METAL], [1], [Define to 1 if you have Metal.])
with_metal=yes],
[AC_MSG_RESULT([no])
AM_CONDITIONAL([am__fastdepOBJC], [false])
with_metal=no])])
AS_IF([test "x$with_ncurses" != "xno"],
[PKG_CHECK_MODULES([NCURSES], [ncurses],
[AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if you have ncurses.]) with_ncurses=yes],
......@@ -162,6 +179,7 @@ VKD3D_CHECK_FUNC([HAVE_SYNC_ADD_AND_FETCH], [__sync_add_and_fetch], [__sync_add_
VKD3D_CHECK_FUNC([HAVE_SYNC_BOOL_COMPARE_AND_SWAP], [__sync_bool_compare_and_swap], [__sync_bool_compare_and_swap((int *)0, 0, 0)])
VKD3D_CHECK_FUNC([HAVE_ATOMIC_EXCHANGE_N], [__atomic_exchange_n], [__atomic_exchange_n((int *)0, 0, 0)])
AC_CHECK_FUNCS([gettid])
AC_CHECK_FUNCS([pthread_threadid_np])
dnl Makefiles
case $host_os in
......@@ -181,6 +199,7 @@ AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_tests" != "xno"])
AM_CONDITIONAL([HAVE_WIDL], [test "x$WIDL" != "xno"])
AM_CONDITIONAL([HAVE_CROSSTARGET32], [test "x$CROSSTARGET32" != "xno"])
AM_CONDITIONAL([HAVE_CROSSTARGET64], [test "x$CROSSTARGET64" != "xno"])
AM_CONDITIONAL([HAVE_METAL], [test "${host_os#darwin}" != "$host_os"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
......@@ -197,11 +216,12 @@ AS_ECHO(["
widl: ${WIDL}
Have dxcompiler: ${HAVE_DXCOMPILER}
Have Metal: ${with_metal}
Have ncurses: ${with_ncurses}
Have OpenGL: ${with_opengl}
Have SPIRV-Tools: ${with_spirv_tools}
Have xcb: ${HAVE_XCB}
Have dxcompiler: ${HAVE_DXCOMPILER}
Building demos: ${enable_demos}
Building tests: ${enable_tests}
......
......@@ -39,6 +39,42 @@
#include <vkd3d_d3d12.h>
#include <inttypes.h>
#ifdef __WIN32__
#define DEMO_ASM_PUSHSECTION ".section rdata\n\t"
#define DEMO_ASM_POPSECTION ".text\n\t"
#define DEMO_ASM_OBJECT_TYPE(name)
#else
#define DEMO_ASM_PUSHSECTION ".pushsection .rodata\n\t"
#define DEMO_ASM_POPSECTION ".popsection\n\t"
#define DEMO_ASM_OBJECT_TYPE(name) ".type "name", @object\n\t"
#endif
#if defined(__WIN32__) && defined(__i386__)
#define DEMO_ASM_NAME(name) "_"#name
#else
#define DEMO_ASM_NAME(name) #name
#endif
#define DEMO_EMBED_ASM(name, file) \
DEMO_ASM_PUSHSECTION \
".global "name"\n\t" \
DEMO_ASM_OBJECT_TYPE(name) \
".balign 8\n\t" \
name":\n\t" \
".incbin \""file"\"\n\t" \
name"_end:\n\t" \
".global "name"_size\n\t" \
DEMO_ASM_OBJECT_TYPE(name"_size") \
".balign 8\n\t" \
name"_size:\n\t" \
".int "name"_end - "name"\n\t" \
DEMO_ASM_POPSECTION
#define DEMO_EMBED(name, file) \
extern const unsigned int name##_size; \
extern const uint8_t name[]; \
__asm__(DEMO_EMBED_ASM(DEMO_ASM_NAME(name), file))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*x))
#define DEMO_KEY_UNKNOWN 0x0000
......@@ -142,5 +178,5 @@ static inline HRESULT demo_create_root_signature(ID3D12Device *device,
#include "demo_win32.h"
#else
#define INFINITE VKD3D_INFINITE
#include "demo_xcb.h"
#include "demo_vkd3d.h"
#endif
/*
* Copyright 2016 Józef Kucia for CodeWeavers
* Copyright 2016 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define VK_NO_PROTOTYPES
#define VK_USE_PLATFORM_XCB_KHR
#define VKD3D_UTILS_API_VERSION VKD3D_API_VERSION_1_15
#include "config.h"
#include <vkd3d.h>
#include <vkd3d_utils.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_icccm.h>
#include <xcb/xcb_keysyms.h>
#include <dlfcn.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#define DECLARE_VK_PFN(name) PFN_##name name;
DECLARE_VK_PFN(vkAcquireNextImageKHR)
DECLARE_VK_PFN(vkCreateFence)
DECLARE_VK_PFN(vkCreateSwapchainKHR)
DECLARE_VK_PFN(vkCreateXcbSurfaceKHR)
DECLARE_VK_PFN(vkDestroyFence)
DECLARE_VK_PFN(vkDestroySurfaceKHR)
DECLARE_VK_PFN(vkDestroySwapchainKHR)
DECLARE_VK_PFN(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)
DECLARE_VK_PFN(vkGetPhysicalDeviceSurfaceFormatsKHR)
DECLARE_VK_PFN(vkGetPhysicalDeviceSurfaceSupportKHR)
DECLARE_VK_PFN(vkGetSwapchainImagesKHR)
DECLARE_VK_PFN(vkQueuePresentKHR)
DECLARE_VK_PFN(vkResetFences)
DECLARE_VK_PFN(vkWaitForFences)
struct demo_xcb
{
xcb_connection_t *connection;
xcb_atom_t wm_protocols_atom;
xcb_atom_t wm_delete_window_atom;
xcb_key_symbols_t *xcb_keysyms;
int screen;
};
struct demo
{
struct demo_xcb xcb;
struct demo_window **windows;
size_t windows_size;
size_t window_count;
void *user_data;
void (*idle_func)(struct demo *demo, void *user_data);
};
struct demo_window
{
struct demo *demo;
void *user_data;
void (*expose_func)(struct demo_window *window, void *user_data);
void (*key_press_func)(struct demo_window *window, demo_key key, void *user_data);
};
static inline bool demo_add_window(struct demo *demo, struct demo_window *window)
{
if (demo->window_count == demo->windows_size)
{
size_t new_capacity;
void *new_elements;
new_capacity = max(demo->windows_size * 2, 4);
if (!(new_elements = realloc(demo->windows, new_capacity * sizeof(*demo->windows))))
return false;
demo->windows = new_elements;
demo->windows_size = new_capacity;
}
demo->windows[demo->window_count++] = window;
return true;
}
static inline void demo_remove_window(struct demo *demo, const struct demo_window *window)
{
size_t i;
for (i = 0; i < demo->window_count; ++i)
{
if (demo->windows[i] != window)
continue;
--demo->window_count;
memmove(&demo->windows[i], &demo->windows[i + 1], (demo->window_count - i) * sizeof(*demo->windows));
break;
}
}
static inline bool demo_window_init(struct demo_window *window, struct demo *demo, void *user_data)
{
if (!demo_add_window(demo, window))
return false;
window->demo = demo;
window->user_data = user_data;
window->expose_func = NULL;
window->key_press_func = NULL;
return true;
}
static inline void demo_window_cleanup(struct demo_window *window)
{
demo_remove_window(window->demo, window);
}
#include "demo_xcb.h"
static void load_vulkan_procs(void)
{
void *libvulkan;
if (!(libvulkan = dlopen(SONAME_LIBVULKAN, RTLD_NOW)))
{
fprintf(stderr, "Failed to load %s: %s.\n", SONAME_LIBVULKAN, dlerror());
exit(1);
}
#define LOAD_VK_PFN(name) name = (void *)dlsym(libvulkan, #name);
LOAD_VK_PFN(vkAcquireNextImageKHR)
LOAD_VK_PFN(vkCreateFence)
LOAD_VK_PFN(vkCreateSwapchainKHR)
LOAD_VK_PFN(vkCreateXcbSurfaceKHR)
LOAD_VK_PFN(vkDestroyFence)
LOAD_VK_PFN(vkDestroySurfaceKHR)
LOAD_VK_PFN(vkDestroySwapchainKHR)
LOAD_VK_PFN(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)
LOAD_VK_PFN(vkGetPhysicalDeviceSurfaceFormatsKHR)
LOAD_VK_PFN(vkGetPhysicalDeviceSurfaceSupportKHR)
LOAD_VK_PFN(vkGetSwapchainImagesKHR)
LOAD_VK_PFN(vkQueuePresentKHR)
LOAD_VK_PFN(vkResetFences)
LOAD_VK_PFN(vkWaitForFences)
}
struct demo_swapchain
{
VkSurfaceKHR vk_surface;
VkSwapchainKHR vk_swapchain;
VkFence vk_fence;
VkInstance vk_instance;
VkDevice vk_device;
ID3D12CommandQueue *command_queue;
ID3D12Fence *present_fence;
unsigned long long present_count;
uint32_t current_buffer;
unsigned int buffer_count;
ID3D12Resource *buffers[1];
};
static inline void demo_cleanup(struct demo *demo)
{
free(demo->windows);
demo_xcb_cleanup(demo);
}
static inline bool demo_init(struct demo *demo, void *user_data)
{
if (!demo_xcb_init(&demo->xcb))
return false;
demo->windows = NULL;
demo->windows_size = 0;
demo->window_count = 0;
demo->user_data = user_data;
demo->idle_func = NULL;
return true;
}
static inline void demo_get_dpi(struct demo *demo, double *dpi_x, double *dpi_y)
{
demo_xcb_get_dpi(demo, dpi_x, dpi_y);
}
static inline void demo_process_events(struct demo *demo)
{
demo_xcb_process_events(demo);
}
static inline void demo_set_idle_func(struct demo *demo,
void (*idle_func)(struct demo *demo, void *user_data))
{
demo->idle_func = idle_func;
}
static inline void demo_window_destroy(struct demo_window *window)
{
demo_window_xcb_destroy(window);
}
static inline struct demo_window *demo_window_create(struct demo *demo, const char *title,
unsigned int width, unsigned int height, void *user_data)
{
return demo_window_xcb_create(demo, title, width, height, user_data);
}
static inline void demo_window_set_expose_func(struct demo_window *window,
void (*expose_func)(struct demo_window *window, void *user_data))
{
window->expose_func = expose_func;
}
static inline void demo_window_set_key_press_func(struct demo_window *window,
void (*key_press_func)(struct demo_window *window, demo_key key, void *user_data))
{
window->key_press_func = key_press_func;
}
static inline struct demo_swapchain *demo_swapchain_create(ID3D12CommandQueue *command_queue,
struct demo_window *window, const struct demo_swapchain_desc *desc)
{
struct vkd3d_image_resource_create_info resource_create_info;
struct VkSwapchainCreateInfoKHR vk_swapchain_desc;
VkSwapchainKHR vk_swapchain = VK_NULL_HANDLE;
uint32_t format_count, queue_family_index;
VkSurfaceCapabilitiesKHR surface_caps;
VkPhysicalDevice vk_physical_device;
VkFence vk_fence = VK_NULL_HANDLE;
struct demo_swapchain *swapchain;
unsigned int image_count, i, j;
VkFenceCreateInfo fence_desc;
VkSurfaceFormatKHR *formats;
ID3D12Device *d3d12_device;
VkSurfaceKHR vk_surface;
VkInstance vk_instance;
VkBool32 supported;
VkDevice vk_device;
VkImage *vk_images;
VkFormat format;
load_vulkan_procs();
if ((format = vkd3d_get_vk_format(desc->format)) == VK_FORMAT_UNDEFINED)
return NULL;
if (FAILED(ID3D12CommandQueue_GetDevice(command_queue, &IID_ID3D12Device, (void **)&d3d12_device)))
return NULL;
vk_instance = vkd3d_instance_get_vk_instance(vkd3d_instance_from_device(d3d12_device));
vk_physical_device = vkd3d_get_vk_physical_device(d3d12_device);
vk_device = vkd3d_get_vk_device(d3d12_device);
if (!(vk_surface = demo_window_xcb_create_vk_surface(window, vk_instance)))
{
ID3D12Device_Release(d3d12_device);
return NULL;
}
queue_family_index = vkd3d_get_vk_queue_family_index(command_queue);
if (vkGetPhysicalDeviceSurfaceSupportKHR(vk_physical_device,
queue_family_index, vk_surface, &supported) < 0 || !supported)
goto fail;
if (vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vk_physical_device, vk_surface, &surface_caps) < 0)
goto fail;
if ((surface_caps.maxImageCount && desc->buffer_count > surface_caps.maxImageCount)
|| desc->buffer_count < surface_caps.minImageCount
|| desc->width > surface_caps.maxImageExtent.width || desc->width < surface_caps.minImageExtent.width
|| desc->height > surface_caps.maxImageExtent.height || desc->height < surface_caps.minImageExtent.height
|| !(surface_caps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR))
goto fail;
if (vkGetPhysicalDeviceSurfaceFormatsKHR(vk_physical_device, vk_surface, &format_count, NULL) < 0
|| !format_count || !(formats = calloc(format_count, sizeof(*formats))))
goto fail;
if (vkGetPhysicalDeviceSurfaceFormatsKHR(vk_physical_device, vk_surface, &format_count, formats) < 0)
{
free(formats);
goto fail;
}
if (format_count != 1 || formats->format != VK_FORMAT_UNDEFINED
|| formats->colorSpace != VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)
{
for (i = 0; i < format_count; ++i)
{
if (formats[i].format == format && formats[i].colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)
break;
}
if (i == format_count)
{
free(formats);
goto fail;
}
}
free(formats);
formats = NULL;
vk_swapchain_desc.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
vk_swapchain_desc.pNext = NULL;
vk_swapchain_desc.flags = 0;
vk_swapchain_desc.surface = vk_surface;
vk_swapchain_desc.minImageCount = desc->buffer_count;
vk_swapchain_desc.imageFormat = format;
vk_swapchain_desc.imageColorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
vk_swapchain_desc.imageExtent.width = desc->width;
vk_swapchain_desc.imageExtent.height = desc->height;
vk_swapchain_desc.imageArrayLayers = 1;
vk_swapchain_desc.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
vk_swapchain_desc.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
vk_swapchain_desc.queueFamilyIndexCount = 0;
vk_swapchain_desc.pQueueFamilyIndices = NULL;
vk_swapchain_desc.preTransform = surface_caps.currentTransform;
vk_swapchain_desc.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
vk_swapchain_desc.presentMode = VK_PRESENT_MODE_FIFO_KHR;
vk_swapchain_desc.clipped = VK_TRUE;
vk_swapchain_desc.oldSwapchain = VK_NULL_HANDLE;
if (vkCreateSwapchainKHR(vk_device, &vk_swapchain_desc, NULL, &vk_swapchain) < 0)
goto fail;
fence_desc.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
fence_desc.pNext = NULL;
fence_desc.flags = 0;
if (vkCreateFence(vk_device, &fence_desc, NULL, &vk_fence) < 0)
goto fail;
if (vkGetSwapchainImagesKHR(vk_device, vk_swapchain, &image_count, NULL) < 0
|| !(vk_images = calloc(image_count, sizeof(*vk_images))))
goto fail;
if (vkGetSwapchainImagesKHR(vk_device, vk_swapchain, &image_count, vk_images) < 0)
{
free(vk_images);
goto fail;
}
if (!(swapchain = malloc(offsetof(struct demo_swapchain, buffers[image_count]))))
{
free(vk_images);
goto fail;
}
swapchain->vk_surface = vk_surface;
swapchain->vk_swapchain = vk_swapchain;
swapchain->vk_fence = vk_fence;
swapchain->vk_instance = vk_instance;
swapchain->vk_device = vk_device;
vkAcquireNextImageKHR(vk_device, vk_swapchain, UINT64_MAX,
VK_NULL_HANDLE, vk_fence, &swapchain->current_buffer);
vkWaitForFences(vk_device, 1, &vk_fence, VK_TRUE, UINT64_MAX);
vkResetFences(vk_device, 1, &vk_fence);
resource_create_info.type = VKD3D_STRUCTURE_TYPE_IMAGE_RESOURCE_CREATE_INFO;
resource_create_info.next = NULL;
resource_create_info.desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
resource_create_info.desc.Alignment = 0;
resource_create_info.desc.Width = desc->width;
resource_create_info.desc.Height = desc->height;
resource_create_info.desc.DepthOrArraySize = 1;
resource_create_info.desc.MipLevels = 1;
resource_create_info.desc.Format = desc->format;
resource_create_info.desc.SampleDesc.Count = 1;
resource_create_info.desc.SampleDesc.Quality = 0;
resource_create_info.desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
resource_create_info.desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
resource_create_info.flags = VKD3D_RESOURCE_INITIAL_STATE_TRANSITION | VKD3D_RESOURCE_PRESENT_STATE_TRANSITION;
resource_create_info.present_state = D3D12_RESOURCE_STATE_PRESENT;
for (i = 0; i < image_count; ++i)
{
resource_create_info.vk_image = vk_images[i];
if (FAILED(vkd3d_create_image_resource(d3d12_device, &resource_create_info, &swapchain->buffers[i])))
{
for (j = 0; j < i; ++j)
{
ID3D12Resource_Release(swapchain->buffers[j]);
}
free(swapchain);
free(vk_images);
goto fail;
}
}
swapchain->buffer_count = image_count;
free(vk_images);
if (FAILED(ID3D12Device_CreateFence(d3d12_device, 0, 0, &IID_ID3D12Fence, (void **)&swapchain->present_fence)))
{
for (i = 0; i < image_count; ++i)
{
ID3D12Resource_Release(swapchain->buffers[i]);
}
free(swapchain);
goto fail;
}
swapchain->present_count = 0;
ID3D12Device_Release(d3d12_device);
ID3D12CommandQueue_AddRef(swapchain->command_queue = command_queue);
return swapchain;
fail:
if (vk_fence != VK_NULL_HANDLE)
vkDestroyFence(vk_device, vk_fence, NULL);
if (vk_swapchain != VK_NULL_HANDLE)
vkDestroySwapchainKHR(vk_device, vk_swapchain, NULL);
vkDestroySurfaceKHR(vk_instance, vk_surface, NULL);
ID3D12Device_Release(d3d12_device);
return NULL;
}
static inline unsigned int demo_swapchain_get_current_back_buffer_index(struct demo_swapchain *swapchain)
{
return swapchain->current_buffer;
}
static inline ID3D12Resource *demo_swapchain_get_back_buffer(struct demo_swapchain *swapchain, unsigned int index)
{
ID3D12Resource *resource = NULL;
if (index < swapchain->buffer_count && (resource = swapchain->buffers[index]))
ID3D12Resource_AddRef(resource);
return resource;
}
static inline void demo_swapchain_present(struct demo_swapchain *swapchain)
{
VkPresentInfoKHR present_desc;
VkQueue vk_queue;
present_desc.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
present_desc.pNext = NULL;
present_desc.waitSemaphoreCount = 0;
present_desc.pWaitSemaphores = NULL;
present_desc.swapchainCount = 1;
present_desc.pSwapchains = &swapchain->vk_swapchain;
present_desc.pImageIndices = &swapchain->current_buffer;
present_desc.pResults = NULL;
/* Synchronize vkd3d_acquire_vk_queue() with the Direct3D 12 work
* already submitted to the command queue. */
++swapchain->present_count;
ID3D12CommandQueue_Signal(swapchain->command_queue, swapchain->present_fence, swapchain->present_count);
ID3D12Fence_SetEventOnCompletion(swapchain->present_fence, swapchain->present_count, NULL);
vk_queue = vkd3d_acquire_vk_queue(swapchain->command_queue);
vkQueuePresentKHR(vk_queue, &present_desc);
vkd3d_release_vk_queue(swapchain->command_queue);
vkAcquireNextImageKHR(swapchain->vk_device, swapchain->vk_swapchain, UINT64_MAX,
VK_NULL_HANDLE, swapchain->vk_fence, &swapchain->current_buffer);
vkWaitForFences(swapchain->vk_device, 1, &swapchain->vk_fence, VK_TRUE, UINT64_MAX);
vkResetFences(swapchain->vk_device, 1, &swapchain->vk_fence);
}
static inline void demo_swapchain_destroy(struct demo_swapchain *swapchain)
{
unsigned int i;
ID3D12CommandQueue_Release(swapchain->command_queue);
ID3D12Fence_Release(swapchain->present_fence);
for (i = 0; i < swapchain->buffer_count; ++i)
{
ID3D12Resource_Release(swapchain->buffers[i]);
}
vkDestroyFence(swapchain->vk_device, swapchain->vk_fence, NULL);
vkDestroySwapchainKHR(swapchain->vk_device, swapchain->vk_swapchain, NULL);
vkDestroySurfaceKHR(swapchain->vk_instance, swapchain->vk_surface, NULL);
free(swapchain);
}
static inline HANDLE demo_create_event(void)
{
return vkd3d_create_event();
}
static inline unsigned int demo_wait_event(HANDLE event, unsigned int ms)
{
return vkd3d_wait_event(event, ms);
}
static inline void demo_destroy_event(HANDLE event)
{
vkd3d_destroy_event(event);
}
......@@ -31,6 +31,8 @@ struct demo
void *user_data;
void (*idle_func)(struct demo *demo, void *user_data);
UINT (*GetDpiForSystem)(void);
};
struct demo_window
......@@ -48,6 +50,11 @@ struct demo_swapchain
IDXGISwapChain3 *swapchain;
};
static inline void demo_get_dpi(struct demo *demo, double *dpi_x, double *dpi_y)
{
*dpi_x = *dpi_y = demo->GetDpiForSystem();
}
static inline struct demo_window *demo_window_create(struct demo *demo, const char *title,
unsigned int width, unsigned int height, void *user_data)
{
......@@ -191,6 +198,11 @@ static inline void demo_process_events(struct demo *demo)
}
}
static inline UINT demo_GetDpiForSystem(void)
{
return 96;
}
static inline bool demo_init(struct demo *demo, void *user_data)
{
WNDCLASSEXW wc;
......@@ -215,6 +227,11 @@ static inline bool demo_init(struct demo *demo, void *user_data)
demo->user_data = user_data;
demo->idle_func = NULL;
if ((demo->GetDpiForSystem = (void *)GetProcAddress(GetModuleHandleA("user32"), "GetDpiForSystem")))
SetProcessDPIAware();
else
demo->GetDpiForSystem = demo_GetDpiForSystem;
return true;
}
......
This diff is collapsed.
......@@ -48,7 +48,7 @@
#include <math.h>
#include "demo.h"
#include "gears_hlsl.h"
DEMO_EMBED(gears_hlsl, "gears.hlsl");
struct cxg_fence
{
......@@ -681,11 +681,14 @@ static void cxg_load_assets(struct cx_gears *cxg)
hr = demo_create_root_signature(cxg->device, &root_signature_desc, &cxg->root_signature);
assert(SUCCEEDED(hr));
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
hr = D3DCompile(gears_hlsl, gears_hlsl_size, "gears.hlsl",
NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
assert(SUCCEEDED(hr));
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "ps_main_flat", "ps_5_0", 0, 0, &ps_flat, NULL);
hr = D3DCompile(gears_hlsl, gears_hlsl_size, "gears.hlsl",
NULL, NULL, "ps_main_flat", "ps_5_0", 0, 0, &ps_flat, NULL);
assert(SUCCEEDED(hr));
hr = D3DCompile(gears_hlsl, strlen(gears_hlsl), NULL, NULL, NULL, "ps_main_smooth", "ps_5_0", 0, 0, &ps_smooth, NULL);
hr = D3DCompile(gears_hlsl, gears_hlsl_size, "gears.hlsl",
NULL, NULL, "ps_main_smooth", "ps_5_0", 0, 0, &ps_smooth, NULL);
assert(SUCCEEDED(hr));
memset(&pso_desc, 0, sizeof(pso_desc));
......@@ -846,12 +849,16 @@ static int cxg_main(void)
{
unsigned int width = 300, height = 300;
struct cx_gears cxg;
double dpi_x, dpi_y;
memset(&cxg, 0, sizeof(cxg));
if (!demo_init(&cxg.demo, &cxg))
return EXIT_FAILURE;
demo_set_idle_func(&cxg.demo, cxg_idle);
demo_get_dpi(&cxg.demo, &dpi_x, &dpi_y);
width *= dpi_x / 96.0;
height *= dpi_y / 96.0;
cxg.window = demo_window_create(&cxg.demo, "Vkd3d Gears", width, height, &cxg);
demo_window_set_key_press_func(cxg.window, cxg_key_press);
demo_window_set_expose_func(cxg.window, cxg_expose);
......
/*
* Copyright 2016 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
cbuffer gear_block : register(b0)
{
float4x4 mvp_matrix;
float3x3 normal_matrix;
};
struct vs_in
{
float4 position : POSITION;
float3 normal : NORMAL;
float3 diffuse : DIFFUSE;
float4 transform : TRANSFORM;
};
struct vs_out
{
float4 position : SV_POSITION;
float4 colour : COLOR;
};
struct vs_out vs_main(struct vs_in i)
{
const float3 l_pos = float3(5.0, 5.0, 10.0);
float3 dir, normal;
float4 position;
struct vs_out o;
float att;
position.x = i.transform.x * i.position.x - i.transform.y * i.position.y + i.transform.z;
position.y = i.transform.x * i.position.y + i.transform.y * i.position.x + i.transform.w;
position.zw = i.position.zw;
o.position = mul(mvp_matrix, position);
dir = normalize(l_pos - o.position.xyz / o.position.w);
normal.x = i.transform.x * i.normal.x - i.transform.y * i.normal.y;
normal.y = i.transform.x * i.normal.y + i.transform.y * i.normal.x;
normal.z = i.normal.z;
att = 0.2 + dot(dir, normalize(mul(normal_matrix, normal)));
o.colour.xyz = i.diffuse.xyz * att;
o.colour.w = 1.0;
return o;
}
float4 ps_main_smooth(float4 position : SV_POSITION, float4 colour : COLOR) : SV_TARGET
{
return colour;
}
float4 ps_main_flat(float4 position : SV_POSITION, nointerpolation float4 colour : COLOR) : SV_TARGET
{
return colour;
}
static const char gears_hlsl[] =
"cbuffer gear_block : register(b0)\n"
"{\n"
" float4x4 mvp_matrix;\n"
" float3x3 normal_matrix;\n"
"};\n"
"\n"
"struct vs_in\n"
"{\n"
" float4 position : POSITION;\n"
" float3 normal : NORMAL;\n"
" float3 diffuse : DIFFUSE;\n"
" float4 transform : TRANSFORM;\n"
"};\n"
"\n"
"struct vs_out\n"
"{\n"
" float4 position : SV_POSITION;\n"
" float4 colour : COLOR;\n"
"};\n"
"\n"
"struct vs_out vs_main(struct vs_in i)\n"
"{\n"
" const float3 l_pos = float3(5.0, 5.0, 10.0);\n"
" float3 dir, normal;\n"
" float4 position;\n"
" struct vs_out o;\n"
" float att;\n"
"\n"
" position.x = i.transform.x * i.position.x - i.transform.y * i.position.y + i.transform.z;\n"
" position.y = i.transform.x * i.position.y + i.transform.y * i.position.x + i.transform.w;\n"
" position.zw = i.position.zw;\n"
"\n"
" o.position = mul(mvp_matrix, position);\n"
" dir = normalize(l_pos - o.position.xyz / o.position.w);\n"
"\n"
" normal.x = i.transform.x * i.normal.x - i.transform.y * i.normal.y;\n"
" normal.y = i.transform.x * i.normal.y + i.transform.y * i.normal.x;\n"
" normal.z = i.normal.z;\n"
" att = 0.2 + dot(dir, normalize(mul(normal_matrix, normal)));\n"
"\n"
" o.colour.xyz = i.diffuse.xyz * att;\n"
" o.colour.w = 1.0;\n"
"\n"
" return o;\n"
"}\n"
"\n"
"float4 ps_main_smooth(float4 position : SV_POSITION, float4 colour : COLOR) : SV_TARGET\n"
"{\n"
" return colour;\n"
"}\n"
"\n"
"float4 ps_main_flat(float4 position : SV_POSITION, nointerpolation float4 colour : COLOR) : SV_TARGET\n"
"{\n"
" return colour;\n"
"}\n";
......@@ -45,7 +45,7 @@
#include <assert.h>
#include "demo.h"
#include "triangle_hlsl.h"
DEMO_EMBED(triangle_hlsl, "triangle.hlsl");
struct cxt_fence
{
......@@ -285,9 +285,11 @@ static void cxt_load_assets(struct cx_triangle *cxt)
hr = demo_create_root_signature(cxt->device, &root_signature_desc, &cxt->root_signature);
assert(SUCCEEDED(hr));
hr = D3DCompile(triangle_hlsl, strlen(triangle_hlsl), NULL, NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
hr = D3DCompile(triangle_hlsl, triangle_hlsl_size, "triangle.hlsl",
NULL, NULL, "vs_main", "vs_5_0", 0, 0, &vs, NULL);
assert(SUCCEEDED(hr));
hr = D3DCompile(triangle_hlsl, strlen(triangle_hlsl), NULL, NULL, NULL, "ps_main", "ps_5_0", 0, 0, &ps, NULL);
hr = D3DCompile(triangle_hlsl, triangle_hlsl_size, "triangle.hlsl",
NULL, NULL, "ps_main", "ps_5_0", 0, 0, &ps, NULL);
assert(SUCCEEDED(hr));
memset(&pso_desc, 0, sizeof(pso_desc));
......@@ -366,12 +368,16 @@ static int cxt_main(void)
{
unsigned int width = 640, height = 480;
struct cx_triangle cxt;
double dpi_x, dpi_y;
memset(&cxt, 0, sizeof(cxt));
if (!demo_init(&cxt.demo, NULL))
return EXIT_FAILURE;
demo_get_dpi(&cxt.demo, &dpi_x, &dpi_y);
width *= dpi_x / 96.0;
height *= dpi_y / 96.0;
cxt.window = demo_window_create(&cxt.demo, "Vkd3d Triangle", width, height, &cxt);
demo_window_set_expose_func(cxt.window, cxt_render_frame);
demo_window_set_key_press_func(cxt.window, cxt_key_press);
......
/*
* Copyright 2016 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* This application contains code derived from Microsoft's "HelloTriangle"
* demo, the license for which follows:
*
* Copyright (c) 2015 Microsoft
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
struct ps_in
{
float4 position : SV_POSITION;
float4 colour : COLOR;
};
struct ps_in vs_main(float4 position : POSITION, float4 colour : COLOR)
{
struct ps_in o;
o.position = position;
o.colour = colour;
return o;
}
float4 ps_main(struct ps_in i) : SV_TARGET
{
return i.colour;
}
static const char triangle_hlsl[] =
"struct ps_in\n"
"{\n"
" float4 position : SV_POSITION;\n"
" float4 colour : COLOR;\n"
"};\n"
"\n"
"struct ps_in vs_main(float4 position : POSITION, float4 colour : COLOR)\n"
"{\n"
" struct ps_in o;\n"
"\n"
" o.position = position;\n"
" o.colour = colour;\n"
"\n"
" return o;\n"
"}\n"
"\n"
"float4 ps_main(struct ps_in i) : SV_TARGET\n"
"{\n"
" return i.colour;\n"
"}\n";
......@@ -12,7 +12,7 @@ mkdir build
cd build
export LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH-}"
if ../configure --enable-demos --with-spirv-tools DXCOMPILER_LIBS="-L/usr/local/lib" CFLAGS="-g -O2 -Werror" \
CPPFLAGS="-DVKD3D_SHADER_UNSUPPORTED_DXIL -DVKD3D_SHADER_UNSUPPORTED_GLSL -DVKD3D_ABORT_ON_ERR" && \
CPPFLAGS="-DVKD3D_SHADER_UNSUPPORTED_GLSL -DVKD3D_ABORT_ON_ERR" && \
make -j$(nproc) ; then
make -j$(nproc) AM_COLOR_TESTS=always check || \
touch ../tests_failed
......
......@@ -11,7 +11,8 @@ rm -fr build
mkdir build
cd build
if ../configure CFLAGS="-I/opt/homebrew/opt/vulkan-headers/include -I/opt/homebrew/opt/spirv-headers/include -g -O2 -Wno-implicit-fallthrough -Wno-ignored-attributes -Wno-unknown-attributes -Wno-unused-but-set-variable -Werror" \
CPPFLAGS="-DVKD3D_ABORT_ON_ERR" \
OBJCFLAGS="-g -O2 -Wno-unknown-attributes -Wno-ignored-attributes -Werror" \
CPPFLAGS="-DVKD3D_ABORT_ON_ERR -DVKD3D_SHADER_UNSUPPORTED_MSL" \
VULKAN_LIBS=-L/opt/homebrew/opt/vulkan-loader/lib --with-spirv-tools && \
make -j$(sysctl -n hw.ncpu) ; then
make -j$(sysctl -n hw.ncpu) AM_COLOR_TESTS=always check || \
......