| 1 |
/* |
| 2 |
* Copyright (c) 2009-2024 Broadcom. All Rights Reserved. |
| 3 |
* The term “Broadcom” refers to Broadcom Inc. |
| 4 |
* and/or its subsidiaries. |
| 5 |
* SPDX-License-Identifier: MIT |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* @file |
| 10 |
* Shaders for VMware SVGA winsys. |
| 11 |
* |
| 12 |
* @author Jose Fonseca <[email protected]> |
| 13 |
* @author Thomas Hellstrom <[email protected]> |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef VMW_SHADER_H_ |
| 17 |
#define VMW_SHADER_H_ |
| 18 |
|
| 19 |
#include "util/compiler.h" |
| 20 |
#include "util/u_atomic.h" |
| 21 |
#include "util/u_inlines.h" |
| 22 |
|
| 23 |
struct vmw_svga_winsys_shader |
| 24 |
{ |
| 25 |
int32_t validated; |
| 26 |
struct pipe_reference refcnt; |
| 27 |
|
| 28 |
struct vmw_winsys_screen *screen; |
| 29 |
struct svga_winsys_buffer *buf; |
| 30 |
uint32_t shid; |
| 31 |
}; |
| 32 |
|
| 33 |
static inline struct svga_winsys_gb_shader * |
| 34 |
svga_winsys_shader(struct vmw_svga_winsys_shader *shader) |
| 35 |
{ |
| 36 |
assert(!shader || shader->shid != SVGA3D_INVALID_ID); |
| 37 |
return (struct svga_winsys_gb_shader *)shader; |
| 38 |
} |
| 39 |
|
| 40 |
static inline struct vmw_svga_winsys_shader * |
| 41 |
vmw_svga_winsys_shader(struct svga_winsys_gb_shader *shader) |
| 42 |
{ |
| 43 |
return (struct vmw_svga_winsys_shader *)shader; |
| 44 |
} |
| 45 |
|
| 46 |
void |
| 47 |
vmw_svga_winsys_shader_reference(struct vmw_svga_winsys_shader **pdst, |
| 48 |
struct vmw_svga_winsys_shader *src); |
| 49 |
|
| 50 |
struct vmw_svga_winsys_shader * |
| 51 |
vmw_svga_shader_create(struct svga_winsys_screen *sws, |
| 52 |
SVGA3dShaderType type, |
| 53 |
const uint32 *bytecode, |
| 54 |
uint32 bytecodeLen, |
| 55 |
const SVGA3dDXShaderSignatureHeader *sgnInfo, |
| 56 |
uint32 sgnLen); |
| 57 |
|
| 58 |
#endif /* VMW_SHADER_H_ */ |