Skip to content

Commit

Permalink
gpu: do not crash on null pixel shader
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Oct 23, 2024
1 parent 43afb19 commit 9f230af
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rpcsx/gpu/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,19 @@ void amdgpu::draw(GraphicsPipe &pipe, int vmId, std::uint32_t firstVertex,
vsPrimType, viewPorts);
}

auto pixelShader =
cacheTag.getPixelShader(pipe.sh.spiShaderPgmPs, pipe.context, viewPorts);
shaders[Cache::getStageIndex(VK_SHADER_STAGE_VERTEX_BIT)] =
vertexShader.handle;

if (pipe.sh.spiShaderPgmPs.address != 0) {
auto pixelShader = cacheTag.getPixelShader(pipe.sh.spiShaderPgmPs,
pipe.context, viewPorts);

if (pixelShader.handle == nullptr) {
shaders[Cache::getStageIndex(VK_SHADER_STAGE_FRAGMENT_BIT)] =
getFillRedFragShader(*cacheTag.getCache());
pixelShader.handle != nullptr
? pixelShader.handle
: getFillRedFragShader(*cacheTag.getCache());
}

shaders[Cache::getStageIndex(VK_SHADER_STAGE_VERTEX_BIT)] =
vertexShader.handle;
shaders[Cache::getStageIndex(VK_SHADER_STAGE_FRAGMENT_BIT)] =
pixelShader.handle;

if (pipe.uConfig.vgtPrimitiveType == gnm::PrimitiveType::RectList) {
shaders[Cache::getStageIndex(VK_SHADER_STAGE_GEOMETRY_BIT)] =
getPrimTypeRectGeomShader(*cacheTag.getCache());
Expand Down

0 comments on commit 9f230af

Please sign in to comment.