swr/rasterizer: Enable ARB_fragment_layer_viewport
Added loading gl_Layer and gl_ViewportIndex variables to Pixel Shader context. Reviewed-by: Alok Hota <alok.hota@intel.com>
This commit is contained in:
@@ -174,7 +174,7 @@ GL 4.3, GLSL 4.30 -- all DONE: i965/gen8+, nvc0, r600, radeonsi, virgl
|
|||||||
GL_ARB_copy_image DONE (i965, nv50, softpipe, llvmpipe, swr)
|
GL_ARB_copy_image DONE (i965, nv50, softpipe, llvmpipe, swr)
|
||||||
GL_KHR_debug DONE (all drivers)
|
GL_KHR_debug DONE (all drivers)
|
||||||
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
||||||
GL_ARB_fragment_layer_viewport DONE (i965, nv50, llvmpipe, softpipe)
|
GL_ARB_fragment_layer_viewport DONE (i965, nv50, llvmpipe, softpipe, swr)
|
||||||
GL_ARB_framebuffer_no_attachments DONE (freedreno, i965, softpipe)
|
GL_ARB_framebuffer_no_attachments DONE (freedreno, i965, softpipe)
|
||||||
GL_ARB_internalformat_query2 DONE (all drivers)
|
GL_ARB_internalformat_query2 DONE (all drivers)
|
||||||
GL_ARB_invalidate_subdata DONE (all drivers)
|
GL_ARB_invalidate_subdata DONE (all drivers)
|
||||||
|
@@ -29,6 +29,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "tilemgr.h"
|
#include "tilemgr.h"
|
||||||
|
#include "state.h"
|
||||||
|
#include "context.h"
|
||||||
|
|
||||||
|
|
||||||
void InitBackendSingleFuncTable(PFN_BACKEND_FUNC (&table)[SWR_INPUT_COVERAGE_COUNT][2][2]);
|
void InitBackendSingleFuncTable(PFN_BACKEND_FUNC (&table)[SWR_INPUT_COVERAGE_COUNT][2][2]);
|
||||||
void InitBackendSampleFuncTable(
|
void InitBackendSampleFuncTable(
|
||||||
@@ -648,6 +651,7 @@ void SetupPixelShaderContext(SWR_PS_CONTEXT* psContext,
|
|||||||
psContext->pPerspAttribs = work.pPerspAttribs;
|
psContext->pPerspAttribs = work.pPerspAttribs;
|
||||||
psContext->frontFace = work.triFlags.frontFacing;
|
psContext->frontFace = work.triFlags.frontFacing;
|
||||||
psContext->renderTargetArrayIndex = work.triFlags.renderTargetArrayIndex;
|
psContext->renderTargetArrayIndex = work.triFlags.renderTargetArrayIndex;
|
||||||
|
psContext->viewportIndex = work.triFlags.viewportIndex;
|
||||||
|
|
||||||
// save Ia/Ib/Ic and Ja/Jb/Jc if we need to reevaluate i/j/k in the shader because of pull
|
// save Ia/Ib/Ic and Ja/Jb/Jc if we need to reevaluate i/j/k in the shader because of pull
|
||||||
// attribs
|
// attribs
|
||||||
|
@@ -387,6 +387,7 @@ struct SWR_PS_CONTEXT
|
|||||||
uint32_t frontFace; // IN: front- 1, back- 0
|
uint32_t frontFace; // IN: front- 1, back- 0
|
||||||
uint32_t sampleIndex; // IN: sampleIndex
|
uint32_t sampleIndex; // IN: sampleIndex
|
||||||
uint32_t renderTargetArrayIndex; // IN: render target array index from GS
|
uint32_t renderTargetArrayIndex; // IN: render target array index from GS
|
||||||
|
uint32_t viewportIndex; // IN: viewport index from GS
|
||||||
uint32_t rasterizerSampleCount; // IN: sample count used by the rasterizer
|
uint32_t rasterizerSampleCount; // IN: sample count used by the rasterizer
|
||||||
|
|
||||||
uint8_t* pColorBuffer[SWR_NUM_RENDERTARGETS]; // IN: Pointers to render target hottiles
|
uint8_t* pColorBuffer[SWR_NUM_RENDERTARGETS]; // IN: Pointers to render target hottiles
|
||||||
|
@@ -1170,8 +1170,23 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
|
|||||||
inputs[attrib][3] =
|
inputs[attrib][3] =
|
||||||
wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vOneOverW, PixelPositions_center}, "vOneOverW"));
|
wrap(LOAD(pPS, {0, SWR_PS_CONTEXT_vOneOverW, PixelPositions_center}, "vOneOverW"));
|
||||||
continue;
|
continue;
|
||||||
|
} else if (semantic_name == TGSI_SEMANTIC_LAYER) { // gl_Layer
|
||||||
|
Value *ff = LOAD(pPS, {0, SWR_PS_CONTEXT_renderTargetArrayIndex});
|
||||||
|
ff = VECTOR_SPLAT(JM()->mVWidth, ff, "vRenderTargetArrayIndex");
|
||||||
|
inputs[attrib][0] = wrap(ff);
|
||||||
|
inputs[attrib][1] = wrap(VIMMED1(0.0f));
|
||||||
|
inputs[attrib][2] = wrap(VIMMED1(0.0f));
|
||||||
|
inputs[attrib][3] = wrap(VIMMED1(0.0f));
|
||||||
|
continue;
|
||||||
|
} else if (semantic_name == TGSI_SEMANTIC_VIEWPORT_INDEX) { // gl_ViewportIndex
|
||||||
|
Value *ff = LOAD(pPS, {0, SWR_PS_CONTEXT_viewportIndex});
|
||||||
|
ff = VECTOR_SPLAT(JM()->mVWidth, ff, "vViewportIndex");
|
||||||
|
inputs[attrib][0] = wrap(ff);
|
||||||
|
inputs[attrib][1] = wrap(VIMMED1(0.0f));
|
||||||
|
inputs[attrib][2] = wrap(VIMMED1(0.0f));
|
||||||
|
inputs[attrib][3] = wrap(VIMMED1(0.0f));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned linkedAttrib =
|
unsigned linkedAttrib =
|
||||||
locate_linkage(semantic_name, semantic_idx, pPrevShader) - 1;
|
locate_linkage(semantic_name, semantic_idx, pPrevShader) - 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user