Lines Matching refs:This
34 NinePixelShader9_ctor( struct NinePixelShader9 *This, in NinePixelShader9_ctor() argument
43 DBG("This=%p pParams=%p pFunction=%p cso=%p\n", This, pParams, pFunction, cso); in NinePixelShader9_ctor()
45 hr = NineUnknown_ctor(&This->base, pParams); in NinePixelShader9_ctor()
50 This->ff_cso = cso; in NinePixelShader9_ctor()
53 device = This->base.device; in NinePixelShader9_ctor()
75 This->byte_code.version = info.version; in NinePixelShader9_ctor()
77 This->byte_code.tokens = mem_dup(pFunction, info.byte_size); in NinePixelShader9_ctor()
78 if (!This->byte_code.tokens) in NinePixelShader9_ctor()
80 This->byte_code.size = info.byte_size; in NinePixelShader9_ctor()
82 This->variant.cso = info.cso; in NinePixelShader9_ctor()
83 This->variant.const_ranges = info.const_ranges; in NinePixelShader9_ctor()
84 This->variant.const_used_size = info.const_used_size; in NinePixelShader9_ctor()
85 This->last_cso = info.cso; in NinePixelShader9_ctor()
86 This->last_const_ranges = info.const_ranges; in NinePixelShader9_ctor()
87 This->last_const_used_size = info.const_used_size; in NinePixelShader9_ctor()
88 This->last_key = 0; in NinePixelShader9_ctor()
90 This->sampler_mask = info.sampler_mask; in NinePixelShader9_ctor()
91 This->rt_mask = info.rt_mask; in NinePixelShader9_ctor()
92 This->bumpenvmat_needed = info.bumpenvmat_needed; in NinePixelShader9_ctor()
94 memcpy(This->int_slots_used, info.int_slots_used, sizeof(This->int_slots_used)); in NinePixelShader9_ctor()
95 memcpy(This->bool_slots_used, info.bool_slots_used, sizeof(This->bool_slots_used)); in NinePixelShader9_ctor()
97 This->const_int_slots = info.const_int_slots; in NinePixelShader9_ctor()
98 This->const_bool_slots = info.const_bool_slots; in NinePixelShader9_ctor()
100 This->c_combinations = NULL; in NinePixelShader9_ctor()
110 NinePixelShader9_dtor( struct NinePixelShader9 *This ) in NinePixelShader9_dtor() argument
112 DBG("This=%p\n", This); in NinePixelShader9_dtor()
114 if (This->base.device) { in NinePixelShader9_dtor()
115 struct pipe_context *pipe = nine_context_get_pipe_multithread(This->base.device); in NinePixelShader9_dtor()
116 struct nine_shader_variant *var = &This->variant; in NinePixelShader9_dtor()
120 if (This->base.device->context.cso_shader.ps == var->cso) { in NinePixelShader9_dtor()
125 This->base.device->context.commit |= NINE_STATE_COMMIT_PS; in NinePixelShader9_dtor()
133 if (This->ff_cso) { in NinePixelShader9_dtor()
134 if (This->ff_cso == This->base.device->context.cso_shader.ps) { in NinePixelShader9_dtor()
136 This->base.device->context.commit |= NINE_STATE_COMMIT_PS; in NinePixelShader9_dtor()
138 pipe->delete_fs_state(pipe, This->ff_cso); in NinePixelShader9_dtor()
141 nine_shader_variants_free(&This->variant); in NinePixelShader9_dtor()
143 nine_shader_constant_combination_free(This->c_combinations); in NinePixelShader9_dtor()
145 FREE((void *)This->byte_code.tokens); /* const_cast */ in NinePixelShader9_dtor()
147 NineUnknown_dtor(&This->base); in NinePixelShader9_dtor()
151 NinePixelShader9_GetFunction( struct NinePixelShader9 *This, in NinePixelShader9_GetFunction() argument
155 DBG("This=%p pData=%p pSizeOfData=%p\n", This, pData, pSizeOfData); in NinePixelShader9_GetFunction()
160 *pSizeOfData = This->byte_code.size; in NinePixelShader9_GetFunction()
163 user_assert(*pSizeOfData >= This->byte_code.size, D3DERR_INVALIDCALL); in NinePixelShader9_GetFunction()
165 memcpy(pData, This->byte_code.tokens, This->byte_code.size); in NinePixelShader9_GetFunction()
171 NinePixelShader9_GetVariant( struct NinePixelShader9 *This, in NinePixelShader9_GetVariant() argument
177 struct pipe_context *pipe = This->base.device->context.pipe; in NinePixelShader9_GetVariant()
181 key = This->next_key; in NinePixelShader9_GetVariant()
182 if (key == This->last_key) { in NinePixelShader9_GetVariant()
183 *const_ranges = This->last_const_ranges; in NinePixelShader9_GetVariant()
184 *const_used_size = This->last_const_used_size; in NinePixelShader9_GetVariant()
185 return This->last_cso; in NinePixelShader9_GetVariant()
188 cso = nine_shader_variant_get(&This->variant, const_ranges, const_used_size, key); in NinePixelShader9_GetVariant()
190 struct NineDevice9 *device = This->base.device; in NinePixelShader9_GetVariant()
197 info.byte_code = This->byte_code.tokens; in NinePixelShader9_GetVariant()
200 if (unlikely(This->byte_code.version < 0x20)) { in NinePixelShader9_GetVariant()
201 if (This->byte_code.version < 0x14) { in NinePixelShader9_GetVariant()
216 nine_shader_constant_combination_get(This->c_combinations, (key >> 24) & 0xff); in NinePixelShader9_GetVariant()
217 info.add_constants_defs.int_const_added = &This->int_slots_used; in NinePixelShader9_GetVariant()
218 info.add_constants_defs.bool_const_added = &This->bool_slots_used; in NinePixelShader9_GetVariant()
223 hr = nine_translate_shader(This->base.device, &info, pipe); in NinePixelShader9_GetVariant()
226 nine_shader_variant_add(&This->variant, key, info.cso, in NinePixelShader9_GetVariant()
233 This->last_key = key; in NinePixelShader9_GetVariant()
234 This->last_cso = cso; in NinePixelShader9_GetVariant()
235 This->last_const_ranges = *const_ranges; in NinePixelShader9_GetVariant()
236 This->last_const_used_size = *const_used_size; in NinePixelShader9_GetVariant()