renderer/vulkan: Fix binding/unbinding of shadow rendering buffer.

This commit is contained in:
Steveice10
2023-09-04 16:26:33 +03:00
committed by GPUCode
parent 37f5d66c10
commit cc9768963a
3 changed files with 19 additions and 5 deletions

View File

@ -244,6 +244,11 @@ void RasterizerAccelerated::NotifyPicaRegisterChanged(u32 id) {
}
break;
// Fragment operation mode
case PICA_REG_INDEX(framebuffer.output_merger.fragment_operation_mode):
shader_dirty = true;
break;
// Alpha test
case PICA_REG_INDEX(framebuffer.output_merger.alpha_test):
SyncAlphaTest();
@ -617,11 +622,10 @@ void RasterizerAccelerated::NotifyPicaRegisterChanged(u32 id) {
case PICA_REG_INDEX(rasterizer.clip_coef[3]):
SyncClipCoef();
break;
default:
// Forward registers that map to fixed function API features to the video backend
NotifyFixedFunctionPicaRegisterChanged(id);
}
// Forward registers that map to fixed function API features to the video backend
NotifyFixedFunctionPicaRegisterChanged(id);
}
void RasterizerAccelerated::SyncDepthScale() {

View File

@ -632,9 +632,16 @@ bool Instance::SetMoltenVkConfig() {
return false;
}
// Use synchronous queue submits if async presentation is enabled, to avoid threading
// indirection.
mvk_config.synchronousQueueSubmits = Settings::values.async_presentation.GetValue();
// If the device is lost, make an attempt to resume if possible to avoid crashes.
mvk_config.resumeLostDevice = true;
// Maximize concurrency to improve shader compilation performance.
mvk_config.shouldMaximizeConcurrentCompilation = true;
// Use Metal argument buffers as otherwise we run into issues with shadow rendering
// image atomics.
mvk_config.useMetalArgumentBuffers = MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS_ALWAYS;
if (_vkSetMoltenVKConfigurationMVK(VK_NULL_HANDLE, &mvk_config, &mvk_config_size) !=
VK_SUCCESS) {

View File

@ -471,6 +471,9 @@ bool RasterizerVulkan::Draw(bool accelerate, bool is_indexed) {
if (shadow_rendering) {
pipeline_cache.BindStorageImage(6, framebuffer->ImageView(SurfaceType::Color));
} else {
Surface& null_surface = res_cache.GetSurface(VideoCore::NULL_SURFACE_ID);
pipeline_cache.BindStorageImage(6, null_surface.StorageView());
}
// Update scissor uniforms
@ -660,7 +663,7 @@ void RasterizerVulkan::UnbindSpecial() {
const Surface& null_cube_surface = res_cache.GetSurface(VideoCore::NULL_SURFACE_CUBE_ID);
const Sampler& null_sampler = res_cache.GetSampler(VideoCore::NULL_SAMPLER_ID);
pipeline_cache.BindTexture(3, null_cube_surface.ImageView(), null_sampler.Handle());
for (u32 i = 0; i < 7; i++) {
for (u32 i = 0; i < 6; i++) {
pipeline_cache.BindStorageImage(i, null_surface.StorageView());
}
}