nvk: Take CRS into account when allocating the SLM area
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30402>
This commit is contained in:
committed by
Marge Bot
parent
b78f7d208b
commit
d19ea8524b
@@ -585,8 +585,10 @@ nvk_cmd_bind_shaders(struct vk_command_buffer *vk_cmd,
|
||||
struct nvk_shader *shader =
|
||||
container_of(shaders[i], struct nvk_shader, vk);
|
||||
|
||||
if (shader != NULL && shader->info.slm_size > 0)
|
||||
nvk_device_ensure_slm(dev, shader->info.slm_size);
|
||||
if (shader != NULL) {
|
||||
nvk_device_ensure_slm(dev, shader->info.slm_size,
|
||||
shader->info.crs_size);
|
||||
}
|
||||
|
||||
if (stages[i] == MESA_SHADER_COMPUTE ||
|
||||
stages[i] == MESA_SHADER_KERNEL)
|
||||
|
||||
@@ -52,17 +52,15 @@ nvk_slm_area_get_mem_ref(struct nvk_slm_area *area,
|
||||
static VkResult
|
||||
nvk_slm_area_ensure(struct nvk_device *dev,
|
||||
struct nvk_slm_area *area,
|
||||
uint32_t bytes_per_thread)
|
||||
uint32_t slm_bytes_per_lane,
|
||||
uint32_t crs_bytes_per_warp)
|
||||
{
|
||||
struct nvk_physical_device *pdev = nvk_device_physical(dev);
|
||||
VkResult result;
|
||||
|
||||
assert(bytes_per_thread < (1 << 24));
|
||||
|
||||
/* TODO: Volta+doesn't use CRC */
|
||||
const uint32_t crs_size = 0;
|
||||
|
||||
uint64_t bytes_per_warp = bytes_per_thread * 32 + crs_size;
|
||||
assert(slm_bytes_per_lane < (1 << 24));
|
||||
assert(crs_bytes_per_warp <= (1 << 20));
|
||||
uint64_t bytes_per_warp = slm_bytes_per_lane * 32 + crs_bytes_per_warp;
|
||||
|
||||
/* The hardware seems to require this alignment for
|
||||
* NV9097_SET_SHADER_LOCAL_MEMORY_E_DEFAULT_SIZE_PER_WARP
|
||||
@@ -359,7 +357,10 @@ nvk_GetCalibratedTimestampsKHR(VkDevice _device,
|
||||
|
||||
VkResult
|
||||
nvk_device_ensure_slm(struct nvk_device *dev,
|
||||
uint32_t bytes_per_thread)
|
||||
uint32_t slm_bytes_per_lane,
|
||||
uint32_t crs_bytes_per_warp)
|
||||
{
|
||||
return nvk_slm_area_ensure(dev, &dev->slm, bytes_per_thread);
|
||||
return nvk_slm_area_ensure(dev, &dev->slm,
|
||||
slm_bytes_per_lane,
|
||||
crs_bytes_per_warp);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,8 @@ struct nvk_device {
|
||||
VK_DEFINE_HANDLE_CASTS(nvk_device, vk.base, VkDevice, VK_OBJECT_TYPE_DEVICE)
|
||||
|
||||
VkResult nvk_device_ensure_slm(struct nvk_device *dev,
|
||||
uint32_t bytes_per_thread);
|
||||
uint32_t slm_bytes_per_lane,
|
||||
uint32_t crs_bytes_per_warp);
|
||||
|
||||
static inline struct nvk_physical_device *
|
||||
nvk_device_physical(struct nvk_device *dev)
|
||||
|
||||
Reference in New Issue
Block a user