vkd3d-shader: Make vkd3d_shader_transform_feedback_info a member

Moves it into vkd3d_shader_interface_info, this doesn't need to be
a pNext.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-04-19 17:23:07 +01:00 committed by Hans-Kristian Arntzen
parent 3e4a8b1504
commit 220e1146ee
5 changed files with 9 additions and 18 deletions

View File

@ -37,7 +37,6 @@ enum vkd3d_shader_structure_type
VKD3D_SHADER_STRUCTURE_TYPE_SHADER_INTERFACE_INFO,
VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_ARGUMENTS,
VKD3D_SHADER_STRUCTURE_TYPE_SCAN_INFO,
VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO,
VKD3D_SHADER_STRUCTURE_TYPE_DOMAIN_SHADER_COMPILE_ARGUMENTS,
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_STRUCTURE_TYPE),
@ -214,6 +213,8 @@ struct vkd3d_shader_interface_info
const struct vkd3d_shader_descriptor_binding *offset_buffer_binding;
VkShaderStageFlagBits stage;
const struct vkd3d_shader_transform_feedback_info *xfb_info;
};
struct vkd3d_shader_descriptor_table
@ -266,12 +267,8 @@ struct vkd3d_shader_transform_feedback_element
uint8_t output_slot;
};
/* Extends vkd3d_shader_interface_info. */
struct vkd3d_shader_transform_feedback_info
{
enum vkd3d_shader_structure_type type;
const void *next;
const struct vkd3d_shader_transform_feedback_element *elements;
unsigned int element_count;
const unsigned int *buffer_strides;

View File

@ -478,7 +478,6 @@ int vkd3d_shader_compile_dxil(const struct vkd3d_shader_code *dxbc,
const struct vkd3d_shader_interface_info *shader_interface_info,
const struct vkd3d_shader_compile_arguments *compiler_args)
{
const struct vkd3d_shader_transform_feedback_info *xfb_info;
struct vkd3d_dxil_remap_userdata remap_userdata;
unsigned int non_raw_va_binding_count = 0;
unsigned int raw_va_binding_count = 0;
@ -741,9 +740,8 @@ int vkd3d_shader_compile_dxil(const struct vkd3d_shader_code *dxbc,
dxil_spv_converter_set_vertex_input_remapper(converter, dxil_input_remap, (void *)shader_interface_info);
xfb_info = vkd3d_find_struct(shader_interface_info->next, TRANSFORM_FEEDBACK_INFO);
if (xfb_info)
dxil_spv_converter_set_stream_output_remapper(converter, dxil_output_remap, (void *)xfb_info);
if (shader_interface_info->xfb_info)
dxil_spv_converter_set_stream_output_remapper(converter, dxil_output_remap, (void *)shader_interface_info->xfb_info);
if (dxil_spv_converter_run(converter) != DXIL_SPV_SUCCESS)
{

View File

@ -2254,7 +2254,6 @@ struct vkd3d_dxbc_compiler
const struct vkd3d_shader_signature *input_signature;
const struct vkd3d_shader_signature *output_signature;
const struct vkd3d_shader_signature *patch_constant_signature;
const struct vkd3d_shader_transform_feedback_info *xfb_info;
struct vkd3d_shader_output_info
{
uint32_t id;
@ -2353,8 +2352,6 @@ struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader
if (shader_interface)
{
compiler->xfb_info = vkd3d_find_struct(shader_interface->next, TRANSFORM_FEEDBACK_INFO);
compiler->shader_interface = *shader_interface;
if (shader_interface->push_constant_buffer_count)
{
@ -4260,7 +4257,7 @@ static const struct vkd3d_shader_phase *vkd3d_dxbc_compiler_get_current_shader_p
static void vkd3d_dxbc_compiler_decorate_xfb_output(struct vkd3d_dxbc_compiler *compiler,
uint32_t id, unsigned int component_count, const struct vkd3d_shader_signature_element *signature_element)
{
const struct vkd3d_shader_transform_feedback_info *xfb_info = compiler->xfb_info;
const struct vkd3d_shader_transform_feedback_info *xfb_info = compiler->shader_interface.xfb_info;
const struct vkd3d_shader_transform_feedback_element *xfb_element;
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
unsigned int buffer_offsets[D3D12_SO_BUFFER_SLOT_COUNT];
@ -5586,7 +5583,7 @@ static const struct vkd3d_shader_buffer_reference_type *vkd3d_dxbc_compiler_get_
static void vkd3d_dxbc_compiler_emit_initial_declarations(struct vkd3d_dxbc_compiler *compiler)
{
const struct vkd3d_shader_transform_feedback_info *xfb_info = compiler->xfb_info;
const struct vkd3d_shader_transform_feedback_info *xfb_info = compiler->shader_interface.xfb_info;
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
switch (compiler->shader_type)

View File

@ -877,6 +877,7 @@ static HRESULT d3d12_state_object_compile_pipeline(struct d3d12_state_object *ob
/* Effectively ignored. */
shader_interface_info.stage = VK_SHADER_STAGE_ALL;
shader_interface_info.xfb_info = NULL;
global_signature = unsafe_impl_from_ID3D12RootSignature(data->global_root_signature);

View File

@ -2148,6 +2148,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st
shader_interface.push_constant_ubo_binding = &root_signature->push_constant_ubo_binding;
shader_interface.offset_buffer_binding = &root_signature->offset_buffer_binding;
shader_interface.stage = VK_SHADER_STAGE_COMPUTE_BIT;
shader_interface.xfb_info = NULL;
if ((hr = vkd3d_create_pipeline_cache_from_d3d12_desc(device, &desc->cached_pso, &state->vk_pso_cache)) < 0)
{
@ -3003,9 +3004,6 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
graphics->xfb_enabled = true;
xfb_info.type = VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO;
xfb_info.next = NULL;
xfb_info.elements = (const struct vkd3d_shader_transform_feedback_element *)so_desc->pSODeclaration;
xfb_info.element_count = so_desc->NumEntries;
xfb_info.buffer_strides = so_desc->pBufferStrides;
@ -3077,7 +3075,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
goto fail;
}
shader_interface.next = shader_stages[i].stage == xfb_stage ? &xfb_info : NULL;
shader_interface.xfb_info = shader_stages[i].stage == xfb_stage ? &xfb_info : NULL;
shader_interface.stage = shader_stages[i].stage;
if (FAILED(hr = create_shader_stage(device, &graphics->stages[graphics->stage_count],
shader_stages[i].stage, b, &shader_interface,