mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
spirv: Ignore ArrayStride in OpPtrAccessChain for Workgroup
From OpPtrAccessChain description in the SPIR-V spec (1.4 rev 1):
For objects in the Uniform, StorageBuffer, or PushConstant storage
classes, the element’s address or location is calculated using a
stride, which will be the Base-type’s Array Stride when the Base
type is decorated with ArrayStride. For all other objects, the
implementation will calculate the element’s address or location.
For non-CL shaders the driver should layout the Workgroup storage
class, so override any explicitly set ArrayStride in the shader. This
currently fixes only the lower_workgroup_access_to_offsets case, which
is used by anv.
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
This commit is contained in:
parent
95a7fd0f10
commit
050eb6389a
1 changed files with 6 additions and 4 deletions
|
|
@ -1396,15 +1396,17 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} else if (storage_class == SpvStorageClassWorkgroup &&
|
||||||
|
|
||||||
if (storage_class == SpvStorageClassWorkgroup &&
|
|
||||||
b->options->lower_workgroup_access_to_offsets) {
|
b->options->lower_workgroup_access_to_offsets) {
|
||||||
|
/* Workgroup is laid out by the implementation. */
|
||||||
uint32_t size, align;
|
uint32_t size, align;
|
||||||
val->type->deref = vtn_type_layout_std430(b, val->type->deref,
|
val->type->deref = vtn_type_layout_std430(b, val->type->deref,
|
||||||
&size, &align);
|
&size, &align);
|
||||||
val->type->length = size;
|
val->type->length = size;
|
||||||
val->type->align = align;
|
val->type->align = align;
|
||||||
|
|
||||||
|
/* Override any ArrayStride previously set. */
|
||||||
|
val->type->stride = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue