On Jul 26, 2016 12:54 PM, "Anuj Phogat" <anuj.pho...@gmail.com> wrote: > > Fixes ~45 DEQP sample shading tests: > ./deqp-vk --deqp-case=dEQP-VK.pipeline.multisample.min_sample_shading* > > Many tests exited with VK_ERROR_OUT_OF_DEVICE_MEMORY without this patch. > > Cc: Jason Ekstrand <ja...@jlekstrand.net> > Signed-off-by: Anuj Phogat <anuj.pho...@gmail.com> > > --- > Another patch enabling the sample shading is required to test this patch. > I'll send out the enabling patch once we pass all the sample shading tests. > Use https://github.com/aphogat/mesa, branch: review to test the patch. > --- > src/intel/vulkan/gen7_pipeline.c | 9 ++++++++- > src/intel/vulkan/gen8_pipeline.c | 12 ++++++++---- > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c > index 8ce50be..23535f5 100644 > --- a/src/intel/vulkan/gen7_pipeline.c > +++ b/src/intel/vulkan/gen7_pipeline.c > @@ -249,6 +249,8 @@ genX(graphics_pipeline_create)( > anv_finishme("primitive_id needs sbe swizzling setup"); > > emit_3dstate_sbe(pipeline); > + bool per_sample_ps = pCreateInfo->pMultisampleState && > + pCreateInfo->pMultisampleState->sampleShadingEnable; > > anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS), ps) { > ps.KernelStartPointer0 = pipeline->ps_ksp0; > @@ -274,7 +276,12 @@ genX(graphics_pipeline_create)( > > ps._32PixelDispatchEnable = false; > ps._16PixelDispatchEnable = wm_prog_data->dispatch_16; > - ps._8PixelDispatchEnable = wm_prog_data->dispatch_8; > + /* On all hardware generations, the only configurations supporting > + * persample dispatch are in which only one dispatch width is enabled. > + */ > + ps._8PixelDispatchEnable = wm_prog_data->dispatch_8 && > + (!per_sample_ps || > + !wm_prog_data->dispatch_16);
I don't think we need to do this. brw_compile_fs in brw_fs.cpp should handle this for us based on the shader key. We should be able to just set the shader key bits correctly and then trust brw_compile_fs to give us only one dispatch width. --Jason > > ps.DispatchGRFStartRegisterforConstantSetupData0 = > wm_prog_data->base.dispatch_grf_start_reg, > diff --git a/src/intel/vulkan/gen8_pipeline.c b/src/intel/vulkan/gen8_pipeline.c > index cc10d3a..bde7660 100644 > --- a/src/intel/vulkan/gen8_pipeline.c > +++ b/src/intel/vulkan/gen8_pipeline.c > @@ -333,12 +333,19 @@ genX(graphics_pipeline_create)( > } > } else { > emit_3dstate_sbe(pipeline); > + bool per_sample_ps = pCreateInfo->pMultisampleState && > + pCreateInfo->pMultisampleState->sampleShadingEnable; > > anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS), ps) { > ps.KernelStartPointer0 = pipeline->ps_ksp0; > ps.KernelStartPointer1 = 0; > ps.KernelStartPointer2 = pipeline->ps_ksp0 + wm_prog_data->prog_offset_2; > - ps._8PixelDispatchEnable = wm_prog_data->dispatch_8; > + /* On all hardware generations, the only configurations supporting > + * persample dispatch are in which only one dispatch width is enabled. > + */ > + ps._8PixelDispatchEnable = wm_prog_data->dispatch_8 && > + (!per_sample_ps || > + !wm_prog_data->dispatch_16); > ps._16PixelDispatchEnable = wm_prog_data->dispatch_16; > ps._32PixelDispatchEnable = false; > ps.SingleProgramFlow = false; > @@ -365,9 +372,6 @@ genX(graphics_pipeline_create)( > wm_prog_data->dispatch_grf_start_reg_2; > } > > - bool per_sample_ps = pCreateInfo->pMultisampleState && > - pCreateInfo->pMultisampleState->sampleShadingEnable; > - > anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_EXTRA), ps) { > ps.PixelShaderValid = true; > ps.PixelShaderKillsPixel = wm_prog_data->uses_kill; > -- > 2.5.5 >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev