[PATCH] wined3d: Implement icb dcl support in GLSL.
Guillaume Charifi
guillaume.charifi at sfr.fr
Mon Jun 13 11:41:17 CDT 2016
Signed-off-by: Guillaume Charifi <guillaume.charifi at sfr.fr>
---
dlls/wined3d/glsl_shader.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 55affc1..def224c 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1886,6 +1886,19 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
if (shader->limits->constant_bool > 0 && reg_maps->boolean_constants)
shader_addline(buffer, "uniform bool %s_b[%u];\n", prefix, shader->limits->constant_bool);
+ if (reg_maps->icb)
+ {
+ shader_addline(buffer, "const vec4 %s_icb[%u] = vec4[%u](\n",
+ prefix, reg_maps->icb->element_count / 4, reg_maps->icb->element_count / 4);
+ for (i = 0; i < reg_maps->icb->element_count / 4; i++) {
+ shader_glsl_append_imm_vec4(buffer, (float *)®_maps->icb->data[4 * i]);
+ if (i != reg_maps->icb->element_count / 4 - 1)
+ shader_addline(buffer, ",");
+ shader_addline(buffer, "\n");
+ }
+ shader_addline(buffer, ");\n");
+ }
+
for (i = 0; i < WINED3D_MAX_CBS; ++i)
{
if (reg_maps->cb_sizes[i])
@@ -8561,7 +8574,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_DCL_GLOBAL_FLAGS */ shader_glsl_nop,
/* WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT */ NULL,
/* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL,
- /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL,
+ /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT */ shader_glsl_nop,
/* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL,
/* WINED3DSIH_DCL_INPUT_PRIMITIVE */ shader_glsl_nop,
--
2.7.4
More information about the wine-patches
mailing list