mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-04 17:53:17 +00:00
gpu: check right register for primitive restart index (#453)
@red-prig suggestion Not sure if it is possible to have trash in the register (maybe if primitive restart is toggled off), but just to make sure.
This commit is contained in:
parent
ad60ae1d40
commit
444cdfbba5
4 changed files with 13 additions and 8 deletions
|
@ -86,10 +86,10 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul
|
|||
|
||||
const vk::PipelineInputAssemblyStateCreateInfo input_assembly = {
|
||||
.topology = LiverpoolToVK::PrimitiveType(key.prim_type),
|
||||
.primitiveRestartEnable = key.prim_restart_index != 0,
|
||||
.primitiveRestartEnable = key.enable_primitive_restart != 0,
|
||||
};
|
||||
ASSERT_MSG(key.prim_restart_index == 0 || key.prim_restart_index == 0xFFFF,
|
||||
"Primitive restart index other than 0xFFFF is not supported");
|
||||
ASSERT_MSG(!key.enable_primitive_restart || key.primitive_restart_index == 0xFFFF,
|
||||
"Primitive restart index other than 0xFFFF is not supported yet");
|
||||
|
||||
const vk::PipelineRasterizationStateCreateInfo raster_state = {
|
||||
.depthClampEnable = false,
|
||||
|
|
|
@ -39,7 +39,8 @@ struct GraphicsPipelineKey {
|
|||
Liverpool::StencilRefMask stencil_ref_front;
|
||||
Liverpool::StencilRefMask stencil_ref_back;
|
||||
Liverpool::PrimitiveType prim_type;
|
||||
u32 prim_restart_index;
|
||||
u32 enable_primitive_restart;
|
||||
u32 primitive_restart_index;
|
||||
Liverpool::PolygonMode polygon_mode;
|
||||
Liverpool::CullMode cull_mode;
|
||||
Liverpool::FrontFace front_face;
|
||||
|
|
|
@ -165,7 +165,8 @@ void PipelineCache::RefreshGraphicsKey() {
|
|||
key.stencil_ref_front = regs.stencil_ref_front;
|
||||
key.stencil_ref_back = regs.stencil_ref_back;
|
||||
key.prim_type = regs.primitive_type;
|
||||
key.prim_restart_index = regs.primitive_reset_index;
|
||||
key.enable_primitive_restart = regs.enable_primitive_restart;
|
||||
key.primitive_restart_index = regs.primitive_restart_index & 1;
|
||||
key.polygon_mode = regs.polygon_control.PolyMode();
|
||||
key.cull_mode = regs.polygon_control.CullingMode();
|
||||
key.clip_space = regs.clipper_control.clip_space;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue