wined3d: Add support for SV_InstanceID.
This commit is contained in:
parent
f9fafb3686
commit
a33d3ad41b
|
@ -1182,11 +1182,14 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
|
||||||
|
|
||||||
if (version->type == WINED3D_SHADER_TYPE_VERTEX)
|
if (version->type == WINED3D_SHADER_TYPE_VERTEX)
|
||||||
{
|
{
|
||||||
/* Declare attributes. */
|
for (i = 0; i < shader->input_signature.element_count; ++i)
|
||||||
for (i = 0, map = reg_maps->input_registers; map; map >>= 1, ++i)
|
|
||||||
{
|
{
|
||||||
if (map & 1)
|
const struct wined3d_shader_signature_element *e = &shader->input_signature.elements[i];
|
||||||
shader_addline(buffer, "attribute vec4 %s_in%u;\n", prefix, i);
|
if (e->sysval_semantic == WINED3D_SV_INSTANCEID)
|
||||||
|
shader_addline(buffer, "vec4 %s_in%u = vec4(intBitsToFloat(gl_InstanceID), 0.0, 0.0, 0.0);\n",
|
||||||
|
prefix, e->register_idx);
|
||||||
|
else
|
||||||
|
shader_addline(buffer, "attribute vec4 %s_in%u;\n", prefix, e->register_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
shader_addline(buffer, "uniform vec4 posFixup;\n");
|
shader_addline(buffer, "uniform vec4 posFixup;\n");
|
||||||
|
@ -4588,6 +4591,8 @@ static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context
|
||||||
|
|
||||||
shader_addline(buffer, "#version 120\n");
|
shader_addline(buffer, "#version 120\n");
|
||||||
|
|
||||||
|
if (gl_info->supported[ARB_DRAW_INSTANCED])
|
||||||
|
shader_addline(buffer, "#extension GL_ARB_draw_instanced : enable\n");
|
||||||
if (gl_info->supported[ARB_SHADER_BIT_ENCODING])
|
if (gl_info->supported[ARB_SHADER_BIT_ENCODING])
|
||||||
shader_addline(buffer, "#extension GL_ARB_shader_bit_encoding : enable\n");
|
shader_addline(buffer, "#extension GL_ARB_shader_bit_encoding : enable\n");
|
||||||
if (gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT])
|
if (gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT])
|
||||||
|
|
|
@ -768,6 +768,7 @@ enum wined3d_decl_usage
|
||||||
enum wined3d_sysval_semantic
|
enum wined3d_sysval_semantic
|
||||||
{
|
{
|
||||||
WINED3D_SV_POSITION = 1,
|
WINED3D_SV_POSITION = 1,
|
||||||
|
WINED3D_SV_INSTANCEID = 8,
|
||||||
|
|
||||||
WINED3D_SV_DEPTH = 0xffffffff,
|
WINED3D_SV_DEPTH = 0xffffffff,
|
||||||
WINED3D_SV_TARGET0 = 0,
|
WINED3D_SV_TARGET0 = 0,
|
||||||
|
|
Loading…
Reference in New Issue