mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 11:10:10 +01:00
gallium/swr: Fix compilation warnings
In some places in SWR cod objects are initialized using memset/memcpy. This is usually done to enable allocating those objects in aligned memory. It generates compilation warnings though, which are worked around by casting the pointers to void* before calling memset/memcpy. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5777>
This commit is contained in:
parent
846f4f95dd
commit
53e204dc26
9 changed files with 34 additions and 73 deletions
|
|
@ -106,7 +106,7 @@ void BucketManager::PrintBucket(
|
||||||
std::string str = arrows[level];
|
std::string str = arrows[level];
|
||||||
str += desc.name;
|
str += desc.name;
|
||||||
char hier[80];
|
char hier[80];
|
||||||
strcpy_s(hier, sizeof(hier), str.c_str());
|
strcpy_s(hier, sizeof(hier)-1, str.c_str());
|
||||||
|
|
||||||
// print out
|
// print out
|
||||||
fprintf(f,
|
fprintf(f,
|
||||||
|
|
|
||||||
|
|
@ -142,8 +142,8 @@ HANDLE SwrCreateContext(SWR_CREATECONTEXT_INFO* pCreateInfo)
|
||||||
pContext->workerPrivateState = *pCreateInfo->pWorkerPrivateState;
|
pContext->workerPrivateState = *pCreateInfo->pWorkerPrivateState;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&pContext->WaitLock, 0, sizeof(pContext->WaitLock));
|
memset((void*)&pContext->WaitLock, 0, sizeof(pContext->WaitLock));
|
||||||
memset(&pContext->FifosNotEmpty, 0, sizeof(pContext->FifosNotEmpty));
|
memset((void*)&pContext->FifosNotEmpty, 0, sizeof(pContext->FifosNotEmpty));
|
||||||
new (&pContext->WaitLock) std::mutex();
|
new (&pContext->WaitLock) std::mutex();
|
||||||
new (&pContext->FifosNotEmpty) std::condition_variable();
|
new (&pContext->FifosNotEmpty) std::condition_variable();
|
||||||
|
|
||||||
|
|
@ -230,7 +230,7 @@ HANDLE SwrCreateContext(SWR_CREATECONTEXT_INFO* pCreateInfo)
|
||||||
|
|
||||||
void CopyState(DRAW_STATE& dst, const DRAW_STATE& src)
|
void CopyState(DRAW_STATE& dst, const DRAW_STATE& src)
|
||||||
{
|
{
|
||||||
memcpy(&dst.state, &src.state, sizeof(API_STATE));
|
memcpy((void*)&dst.state, (void*)&src.state, sizeof(API_STATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool IsDraw>
|
template <bool IsDraw>
|
||||||
|
|
@ -489,7 +489,7 @@ void SWR_API SwrRestoreState(HANDLE hContext, const void* pStateBlock, size_t me
|
||||||
auto pDst = GetDrawState(pContext);
|
auto pDst = GetDrawState(pContext);
|
||||||
assert(pStateBlock && memSize >= sizeof(*pDst));
|
assert(pStateBlock && memSize >= sizeof(*pDst));
|
||||||
|
|
||||||
memcpy(pDst, pStateBlock, sizeof(*pDst));
|
memcpy((void*)pDst, (void*)pStateBlock, sizeof(*pDst));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupDefaultState(SWR_CONTEXT* pContext)
|
void SetupDefaultState(SWR_CONTEXT* pContext)
|
||||||
|
|
@ -748,7 +748,7 @@ void SwrSetRastState(HANDLE hContext, const SWR_RASTSTATE* pRastState)
|
||||||
SWR_CONTEXT* pContext = GetContext(hContext);
|
SWR_CONTEXT* pContext = GetContext(hContext);
|
||||||
API_STATE* pState = GetDrawState(pContext);
|
API_STATE* pState = GetDrawState(pContext);
|
||||||
|
|
||||||
memcpy(&pState->rastState, pRastState, sizeof(SWR_RASTSTATE));
|
memcpy((void*)&pState->rastState, (void*)pRastState, sizeof(SWR_RASTSTATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwrSetViewports(HANDLE hContext,
|
void SwrSetViewports(HANDLE hContext,
|
||||||
|
|
|
||||||
|
|
@ -1243,7 +1243,7 @@ static void AllocateTessellationData(SWR_CONTEXT* pContext)
|
||||||
{
|
{
|
||||||
gt_pTessellationThreadData =
|
gt_pTessellationThreadData =
|
||||||
(TessellationThreadLocalData*)AlignedMalloc(sizeof(TessellationThreadLocalData), 64);
|
(TessellationThreadLocalData*)AlignedMalloc(sizeof(TessellationThreadLocalData), 64);
|
||||||
memset(gt_pTessellationThreadData, 0, sizeof(*gt_pTessellationThreadData));
|
memset((void*)gt_pTessellationThreadData, 0, sizeof(*gt_pTessellationThreadData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public:
|
||||||
mNumEntries = numEntries;
|
mNumEntries = numEntries;
|
||||||
mpRingBuffer = (T*)AlignedMalloc(sizeof(T) * numEntries, 64);
|
mpRingBuffer = (T*)AlignedMalloc(sizeof(T) * numEntries, 64);
|
||||||
SWR_ASSERT(mpRingBuffer != nullptr);
|
SWR_ASSERT(mpRingBuffer != nullptr);
|
||||||
memset(mpRingBuffer, 0, sizeof(T) * numEntries);
|
memset((void*)mpRingBuffer, 0, sizeof(T) * numEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Destroy()
|
void Destroy()
|
||||||
|
|
|
||||||
|
|
@ -108,45 +108,6 @@ namespace SwrJit
|
||||||
return (uint16_t)tmpVal;
|
return (uint16_t)tmpVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief Convert an IEEE 754 16-bit float to an 32-bit single precision
|
|
||||||
/// float
|
|
||||||
/// @param val - 16-bit float
|
|
||||||
/// @todo Maybe move this outside of this file into a header?
|
|
||||||
static float ConvertFloat16ToFloat32(uint32_t val)
|
|
||||||
{
|
|
||||||
uint32_t result;
|
|
||||||
if ((val & 0x7fff) == 0)
|
|
||||||
{
|
|
||||||
result = ((uint32_t)(val & 0x8000)) << 16;
|
|
||||||
}
|
|
||||||
else if ((val & 0x7c00) == 0x7c00)
|
|
||||||
{
|
|
||||||
result = ((val & 0x3ff) == 0) ? 0x7f800000 : 0x7fc00000;
|
|
||||||
result |= ((uint32_t)val & 0x8000) << 16;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
uint32_t sign = (val & 0x8000) << 16;
|
|
||||||
uint32_t mant = (val & 0x3ff) << 13;
|
|
||||||
uint32_t exp = (val >> 10) & 0x1f;
|
|
||||||
if ((exp == 0) && (mant != 0)) // Adjust exponent and mantissa for denormals
|
|
||||||
{
|
|
||||||
mant <<= 1;
|
|
||||||
while (mant < (0x400 << 13))
|
|
||||||
{
|
|
||||||
exp--;
|
|
||||||
mant <<= 1;
|
|
||||||
}
|
|
||||||
mant &= (0x3ff << 13);
|
|
||||||
}
|
|
||||||
exp = ((exp - 15 + 127) & 0xff) << 23;
|
|
||||||
result = sign | exp | mant;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *(float*)&result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Constant* Builder::C(bool i) { return ConstantInt::get(IRB()->getInt1Ty(), (i ? 1 : 0)); }
|
Constant* Builder::C(bool i) { return ConstantInt::get(IRB()->getInt1Ty(), (i ? 1 : 0)); }
|
||||||
|
|
||||||
Constant* Builder::C(char i) { return ConstantInt::get(IRB()->getInt8Ty(), i); }
|
Constant* Builder::C(char i) { return ConstantInt::get(IRB()->getInt8Ty(), i); }
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* @file StoreTile.h
|
* @file StoreTile.h
|
||||||
*
|
*
|
||||||
* @brief Functionality for Store.
|
* @brief Functionality for Store.
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
@ -347,8 +347,8 @@ struct ConvertPixelsSOAtoAOS
|
||||||
{
|
{
|
||||||
static const uint32_t MAX_RASTER_TILE_BYTES = 16 * 16; // 16 pixels * 16 bytes per pixel
|
static const uint32_t MAX_RASTER_TILE_BYTES = 16 * 16; // 16 pixels * 16 bytes per pixel
|
||||||
|
|
||||||
OSALIGNSIMD16(uint8_t) soaTile[MAX_RASTER_TILE_BYTES];
|
OSALIGNSIMD16(uint8_t) soaTile[MAX_RASTER_TILE_BYTES] = {0};
|
||||||
OSALIGNSIMD16(uint8_t) aosTile[MAX_RASTER_TILE_BYTES];
|
OSALIGNSIMD16(uint8_t) aosTile[MAX_RASTER_TILE_BYTES] = {0};
|
||||||
|
|
||||||
// Convert from SrcFormat --> DstFormat
|
// Convert from SrcFormat --> DstFormat
|
||||||
simd16vector src;
|
simd16vector src;
|
||||||
|
|
@ -580,10 +580,10 @@ INLINE static void FlatConvert(const uint8_t* pSrc, uint8_t* pDst, uint8_t* pDst
|
||||||
static const uint32_t offset = sizeof(simdscalar);
|
static const uint32_t offset = sizeof(simdscalar);
|
||||||
|
|
||||||
// swizzle rgba -> bgra while we load
|
// swizzle rgba -> bgra while we load
|
||||||
simdscalar vComp0 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(0))*offset)); // float32 rrrrrrrr
|
simdscalar vComp0 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(0))*offset)); // float32 rrrrrrrr
|
||||||
simdscalar vComp1 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(1))*offset)); // float32 gggggggg
|
simdscalar vComp1 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(1))*offset)); // float32 gggggggg
|
||||||
simdscalar vComp2 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(2))*offset)); // float32 bbbbbbbb
|
simdscalar vComp2 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(2))*offset)); // float32 bbbbbbbb
|
||||||
simdscalar vComp3 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(3))*offset)); // float32 aaaaaaaa
|
simdscalar vComp3 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(3))*offset)); // float32 aaaaaaaa
|
||||||
|
|
||||||
// clamp
|
// clamp
|
||||||
vComp0 = _simd_max_ps(vComp0, _simd_setzero_ps());
|
vComp0 = _simd_max_ps(vComp0, _simd_setzero_ps());
|
||||||
|
|
@ -607,15 +607,15 @@ INLINE static void FlatConvert(const uint8_t* pSrc, uint8_t* pDst, uint8_t* pDst
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert float components from 0.0f .. 1.0f to correct scale for 0 .. 255 dest format
|
// convert float components from 0.0f .. 1.0f to correct scale for 0 .. 255 dest format
|
||||||
vComp0 = _simd_mul_ps(vComp0, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(0)));
|
vComp0 = _simd_mul_ps(vComp0, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(0)));
|
||||||
vComp1 = _simd_mul_ps(vComp1, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(1)));
|
vComp1 = _simd_mul_ps(vComp1, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(1)));
|
||||||
vComp2 = _simd_mul_ps(vComp2, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(2)));
|
vComp2 = _simd_mul_ps(vComp2, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(2)));
|
||||||
vComp3 = _simd_mul_ps(vComp3, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(3)));
|
vComp3 = _simd_mul_ps(vComp3, _simd_set1_ps(FormatTraits<DstFormat>::fromFloat(3)));
|
||||||
|
|
||||||
// moving to 8 wide integer vector types
|
// moving to 8 wide integer vector types
|
||||||
simdscalari src0 = _simd_cvtps_epi32(vComp0); // padded byte rrrrrrrr
|
simdscalari src0 = _simd_cvtps_epi32(vComp0); // padded byte rrrrrrrr
|
||||||
simdscalari src1 = _simd_cvtps_epi32(vComp1); // padded byte gggggggg
|
simdscalari src1 = _simd_cvtps_epi32(vComp1); // padded byte gggggggg
|
||||||
simdscalari src2 = _simd_cvtps_epi32(vComp2); // padded byte bbbbbbbb
|
simdscalari src2 = _simd_cvtps_epi32(vComp2); // padded byte bbbbbbbb
|
||||||
simdscalari src3 = _simd_cvtps_epi32(vComp3); // padded byte aaaaaaaa
|
simdscalari src3 = _simd_cvtps_epi32(vComp3); // padded byte aaaaaaaa
|
||||||
|
|
||||||
#if KNOB_ARCH <= KNOB_ARCH_AVX
|
#if KNOB_ARCH <= KNOB_ARCH_AVX
|
||||||
|
|
@ -743,9 +743,9 @@ INLINE static void FlatConvertNoAlpha(const uint8_t* pSrc, uint8_t* pDst, uint8_
|
||||||
static const uint32_t offset = sizeof(simdscalar);
|
static const uint32_t offset = sizeof(simdscalar);
|
||||||
|
|
||||||
// swizzle rgba -> bgra while we load
|
// swizzle rgba -> bgra while we load
|
||||||
simdscalar vComp0 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(0))*offset)); // float32 rrrrrrrr
|
simdscalar vComp0 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(0))*offset)); // float32 rrrrrrrr
|
||||||
simdscalar vComp1 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(1))*offset)); // float32 gggggggg
|
simdscalar vComp1 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(1))*offset)); // float32 gggggggg
|
||||||
simdscalar vComp2 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(2))*offset)); // float32 bbbbbbbb
|
simdscalar vComp2 = _simd_load_ps((const float*)(pSrc + (FormatTraits<DstFormat>::swizzle(2))*offset)); // float32 bbbbbbbb
|
||||||
// clamp
|
// clamp
|
||||||
vComp0 = _simd_max_ps(vComp0, _simd_setzero_ps());
|
vComp0 = _simd_max_ps(vComp0, _simd_setzero_ps());
|
||||||
vComp0 = _simd_min_ps(vComp0, _simd_set1_ps(1.0f));
|
vComp0 = _simd_min_ps(vComp0, _simd_set1_ps(1.0f));
|
||||||
|
|
@ -771,8 +771,8 @@ INLINE static void FlatConvertNoAlpha(const uint8_t* pSrc, uint8_t* pDst, uint8_
|
||||||
|
|
||||||
// moving to 8 wide integer vector types
|
// moving to 8 wide integer vector types
|
||||||
simdscalari src0 = _simd_cvtps_epi32(vComp0); // padded byte rrrrrrrr
|
simdscalari src0 = _simd_cvtps_epi32(vComp0); // padded byte rrrrrrrr
|
||||||
simdscalari src1 = _simd_cvtps_epi32(vComp1); // padded byte gggggggg
|
simdscalari src1 = _simd_cvtps_epi32(vComp1); // padded byte gggggggg
|
||||||
simdscalari src2 = _simd_cvtps_epi32(vComp2); // padded byte bbbbbbbb
|
simdscalari src2 = _simd_cvtps_epi32(vComp2); // padded byte bbbbbbbb
|
||||||
|
|
||||||
#if KNOB_ARCH <= KNOB_ARCH_AVX
|
#if KNOB_ARCH <= KNOB_ARCH_AVX
|
||||||
|
|
||||||
|
|
@ -1062,13 +1062,13 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_NONE, 8>, SrcFormat, DstFormat>
|
||||||
return GenericStoreTile::Store(pSrc, pDstSurface, x, y, sampleNum, renderTargetArrayIndex);
|
return GenericStoreTile::Store(pSrc, pDstSurface, x, y, sampleNum, renderTargetArrayIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *pDst = (uint8_t*)ComputeSurfaceAddress<false, false>(x, y, pDstSurface->arrayIndex + renderTargetArrayIndex,
|
uint8_t *pDst = (uint8_t*)ComputeSurfaceAddress<false, false>(x, y, pDstSurface->arrayIndex + renderTargetArrayIndex,
|
||||||
pDstSurface->arrayIndex + renderTargetArrayIndex, sampleNum, pDstSurface->lod, pDstSurface);
|
pDstSurface->arrayIndex + renderTargetArrayIndex, sampleNum, pDstSurface->lod, pDstSurface);
|
||||||
|
|
||||||
const uint32_t dx = SIMD16_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
const uint32_t dx = SIMD16_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
||||||
const uint32_t dy = SIMD16_TILE_Y_DIM * pDstSurface->pitch - KNOB_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
const uint32_t dy = SIMD16_TILE_Y_DIM * pDstSurface->pitch - KNOB_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
||||||
|
|
||||||
uint8_t* ppDsts[] =
|
uint8_t* ppDsts[] =
|
||||||
{
|
{
|
||||||
pDst, // row 0, col 0
|
pDst, // row 0, col 0
|
||||||
pDst + pDstSurface->pitch, // row 1, col 0
|
pDst + pDstSurface->pitch, // row 1, col 0
|
||||||
|
|
@ -1127,7 +1127,7 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_NONE, 16>, SrcFormat, DstFormat
|
||||||
return GenericStoreTile::Store(pSrc, pDstSurface, x, y, sampleNum, renderTargetArrayIndex);
|
return GenericStoreTile::Store(pSrc, pDstSurface, x, y, sampleNum, renderTargetArrayIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *pDst = (uint8_t*)ComputeSurfaceAddress<false, false>(x, y, pDstSurface->arrayIndex + renderTargetArrayIndex,
|
uint8_t *pDst = (uint8_t*)ComputeSurfaceAddress<false, false>(x, y, pDstSurface->arrayIndex + renderTargetArrayIndex,
|
||||||
pDstSurface->arrayIndex + renderTargetArrayIndex, sampleNum, pDstSurface->lod, pDstSurface);
|
pDstSurface->arrayIndex + renderTargetArrayIndex, sampleNum, pDstSurface->lod, pDstSurface);
|
||||||
|
|
||||||
const uint32_t dx = SIMD16_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
const uint32_t dx = SIMD16_TILE_X_DIM * DST_BYTES_PER_PIXEL;
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
|
||||||
{
|
{
|
||||||
struct swr_context *ctx = (struct swr_context *)
|
struct swr_context *ctx = (struct swr_context *)
|
||||||
AlignedMalloc(sizeof(struct swr_context), KNOB_SIMD_BYTES);
|
AlignedMalloc(sizeof(struct swr_context), KNOB_SIMD_BYTES);
|
||||||
memset(ctx, 0, sizeof(struct swr_context));
|
memset((void*)ctx, 0, sizeof(struct swr_context));
|
||||||
|
|
||||||
swr_screen(p_screen)->pfnSwrGetInterface(ctx->api);
|
swr_screen(p_screen)->pfnSwrGetInterface(ctx->api);
|
||||||
swr_screen(p_screen)->pfnSwrGetTileInterface(ctx->tileApi);
|
swr_screen(p_screen)->pfnSwrGetTileInterface(ctx->tileApi);
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ swr_generate_fs_key(struct swr_jit_fs_key &key,
|
||||||
struct swr_context *ctx,
|
struct swr_context *ctx,
|
||||||
swr_fragment_shader *swr_fs)
|
swr_fragment_shader *swr_fs)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
key.nr_cbufs = ctx->framebuffer.nr_cbufs;
|
key.nr_cbufs = ctx->framebuffer.nr_cbufs;
|
||||||
key.light_twoside = ctx->rasterizer->light_twoside;
|
key.light_twoside = ctx->rasterizer->light_twoside;
|
||||||
|
|
@ -221,7 +221,7 @@ swr_generate_vs_key(struct swr_jit_vs_key &key,
|
||||||
struct swr_context *ctx,
|
struct swr_context *ctx,
|
||||||
swr_vertex_shader *swr_vs)
|
swr_vertex_shader *swr_vs)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
key.clip_plane_mask =
|
key.clip_plane_mask =
|
||||||
swr_vs->info.base.clipdist_writemask ?
|
swr_vs->info.base.clipdist_writemask ?
|
||||||
|
|
@ -235,7 +235,7 @@ void
|
||||||
swr_generate_fetch_key(struct swr_jit_fetch_key &key,
|
swr_generate_fetch_key(struct swr_jit_fetch_key &key,
|
||||||
struct swr_vertex_element_state *velems)
|
struct swr_vertex_element_state *velems)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
key.fsState = velems->fsState;
|
key.fsState = velems->fsState;
|
||||||
}
|
}
|
||||||
|
|
@ -245,7 +245,7 @@ swr_generate_gs_key(struct swr_jit_gs_key &key,
|
||||||
struct swr_context *ctx,
|
struct swr_context *ctx,
|
||||||
swr_geometry_shader *swr_gs)
|
swr_geometry_shader *swr_gs)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
struct tgsi_shader_info *pPrevShader = nullptr;
|
struct tgsi_shader_info *pPrevShader = nullptr;
|
||||||
|
|
||||||
|
|
@ -270,7 +270,7 @@ swr_generate_tcs_key(struct swr_jit_tcs_key &key,
|
||||||
struct swr_context *ctx,
|
struct swr_context *ctx,
|
||||||
swr_tess_control_shader *swr_tcs)
|
swr_tess_control_shader *swr_tcs)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
struct tgsi_shader_info *pPrevShader = &ctx->vs->info.base;
|
struct tgsi_shader_info *pPrevShader = &ctx->vs->info.base;
|
||||||
|
|
||||||
|
|
@ -294,7 +294,7 @@ swr_generate_tes_key(struct swr_jit_tes_key &key,
|
||||||
struct swr_context *ctx,
|
struct swr_context *ctx,
|
||||||
swr_tess_evaluation_shader *swr_tes)
|
swr_tess_evaluation_shader *swr_tes)
|
||||||
{
|
{
|
||||||
memset(&key, 0, sizeof(key));
|
memset((void*)&key, 0, sizeof(key));
|
||||||
|
|
||||||
struct tgsi_shader_info *pPrevShader = nullptr;
|
struct tgsi_shader_info *pPrevShader = nullptr;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -584,7 +584,7 @@ swr_create_vertex_elements_state(struct pipe_context *pipe,
|
||||||
assert(num_elements <= PIPE_MAX_ATTRIBS);
|
assert(num_elements <= PIPE_MAX_ATTRIBS);
|
||||||
velems = new swr_vertex_element_state;
|
velems = new swr_vertex_element_state;
|
||||||
if (velems) {
|
if (velems) {
|
||||||
memset(&velems->fsState, 0, sizeof(velems->fsState));
|
memset((void*)&velems->fsState, 0, sizeof(velems->fsState));
|
||||||
velems->fsState.bVertexIDOffsetEnable = true;
|
velems->fsState.bVertexIDOffsetEnable = true;
|
||||||
velems->fsState.numAttribs = num_elements;
|
velems->fsState.numAttribs = num_elements;
|
||||||
for (unsigned i = 0; i < num_elements; i++) {
|
for (unsigned i = 0; i < num_elements; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue