struct d3d12_shader *shader = rzalloc(sel, d3d12_shader);
shader->key = *key;
+ if (shader->key.n_texture_states > 0) {
+ shader->key.tex_wrap_states = (dxil_wrap_sampler_state*)ralloc_size(sel, sizeof(dxil_wrap_sampler_state) * shader->key.n_texture_states);
+ memcpy(shader->key.tex_wrap_states, key->tex_wrap_states, sizeof(dxil_wrap_sampler_state) * shader->key.n_texture_states);
+ }
+ else
+ shader->key.tex_wrap_states = nullptr;
+
shader->output_vars_fs = nullptr;
shader->output_vars_gs = nullptr;
shader->output_vars_default = nullptr;
if (expect->n_images != have->n_images)
return false;
- if (memcmp(expect->tex_wrap_states, have->tex_wrap_states,
+ if (expect->n_texture_states > 0 &&
+ memcmp(expect->tex_wrap_states, have->tex_wrap_states,
expect->n_texture_states * sizeof(dxil_wrap_sampler_state)))
return false;
}
key->n_texture_states = 0;
+ key->tex_wrap_states = sel_ctx->ctx->tex_wrap_states_shader_key;
key->n_images = 0;
if (prev) {
memcpy(&key->tex_wrap_states[i], &wrap_state, sizeof(wrap_state));
key->swizzle_state[i] = sel_ctx->ctx->tex_swizzle_state[stage][i];
}
+ else
+ memset(&key->tex_wrap_states[i], 0, sizeof(key->tex_wrap_states[i]));
}
}
key->n_texture_states * sizeof(enum compare_func));
memcpy(key->swizzle_state, sel_ctx->ctx->tex_swizzle_state[stage],
key->n_texture_states * sizeof(dxil_texture_swizzle_state));
+ if (!sel->samples_int_textures)
+ memset(key->tex_wrap_states, 0, sizeof(key->tex_wrap_states[0]) * key->n_texture_states);
}
if (stage == PIPE_SHADER_VERTEX && sel_ctx->ctx->gfx_pipeline_state.ves) {
struct d3d12_sampler_state *samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
unsigned num_samplers[PIPE_SHADER_TYPES];
D3D12_INDEX_BUFFER_VIEW ibv;
+
dxil_wrap_sampler_state tex_wrap_states[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
+ dxil_wrap_sampler_state tex_wrap_states_shader_key[PIPE_MAX_SHADER_SAMPLER_VIEWS];
+
dxil_texture_swizzle_state tex_swizzle_state[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
enum compare_func tex_compare_func[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];