wined3d: Support SV_RenderTargetArrayIndex semantic for pixel shader inputs.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-04-06 11:47:53 +02:00 committed by Alexandre Julliard
parent e5d3908ffa
commit acb480e7e4
3 changed files with 13 additions and 0 deletions

View File

@ -126,6 +126,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_ARB_ES3_compatibility", ARB_ES3_COMPATIBILITY },
{"GL_ARB_explicit_attrib_location", ARB_EXPLICIT_ATTRIB_LOCATION },
{"GL_ARB_fragment_coord_conventions", ARB_FRAGMENT_COORD_CONVENTIONS},
{"GL_ARB_fragment_layer_viewport", ARB_FRAGMENT_LAYER_VIEWPORT },
{"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM },
{"GL_ARB_fragment_shader", ARB_FRAGMENT_SHADER },
{"GL_ARB_framebuffer_object", ARB_FRAMEBUFFER_OBJECT },
@ -3845,6 +3846,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
{ARB_COMPUTE_SHADER, MAKEDWORD_VERSION(4, 3)},
{ARB_DEBUG_OUTPUT, MAKEDWORD_VERSION(4, 3)},
{ARB_ES3_COMPATIBILITY, MAKEDWORD_VERSION(4, 3)},
{ARB_FRAGMENT_LAYER_VIEWPORT, MAKEDWORD_VERSION(4, 3)},
{ARB_INTERNALFORMAT_QUERY2, MAKEDWORD_VERSION(4, 3)},
{ARB_SHADER_IMAGE_SIZE, MAKEDWORD_VERSION(4, 3)},
{ARB_SHADER_STORAGE_BUFFER_OBJECT, MAKEDWORD_VERSION(4, 3)},

View File

@ -6444,6 +6444,14 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
"uintBitsToFloat(gl_FrontFacing ? 0xffffffffu : 0u), 0.0, 0.0, 0.0);\n",
input->register_idx);
}
else if (input->sysval_semantic == WINED3D_SV_RENDER_TARGET_ARRAY_INDEX && !semantic_idx)
{
if (gl_info->supported[ARB_FRAGMENT_LAYER_VIEWPORT])
shader_addline(buffer, "ps_in[%u]%s = intBitsToFloat(gl_Layer);\n",
input->register_idx, reg_mask);
else
FIXME("ARB_fragment_layer_viewport is not supported.\n");
}
else
{
if (input->sysval_semantic)
@ -7051,6 +7059,8 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
shader_addline(buffer, "#extension GL_ARB_derivative_control : enable\n");
if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
shader_addline(buffer, "#extension GL_ARB_fragment_coord_conventions : enable\n");
if (gl_info->supported[ARB_FRAGMENT_LAYER_VIEWPORT])
shader_addline(buffer, "#extension GL_ARB_fragment_layer_viewport : enable\n");
if (gl_info->supported[ARB_SHADER_TEXTURE_LOD])
shader_addline(buffer, "#extension GL_ARB_shader_texture_lod : enable\n");
/* The spec says that it doesn't have to be explicitly enabled, but the

View File

@ -59,6 +59,7 @@ enum wined3d_gl_extension
ARB_ES3_COMPATIBILITY,
ARB_EXPLICIT_ATTRIB_LOCATION,
ARB_FRAGMENT_COORD_CONVENTIONS,
ARB_FRAGMENT_LAYER_VIEWPORT,
ARB_FRAGMENT_PROGRAM,
ARB_FRAGMENT_SHADER,
ARB_FRAMEBUFFER_OBJECT,