gallium: Check for OOM condition when creating a sampler view.
This commit is contained in:
parent
252dc5f897
commit
530b9910c2
|
@ -298,11 +298,13 @@ cell_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -598,11 +598,13 @@ i915_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -219,11 +219,13 @@ brw_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -170,11 +170,13 @@ llvmpipe_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -304,11 +304,13 @@ nv30_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -314,11 +314,13 @@ nv40_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -980,11 +980,13 @@ r300_create_sampler_view(struct pipe_context *pipe,
|
|||
struct r300_context *r300 = r300_context(pipe);
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -128,11 +128,13 @@ softpipe_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
|
@ -183,11 +183,13 @@ svga_create_sampler_view(struct pipe_context *pipe,
|
|||
{
|
||||
struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
|
||||
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
if (view) {
|
||||
*view = *templ;
|
||||
view->reference.count = 1;
|
||||
view->texture = NULL;
|
||||
pipe_texture_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue