On Fri, May 19, 2017 at 2:50 AM, Sven Hesse <drmccoy(a)drmccoy.de> wrote:
- resource_param_idx = ins->handler_idx == WINED3DSIH_GATHER4_PO ? 2 : 1; + resource_param_idx = (ins->handler_idx == WINED3DSIH_GATHER4_PO || ins->handler_idx == WINED3DSIH_GATHER4_PO_C) ? 2 : 1;
Please avoid lines longer than 120 characters in D3D code.
resource_idx = ins->src[resource_param_idx].reg.idx[0].offset; sampler_idx = ins->src[resource_param_idx + 1].reg.idx[0].offset; component_idx = shader_glsl_swizzle_get_component(ins->src[resource_param_idx + 1].swizzle, 0); @@ -5878,8 +5879,12 @@ static void shader_glsl_gather4(const struct wined3d_shader_instruction *ins) { shader_glsl_add_src_param(ins, &ins->src[3], WINED3DSP_WRITEMASK_0, &compare_param); shader_addline(buffer, ", %s", compare_param.param_str); + } else if (ins->handler_idx == WINED3DSIH_GATHER4_PO_C) + { + shader_glsl_add_src_param(ins, &ins->src[4], WINED3DSP_WRITEMASK_0, &compare_param); + shader_addline(buffer, ", %s", compare_param.param_str);
Please put the closing bracket on its own line in order to match existing D3D coding style. Also, you may merge "if" statements: if (ins->handler_idx == WINED3DSIH_GATHER4_C || ins->handler_idx == WINED3DSIH_GATHER4_PO_C) { shader_glsl_add_src_param(ins, &ins->src[resource_param_idx + 2], WINED3DSP_WRITEMASK_0, &compare_param); shader_addline(buffer, ", %s", compare_param.param_str); }
- else if (ins.handler_idx == WINED3DSIH_GATHER4_PO) + else if (ins.handler_idx == WINED3DSIH_GATHER4_PO + || ins.handler_idx == WINED3DSIH_GATHER4_PO_C) + {
Please remove the empty line.