mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
renderer_vulkan: Fix additional validation errors (#4296)
This commit is contained in:
parent
d1643d1475
commit
01e8606f14
@ -26,15 +26,6 @@ static constexpr std::array LogicalStageToStageBit = {
|
||||
vk::ShaderStageFlagBits::eCompute,
|
||||
};
|
||||
|
||||
static bool IsPrimitiveTopologyList(const vk::PrimitiveTopology topology) {
|
||||
return topology == vk::PrimitiveTopology::ePointList ||
|
||||
topology == vk::PrimitiveTopology::eLineList ||
|
||||
topology == vk::PrimitiveTopology::eTriangleList ||
|
||||
topology == vk::PrimitiveTopology::eLineListWithAdjacency ||
|
||||
topology == vk::PrimitiveTopology::eTriangleListWithAdjacency ||
|
||||
topology == vk::PrimitiveTopology::ePatchList;
|
||||
}
|
||||
|
||||
GraphicsPipeline::GraphicsPipeline(
|
||||
const Instance& instance, Scheduler& scheduler, DescriptorHeap& desc_heap,
|
||||
const Shader::Profile& profile, const GraphicsPipelineKey& key_,
|
||||
|
||||
@ -829,6 +829,7 @@ RenderState Rasterizer::BeginRendering(const GraphicsPipeline* pipeline) {
|
||||
for (auto cb = 0u; cb < state.num_color_attachments; ++cb) {
|
||||
auto& [image_id, desc] = cb_descs[cb];
|
||||
if (!image_id) {
|
||||
state.color_attachments[cb] = {};
|
||||
continue;
|
||||
}
|
||||
auto* image = &texture_cache.GetImage(image_id);
|
||||
@ -1286,7 +1287,19 @@ void Rasterizer::UpdatePrimitiveState(const bool is_indexed) const {
|
||||
const auto& regs = liverpool->regs;
|
||||
auto& dynamic_state = scheduler.GetDynamicState();
|
||||
|
||||
const auto prim_restart = (regs.enable_primitive_restart & 1) != 0;
|
||||
const auto is_list_topology = [](const AmdGpu::PrimitiveType type) {
|
||||
const auto topology = LiverpoolToVK::PrimitiveType(type);
|
||||
return topology == vk::PrimitiveTopology::ePointList ||
|
||||
topology == vk::PrimitiveTopology::eLineList ||
|
||||
topology == vk::PrimitiveTopology::eTriangleList ||
|
||||
topology == vk::PrimitiveTopology::eLineListWithAdjacency ||
|
||||
topology == vk::PrimitiveTopology::eTriangleListWithAdjacency ||
|
||||
topology == vk::PrimitiveTopology::ePatchList;
|
||||
};
|
||||
|
||||
const auto prim_restart =
|
||||
(regs.enable_primitive_restart & 1) != 0 &&
|
||||
(instance.IsListRestartSupported() || !is_list_topology(regs.primitive_type));
|
||||
ASSERT_MSG(!is_indexed || !prim_restart || regs.primitive_restart_index == 0xFFFF ||
|
||||
regs.primitive_restart_index == 0xFFFFFFFF,
|
||||
"Primitive restart index other than -1 is not supported yet");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user