<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Ah, yes, this patch missed the 8x2 tile path - I’ve fixed that now. I don’t see another path to using the blend jit functions.
<div class=""><br class="">
</div>
<div class="">Thanks.</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 9, 2016, at 10:44 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<p dir="ltr" class="">I think a second instance of the blend func being called was missed in backend.h (the avx512 one). Also iirc there was so.e third place where it was called... Should grep for pfnBlendFunc and see if any other instances pop up.</p>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Nov 9, 2016 10:19 PM, "Tim Rowley" <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>> wrote:<br type="attribution" class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alpha from render target 0 should always be used for alpha test for all<br class="">
render targets, according to GL and DX9 specs. Previously we were using<br class="">
alpha from the current render target.<br class="">
---<br class="">
src/gallium/drivers/swr/<wbr class="">rasterizer/core/backend.h | 1 +<br class="">
src/gallium/drivers/swr/<wbr class="">rasterizer/core/state.h | 6 +++++-<br class="">
src/gallium/drivers/swr/<wbr class="">rasterizer/jitter/blend_jit.<wbr class="">cpp | 10 ++++++++--<br class="">
3 files changed, 14 insertions(+), 3 deletions(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/<wbr class="">rasterizer/core/backend.h b/src/gallium/drivers/swr/<wbr class="">rasterizer/core/backend.h<br class="">
index dc0be90..a7018e0 100644<br class="">
--- a/src/gallium/drivers/swr/<wbr class="">rasterizer/core/backend.h<br class="">
+++ b/src/gallium/drivers/swr/<wbr class="">rasterizer/core/backend.h<br class="">
@@ -714,6 +714,7 @@ INLINE void OutputMerger(SWR_PS_CONTEXT &psContext, uint8_t* (&pColorBase)[SWR_N<br class="">
pBlendState,<br class="">
psContext.shaded[rt],<br class="">
psContext.shaded[1],<br class="">
+ psContext.shaded[0].w,<br class="">
sample,<br class="">
pColorSample,<br class="">
blendOut,<br class="">
diff --git a/src/gallium/drivers/swr/<wbr class="">rasterizer/core/state.h b/src/gallium/drivers/swr/<wbr class="">rasterizer/core/state.h<br class="">
index 5ee12e8..24927cd 100644<br class="">
--- a/src/gallium/drivers/swr/<wbr class="">rasterizer/core/state.h<br class="">
+++ b/src/gallium/drivers/swr/<wbr class="">rasterizer/core/state.h<br class="">
@@ -805,9 +805,13 @@ typedef void(__cdecl *PFN_CS_FUNC)(HANDLE hPrivateData, SWR_CS_CONTEXT* pCsConte<br class="">
typedef void(__cdecl *PFN_SO_FUNC)(SWR_STREAMOUT_<wbr class="">CONTEXT& soContext);<br class="">
typedef void(__cdecl *PFN_PIXEL_KERNEL)(HANDLE hPrivateData, SWR_PS_CONTEXT *pContext);<br class="">
typedef void(__cdecl *PFN_CPIXEL_KERNEL)(HANDLE hPrivateData, SWR_PS_CONTEXT *pContext);<br class="">
-typedef void(__cdecl *PFN_BLEND_JIT_FUNC)(const SWR_BLEND_STATE*, simdvector&, simdvector&, uint32_t, uint8_t*, simdvector&, simdscalari*, simdscalari*);<br class="">
+typedef void(__cdecl *PFN_BLEND_JIT_FUNC)(const SWR_BLEND_STATE*,<br class="">
+ simdvector& vSrc, simdvector& vSrc1, simdscalar& vSrc0Alpha, uint32_t sample,<br class="">
+ uint8_t* pDst, simdvector& vResult, simdscalari* vOMask, simdscalari* vCoverageMask);<br class="">
typedef simdscalar(*PFN_QUANTIZE_<wbr class="">DEPTH)(simdscalar);<br class="">
<br class="">
+<br class="">
+<br class="">
//////////////////////////////<wbr class="">//////////////////////////////<wbr class="">//////////////<br class="">
/// FRONTEND_STATE<br class="">
//////////////////////////////<wbr class="">//////////////////////////////<wbr class="">/////////////<br class="">
diff --git a/src/gallium/drivers/swr/<wbr class="">rasterizer/jitter/blend_jit.<wbr class="">cpp b/src/gallium/drivers/swr/<wbr class="">rasterizer/jitter/blend_jit.<wbr class="">cpp<br class="">
index d69d503..43e3d36 100644<br class="">
--- a/src/gallium/drivers/swr/<wbr class="">rasterizer/jitter/blend_jit.<wbr class="">cpp<br class="">
+++ b/src/gallium/drivers/swr/<wbr class="">rasterizer/jitter/blend_jit.<wbr class="">cpp<br class="">
@@ -443,10 +443,13 @@ struct BlendJit : public Builder<br class="">
}<br class="">
}<br class="">
<br class="">
- void AlphaTest(const BLEND_COMPILE_STATE& state, Value* pBlendState, Value* pAlpha, Value* ppMask)<br class="">
+ void AlphaTest(const BLEND_COMPILE_STATE& state, Value* pBlendState, Value* ppAlpha, Value* ppMask)<br class="">
{<br class="">
// load uint32_t reference<br class="">
Value* pRef = VBROADCAST(LOAD(pBlendState, { 0, SWR_BLEND_STATE_<wbr class="">alphaTestReference }));<br class="">
+<br class="">
+ // load alpha<br class="">
+ Value* pAlpha = LOAD(ppAlpha);<br class="">
<br class="">
Value* pTest = nullptr;<br class="">
if (state.alphaTestFormat == ALPHA_TEST_UNORM8)<br class="">
@@ -523,6 +526,7 @@ struct BlendJit : public Builder<br class="">
PointerType::get(Gen_SWR_<wbr class="">BLEND_STATE(JM()), 0), // SWR_BLEND_STATE*<br class="">
PointerType::get(mSimdFP32Ty, 0), // simdvector& src<br class="">
PointerType::get(mSimdFP32Ty, 0), // simdvector& src1<br class="">
+ PointerType::get(mSimdFP32Ty, 0), // src0alpha<br class="">
Type::getInt32Ty(JM()-><wbr class="">mContext), // sampleNum<br class="">
PointerType::get(mSimdFP32Ty, 0), // uint8_t* pDst<br class="">
PointerType::get(mSimdFP32Ty, 0), // simdvector& result<br class="">
@@ -545,6 +549,8 @@ struct BlendJit : public Builder<br class="">
pSrc->setName("src");<br class="">
Value* pSrc1 = &*argitr++;<br class="">
pSrc1->setName("src1");<br class="">
+ Value* pSrc0Alpha = &*argitr++;<br class="">
+ pSrc0Alpha->setName("<wbr class="">src0alpha");<br class="">
Value* sampleNum = &*argitr++;<br class="">
sampleNum->setName("sampleNum"<wbr class="">);<br class="">
Value* pDst = &*argitr++;<br class="">
@@ -588,7 +594,7 @@ struct BlendJit : public Builder<br class="">
// alpha test<br class="">
if (state.desc.alphaTestEnable)<br class="">
{<br class="">
- AlphaTest(state, pBlendState, src[3], ppMask);<br class="">
+ AlphaTest(state, pBlendState, pSrc0Alpha, ppMask);<br class="">
}<br class="">
<br class="">
// color blend<br class="">
--<br class="">
2.7.4<br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
mesa-dev mailing list<br class="">
<a href="mailto:mesa-dev@lists.freedesktop.org" class="">mesa-dev@lists.freedesktop.org</a><br class="">
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank" class="">https://lists.freedesktop.org/<wbr class="">mailman/listinfo/mesa-dev</a><br class="">
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>