mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[vulkan] Limit shadow textures to 32
This is the minimum maximum count for sampled images, and with layered shadow maps (with a minimum of 2048 layers supported), that's really way more than enough.
This commit is contained in:
parent
edc1326736
commit
87f99f9081
4 changed files with 4 additions and 11 deletions
|
@ -58,7 +58,7 @@ typedef struct qfv_light_buffer_s {
|
||||||
|
|
||||||
#define LIGHTING_BUFFER_INFOS 1
|
#define LIGHTING_BUFFER_INFOS 1
|
||||||
#define LIGHTING_ATTACH_INFOS 5
|
#define LIGHTING_ATTACH_INFOS 5
|
||||||
#define LIGHTING_SHADOW_INFOS MaxLights
|
#define LIGHTING_SHADOW_INFOS 32
|
||||||
#define LIGHTING_DESCRIPTORS (LIGHTING_BUFFER_INFOS + LIGHTING_ATTACH_INFOS + 1)
|
#define LIGHTING_DESCRIPTORS (LIGHTING_BUFFER_INFOS + LIGHTING_ATTACH_INFOS + 1)
|
||||||
|
|
||||||
typedef struct lightingframe_s {
|
typedef struct lightingframe_s {
|
||||||
|
|
|
@ -47,11 +47,6 @@ typedef struct qfv_matrix_buffer_s {
|
||||||
vec4f_t pad2[3];
|
vec4f_t pad2[3];
|
||||||
} qfv_matrix_buffer_t;
|
} qfv_matrix_buffer_t;
|
||||||
|
|
||||||
#define LIGHTING_BUFFER_INFOS 1
|
|
||||||
#define LIGHTING_ATTACH_INFOS 5
|
|
||||||
#define LIGHTING_SHADOW_INFOS MaxLights
|
|
||||||
#define LIGHTING_DESCRIPTORS (LIGHTING_BUFFER_INFOS + LIGHTING_ATTACH_INFOS + 1)
|
|
||||||
|
|
||||||
typedef struct matrixframe_s {
|
typedef struct matrixframe_s {
|
||||||
//VkCommandBuffer cmd;
|
//VkCommandBuffer cmd;
|
||||||
VkBuffer buffer;
|
VkBuffer buffer;
|
||||||
|
|
|
@ -229,7 +229,7 @@
|
||||||
bindings = (
|
bindings = (
|
||||||
{
|
{
|
||||||
type = combined_image_sampler;
|
type = combined_image_sampler;
|
||||||
descriptorCount = 768;//"$frames.size * size_t($properties.limits.maxSamplers)";
|
descriptorCount = "$frames.size * size_t(32)";
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
{
|
{
|
||||||
binding = 0;
|
binding = 0;
|
||||||
descriptorType = combined_image_sampler;
|
descriptorType = combined_image_sampler;
|
||||||
descriptorCount = 768;//$properties.limits.maxSamplers;
|
descriptorCount = 32;
|
||||||
stageFlags = fragment;
|
stageFlags = fragment;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -448,9 +448,7 @@ Vulkan_Lighting_Init (vulkan_ctx_t *ctx)
|
||||||
lframe->shadowWrite = base_image_write;
|
lframe->shadowWrite = base_image_write;
|
||||||
lframe->shadowWrite.dstSet = shadow_set->a[i];
|
lframe->shadowWrite.dstSet = shadow_set->a[i];
|
||||||
lframe->shadowWrite.dstBinding = 0;
|
lframe->shadowWrite.dstBinding = 0;
|
||||||
lframe->shadowWrite.descriptorCount
|
lframe->shadowWrite.descriptorCount = LIGHTING_SHADOW_INFOS;
|
||||||
= min (MaxLights,
|
|
||||||
device->physDev->properties->limits.maxPerStageDescriptorSamplers);
|
|
||||||
lframe->shadowWrite.pImageInfo = lframe->shadowInfo;
|
lframe->shadowWrite.pImageInfo = lframe->shadowInfo;
|
||||||
}
|
}
|
||||||
free (shadow_set);
|
free (shadow_set);
|
||||||
|
|
Loading…
Reference in a new issue