Lines Matching defs:This
34 NinePixelShader9_ctor( struct NinePixelShader9 *This,
43 DBG("This=%p pParams=%p pFunction=%p cso=%p\n", This, pParams, pFunction, cso);
45 hr = NineUnknown_ctor(&This->base, pParams);
50 This->ff_cso = cso;
53 device = This->base.device;
75 This->byte_code.version = info.version;
77 This->byte_code.tokens = mem_dup(pFunction, info.byte_size);
78 if (!This->byte_code.tokens)
80 This->byte_code.size = info.byte_size;
82 This->variant.cso = info.cso;
83 This->variant.const_ranges = info.const_ranges;
84 This->variant.const_used_size = info.const_used_size;
85 This->last_cso = info.cso;
86 This->last_const_ranges = info.const_ranges;
87 This->last_const_used_size = info.const_used_size;
88 This->last_key = 0;
90 This->sampler_mask = info.sampler_mask;
91 This->rt_mask = info.rt_mask;
92 This->bumpenvmat_needed = info.bumpenvmat_needed;
94 memcpy(This->int_slots_used, info.int_slots_used, sizeof(This->int_slots_used));
95 memcpy(This->bool_slots_used, info.bool_slots_used, sizeof(This->bool_slots_used));
97 This->const_int_slots = info.const_int_slots;
98 This->const_bool_slots = info.const_bool_slots;
100 This->c_combinations = NULL;
110 NinePixelShader9_dtor( struct NinePixelShader9 *This )
112 DBG("This=%p\n", This);
114 if (This->base.device) {
115 struct pipe_context *pipe = nine_context_get_pipe_multithread(This->base.device);
116 struct nine_shader_variant *var = &This->variant;
120 if (This->base.device->context.cso_shader.ps == var->cso)
128 if (This->ff_cso) {
129 if (This->ff_cso == This->base.device->context.cso_shader.ps)
131 pipe->delete_fs_state(pipe, This->ff_cso);
134 nine_shader_variants_free(&This->variant);
136 nine_shader_constant_combination_free(This->c_combinations);
138 FREE((void *)This->byte_code.tokens); /* const_cast */
140 NineUnknown_dtor(&This->base);
144 NinePixelShader9_GetFunction( struct NinePixelShader9 *This,
148 DBG("This=%p pData=%p pSizeOfData=%p\n", This, pData, pSizeOfData);
153 *pSizeOfData = This->byte_code.size;
156 user_assert(*pSizeOfData >= This->byte_code.size, D3DERR_INVALIDCALL);
158 memcpy(pData, This->byte_code.tokens, This->byte_code.size);
164 NinePixelShader9_GetVariant( struct NinePixelShader9 *This,
170 struct pipe_context *pipe = This->base.device->context.pipe;
174 key = This->next_key;
175 if (key == This->last_key) {
176 *const_ranges = This->last_const_ranges;
177 *const_used_size = This->last_const_used_size;
178 return This->last_cso;
181 cso = nine_shader_variant_get(&This->variant, const_ranges, const_used_size, key);
183 struct NineDevice9 *device = This->base.device;
190 info.byte_code = This->byte_code.tokens;
193 if (unlikely(This->byte_code.version < 0x20)) {
194 if (This->byte_code.version < 0x14) {
209 nine_shader_constant_combination_get(This->c_combinations, (key >> 24) & 0xff);
210 info.add_constants_defs.int_const_added = &This->int_slots_used;
211 info.add_constants_defs.bool_const_added = &This->bool_slots_used;
216 hr = nine_translate_shader(This->base.device, &info, pipe);
219 nine_shader_variant_add(&This->variant, key, info.cso,
226 This->last_key = key;
227 This->last_cso = cso;
228 This->last_const_ranges = *const_ranges;
229 This->last_const_used_size = *const_used_size;