Compare commits

...

2 Commits

Author SHA1 Message Date
Joshua Ashton ab5060a7f2 vkd3d-shader: Fix potential buffer overrun for image_operands
This would happen if you both sampled with both a texel offset and were LOD masked.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-29 13:53:49 +01:00
Joshua Ashton 5e3127a0d5 vkd3d-shader: Fix buffer overrun for bindless constant loads
Previously, last_index would be 4 by the time it got to the loop if we were bindless -- which corrupted the component_ids that were being written.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-29 13:53:49 +01:00
1 changed files with 2 additions and 2 deletions

View File

@ -3170,7 +3170,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_constant_buffer(struct vkd3d_dxbc_
{
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
uint32_t type_id, ptr_type_id, ptr_id, val_id, last_index;
uint32_t indexes[4], component_ids[4];
uint32_t indexes[5], component_ids[4];
unsigned int i, j, component_count;
assert(!reg->idx[0].rel_addr);
@ -7874,7 +7874,7 @@ static void vkd3d_dxbc_compiler_emit_sample(struct vkd3d_dxbc_compiler *compiler
unsigned int image_operand_count = 0;
struct vkd3d_shader_image image;
unsigned int num_coordinates;
uint32_t image_operands[3];
uint32_t image_operands[4];
DWORD coordinate_mask;
bool is_sparse_op;
SpvOp op;