summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.h
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-05-18 10:50:19 -0700
committerJonathan <[email protected]>2018-05-18 10:50:19 -0700
commitc8a6dfa9bb8bcec0458a58f0b702cd7b739ac1f1 (patch)
treef8c9eda1fdd1de48388b17cdbe2ab83b205c3d22 /src/abstract_hardware_model.h
parentab1f21e94756b4276e97124a7f2af6bec645c81e (diff)
reverted cuda8 changes (extra fields) and assert texture bug fix's assumption
Diffstat (limited to 'src/abstract_hardware_model.h')
-rw-r--r--src/abstract_hardware_model.h134
1 files changed, 44 insertions, 90 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 608a7e2..412c0a8 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -451,33 +451,32 @@ struct textureReference {
enum cudaTextureAddressMode addressMode[3];
struct cudaChannelFormatDesc channelDesc;
-#ifdef VERSION_EIGHT
- /**
- * Perform sRGB->linear conversion during texture read
- */
- int sRGB;
- /**
- * Limit to the anisotropy ratio
- */
- unsigned int maxAnisotropy;
- /**
- * Mipmap filter mode
- */
- enum cudaTextureFilterMode mipmapFilterMode;
- /**
- * Offset applied to the supplied mipmap level
- */
- float mipmapLevelBias;
- /**
- * Lower end of the mipmap level range to clamp access to
- */
- float minMipmapLevelClamp;
- /**
- * Upper end of the mipmap level range to clamp access to
- */
- float maxMipmapLevelClamp;
- int __cudaReserved[15];
-#endif
+//following commented section applies only to CUDA_VERSION 8+
+// /**
+// * Perform sRGB->linear conversion during texture read
+// */
+// int sRGB;
+// /**
+// * Limit to the anisotropy ratio
+// */
+// unsigned int maxAnisotropy;
+// /**
+// * Mipmap filter mode
+// */
+// enum cudaTextureFilterMode mipmapFilterMode;
+// /**
+// * Offset applied to the supplied mipmap level
+// */
+// float mipmapLevelBias;
+// /**
+// * Lower end of the mipmap level range to clamp access to
+// */
+// float minMipmapLevelClamp;
+// /**
+// * Upper end of the mipmap level range to clamp access to
+// */
+// float maxMipmapLevelClamp;
+// int __cudaReserved[15];
};
@@ -569,7 +568,10 @@ public:
tr->channelDesc.y==texref->channelDesc.y&&
tr->channelDesc.z==texref->channelDesc.z&&
tr->channelDesc.w==texref->channelDesc.w&&
- tr->channelDesc.f==texref->channelDesc.f &&
+ tr->channelDesc.f==texref->channelDesc.f
+ //following commented section applies only to CUDA_VERSION 8+
+ /*
+ &&
tr->sRGB==texref->sRGB&&
tr->maxAnisotropy==texref->maxAnisotropy&&
tr->mipmapFilterMode==texref->mipmapFilterMode&&
@@ -591,6 +593,7 @@ public:
tr->__cudaReserved[12]==texref->__cudaReserved[12]&&
tr->__cudaReserved[13]==texref->__cudaReserved[13]&&
tr->__cudaReserved[14]==texref->__cudaReserved[14]
+ */
){
matches++;
t = kv->second;
@@ -598,15 +601,9 @@ public:
}
}
- printf("matches (texarray) = %d\n", matches);
- //assert(matches==1);
+ //printf("matches (texarray) = %d\n", matches);
+ assert(matches==1);
return t;
-
- //assert(false);
-
-// std::map<const struct textureReference*,const struct cudaArray*>::const_iterator t=m_TextureRefToCudaArray.find(texref);
-// assert(t != m_TextureRefToCudaArray.end());
-// return t->second;
}
const struct textureInfo* get_texinfo( const struct textureReference *texref ) const
{
@@ -623,7 +620,10 @@ public:
tr->channelDesc.y==texref->channelDesc.y&&
tr->channelDesc.z==texref->channelDesc.z&&
tr->channelDesc.w==texref->channelDesc.w&&
- tr->channelDesc.f==texref->channelDesc.f&&
+ tr->channelDesc.f==texref->channelDesc.f
+ //following commented section applies only to CUDA_VERSION 8+
+ /*
+ &&
tr->sRGB==texref->sRGB&&
tr->maxAnisotropy==texref->maxAnisotropy&&
tr->mipmapFilterMode==texref->mipmapFilterMode&&
@@ -644,69 +644,23 @@ public:
tr->__cudaReserved[11]==texref->__cudaReserved[11]&&
tr->__cudaReserved[12]==texref->__cudaReserved[12]&&
tr->__cudaReserved[13]==texref->__cudaReserved[13]&&
- tr->__cudaReserved[14]==texref->__cudaReserved[14]){
+ tr->__cudaReserved[14]==texref->__cudaReserved[14]
+ */
+ ){
matches++;
t = kv->second;
- //return kv->second;
}
}
- printf("matches (texinfo) = %d\n", matches);
- //assert(matches==1);
+ //printf("matches (texinfo) = %d\n", matches);
+ assert(matches==1);
return t;
-
-// std::map<const struct textureReference*, const struct textureInfo*>::const_iterator t=m_TextureRefToTexureInfo.find(texref);
-// assert(t != m_TextureRefToTexureInfo.end());
-// return t->second;
}
const struct textureReferenceAttr* get_texattr( const struct textureReference *texref ) const
{
-// int matches = 0;
-// const struct textureReferenceAttr* t = NULL;
-// for (std::map<const struct textureReference*, const struct textureReferenceAttr*>::const_iterator kv = m_TextureRefToAttribute.begin(); kv!= m_TextureRefToAttribute.end(); kv ++){
-// const struct textureReference* tr = kv->first;
-// if (tr->normalized==texref->normalized&&
-// tr->filterMode==texref->filterMode&&
-// tr->addressMode[0]==texref->addressMode[0]&&
-// tr->addressMode[1]==texref->addressMode[1]&&
-// tr->addressMode[2]==texref->addressMode[2]&&
-// tr->channelDesc.x==texref->channelDesc.x&&
-// tr->channelDesc.y==texref->channelDesc.y&&
-// tr->channelDesc.z==texref->channelDesc.z&&
-// tr->channelDesc.w==texref->channelDesc.w&&
-// tr->channelDesc.f==texref->channelDesc.f&&
-// tr->sRGB==texref->sRGB&&
-// tr->maxAnisotropy==texref->maxAnisotropy&&
-// tr->mipmapFilterMode==texref->mipmapFilterMode&&
-// tr->mipmapLevelBias==texref->mipmapLevelBias&&
-// tr->minMipmapLevelClamp==texref->minMipmapLevelClamp&&
-// tr->maxMipmapLevelClamp==texref->maxMipmapLevelClamp&&
-// tr->__cudaReserved[0] ==texref->__cudaReserved[0]&&
-// tr->__cudaReserved[1] ==texref->__cudaReserved[1]&&
-// tr->__cudaReserved[2] ==texref->__cudaReserved[2]&&
-// tr->__cudaReserved[3] ==texref->__cudaReserved[3]&&
-// tr->__cudaReserved[4] ==texref->__cudaReserved[4]&&
-// tr->__cudaReserved[5] ==texref->__cudaReserved[5]&&
-// tr->__cudaReserved[6] ==texref->__cudaReserved[6]&&
-// tr->__cudaReserved[7] ==texref->__cudaReserved[7]&&
-// tr->__cudaReserved[8] ==texref->__cudaReserved[8]&&
-// tr->__cudaReserved[9] ==texref->__cudaReserved[9]&&
-// tr->__cudaReserved[10]==texref->__cudaReserved[10]&&
-// tr->__cudaReserved[11]==texref->__cudaReserved[11]&&
-// tr->__cudaReserved[12]==texref->__cudaReserved[12]&&
-// tr->__cudaReserved[13]==texref->__cudaReserved[13]&&
-// tr->__cudaReserved[14]==texref->__cudaReserved[14]){
-// matches++;
-// t = kv->second;
-// //return kv->second;
-// }
-// }
-//
-// printf("matches (texattr) = %d\n", matches);
-// //assert(matches==1);
-// return t;
-
+ //note textureReferenceAttr map behaves differently from cudaArray and
+ //textureInfo maps
std::map<const struct textureReference*, const struct textureReferenceAttr*>::const_iterator t=m_TextureRefToAttribute.find(texref);
assert(t != m_TextureRefToAttribute.end());
return t->second;