renderer/vulkan: Fix binding/unbinding of shadow rendering buffer.
This commit is contained in:
@ -244,6 +244,11 @@ void RasterizerAccelerated::NotifyPicaRegisterChanged(u32 id) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Fragment operation mode
|
||||||
|
case PICA_REG_INDEX(framebuffer.output_merger.fragment_operation_mode):
|
||||||
|
shader_dirty = true;
|
||||||
|
break;
|
||||||
|
|
||||||
// Alpha test
|
// Alpha test
|
||||||
case PICA_REG_INDEX(framebuffer.output_merger.alpha_test):
|
case PICA_REG_INDEX(framebuffer.output_merger.alpha_test):
|
||||||
SyncAlphaTest();
|
SyncAlphaTest();
|
||||||
@ -617,12 +622,11 @@ void RasterizerAccelerated::NotifyPicaRegisterChanged(u32 id) {
|
|||||||
case PICA_REG_INDEX(rasterizer.clip_coef[3]):
|
case PICA_REG_INDEX(rasterizer.clip_coef[3]):
|
||||||
SyncClipCoef();
|
SyncClipCoef();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
// Forward registers that map to fixed function API features to the video backend
|
// Forward registers that map to fixed function API features to the video backend
|
||||||
NotifyFixedFunctionPicaRegisterChanged(id);
|
NotifyFixedFunctionPicaRegisterChanged(id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void RasterizerAccelerated::SyncDepthScale() {
|
void RasterizerAccelerated::SyncDepthScale() {
|
||||||
const f32 depth_scale = f24::FromRaw(regs.rasterizer.viewport_depth_range).ToFloat32();
|
const f32 depth_scale = f24::FromRaw(regs.rasterizer.viewport_depth_range).ToFloat32();
|
||||||
|
@ -632,9 +632,16 @@ bool Instance::SetMoltenVkConfig() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use synchronous queue submits if async presentation is enabled, to avoid threading
|
||||||
|
// indirection.
|
||||||
mvk_config.synchronousQueueSubmits = Settings::values.async_presentation.GetValue();
|
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;
|
mvk_config.resumeLostDevice = true;
|
||||||
|
// Maximize concurrency to improve shader compilation performance.
|
||||||
mvk_config.shouldMaximizeConcurrentCompilation = true;
|
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) !=
|
if (_vkSetMoltenVKConfigurationMVK(VK_NULL_HANDLE, &mvk_config, &mvk_config_size) !=
|
||||||
VK_SUCCESS) {
|
VK_SUCCESS) {
|
||||||
|
@ -471,6 +471,9 @@ bool RasterizerVulkan::Draw(bool accelerate, bool is_indexed) {
|
|||||||
|
|
||||||
if (shadow_rendering) {
|
if (shadow_rendering) {
|
||||||
pipeline_cache.BindStorageImage(6, framebuffer->ImageView(SurfaceType::Color));
|
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
|
// Update scissor uniforms
|
||||||
@ -660,7 +663,7 @@ void RasterizerVulkan::UnbindSpecial() {
|
|||||||
const Surface& null_cube_surface = res_cache.GetSurface(VideoCore::NULL_SURFACE_CUBE_ID);
|
const Surface& null_cube_surface = res_cache.GetSurface(VideoCore::NULL_SURFACE_CUBE_ID);
|
||||||
const Sampler& null_sampler = res_cache.GetSampler(VideoCore::NULL_SAMPLER_ID);
|
const Sampler& null_sampler = res_cache.GetSampler(VideoCore::NULL_SAMPLER_ID);
|
||||||
pipeline_cache.BindTexture(3, null_cube_surface.ImageView(), null_sampler.Handle());
|
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());
|
pipeline_cache.BindStorageImage(i, null_surface.StorageView());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user