mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/spirv: Implement texel offset support for sample_c instructions.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
ebc82a622c
commit
ea1b01b1f8
@@ -8235,12 +8235,9 @@ static void vkd3d_dxbc_compiler_emit_sample_c(struct vkd3d_dxbc_compiler *compil
|
|||||||
SpvImageOperandsMask operands_mask = 0;
|
SpvImageOperandsMask operands_mask = 0;
|
||||||
unsigned int image_operand_count = 0;
|
unsigned int image_operand_count = 0;
|
||||||
struct vkd3d_shader_image image;
|
struct vkd3d_shader_image image;
|
||||||
uint32_t image_operands[1];
|
uint32_t image_operands[2];
|
||||||
SpvOp op;
|
SpvOp op;
|
||||||
|
|
||||||
if (vkd3d_shader_instruction_has_texel_offset(instruction))
|
|
||||||
FIXME("Texel offset not supported.\n");
|
|
||||||
|
|
||||||
if (instruction->handler_idx == VKD3DSIH_SAMPLE_C_LZ)
|
if (instruction->handler_idx == VKD3DSIH_SAMPLE_C_LZ)
|
||||||
{
|
{
|
||||||
op = SpvOpImageSampleDrefExplicitLod;
|
op = SpvOpImageSampleDrefExplicitLod;
|
||||||
@@ -8255,6 +8252,14 @@ static void vkd3d_dxbc_compiler_emit_sample_c(struct vkd3d_dxbc_compiler *compil
|
|||||||
|
|
||||||
vkd3d_dxbc_compiler_prepare_image(compiler,
|
vkd3d_dxbc_compiler_prepare_image(compiler,
|
||||||
&image, &src[1].reg, &src[2].reg, VKD3D_IMAGE_FLAG_SAMPLED | VKD3D_IMAGE_FLAG_DEPTH);
|
&image, &src[1].reg, &src[2].reg, VKD3D_IMAGE_FLAG_SAMPLED | VKD3D_IMAGE_FLAG_DEPTH);
|
||||||
|
|
||||||
|
if (vkd3d_shader_instruction_has_texel_offset(instruction))
|
||||||
|
{
|
||||||
|
operands_mask |= SpvImageOperandsConstOffsetMask;
|
||||||
|
image_operands[image_operand_count++] = vkd3d_dxbc_compiler_emit_texel_offset(compiler,
|
||||||
|
instruction, image.resource_type_info);
|
||||||
|
}
|
||||||
|
|
||||||
sampled_type_id = vkd3d_spirv_get_type_id(builder, image.sampled_type, 1);
|
sampled_type_id = vkd3d_spirv_get_type_id(builder, image.sampled_type, 1);
|
||||||
coordinate_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[0], VKD3DSP_WRITEMASK_ALL);
|
coordinate_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[0], VKD3DSP_WRITEMASK_ALL);
|
||||||
dref_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[3], VKD3DSP_WRITEMASK_0);
|
dref_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[3], VKD3DSP_WRITEMASK_0);
|
||||||
|
@@ -14784,7 +14784,6 @@ static void test_sample_c_lz(void)
|
|||||||
transition_resource_state(command_list, context.render_target,
|
transition_resource_state(command_list, context.render_target,
|
||||||
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||||
|
|
||||||
todo_if(j && tests[i].d_ref > 0.0f)
|
|
||||||
check_sub_resource_float(context.render_target, 0, queue, command_list, tests[i].expected, 2);
|
check_sub_resource_float(context.render_target, 0, queue, command_list, tests[i].expected, 2);
|
||||||
|
|
||||||
reset_command_list(command_list, context.allocator);
|
reset_command_list(command_list, context.allocator);
|
||||||
|
Reference in New Issue
Block a user