/* Include space for I,B constants for user constbuf. */
This->state.vs_const_f = CALLOC(This->vs_const_size, 1);
This->state.ps_const_f = CALLOC(This->ps_const_size, 1);
- if (!This->state.vs_const_f || !This->state.ps_const_f)
+ This->state.vs_lconstf_temp = CALLOC(This->vs_const_size,1);
+ if (!This->state.vs_const_f || !This->state.ps_const_f ||
+ !This->state.vs_lconstf_temp)
return E_OUTOFMEMORY;
if (strstr(pScreen->get_name(pScreen), "AMD") ||
pipe_resource_reference(&This->constbuf_ps, NULL);
FREE(This->state.vs_const_f);
FREE(This->state.ps_const_f);
+ FREE(This->state.vs_lconstf_temp);
if (This->swapchains) {
for (i = 0; i < This->nswapchains; ++i)
const struct nine_lconstf *lconstf = &device->state.vs->lconstf;
const struct nine_range *r = lconstf->ranges;
unsigned n = 0;
- float *dst = (float *)MALLOC(cb.buffer_size);
+ float *dst = device->state.vs_lconstf_temp;
float *src = (float *)cb.user_buffer;
memcpy(dst, src, cb.buffer_size);
while (r) {
pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, &cb);
- if (device->state.vs->lconstf.ranges)
- FREE((void *)cb.user_buffer);
-
if (device->state.changed.vs_const_f) {
struct nine_range *r = device->state.changed.vs_const_f;
struct nine_range *p = r;
float *vs_const_f;
int vs_const_i[NINE_MAX_CONST_I][4];
BOOL vs_const_b[NINE_MAX_CONST_B];
+ float *vs_lconstf_temp;
uint32_t vs_key;
struct NinePixelShader9 *ps;