Commit 399f5099 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Check some nulls

parent 0cf256e5
......@@ -38,9 +38,10 @@
#define P_SCREEN_H
#include "p_compiler.h"
#include "p_format.h"
#include "p_defines.h"
#include "pipe/p_compiler.h"
#include "pipe/p_format.h"
#include "pipe/p_defines.h"
#include "pipe/p_video_enums.h"
......@@ -106,6 +107,15 @@ struct pipe_screen {
int (*get_shader_param)( struct pipe_screen *, enum pipe_shader_type shader,
enum pipe_shader_cap param );
/**
* Query an integer-valued capability/parameter/limit for a codec/profile
* \param param one of PIPE_VIDEO_CAP_x
*/
int (*get_video_param)( struct pipe_screen *,
enum pipe_video_profile profile,
enum pipe_video_entrypoint entrypoint,
enum pipe_video_cap param );
/**
* Query a compute-specific capability/parameter/limit.
* \param ir_type shader IR type for which the param applies, or don't care
......@@ -149,6 +159,15 @@ struct pipe_screen {
unsigned sample_count,
unsigned bindings );
/**
* Check if the given pipe_format is supported as output for this codec/profile.
* \param profile profile to check, may also be PIPE_VIDEO_PROFILE_UNKNOWN
*/
boolean (*is_video_format_supported)( struct pipe_screen *,
enum pipe_format format,
enum pipe_video_profile profile,
enum pipe_video_entrypoint entrypoint );
/**
* Check if we can actually create the given resource (test the dimension,
* overall size, etc). Used to implement proxy textures.
......
......@@ -1677,12 +1677,16 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
/* assign new */
pipe_surface_reference(&ctx->pipe_framebuffer.cbufs[i], cb);
struct panfrost_screen* scr = ctx->base.screen;
struct panfrost_screen* scr = (struct panfrost_screen *) pctx->screen;
struct sw_winsys *winsys = scr->winsys;
struct pipe_surface *surf = ctx->pipe_framebuffer.cbufs[i];
uint8_t *map = winsys->displaytarget_map(winsys, ((struct panfrost_resource *) surf->texture)->dt, PIPE_TRANSFER_WRITE);
trans_setup_framebuffer(ctx, map, fb->width, fb->height);
if (surf) {
uint8_t *map = winsys->displaytarget_map(winsys, ((struct panfrost_resource *) surf->texture)->dt, PIPE_TRANSFER_WRITE);
trans_setup_framebuffer(ctx, map, fb->width, fb->height);
} else {
printf("...unbind surface?\n");
}
}
}
......@@ -1711,6 +1715,9 @@ panfrost_bind_blend_state(struct pipe_context *pipe,
struct panfrost_context *ctx = panfrost_context(pipe);
struct pipe_blend_state *blend = (struct pipe_blend_state *) cso;
if (!blend)
return;
/* TODO: The following features are not yet implemented */
assert(!blend->logicop_enable);
assert(!blend->alpha_to_coverage);
......@@ -1764,6 +1771,9 @@ panfrost_bind_depth_stencil_state(struct pipe_context *pipe,
{
struct panfrost_context *ctx = panfrost_context(pipe);
if (!depth_stencil)
return;
/* Alpha does not exist on ES2... */
assert(!depth_stencil->alpha.enabled);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment