<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body ><div>Hello, thank you for your feedback :)</div>I just sent a patch that fixes the NaN issue in all places it can happen (at least in the GLSL backend).<div>Well, stupid drivers... It seems to work really well with Mesa, but I just saw some 1 fps benchmarks, so I guess it's a *nope*.</div><div>I'll do a test to make you happy, and try to fix the other things. :)</div><br><br><br><br><br><br><div>-------- Message d'origine --------</div><div>De : Józef Kucia <joseph.kucia@gmail.com> </div><div>Date :13/06/2016  20:32  (GMT+01:00) </div><div>À : wine-devel <wine-devel@winehq.org> </div><div>Cc : Guillaume Charifi <guillaume.charifi@sfr.fr> </div><div>Objet : Re: [PATCH] wined3d: Implement icb dcl support in GLSL. </div><div><br></div>This implementation has some issues, e.g. a generated GLSL shader will<br>produce a compilation error when the immediate constant buffer<br>contains an unsigned integer which represents NaN. Morever, from<br>testing a similar implementation, it seems that some drivers don't<br>handle shaders with huge arrays very well and such shaders perform<br>poorly. My current impression is that we should implement immediate<br>constant buffers using a uniform variable.<br><br>Also, a test would be nice.<br><br>On Mon, Jun 13, 2016 at 6:41 PM, Guillaume Charifi<br><guillaume.charifi@sfr.fr> wrote:<br>> Signed-off-by: Guillaume Charifi <guillaume.charifi@sfr.fr><br>> ---<br>>  dlls/wined3d/glsl_shader.c | 15 ++++++++++++++-<br>>  1 file changed, 14 insertions(+), 1 deletion(-)<br>><br>> diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c<br>> index 55affc1..def224c 100644<br>> --- a/dlls/wined3d/glsl_shader.c<br>> +++ b/dlls/wined3d/glsl_shader.c<br>> @@ -1886,6 +1886,19 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont<br>>      if (shader->limits->constant_bool > 0 && reg_maps->boolean_constants)<br>>          shader_addline(buffer, "uniform bool %s_b[%u];\n", prefix, shader->limits->constant_bool);<br>><br>> +    if (reg_maps->icb)<br>> +    {<br>> +        shader_addline(buffer, "const vec4 %s_icb[%u] = vec4[%u](\n",<br>> +                prefix, reg_maps->icb->element_count / 4, reg_maps->icb->element_count / 4);<br>> +        for (i = 0; i < reg_maps->icb->element_count / 4; i++) {<br>> +            shader_glsl_append_imm_vec4(buffer, (float *)&reg_maps->icb->data[4 * i]);<br>> +            if (i != reg_maps->icb->element_count / 4 - 1)<br>> +                shader_addline(buffer, ",");<br>> +            shader_addline(buffer, "\n");<br>> +        }<br>> +        shader_addline(buffer, ");\n");<br>> +    }<br><br>I think it would be better to store the number of vectors instead of<br>the element count in "reg_maps->icb". Not that it matters much, but<br>this block of code would certainly look nicer.<br><br>> +<br>>      for (i = 0; i < WINED3D_MAX_CBS; ++i)<br>>      {<br>>          if (reg_maps->cb_sizes[i])<br>> @@ -8561,7 +8574,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB<br>>      /* WINED3DSIH_DCL_GLOBAL_FLAGS                 */ shader_glsl_nop,<br>>      /* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,<br>>      /* WINED3DSIH_DCL_HS_MAX_TESSFACTOR            */ NULL,<br>> -    /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER    */ NULL,<br>> +    /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER    */ shader_glsl_nop,<br>>      /* WINED3DSIH_DCL_INPUT                        */ shader_glsl_nop,<br>>      /* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT    */ NULL,<br>>      /* WINED3DSIH_DCL_INPUT_PRIMITIVE              */ shader_glsl_nop,<br>> --<br>> 2.7.4<br>><br>><br>><br></body>